- NDK compatibility fixes for MSDDK. Use NTAPI instead of STDCALL, and use NTSYSAPI instead of NTOSAPI.

- Remove some functions/types in NDK that were already documented in DDK/IFS.
- Fixup syscall structures for the table and fix protoype of KeAdd/RemoveServiceDescriptorTable.

svn path=/trunk/; revision=17651
This commit is contained in:
Alex Ionescu 2005-09-05 04:48:20 +00:00
parent 118aa9fba3
commit 51f0dfd307
25 changed files with 340 additions and 457 deletions

View file

@ -2,7 +2,7 @@
#define __SERVICES_FS_MS_MSFS_H #define __SERVICES_FS_MS_MSFS_H
#include <ntifs.h> #include <ntifs.h>
#include <ndk/iotypes.h> #include <ndk/ntndk.h>
/* /*
* FIXME: GCC doesn't have a working option for defaulting to a calling * FIXME: GCC doesn't have a working option for defaulting to a calling

View file

@ -13,9 +13,8 @@
/* DEPENDENCIES **************************************************************/ /* DEPENDENCIES **************************************************************/
/* EXPORTED DATA *************************************************************/ /* EXPORTED DATA *************************************************************/
extern ULONG NTOSAPI CcFastMdlReadWait; extern ULONG NTSYSAPI CcFastReadNotPossible;
extern ULONG NTOSAPI CcFastReadNotPossible; extern ULONG NTSYSAPI CcFastReadWait;
extern ULONG NTOSAPI CcFastReadWait;
/* ENUMERATIONS **************************************************************/ /* ENUMERATIONS **************************************************************/

View file

@ -14,9 +14,9 @@
/* EXPORTED DATA *************************************************************/ /* EXPORTED DATA *************************************************************/
#ifndef NTOS_MODE_USER #ifndef NTOS_MODE_USER
extern POBJECT_TYPE NTOSAPI ExIoCompletionType; extern POBJECT_TYPE NTSYSAPI ExIoCompletionType;
extern NTOSAPI POBJECT_TYPE ExMutantObjectType; extern POBJECT_TYPE NTSYSAPI ExMutantObjectType;
extern NTOSAPI POBJECT_TYPE ExTimerType; extern POBJECT_TYPE NTSYSAPI ExTimerType;
#endif #endif
/* CONSTANTS *****************************************************************/ /* CONSTANTS *****************************************************************/
@ -46,9 +46,9 @@ extern NTOSAPI POBJECT_TYPE ExTimerType;
#ifndef NTOS_MODE_USER #ifndef NTOS_MODE_USER
typedef struct _EX_QUEUE_WORKER_INFO typedef struct _EX_QUEUE_WORKER_INFO
{ {
UCHAR QueueDisabled:1; ULONG QueueDisabled:1;
UCHAR MakeThreadsAsNecessary:1; ULONG MakeThreadsAsNecessary:1;
UCHAR WaitMode:1; ULONG WaitMode:1;
ULONG WorkerCount:29; ULONG WorkerCount:29;
} EX_QUEUE_WORKER_INFO, *PEX_QUEUE_WORKER_INFO; } EX_QUEUE_WORKER_INFO, *PEX_QUEUE_WORKER_INFO;

View file

@ -16,31 +16,16 @@
/* PROTOTYPES ****************************************************************/ /* PROTOTYPES ****************************************************************/
VOID
STDCALL
HalAcquireDisplayOwnership(
IN PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters
);
BOOLEAN BOOLEAN
STDCALL NTAPI
HalQueryDisplayOwnership(VOID); HalQueryDisplayOwnership(VOID);
BOOLEAN BOOLEAN
STDCALL NTAPI
HalAllProcessorsStarted(VOID); HalAllProcessorsStarted(VOID);
NTSTATUS
STDCALL
HalAllocateAdapterChannel(
IN PADAPTER_OBJECT AdapterObject,
IN PWAIT_CONTEXT_BLOCK WaitContextBlock,
IN ULONG NumberOfMapRegisters,
IN PDRIVER_CONTROL ExecutionRoutine
);
BOOLEAN BOOLEAN
STDCALL NTAPI
HalBeginSystemInterrupt( HalBeginSystemInterrupt(
ULONG Vector, ULONG Vector,
KIRQL Irql, KIRQL Irql,
@ -48,20 +33,20 @@ HalBeginSystemInterrupt(
); );
BOOLEAN BOOLEAN
STDCALL NTAPI
HalDisableSystemInterrupt( HalDisableSystemInterrupt(
ULONG Vector, ULONG Vector,
KIRQL Irql KIRQL Irql
); );
VOID VOID
STDCALL NTAPI
HalDisplayString ( HalDisplayString (
IN PCHAR String IN PCHAR String
); );
BOOLEAN BOOLEAN
STDCALL NTAPI
HalEnableSystemInterrupt( HalEnableSystemInterrupt(
ULONG Vector, ULONG Vector,
KIRQL Irql, KIRQL Irql,
@ -69,14 +54,14 @@ HalEnableSystemInterrupt(
); );
VOID VOID
STDCALL NTAPI
HalEndSystemInterrupt( HalEndSystemInterrupt(
KIRQL Irql, KIRQL Irql,
ULONG Vector ULONG Vector
); );
BOOLEAN BOOLEAN
STDCALL NTAPI
HalGetEnvironmentVariable( HalGetEnvironmentVariable(
PCH Name, PCH Name,
PCH Value, PCH Value,
@ -84,25 +69,25 @@ HalGetEnvironmentVariable(
); );
VOID VOID
STDCALL NTAPI
HalInitializeProcessor( HalInitializeProcessor(
ULONG ProcessorNumber, ULONG ProcessorNumber,
PVOID ProcessorStack PVOID ProcessorStack
); );
BOOLEAN BOOLEAN
STDCALL NTAPI
HalInitSystem( HalInitSystem(
ULONG BootPhase, ULONG BootPhase,
PLOADER_PARAMETER_BLOCK LoaderBlock PLOADER_PARAMETER_BLOCK LoaderBlock
); );
BOOLEAN BOOLEAN
STDCALL NTAPI
HalQueryDisplayOwnership(VOID); HalQueryDisplayOwnership(VOID);
VOID VOID
STDCALL NTAPI
HalReportResourceUsage(VOID); HalReportResourceUsage(VOID);
VOID VOID
@ -112,37 +97,37 @@ HalRequestSoftwareInterrupt(
); );
VOID VOID
STDCALL NTAPI
HalReleaseDisplayOwnership(VOID); HalReleaseDisplayOwnership(VOID);
VOID VOID
STDCALL NTAPI
HalReturnToFirmware( HalReturnToFirmware(
FIRMWARE_REENTRY Action FIRMWARE_REENTRY Action
); );
VOID VOID
STDCALL NTAPI
HalRequestIpi( HalRequestIpi(
ULONG Unknown ULONG Unknown
); );
BOOLEAN BOOLEAN
STDCALL NTAPI
HalSetEnvironmentVariable( HalSetEnvironmentVariable(
IN PCH Name, IN PCH Name,
IN PCH Value IN PCH Value
); );
BOOLEAN BOOLEAN
STDCALL NTAPI
HalStartNextProcessor( HalStartNextProcessor(
ULONG Unknown1, ULONG Unknown1,
ULONG Unknown2 ULONG Unknown2
); );
VOID VOID
STDCALL NTAPI
IoAssignDriveLetters( IoAssignDriveLetters(
struct _LOADER_PARAMETER_BLOCK *LoaderBlock, struct _LOADER_PARAMETER_BLOCK *LoaderBlock,
PSTRING NtDeviceName, PSTRING NtDeviceName,

View file

@ -12,7 +12,7 @@
/* DEPENDENCIES **************************************************************/ /* DEPENDENCIES **************************************************************/
/* EXPORTED DATA *************************************************************/ /* EXPORTED DATA *************************************************************/
extern ULONG NTOSAPI KdComPortInUse; extern ULONG NTSYSAPI KdComPortInUse;
/* CONSTANTS *****************************************************************/ /* CONSTANTS *****************************************************************/
@ -50,9 +50,9 @@ typedef struct _HAL_PRIVATE_DISPATCH
} HAL_PRIVATE_DISPATCH, *PHAL_PRIVATE_DISPATCH; } HAL_PRIVATE_DISPATCH, *PHAL_PRIVATE_DISPATCH;
#ifdef __NTOSKRNL__ #ifdef __NTOSKRNL__
extern NTOSAPI HAL_PRIVATE_DISPATCH HalPrivateDispatchTable; extern HAL_PRIVATE_DISPATCH NTSYSAPI HalPrivateDispatchTable;
#else #else
extern NTOSAPI PHAL_PRIVATE_DISPATCH HalPrivateDispatchTable; extern PHAL_PRIVATE_DISPATCH NTSYSAPI HalPrivateDispatchTable;
#endif #endif
#define HAL_PRIVATE_DISPATCH_VERSION 1 #define HAL_PRIVATE_DISPATCH_VERSION 1

View file

@ -117,29 +117,29 @@ typedef struct _KTRAP_FRAME
typedef struct _LDT_ENTRY typedef struct _LDT_ENTRY
{ {
WORD LimitLow; USHORT LimitLow;
WORD BaseLow; USHORT BaseLow;
union union
{ {
struct struct
{ {
BYTE BaseMid; UCHAR BaseMid;
BYTE Flags1; UCHAR Flags1;
BYTE Flags2; UCHAR Flags2;
BYTE BaseHi; UCHAR BaseHi;
} Bytes; } Bytes;
struct struct
{ {
DWORD BaseMid : 8; ULONG BaseMid : 8;
DWORD Type : 5; ULONG Type : 5;
DWORD Dpl : 2; ULONG Dpl : 2;
DWORD Pres : 1; ULONG Pres : 1;
DWORD LimitHi : 4; ULONG LimitHi : 4;
DWORD Sys : 1; ULONG Sys : 1;
DWORD Reserved_0 : 1; ULONG Reserved_0 : 1;
DWORD Default_Big : 1; ULONG Default_Big : 1;
DWORD Granularity : 1; ULONG Granularity : 1;
DWORD BaseHi : 8; ULONG BaseHi : 8;
} Bits; } Bits;
} HighWord; } HighWord;
} LDT_ENTRY, *PLDT_ENTRY, *LPLDT_ENTRY; } LDT_ENTRY, *PLDT_ENTRY, *LPLDT_ENTRY;
@ -216,28 +216,28 @@ typedef struct _HARDWARE_PTE_X86
typedef struct _DESCRIPTOR typedef struct _DESCRIPTOR
{ {
WORD Pad; USHORT Pad;
WORD Limit; USHORT Limit;
DWORD Base; ULONG Base;
} KDESCRIPTOR, *PKDESCRIPTOR; } KDESCRIPTOR, *PKDESCRIPTOR;
typedef struct _KSPECIAL_REGISTERS typedef struct _KSPECIAL_REGISTERS
{ {
DWORD Cr0; ULONG Cr0;
DWORD Cr2; ULONG Cr2;
DWORD Cr3; ULONG Cr3;
DWORD Cr4; ULONG Cr4;
DWORD KernelDr0; ULONG KernelDr0;
DWORD KernelDr1; ULONG KernelDr1;
DWORD KernelDr2; ULONG KernelDr2;
DWORD KernelDr3; ULONG KernelDr3;
DWORD KernelDr6; ULONG KernelDr6;
DWORD KernelDr7; ULONG KernelDr7;
KDESCRIPTOR Gdtr; KDESCRIPTOR Gdtr;
KDESCRIPTOR Idtr; KDESCRIPTOR Idtr;
WORD Tr; USHORT Tr;
WORD Ldtr; USHORT Ldtr;
DWORD Reserved[6]; ULONG Reserved[6];
} KSPECIAL_REGISTERS, *PKSPECIAL_REGISTERS; } KSPECIAL_REGISTERS, *PKSPECIAL_REGISTERS;
#pragma pack(push,4) #pragma pack(push,4)
@ -384,32 +384,45 @@ typedef struct _KPRCB
*/ */
typedef struct _KIPCR typedef struct _KIPCR
{ {
KPCR_TIB Tib; /* 00 */ union
struct _KPCR *Self; /* 1C */ {
struct _KPRCB *Prcb; /* 20 */ NT_TIB NtTib;
KIRQL Irql; /* 24 */ struct
ULONG IRR; /* 28 */ {
ULONG IrrActive; /* 2C */ struct _EXCEPTION_REGISTRATION_RECORD *Used_ExceptionList;
ULONG IDR; /* 30 */ PVOID Used_StackBase;
PVOID KdVersionBlock; /* 34 */ PVOID PerfGlobalGroupMask;
PUSHORT IDT; /* 38 */ PVOID TssCopy;
PUSHORT GDT; /* 3C */ ULONG ContextSwitches;
struct _KTSS *TSS; /* 40 */ KAFFINITY SetMemberCopy;
USHORT MajorVersion; /* 44 */ PVOID Used_Self;
USHORT MinorVersion; /* 46 */ };
KAFFINITY SetMember; /* 48 */ };
ULONG StallScaleFactor; /* 4C */ struct _KPCR *Self; /* 1C */
UCHAR SparedUnused; /* 50 */ struct _KPRCB *Prcb; /* 20 */
UCHAR Number; /* 51 */ KIRQL Irql; /* 24 */
UCHAR Reserved; /* 52 */ ULONG IRR; /* 28 */
UCHAR L2CacheAssociativity; /* 53 */ ULONG IrrActive; /* 2C */
ULONG VdmAlert; /* 54 */ ULONG IDR; /* 30 */
ULONG KernelReserved[14]; /* 58 */ PVOID KdVersionBlock; /* 34 */
ULONG L2CacheSize; /* 90 */ PUSHORT IDT; /* 38 */
ULONG HalReserved[16]; /* 94 */ PUSHORT GDT; /* 3C */
ULONG InterruptMode; /* D4 */ struct _KTSS *TSS; /* 40 */
UCHAR KernelReserved2[0x48]; /* D8 */ USHORT MajorVersion; /* 44 */
KPRCB PrcbData; /* 120 */ USHORT MinorVersion; /* 46 */
KAFFINITY SetMember; /* 48 */
ULONG StallScaleFactor; /* 4C */
UCHAR SparedUnused; /* 50 */
UCHAR Number; /* 51 */
UCHAR Reserved; /* 52 */
UCHAR L2CacheAssociativity; /* 53 */
ULONG VdmAlert; /* 54 */
ULONG KernelReserved[14]; /* 58 */
ULONG L2CacheSize; /* 90 */
ULONG HalReserved[16]; /* 94 */
ULONG InterruptMode; /* D4 */
UCHAR KernelReserved2[0x48]; /* D8 */
KPRCB PrcbData; /* 120 */
} KIPCR, *PKIPCR; } KIPCR, *PKIPCR;
#pragma pack(pop) #pragma pack(pop)
@ -507,9 +520,6 @@ typedef struct _KTSS
#include <poppack.h> #include <poppack.h>
/* i386 Doesn't have Exception Frames */ /* i386 Doesn't have Exception Frames */
typedef struct _KEXCEPTION_FRAME typedef struct _KEXCEPTION_FRAME KEXCEPTION_FRAME, *PKEXCEPTION_FRAME;
{
} KEXCEPTION_FRAME, *PKEXCEPTION_FRAME;
#endif #endif

View file

@ -16,53 +16,53 @@
/* PROTOTYPES ****************************************************************/ /* PROTOTYPES ****************************************************************/
VOID VOID
STDCALL NTAPI
InbvAcquireDisplayOwnership(VOID); InbvAcquireDisplayOwnership(VOID);
BOOLEAN BOOLEAN
STDCALL NTAPI
InbvCheckDisplayOwnership(VOID); InbvCheckDisplayOwnership(VOID);
BOOLEAN BOOLEAN
STDCALL NTAPI
InbvDisplayString( InbvDisplayString(
IN PCHAR String IN PCHAR String
); );
VOID VOID
STDCALL NTAPI
InbvEnableBootDriver( InbvEnableBootDriver(
IN BOOLEAN Enable IN BOOLEAN Enable
); );
BOOLEAN BOOLEAN
STDCALL NTAPI
InbvEnableDisplayString( InbvEnableDisplayString(
IN BOOLEAN Enable IN BOOLEAN Enable
); );
VOID VOID
STDCALL NTAPI
InbvInstallDisplayStringFilter( InbvInstallDisplayStringFilter(
IN PVOID Unknown IN PVOID Unknown
); );
BOOLEAN BOOLEAN
STDCALL NTAPI
InbvIsBootDriverInstalled(VOID); InbvIsBootDriverInstalled(VOID);
VOID VOID
STDCALL NTAPI
InbvNotifyDisplayOwnershipLost( InbvNotifyDisplayOwnershipLost(
IN PVOID Callback IN PVOID Callback
); );
BOOLEAN BOOLEAN
STDCALL NTAPI
InbvResetDisplay(VOID); InbvResetDisplay(VOID);
VOID VOID
STDCALL NTAPI
InbvSetScrollRegion( InbvSetScrollRegion(
IN ULONG Left, IN ULONG Left,
IN ULONG Top, IN ULONG Top,
@ -71,13 +71,13 @@ InbvSetScrollRegion(
); );
VOID VOID
STDCALL NTAPI
InbvSetTextColor( InbvSetTextColor(
IN ULONG Color IN ULONG Color
); );
VOID VOID
STDCALL NTAPI
InbvSolidColorFill( InbvSolidColorFill(
IN ULONG Left, IN ULONG Left,
IN ULONG Top, IN ULONG Top,
@ -87,15 +87,15 @@ InbvSolidColorFill(
); );
VOID VOID
STDCALL NTAPI
VidCleanUp(VOID); VidCleanUp(VOID);
BOOL BOOLEAN
STDCALL NTAPI
VidResetDisplay(VOID); VidResetDisplay(VOID);
BOOLEAN BOOLEAN
STDCALL NTAPI
VidIsBootDriverInstalled(VOID); VidIsBootDriverInstalled(VOID);
#endif #endif

View file

@ -14,79 +14,79 @@
/* PROTOTYPES ****************************************************************/ /* PROTOTYPES ****************************************************************/
BYTE UCHAR
STDCALL NTAPI
KdPollBreakIn(VOID); KdPollBreakIn(VOID);
BOOLEAN BOOLEAN
STDCALL NTAPI
KdPortInitialize( KdPortInitialize(
PKD_PORT_INFORMATION PortInformation, PKD_PORT_INFORMATION PortInformation,
DWORD Unknown1, ULONG Unknown1,
DWORD Unknown2 ULONG Unknown2
); );
BOOLEAN BOOLEAN
STDCALL NTAPI
KdPortInitializeEx( KdPortInitializeEx(
PKD_PORT_INFORMATION PortInformation, PKD_PORT_INFORMATION PortInformation,
DWORD Unknown1, ULONG Unknown1,
DWORD Unknown2 ULONG Unknown2
); );
BOOLEAN BOOLEAN
STDCALL NTAPI
KdPortGetByte( KdPortGetByte(
PUCHAR ByteRecieved PUCHAR ByteRecieved
); );
BOOLEAN BOOLEAN
STDCALL NTAPI
KdPortGetByteEx( KdPortGetByteEx(
PKD_PORT_INFORMATION PortInformation, PKD_PORT_INFORMATION PortInformation,
PUCHAR ByteRecieved PUCHAR ByteRecieved
); );
BOOLEAN BOOLEAN
STDCALL NTAPI
KdPortPollByte( KdPortPollByte(
PUCHAR ByteRecieved PUCHAR ByteRecieved
); );
BOOLEAN BOOLEAN
STDCALL NTAPI
KdPortPollByteEx( KdPortPollByteEx(
PKD_PORT_INFORMATION PortInformation, PKD_PORT_INFORMATION PortInformation,
PUCHAR ByteRecieved PUCHAR ByteRecieved
); );
VOID VOID
STDCALL NTAPI
KdPortPutByte( KdPortPutByte(
UCHAR ByteToSend UCHAR ByteToSend
); );
VOID VOID
STDCALL NTAPI
KdPortPutByteEx( KdPortPutByteEx(
PKD_PORT_INFORMATION PortInformation, PKD_PORT_INFORMATION PortInformation,
UCHAR ByteToSend UCHAR ByteToSend
); );
VOID VOID
STDCALL NTAPI
KdPortRestore(VOID); KdPortRestore(VOID);
VOID VOID
STDCALL NTAPI
KdPortSave (VOID); KdPortSave (VOID);
BOOLEAN BOOLEAN
STDCALL NTAPI
KdPortDisableInterrupts(VOID); KdPortDisableInterrupts(VOID);
BOOLEAN BOOLEAN
STDCALL NTAPI
KdPortEnableInterrupts(VOID); KdPortEnableInterrupts(VOID);
#endif #endif

View file

@ -14,8 +14,18 @@
/* PROTOTYPES ****************************************************************/ /* PROTOTYPES ****************************************************************/
BOOLEAN
NTAPI
KeAddSystemServiceTable(
PULONG_PTR Base,
PULONG Count OPTIONAL,
ULONG Limit,
PUCHAR Number,
ULONG Index
);
VOID VOID
STDCALL NTAPI
KeInitializeApc( KeInitializeApc(
IN PKAPC Apc, IN PKAPC Apc,
IN PKTHREAD Thread, IN PKTHREAD Thread,
@ -28,7 +38,7 @@ KeInitializeApc(
); );
VOID VOID
STDCALL NTAPI
KeEnterKernelDebugger(VOID); KeEnterKernelDebugger(VOID);
VOID VOID
@ -44,7 +54,7 @@ KiReleaseSpinLock(
); );
VOID VOID
STDCALL NTAPI
KiDeliverApc( KiDeliverApc(
IN KPROCESSOR_MODE PreviousMode, IN KPROCESSOR_MODE PreviousMode,
IN PVOID Reserved, IN PVOID Reserved,
@ -52,81 +62,34 @@ KiDeliverApc(
); );
VOID VOID
STDCALL NTAPI
KiDispatchInterrupt(VOID); KiDispatchInterrupt(VOID);
BOOLEAN
STDCALL
KeAreApcsDisabled(
VOID
);
VOID VOID
STDCALL NTAPI
KeFlushQueuedDpcs(
VOID
);
ULONG
STDCALL
KeGetRecommendedSharedDataAlignment(
VOID
);
ULONG
STDCALL
KeQueryRuntimeThread(
IN PKTHREAD Thread,
OUT PULONG UserTime
);
BOOLEAN
STDCALL
KeSetKernelStackSwapEnable(
IN BOOLEAN Enable
);
BOOLEAN
STDCALL
KeDeregisterBugCheckReasonCallback(
IN PKBUGCHECK_REASON_CALLBACK_RECORD CallbackRecord
);
BOOLEAN
STDCALL
KeRegisterBugCheckReasonCallback(
IN PKBUGCHECK_REASON_CALLBACK_RECORD CallbackRecord,
IN PKBUGCHECK_REASON_CALLBACK_ROUTINE CallbackRoutine,
IN KBUGCHECK_CALLBACK_REASON Reason,
IN PUCHAR Component
);
VOID
STDCALL
KeTerminateThread( KeTerminateThread(
IN KPRIORITY Increment IN KPRIORITY Increment
); );
BOOLEAN BOOLEAN
STDCALL NTAPI
KeIsAttachedProcess(VOID); KeIsAttachedProcess(VOID);
BOOLEAN BOOLEAN
STDCALL NTAPI
KeIsExecutingDpc( KeIsExecutingDpc(
VOID VOID
); );
VOID VOID
STDCALL NTAPI
KeSetEventBoostPriority( KeSetEventBoostPriority(
IN PKEVENT Event, IN PKEVENT Event,
IN PKTHREAD *Thread OPTIONAL IN PKTHREAD *Thread OPTIONAL
); );
PCONFIGURATION_COMPONENT_DATA PCONFIGURATION_COMPONENT_DATA
STDCALL NTAPI
KeFindConfigurationNextEntry( KeFindConfigurationNextEntry(
IN PCONFIGURATION_COMPONENT_DATA Child, IN PCONFIGURATION_COMPONENT_DATA Child,
IN CONFIGURATION_CLASS Class, IN CONFIGURATION_CLASS Class,
@ -136,7 +99,7 @@ KeFindConfigurationNextEntry(
); );
PCONFIGURATION_COMPONENT_DATA PCONFIGURATION_COMPONENT_DATA
STDCALL NTAPI
KeFindConfigurationEntry( KeFindConfigurationEntry(
IN PCONFIGURATION_COMPONENT_DATA Child, IN PCONFIGURATION_COMPONENT_DATA Child,
IN CONFIGURATION_CLASS Class, IN CONFIGURATION_CLASS Class,
@ -145,57 +108,45 @@ KeFindConfigurationEntry(
); );
VOID VOID
STDCALL NTAPI
KeFlushEntireTb( KeFlushEntireTb(
IN BOOLEAN Unknown, IN BOOLEAN Unknown,
IN BOOLEAN CurrentCpuOnly IN BOOLEAN CurrentCpuOnly
); );
VOID VOID
STDCALL NTAPI
KeRevertToUserAffinityThread(
VOID
);
VOID
STDCALL
KiCoprocessorError( KiCoprocessorError(
VOID VOID
); );
VOID VOID
STDCALL NTAPI
KiUnexpectedInterrupt( KiUnexpectedInterrupt(
VOID VOID
); );
VOID VOID
STDCALL NTAPI
KeSetDmaIoCoherency( KeSetDmaIoCoherency(
IN ULONG Coherency IN ULONG Coherency
); );
VOID VOID
STDCALL NTAPI
KeSetProfileIrql( KeSetProfileIrql(
IN KIRQL ProfileIrql IN KIRQL ProfileIrql
); );
NTSTATUS NTSTATUS
STDCALL NTAPI
KeSetAffinityThread( KeSetAffinityThread(
PKTHREAD Thread, PKTHREAD Thread,
KAFFINITY Affinity KAFFINITY Affinity
); );
VOID
STDCALL
KeSetSystemAffinityThread(
IN KAFFINITY Affinity
);
NTSTATUS NTSTATUS
STDCALL NTAPI
KeUserModeCallback( KeUserModeCallback(
IN ULONG FunctionID, IN ULONG FunctionID,
IN PVOID InputBuffer, IN PVOID InputBuffer,
@ -205,14 +156,14 @@ KeUserModeCallback(
); );
VOID VOID
STDCALL NTAPI
KeSetTimeIncrement( KeSetTimeIncrement(
IN ULONG MaxIncrement, IN ULONG MaxIncrement,
IN ULONG MinIncrement IN ULONG MinIncrement
); );
VOID VOID
STDCALL NTAPI
KeInitializeInterrupt( KeInitializeInterrupt(
PKINTERRUPT InterruptObject, PKINTERRUPT InterruptObject,
PKSERVICE_ROUTINE ServiceRoutine, PKSERVICE_ROUTINE ServiceRoutine,
@ -228,19 +179,19 @@ KeInitializeInterrupt(
); );
BOOLEAN BOOLEAN
STDCALL NTAPI
KeConnectInterrupt( KeConnectInterrupt(
PKINTERRUPT InterruptObject PKINTERRUPT InterruptObject
); );
BOOLEAN BOOLEAN
STDCALL NTAPI
KeDisconnectInterrupt( KeDisconnectInterrupt(
PKINTERRUPT InterruptObject PKINTERRUPT InterruptObject
); );
PKPROCESS PKPROCESS
STDCALL NTAPI
KeGetCurrentProcess( KeGetCurrentProcess(
VOID VOID
); );
@ -252,36 +203,10 @@ KeSetGdtSelector(
ULONG Value2 ULONG Value2
); );
LONG
STDCALL
KeReadStateMutant(
IN PKMUTANT Mutant
);
VOID
STDCALL
KeInitializeMutant(
IN PKMUTANT Mutant,
IN BOOLEAN InitialOwner
);
LONG
STDCALL
KeReleaseMutant(
IN PKMUTANT Mutant,
IN KPRIORITY Increment,
IN BOOLEAN Abandon,
IN BOOLEAN Wait
);
NTSTATUS NTSTATUS
STDCALL NTAPI
KeRaiseUserException( KeRaiseUserException(
IN NTSTATUS ExceptionCode IN NTSTATUS ExceptionCode
); );
VOID
STDCALL
KeFlushWriteBuffer(VOID);
#endif #endif

View file

@ -19,28 +19,11 @@
#define SSDT_MAX_ENTRIES 4 #define SSDT_MAX_ENTRIES 4
#define PROCESSOR_FEATURE_MAX 64 #define PROCESSOR_FEATURE_MAX 64
#define CONTEXT_DEBUGGER (CONTEXT_FULL | CONTEXT_FLOATING_POINT) #define CONTEXT_DEBUGGER (CONTEXT_FULL | CONTEXT_FLOATING_POINT)
#define THREAD_WAIT_OBJECTS 4
#define THREAD_ALERT 0x4
#ifdef NTOS_MODE_USER #ifdef NTOS_MODE_USER
#define SharedUserData ((KUSER_SHARED_DATA * CONST) USER_SHARED_DATA) #define SharedUserData ((KUSER_SHARED_DATA * CONST) USER_SHARED_DATA)
#endif #endif
/* EXPORTED DATA *************************************************************/
#ifndef NTOS_MODE_USER
extern CHAR NTOSAPI KeNumberProcessors;
extern LOADER_PARAMETER_BLOCK NTOSAPI KeLoaderBlock;
extern ULONG NTOSAPI KeDcacheFlushCount;
extern ULONG NTOSAPI KeIcacheFlushCount;
extern KAFFINITY NTOSAPI KeActiveProcessors;
extern ULONG NTOSAPI KiDmaIoCoherency; /* RISC Architectures only */
extern ULONG NTOSAPI KeMaximumIncrement;
extern ULONG NTOSAPI KeMinimumIncrement;
extern ULONG NTOSAPI NtBuildNumber;
extern SSDT_ENTRY NTOSAPI KeServiceDescriptorTable[SSDT_MAX_ENTRIES];
extern SSDT_ENTRY NTOSAPI KeServiceDescriptorTableShadow[SSDT_MAX_ENTRIES];
#endif
/* ENUMERATIONS **************************************************************/ /* ENUMERATIONS **************************************************************/
#ifdef NTOS_MODE_USER #ifdef NTOS_MODE_USER
@ -166,6 +149,7 @@ typedef enum _KTHREAD_STATE
/* FUNCTION TYPES ************************************************************/ /* FUNCTION TYPES ************************************************************/
#ifdef NTOS_MODE_USER
typedef VOID typedef VOID
(NTAPI *PKNORMAL_ROUTINE)( (NTAPI *PKNORMAL_ROUTINE)(
IN PVOID NormalContext, IN PVOID NormalContext,
@ -177,6 +161,7 @@ typedef VOID
IN PVOID TimerContext, IN PVOID TimerContext,
IN ULONG TimerLowValue, IN ULONG TimerLowValue,
IN LONG TimerHighValue); IN LONG TimerHighValue);
#endif
/* TYPES *********************************************************************/ /* TYPES *********************************************************************/
@ -486,6 +471,32 @@ typedef struct _KPROCESS
ULONG StackCount; /* 06C */ ULONG StackCount; /* 06C */
LIST_ENTRY ProcessListEntry; /* 070 */ LIST_ENTRY ProcessListEntry; /* 070 */
} KPROCESS; } KPROCESS;
typedef struct _KSERVICE_TABLE_DESCRIPTOR
{
PULONG_PTR Base;
PULONG Count;
ULONG Limit;
#if defined(_IA64_)
LONG TableBaseGpOffset;
#endif
PUCHAR Number;
} KSERVICE_TABLE_DESCRIPTOR, *PKSERVICE_TABLE_DESCRIPTOR;
#endif /* !NTOS_MODE_USER */ #endif /* !NTOS_MODE_USER */
/* EXPORTED DATA *************************************************************/
#ifndef NTOS_MODE_USER
extern CHAR NTSYSAPI KeNumberProcessors;
extern LOADER_PARAMETER_BLOCK NTSYSAPI KeLoaderBlock;
extern ULONG NTSYSAPI KeDcacheFlushCount;
extern ULONG NTSYSAPI KeIcacheFlushCount;
extern KAFFINITY NTSYSAPI KeActiveProcessors;
extern ULONG NTSYSAPI KiDmaIoCoherency; /* RISC Architectures only */
extern ULONG NTSYSAPI KeMaximumIncrement;
extern ULONG NTSYSAPI KeMinimumIncrement;
extern ULONG NTSYSAPI NtBuildNumber;
extern KSERVICE_TABLE_DESCRIPTOR NTSYSAPI KeServiceDescriptorTable[SSDT_MAX_ENTRIES];
extern KSERVICE_TABLE_DESCRIPTOR NTSYSAPI KeServiceDescriptorTableShadow[SSDT_MAX_ENTRIES];
#endif
#endif #endif

View file

@ -17,7 +17,7 @@
/* PROTOTYPES ****************************************************************/ /* PROTOTYPES ****************************************************************/
NTSTATUS NTSTATUS
STDCALL NTAPI
LdrAccessResource( LdrAccessResource(
IN PVOID BaseAddress, IN PVOID BaseAddress,
IN PIMAGE_RESOURCE_DATA_ENTRY ResourceDataEntry, IN PIMAGE_RESOURCE_DATA_ENTRY ResourceDataEntry,
@ -26,7 +26,7 @@ LdrAccessResource(
); );
NTSTATUS NTSTATUS
STDCALL NTAPI
LdrFindResource_U( LdrFindResource_U(
IN PVOID BaseAddress, IN PVOID BaseAddress,
IN PLDR_RESOURCE_INFO ResourceInfo, IN PLDR_RESOURCE_INFO ResourceInfo,
@ -35,7 +35,7 @@ LdrFindResource_U(
); );
NTSTATUS NTSTATUS
STDCALL NTAPI
LdrFindResourceDirectory_U( LdrFindResourceDirectory_U(
IN PVOID BaseAddress, IN PVOID BaseAddress,
IN PLDR_RESOURCE_INFO ResourceInfo, IN PLDR_RESOURCE_INFO ResourceInfo,
@ -44,7 +44,7 @@ LdrFindResourceDirectory_U(
); );
NTSTATUS NTSTATUS
STDCALL NTAPI
LdrGetProcedureAddress( LdrGetProcedureAddress(
IN PVOID BaseAddress, IN PVOID BaseAddress,
IN PANSI_STRING Name, IN PANSI_STRING Name,

View file

@ -14,7 +14,7 @@
/* PROTOTYPES ****************************************************************/ /* PROTOTYPES ****************************************************************/
NTSTATUS NTSTATUS
STDCALL NTAPI
MmUnmapViewOfSection( MmUnmapViewOfSection(
struct _EPROCESS* Process, struct _EPROCESS* Process,
PVOID BaseAddress PVOID BaseAddress

View file

@ -16,7 +16,7 @@
/* PROTOTYPES ****************************************************************/ /* PROTOTYPES ****************************************************************/
NTSTATUS NTSTATUS
STDCALL NTAPI
ObCreateObject ( ObCreateObject (
IN KPROCESSOR_MODE ObjectAttributesAccessMode OPTIONAL, IN KPROCESSOR_MODE ObjectAttributesAccessMode OPTIONAL,
IN POBJECT_TYPE ObjectType, IN POBJECT_TYPE ObjectType,
@ -30,58 +30,13 @@ ObCreateObject (
); );
ULONG ULONG
STDCALL NTAPI
ObGetObjectPointerCount ( ObGetObjectPointerCount (
IN PVOID Object IN PVOID Object
); );
NTSTATUS NTSTATUS
STDCALL NTAPI
ObInsertObject (
IN PVOID Object,
IN PACCESS_STATE PassedAccessState OPTIONAL,
IN ACCESS_MASK DesiredAccess,
IN ULONG AdditionalReferences,
OUT PVOID *ReferencedObject OPTIONAL,
OUT PHANDLE Handle
);
VOID
STDCALL
ObMakeTemporaryObject (
IN PVOID Object
);
NTSTATUS
STDCALL
ObOpenObjectByPointer (
IN PVOID Object,
IN ULONG HandleAttributes,
IN PACCESS_STATE PassedAccessState OPTIONAL,
IN ACCESS_MASK DesiredAccess OPTIONAL,
IN POBJECT_TYPE ObjectType OPTIONAL,
IN KPROCESSOR_MODE AccessMode,
OUT PHANDLE Handle
);
NTSTATUS
STDCALL
ObQueryNameString (
IN PVOID Object,
OUT POBJECT_NAME_INFORMATION ObjectNameInfo,
IN ULONG Length,
OUT PULONG ReturnLength
);
NTSTATUS
STDCALL
ObQueryObjectAuditingByHandle (
IN HANDLE Handle,
OUT PBOOLEAN GenerateOnClose
);
NTSTATUS
STDCALL
ObReferenceObjectByName ( ObReferenceObjectByName (
IN PUNICODE_STRING ObjectName, IN PUNICODE_STRING ObjectName,
IN ULONG Attributes, IN ULONG Attributes,
@ -94,7 +49,7 @@ ObReferenceObjectByName (
); );
NTSTATUS NTSTATUS
STDCALL NTAPI
ObFindHandleForObject( ObFindHandleForObject(
IN PEPROCESS Process, IN PEPROCESS Process,
IN PVOID Object, IN PVOID Object,

View file

@ -76,7 +76,7 @@ typedef enum _OB_OPEN_REASON
/* Object Callbacks FIXME: Update these soon */ /* Object Callbacks FIXME: Update these soon */
typedef NTSTATUS typedef NTSTATUS
(STDCALL *OB_OPEN_METHOD)( (NTAPI *OB_OPEN_METHOD)(
OB_OPEN_REASON Reason, OB_OPEN_REASON Reason,
PVOID ObjectBody, PVOID ObjectBody,
PEPROCESS Process, PEPROCESS Process,
@ -85,7 +85,7 @@ typedef NTSTATUS
); );
typedef NTSTATUS typedef NTSTATUS
(STDCALL *OB_PARSE_METHOD)( (NTAPI *OB_PARSE_METHOD)(
PVOID Object, PVOID Object,
PVOID *NextObject, PVOID *NextObject,
PUNICODE_STRING FullPath, PUNICODE_STRING FullPath,
@ -94,24 +94,24 @@ typedef NTSTATUS
); );
typedef VOID typedef VOID
(STDCALL *OB_DELETE_METHOD)( (NTAPI *OB_DELETE_METHOD)(
PVOID DeletedObject PVOID DeletedObject
); );
typedef VOID typedef VOID
(STDCALL *OB_CLOSE_METHOD)( (NTAPI *OB_CLOSE_METHOD)(
PVOID ClosedObject, PVOID ClosedObject,
ULONG HandleCount ULONG HandleCount
); );
typedef VOID typedef VOID
(STDCALL *OB_DUMP_METHOD)(VOID); (NTAPI *OB_DUMP_METHOD)(VOID);
typedef NTSTATUS typedef NTSTATUS
(STDCALL *OB_OKAYTOCLOSE_METHOD)(VOID); (NTAPI *OB_OKAYTOCLOSE_METHOD)(VOID);
typedef NTSTATUS typedef NTSTATUS
(STDCALL *OB_QUERYNAME_METHOD)( (NTAPI *OB_QUERYNAME_METHOD)(
PVOID ObjectBody, PVOID ObjectBody,
POBJECT_NAME_INFORMATION ObjectNameInfo, POBJECT_NAME_INFORMATION ObjectNameInfo,
ULONG Length, ULONG Length,
@ -119,14 +119,14 @@ typedef NTSTATUS
); );
typedef PVOID typedef PVOID
(STDCALL *OB_FIND_METHOD)( (NTAPI *OB_FIND_METHOD)(
PVOID WinStaObject, PVOID WinStaObject,
PWSTR Name, PWSTR Name,
ULONG Attributes ULONG Attributes
); );
typedef NTSTATUS typedef NTSTATUS
(STDCALL *OB_SECURITY_METHOD)( (NTAPI *OB_SECURITY_METHOD)(
PVOID Object, PVOID Object,
SECURITY_OPERATION_CODE OperationType, SECURITY_OPERATION_CODE OperationType,
SECURITY_INFORMATION SecurityInformation, SECURITY_INFORMATION SecurityInformation,
@ -139,7 +139,7 @@ typedef NTSTATUS
/* FIXME: TEMPORARY HACK */ /* FIXME: TEMPORARY HACK */
typedef NTSTATUS typedef NTSTATUS
(STDCALL *OB_CREATE_METHOD)( (NTAPI *OB_CREATE_METHOD)(
PVOID ObjectBody, PVOID ObjectBody,
PVOID Parent, PVOID Parent,
PWSTR RemainingPath, PWSTR RemainingPath,
@ -197,7 +197,7 @@ typedef struct _OBJECT_CREATE_INFORMATION
typedef struct _OBJECT_TYPE_INITIALIZER typedef struct _OBJECT_TYPE_INITIALIZER
{ {
WORD Length; USHORT Length;
UCHAR UseDefaultObject; UCHAR UseDefaultObject;
UCHAR CaseInsensitive; UCHAR CaseInsensitive;
ULONG InvalidAttributes; ULONG InvalidAttributes;
@ -264,15 +264,6 @@ typedef struct _OBJECT_HEADER_CREATOR_INFO
USHORT Reserved; USHORT Reserved;
} OBJECT_HEADER_CREATOR_INFO, *POBJECT_HEADER_CREATOR_INFO; } OBJECT_HEADER_CREATOR_INFO, *POBJECT_HEADER_CREATOR_INFO;
typedef struct _QUAD
{
union
{
LONGLONG UseThisFieldToCopy;
float DoNotUseThisField;
};
} QUAD, *PQUAD;
typedef struct _OBJECT_HEADER typedef struct _OBJECT_HEADER
{ {
LIST_ENTRY Entry; /* FIXME: REMOVE THIS SOON */ LIST_ENTRY Entry; /* FIXME: REMOVE THIS SOON */
@ -328,8 +319,8 @@ typedef struct _DEVICE_MAP
/* EXPORTED DATA *************************************************************/ /* EXPORTED DATA *************************************************************/
extern NTOSAPI POBJECT_TYPE ObDirectoryType; extern POBJECT_TYPE NTSYSAPI ObDirectoryType;
extern NTOSAPI PDEVICE_MAP ObSystemDeviceMap; extern PDEVICE_MAP NTSYSAPI ObSystemDeviceMap;
#endif #endif
#endif #endif

View file

@ -10,7 +10,7 @@
#define _POTYPES_H #define _POTYPES_H
/* DEPENDENCIES **************************************************************/ /* DEPENDENCIES **************************************************************/
#include <ddk/ntpoapi.h> #include <ntpoapi.h>
/* EXPORTED DATA *************************************************************/ /* EXPORTED DATA *************************************************************/

View file

@ -14,58 +14,58 @@
/* PROTOTYPES ****************************************************************/ /* PROTOTYPES ****************************************************************/
struct _W32THREAD* STDCALL struct _W32THREAD* NTAPI
PsGetWin32Thread(VOID); PsGetWin32Thread(VOID);
struct _W32PROCESS* STDCALL struct _W32PROCESS* NTAPI
PsGetWin32Process(VOID); PsGetWin32Process(VOID);
PVOID PVOID
STDCALL NTAPI
PsGetProcessWin32Process(PEPROCESS Process); PsGetProcessWin32Process(PEPROCESS Process);
VOID VOID
STDCALL NTAPI
PsSetProcessWin32Process( PsSetProcessWin32Process(
PEPROCESS Process, PEPROCESS Process,
PVOID Win32Process PVOID Win32Process
); );
VOID VOID
STDCALL NTAPI
PsSetThreadWin32Thread( PsSetThreadWin32Thread(
PETHREAD Thread, PETHREAD Thread,
PVOID Win32Thread PVOID Win32Thread
); );
PVOID PVOID
STDCALL NTAPI
PsGetThreadWin32Thread(PETHREAD Thread); PsGetThreadWin32Thread(PETHREAD Thread);
VOID VOID
STDCALL NTAPI
PsRevertThreadToSelf( PsRevertThreadToSelf(
IN struct _ETHREAD* Thread IN struct _ETHREAD* Thread
); );
struct _W32THREAD* struct _W32THREAD*
STDCALL NTAPI
PsGetWin32Thread( PsGetWin32Thread(
VOID VOID
); );
struct _W32PROCESS* struct _W32PROCESS*
STDCALL NTAPI
PsGetWin32Process( PsGetWin32Process(
VOID VOID
); );
VOID VOID
STDCALL NTAPI
PsEstablishWin32Callouts(PW32_CALLOUT_DATA CalloutData); PsEstablishWin32Callouts(PW32_CALLOUT_DATA CalloutData);
HANDLE HANDLE
STDCALL NTAPI
PsGetProcessId(struct _EPROCESS *Process); PsGetProcessId(struct _EPROCESS *Process);
#endif #endif

View file

@ -21,9 +21,8 @@
/* EXPORTED DATA *************************************************************/ /* EXPORTED DATA *************************************************************/
#ifndef NTOS_MODE_USER #ifndef NTOS_MODE_USER
extern NTOSAPI struct _EPROCESS* PsInitialSystemProcess; extern NTSYSAPI struct _EPROCESS* PsInitialSystemProcess;
extern NTOSAPI POBJECT_TYPE PsProcessType; extern NTSYSAPI POBJECT_TYPE PsProcessType;
extern NTOSAPI POBJECT_TYPE PsThreadType;
#endif #endif
/* CONSTANTS *****************************************************************/ /* CONSTANTS *****************************************************************/
@ -643,15 +642,15 @@ typedef struct _EPROCESS
#include <pshpack1.h> #include <pshpack1.h>
typedef struct _PS_JOB_TOKEN_FILTER typedef struct _PS_JOB_TOKEN_FILTER
{ {
UINT CapturedSidCount; ULONG CapturedSidCount;
PSID_AND_ATTRIBUTES CapturedSids; PSID_AND_ATTRIBUTES CapturedSids;
UINT CapturedSidsLength; ULONG CapturedSidsLength;
UINT CapturedGroupCount; ULONG CapturedGroupCount;
PSID_AND_ATTRIBUTES CapturedGroups; PSID_AND_ATTRIBUTES CapturedGroups;
UINT CapturedGroupsLength; ULONG CapturedGroupsLength;
UINT CapturedPrivilegeCount; ULONG CapturedPrivilegeCount;
PLUID_AND_ATTRIBUTES CapturedPrivileges; PLUID_AND_ATTRIBUTES CapturedPrivileges;
UINT CapturedPrivilegesLength; ULONG CapturedPrivilegesLength;
} PS_JOB_TOKEN_FILTER, *PPS_JOB_TOKEN_FILTER; } PS_JOB_TOKEN_FILTER, *PPS_JOB_TOKEN_FILTER;
typedef struct _EJOB typedef struct _EJOB
@ -664,27 +663,27 @@ typedef struct _EJOB
LARGE_INTEGER TotalKernelTime; LARGE_INTEGER TotalKernelTime;
LARGE_INTEGER ThisPeriodTotalUserTime; LARGE_INTEGER ThisPeriodTotalUserTime;
LARGE_INTEGER ThisPeriodTotalKernelTime; LARGE_INTEGER ThisPeriodTotalKernelTime;
UINT TotalPageFaultCount; ULONG TotalPageFaultCount;
UINT TotalProcesses; ULONG TotalProcesses;
UINT ActiveProcesses; ULONG ActiveProcesses;
UINT TotalTerminatedProcesses; ULONG TotalTerminatedProcesses;
LARGE_INTEGER PerProcessUserTimeLimit; LARGE_INTEGER PerProcessUserTimeLimit;
LARGE_INTEGER PerJobUserTimeLimit; LARGE_INTEGER PerJobUserTimeLimit;
UINT LimitFlags; ULONG LimitFlags;
UINT MinimumWorkingSetSize; ULONG MinimumWorkingSetSize;
UINT MaximumWorkingSetSize; ULONG MaximumWorkingSetSize;
UINT ActiveProcessLimit; ULONG ActiveProcessLimit;
UINT Affinity; ULONG Affinity;
BYTE PriorityClass; UCHAR PriorityClass;
UINT UIRestrictionsClass; ULONG UIRestrictionsClass;
UINT SecurityLimitFlags; ULONG SecurityLimitFlags;
PVOID Token; PVOID Token;
PPS_JOB_TOKEN_FILTER Filter; PPS_JOB_TOKEN_FILTER Filter;
UINT EndOfJobTimeAction; ULONG EndOfJobTimeAction;
PVOID CompletionPort; PVOID CompletionPort;
PVOID CompletionKey; PVOID CompletionKey;
UINT SessionId; ULONG SessionId;
UINT SchedulingClass; ULONG SchedulingClass;
ULONGLONG ReadOperationCount; ULONGLONG ReadOperationCount;
ULONGLONG WriteOperationCount; ULONGLONG WriteOperationCount;
ULONGLONG OtherOperationCount; ULONGLONG OtherOperationCount;
@ -692,11 +691,11 @@ typedef struct _EJOB
ULONGLONG WriteTransferCount; ULONGLONG WriteTransferCount;
ULONGLONG OtherTransferCount; ULONGLONG OtherTransferCount;
IO_COUNTERS IoInfo; IO_COUNTERS IoInfo;
UINT ProcessMemoryLimit; ULONG ProcessMemoryLimit;
UINT JobMemoryLimit; ULONG JobMemoryLimit;
UINT PeakProcessMemoryUsed; ULONG PeakProcessMemoryUsed;
UINT PeakJobMemoryUsed; ULONG PeakJobMemoryUsed;
UINT CurrentJobMemoryUsed; ULONG CurrentJobMemoryUsed;
KGUARDED_MUTEX MemoryLimitsLock; KGUARDED_MUTEX MemoryLimitsLock;
ULONG MemberLevel; ULONG MemberLevel;
ULONG JobFlags; ULONG JobFlags;

View file

@ -16,7 +16,7 @@
/* PROTOTYPES ****************************************************************/ /* PROTOTYPES ****************************************************************/
NTSTATUS NTSTATUS
STDCALL NTAPI
SeCaptureSecurityDescriptor( SeCaptureSecurityDescriptor(
IN PSECURITY_DESCRIPTOR OriginalSecurityDescriptor, IN PSECURITY_DESCRIPTOR OriginalSecurityDescriptor,
IN KPROCESSOR_MODE CurrentMode, IN KPROCESSOR_MODE CurrentMode,
@ -26,7 +26,7 @@ SeCaptureSecurityDescriptor(
); );
NTSTATUS NTSTATUS
STDCALL NTAPI
SeCreateAccessState( SeCreateAccessState(
PACCESS_STATE AccessState, PACCESS_STATE AccessState,
PAUX_DATA AuxData, PAUX_DATA AuxData,
@ -35,11 +35,11 @@ SeCreateAccessState(
); );
VOID VOID
STDCALL NTAPI
SeDeleteAccessState(IN PACCESS_STATE AccessState); SeDeleteAccessState(IN PACCESS_STATE AccessState);
NTSTATUS NTSTATUS
STDCALL NTAPI
SeReleaseSecurityDescriptor( SeReleaseSecurityDescriptor(
IN PSECURITY_DESCRIPTOR CapturedSecurityDescriptor, IN PSECURITY_DESCRIPTOR CapturedSecurityDescriptor,
IN KPROCESSOR_MODE CurrentMode, IN KPROCESSOR_MODE CurrentMode,
@ -47,14 +47,14 @@ SeReleaseSecurityDescriptor(
); );
VOID VOID
STDCALL NTAPI
SeSetAccessStateGenericMapping( SeSetAccessStateGenericMapping(
IN PACCESS_STATE AccessState, IN PACCESS_STATE AccessState,
IN PGENERIC_MAPPING GenericMapping IN PGENERIC_MAPPING GenericMapping
); );
SECURITY_IMPERSONATION_LEVEL SECURITY_IMPERSONATION_LEVEL
STDCALL NTAPI
SeTokenImpersonationLevel( SeTokenImpersonationLevel(
IN PACCESS_TOKEN Token IN PACCESS_TOKEN Token
); );

View file

@ -77,7 +77,6 @@ typedef struct _SEP_AUDIT_POLICY
}; };
} SEP_AUDIT_POLICY, *PSEP_AUDIT_POLICY; } SEP_AUDIT_POLICY, *PSEP_AUDIT_POLICY;
#define TOKEN_HAS_TRAVERSE_PRIVILEGE 0x01
typedef struct _TOKEN typedef struct _TOKEN
{ {
TOKEN_SOURCE TokenSource; /* 0x00 */ TOKEN_SOURCE TokenSource; /* 0x00 */

View file

@ -10,6 +10,7 @@
/* We are the Kernel */ /* We are the Kernel */
#define NTKERNELAPI #define NTKERNELAPI
#define _NTSYSTEM_
/* DDK/IFS/NDK Headers */ /* DDK/IFS/NDK Headers */
#include <ddk/ntddk.h> #include <ddk/ntddk.h>

View file

@ -187,7 +187,7 @@ KePrepareForApplicationProcessorInit(ULONG Id)
memset(Pcr, 0, PAGE_SIZE); memset(Pcr, 0, PAGE_SIZE);
Pcr->Number = Id; Pcr->Number = Id;
Pcr->SetMember = 1 << Id; Pcr->SetMember = 1 << Id;
Pcr->Tib.Self = &Pcr->Tib; Pcr->NtTib.Self = &Pcr->NtTib;
Pcr->Self = (PKPCR)Pcr; Pcr->Self = (PKPCR)Pcr;
Pcr->Prcb = &Pcr->PrcbData; Pcr->Prcb = &Pcr->PrcbData;
Pcr->Irql = SYNCH_LEVEL; Pcr->Irql = SYNCH_LEVEL;
@ -197,7 +197,7 @@ KePrepareForApplicationProcessorInit(ULONG Id)
Pcr->StallScaleFactor = BootPcr->StallScaleFactor; Pcr->StallScaleFactor = BootPcr->StallScaleFactor;
/* Mark the end of the exception handler list */ /* Mark the end of the exception handler list */
Pcr->Tib.ExceptionList = (PVOID)-1; Pcr->NtTib.ExceptionList = (PVOID)-1;
KiGdtPrepareForApplicationProcessorInit(Id); KiGdtPrepareForApplicationProcessorInit(Id);
@ -287,7 +287,7 @@ KeInit1(PCHAR CommandLine, PULONG LastKernelAddress)
KPCR->Self = (PKPCR)KPCR; KPCR->Self = (PKPCR)KPCR;
KPCR->Prcb = &KPCR->PrcbData; KPCR->Prcb = &KPCR->PrcbData;
KPCR->Irql = SYNCH_LEVEL; KPCR->Irql = SYNCH_LEVEL;
KPCR->Tib.Self = &KPCR->Tib; KPCR->NtTib.Self = &KPCR->NtTib;
KPCR->GDT = KiBootGdt; KPCR->GDT = KiBootGdt;
KPCR->IDT = (PUSHORT)KiIdt; KPCR->IDT = (PUSHORT)KiIdt;
KPCR->TSS = &KiBootTss; KPCR->TSS = &KiBootTss;
@ -308,7 +308,7 @@ KeInit1(PCHAR CommandLine, PULONG LastKernelAddress)
KiCheckFPU(); KiCheckFPU();
/* Mark the end of the exception handler list */ /* Mark the end of the exception handler list */
KPCR->Tib.ExceptionList = (PVOID)-1; KPCR->NtTib.ExceptionList = (PVOID)-1;
KeInitDpc(KPCR->Prcb); KeInitDpc(KPCR->Prcb);

View file

@ -17,7 +17,7 @@
/* GLOBALS *****************************************************************/ /* GLOBALS *****************************************************************/
SSDT_ENTRY KSERVICE_TABLE_DESCRIPTOR
__declspec(dllexport) __declspec(dllexport)
KeServiceDescriptorTable[SSDT_MAX_ENTRIES] = { KeServiceDescriptorTable[SSDT_MAX_ENTRIES] = {
{ MainSSDT, NULL, NUMBER_OF_SYSCALLS, MainSSPT }, { MainSSDT, NULL, NUMBER_OF_SYSCALLS, MainSSPT },
@ -26,7 +26,7 @@ KeServiceDescriptorTable[SSDT_MAX_ENTRIES] = {
{ NULL, NULL, 0, NULL } { NULL, NULL, 0, NULL }
}; };
SSDT_ENTRY KSERVICE_TABLE_DESCRIPTOR
KeServiceDescriptorTableShadow[SSDT_MAX_ENTRIES] = { KeServiceDescriptorTableShadow[SSDT_MAX_ENTRIES] = {
{ MainSSDT, NULL, NUMBER_OF_SYSCALLS, MainSSPT }, { MainSSDT, NULL, NUMBER_OF_SYSCALLS, MainSSPT },
{ NULL, NULL, 0, NULL }, { NULL, NULL, 0, NULL },
@ -362,24 +362,27 @@ KeUnstackDetachProcess (
/* /*
* @implemented * @implemented
*/ */
BOOLEAN STDCALL BOOLEAN
KeAddSystemServiceTable(PSSDT SSDT, STDCALL
PULONG ServiceCounterTable, KeAddSystemServiceTable(PULONG_PTR Base,
ULONG NumberOfServices, PULONG Count OPTIONAL,
PSSPT SSPT, ULONG Limit,
ULONG TableIndex) PUCHAR Number,
ULONG Index)
{ {
/* check if descriptor table entry is free */ /* Check if descriptor table entry is free */
if ((TableIndex > SSDT_MAX_ENTRIES - 1) || if ((Index > SSDT_MAX_ENTRIES - 1) ||
(KeServiceDescriptorTable[TableIndex].SSDT != NULL) || (KeServiceDescriptorTable[Index].Base) ||
(KeServiceDescriptorTableShadow[TableIndex].SSDT != NULL)) (KeServiceDescriptorTableShadow[Index].Base))
{
return FALSE; return FALSE;
}
/* initialize the shadow service descriptor table */ /* Initialize the shadow service descriptor table */
KeServiceDescriptorTableShadow[TableIndex].SSDT = SSDT; KeServiceDescriptorTableShadow[Index].Base = Base;
KeServiceDescriptorTableShadow[TableIndex].SSPT = SSPT; KeServiceDescriptorTableShadow[Index].Limit = Limit;
KeServiceDescriptorTableShadow[TableIndex].NumberOfServices = NumberOfServices; KeServiceDescriptorTableShadow[Index].Number = Number;
KeServiceDescriptorTableShadow[TableIndex].ServiceCounterTable = ServiceCounterTable; KeServiceDescriptorTableShadow[Index].Count = Count;
return TRUE; return TRUE;
} }
@ -389,31 +392,31 @@ KeAddSystemServiceTable(PSSDT SSDT,
*/ */
BOOLEAN BOOLEAN
STDCALL STDCALL
KeRemoveSystemServiceTable(IN ULONG TableIndex) KeRemoveSystemServiceTable(IN ULONG Index)
{ {
/* Make sure the Index is valid */ /* Make sure the Index is valid */
if (TableIndex > SSDT_MAX_ENTRIES - 1) return FALSE; if (Index > SSDT_MAX_ENTRIES - 1) return FALSE;
/* Is there a Normal Descriptor Table? */ /* Is there a Normal Descriptor Table? */
if (!KeServiceDescriptorTable[TableIndex].SSDT) { if (!KeServiceDescriptorTable[Index].Base)
{
/* Not with the index, is there a shadow at least? */ /* Not with the index, is there a shadow at least? */
if (!KeServiceDescriptorTableShadow[TableIndex].SSDT) return FALSE; if (!KeServiceDescriptorTableShadow[Index].Base) return FALSE;
} }
/* Now clear from the Shadow Table. */ /* Now clear from the Shadow Table. */
KeServiceDescriptorTableShadow[TableIndex].SSDT = NULL; KeServiceDescriptorTableShadow[Index].Base = NULL;
KeServiceDescriptorTableShadow[TableIndex].SSPT = NULL; KeServiceDescriptorTableShadow[Index].Number = NULL;
KeServiceDescriptorTableShadow[TableIndex].NumberOfServices = 0; KeServiceDescriptorTableShadow[Index].Limit = 0;
KeServiceDescriptorTableShadow[TableIndex].ServiceCounterTable = NULL; KeServiceDescriptorTableShadow[Index].Count = NULL;
/* Check if we should clean from the Master one too */ /* Check if we should clean from the Master one too */
if (TableIndex == 1) { if (Index == 1)
{
KeServiceDescriptorTable[TableIndex].SSDT = NULL; KeServiceDescriptorTable[Index].Base = NULL;
KeServiceDescriptorTable[TableIndex].SSPT = NULL; KeServiceDescriptorTable[Index].Number = NULL;
KeServiceDescriptorTable[TableIndex].NumberOfServices = 0; KeServiceDescriptorTable[Index].Limit = 0;
KeServiceDescriptorTable[TableIndex].ServiceCounterTable = NULL; KeServiceDescriptorTable[Index].Count = NULL;
} }
return TRUE; return TRUE;

View file

@ -30,8 +30,8 @@
BOOL INTERNAL_CALL GDI_CleanupForProcess (struct _EPROCESS *Process); BOOL INTERNAL_CALL GDI_CleanupForProcess (struct _EPROCESS *Process);
extern SSDT Win32kSSDT[]; extern ULONG_PTR Win32kSSDT[];
extern SSPT Win32kSSPT[]; extern UCHAR Win32kSSPT[];
extern ULONG Win32kNumberOfSysCalls; extern ULONG Win32kNumberOfSysCalls;
PSHARED_SECTION_POOL SessionSharedSectionPool = NULL; PSHARED_SECTION_POOL SessionSharedSectionPool = NULL;

View file

@ -420,7 +420,7 @@ CreateSystemServiceTable(FILE *SyscallDb,
/* First we build the SSDT */ /* First we build the SSDT */
fprintf(SyscallTable,"\n\n\n"); fprintf(SyscallTable,"\n\n\n");
fprintf(SyscallTable,"SSDT %sSSDT[] = {\n", Name); fprintf(SyscallTable,"ULONG_PTR %sSSDT[] = {\n", Name);
/* We loop, incrementing the System Call Index, until the end of the file */ /* We loop, incrementing the System Call Index, until the end of the file */
for (SyscallId = 0; ((!feof(SyscallDb)) && (fgets(Line, sizeof(Line), SyscallDb) != NULL));) { for (SyscallId = 0; ((!feof(SyscallDb)) && (fgets(Line, sizeof(Line), SyscallDb) != NULL));) {
@ -435,7 +435,7 @@ CreateSystemServiceTable(FILE *SyscallDb,
if (SyscallId > 0) fprintf(SyscallTable,",\n"); if (SyscallId > 0) fprintf(SyscallTable,",\n");
/* Write the syscall name in the service table. */ /* Write the syscall name in the service table. */
fprintf(SyscallTable,"\t\t(PVOID (NTAPI *)(VOID))%s", NtSyscallName); fprintf(SyscallTable,"\t\t(ULONG_PTR)%s", NtSyscallName);
/* Only increase if we actually added something */ /* Only increase if we actually added something */
SyscallId++; SyscallId++;
@ -448,7 +448,7 @@ CreateSystemServiceTable(FILE *SyscallDb,
/* Now we build the SSPT */ /* Now we build the SSPT */
rewind(SyscallDb); rewind(SyscallDb);
fprintf(SyscallTable,"\n\n\n"); fprintf(SyscallTable,"\n\n\n");
fprintf(SyscallTable,"SSPT %sSSPT[] = {\n", Name); fprintf(SyscallTable,"UCHAR %sSSPT[] = {\n", Name);
for (SyscallId = 0; ((!feof(SyscallDb)) && (fgets(Line, sizeof(Line), SyscallDb) != NULL));) { for (SyscallId = 0; ((!feof(SyscallDb)) && (fgets(Line, sizeof(Line), SyscallDb) != NULL));) {

View file

@ -187,6 +187,14 @@ typedef enum _MODE {
MaximumMode MaximumMode
} MODE; } MODE;
typedef struct _QUAD
{
union
{
LONGLONG UseThisFieldToCopy;
float DoNotUseThisField;
};
} QUAD, *PQUAD;
/* Structures not exposed to drivers */ /* Structures not exposed to drivers */
typedef struct _IO_TIMER *PIO_TIMER; typedef struct _IO_TIMER *PIO_TIMER;
@ -356,6 +364,8 @@ typedef struct _ADAPTER_OBJECT *PADAPTER_OBJECT;
#define SEMAPHORE_MODIFY_STATE (0x0002) #define SEMAPHORE_MODIFY_STATE (0x0002)
#define SEMAPHORE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3) #define SEMAPHORE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3)
#define THREAD_ALERT (0x0004)
/* Exported object types */ /* Exported object types */
extern NTOSAPI POBJECT_TYPE ExDesktopObjectType; extern NTOSAPI POBJECT_TYPE ExDesktopObjectType;
extern NTOSAPI POBJECT_TYPE ExEventObjectType; extern NTOSAPI POBJECT_TYPE ExEventObjectType;
@ -366,6 +376,7 @@ extern NTOSAPI POBJECT_TYPE IoDeviceHandlerObjectType;
extern NTOSAPI POBJECT_TYPE IoDeviceObjectType; extern NTOSAPI POBJECT_TYPE IoDeviceObjectType;
extern NTOSAPI POBJECT_TYPE IoDriverObjectType; extern NTOSAPI POBJECT_TYPE IoDriverObjectType;
extern NTOSAPI POBJECT_TYPE IoFileObjectType; extern NTOSAPI POBJECT_TYPE IoFileObjectType;
extern NTOSAPI POBJECT_TYPE PsThreadType;
extern NTOSAPI POBJECT_TYPE LpcPortObjectType; extern NTOSAPI POBJECT_TYPE LpcPortObjectType;
extern NTOSAPI POBJECT_TYPE MmSectionObjectType; extern NTOSAPI POBJECT_TYPE MmSectionObjectType;
extern NTOSAPI POBJECT_TYPE SeTokenObjectType; extern NTOSAPI POBJECT_TYPE SeTokenObjectType;
@ -4032,6 +4043,8 @@ typedef enum _KINTERRUPT_MODE {
Latched Latched
} KINTERRUPT_MODE; } KINTERRUPT_MODE;
#define THREAD_WAIT_OBJECTS 3
typedef VOID typedef VOID
(DDKAPI *PKINTERRUPT_ROUTINE)( (DDKAPI *PKINTERRUPT_ROUTINE)(
VOID); VOID);
@ -7886,31 +7899,6 @@ DDKAPI
KeAcquireInterruptSpinLock( KeAcquireInterruptSpinLock(
IN PKINTERRUPT Interrupt); IN PKINTERRUPT Interrupt);
/* System Service Dispatch Table */
typedef PVOID (NTAPI * SSDT)(VOID);
typedef SSDT * PSSDT;
/* System Service Parameters Table */
typedef UCHAR SSPT, * PSSPT;
typedef struct _SSDT_ENTRY {
PSSDT SSDT;
PULONG ServiceCounterTable;
ULONG NumberOfServices;
PSSPT SSPT;
} SSDT_ENTRY, *PSSDT_ENTRY;
NTOSAPI
BOOLEAN
DDKAPI
KeAddSystemServiceTable(
IN PSSDT SSDT,
IN PULONG ServiceCounterTable,
IN ULONG NumberOfServices,
IN PSSPT SSPT,
IN ULONG TableIndex);
NTOSAPI NTOSAPI
BOOLEAN BOOLEAN
DDKAPI DDKAPI
@ -7974,6 +7962,11 @@ KeEnterCriticalRegion(
*/ */
#define KeFlushIoBuffers(_Mdl, _ReadOperation, _DmaOperation) #define KeFlushIoBuffers(_Mdl, _ReadOperation, _DmaOperation)
NTHALAPI
VOID
DDKAPI
KeFlushWriteBuffer(VOID);
NTOSAPI NTOSAPI
PRKTHREAD PRKTHREAD
DDKAPI DDKAPI
@ -8130,6 +8123,7 @@ DDKAPI
KeReadStateMutex( KeReadStateMutex(
IN PRKMUTEX Mutex); IN PRKMUTEX Mutex);
NTOSAPI NTOSAPI
LONG LONG
DDKAPI DDKAPI
@ -8225,6 +8219,11 @@ DDKAPI
KeRestoreFloatingPointState( KeRestoreFloatingPointState(
IN PKFLOATING_SAVE FloatSave); IN PKFLOATING_SAVE FloatSave);
NTOSAPI
VOID
DDKAPI
KeRevertToUserAffinityThread(VOID);
NTOSAPI NTOSAPI
NTSTATUS NTSTATUS
DDKAPI DDKAPI
@ -8260,6 +8259,12 @@ KeSetPriorityThread(
IN PKTHREAD Thread, IN PKTHREAD Thread,
IN KPRIORITY Priority); IN KPRIORITY Priority);
NTOSAPI
VOID
DDKAPI
KeSetSystemAffinityThread(
IN KAFFINITY Affinity);
NTOSAPI NTOSAPI
VOID VOID
DDKAPI DDKAPI