- 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.
Modified: trunk/reactos/drivers/fs/ms/msfs.h
Modified: trunk/reactos/include/ndk/cctypes.h
Modified: trunk/reactos/include/ndk/extypes.h
Modified: trunk/reactos/include/ndk/halfuncs.h
Modified: trunk/reactos/include/ndk/haltypes.h
Modified: trunk/reactos/include/ndk/i386/ketypes.h
Modified: trunk/reactos/include/ndk/inbvfuncs.h
Modified: trunk/reactos/include/ndk/kdfuncs.h
Modified: trunk/reactos/include/ndk/kefuncs.h
Modified: trunk/reactos/include/ndk/ketypes.h
Modified: trunk/reactos/include/ndk/ldrfuncs.h
Modified: trunk/reactos/include/ndk/mmfuncs.h
Modified: trunk/reactos/include/ndk/obfuncs.h
Modified: trunk/reactos/include/ndk/obtypes.h
Modified: trunk/reactos/include/ndk/potypes.h
Modified: trunk/reactos/include/ndk/psfuncs.h
Modified: trunk/reactos/include/ndk/pstypes.h
Modified: trunk/reactos/include/ndk/sefuncs.h
Modified: trunk/reactos/include/ndk/setypes.h
Modified: trunk/reactos/ntoskrnl/include/ntoskrnl.h
Modified: trunk/reactos/ntoskrnl/ke/i386/kernel.c
Modified: trunk/reactos/ntoskrnl/ke/process.c
Modified: trunk/reactos/subsys/win32k/main/dllmain.c
Modified: trunk/reactos/tools/nci/ncitool.c
Modified: trunk/reactos/w32api/include/ddk/winddk.h

Modified: trunk/reactos/drivers/fs/ms/msfs.h
--- trunk/reactos/drivers/fs/ms/msfs.h	2005-09-04 23:48:19 UTC (rev 17650)
+++ trunk/reactos/drivers/fs/ms/msfs.h	2005-09-05 04:48:20 UTC (rev 17651)
@@ -2,7 +2,7 @@
 #define __SERVICES_FS_MS_MSFS_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

Modified: trunk/reactos/include/ndk/cctypes.h
--- trunk/reactos/include/ndk/cctypes.h	2005-09-04 23:48:19 UTC (rev 17650)
+++ trunk/reactos/include/ndk/cctypes.h	2005-09-05 04:48:20 UTC (rev 17651)
@@ -13,9 +13,8 @@
 /* DEPENDENCIES **************************************************************/
 
 /* EXPORTED DATA *************************************************************/
-extern ULONG NTOSAPI CcFastMdlReadWait;
-extern ULONG NTOSAPI CcFastReadNotPossible;
-extern ULONG NTOSAPI CcFastReadWait;
+extern ULONG NTSYSAPI CcFastReadNotPossible;
+extern ULONG NTSYSAPI CcFastReadWait;
 
 /* ENUMERATIONS **************************************************************/
 

Modified: trunk/reactos/include/ndk/extypes.h
--- trunk/reactos/include/ndk/extypes.h	2005-09-04 23:48:19 UTC (rev 17650)
+++ trunk/reactos/include/ndk/extypes.h	2005-09-05 04:48:20 UTC (rev 17651)
@@ -14,9 +14,9 @@
 
 /* EXPORTED DATA *************************************************************/
 #ifndef NTOS_MODE_USER
-extern POBJECT_TYPE NTOSAPI ExIoCompletionType;
-extern NTOSAPI POBJECT_TYPE ExMutantObjectType;
-extern NTOSAPI POBJECT_TYPE ExTimerType;
+extern POBJECT_TYPE NTSYSAPI ExIoCompletionType;
+extern POBJECT_TYPE NTSYSAPI ExMutantObjectType;
+extern POBJECT_TYPE NTSYSAPI ExTimerType;
 #endif
 
 /* CONSTANTS *****************************************************************/
@@ -46,9 +46,9 @@
 #ifndef NTOS_MODE_USER
 typedef struct _EX_QUEUE_WORKER_INFO
 {
-    UCHAR QueueDisabled:1;
-    UCHAR MakeThreadsAsNecessary:1;
-    UCHAR WaitMode:1;
+    ULONG QueueDisabled:1;
+    ULONG MakeThreadsAsNecessary:1;
+    ULONG WaitMode:1;
     ULONG WorkerCount:29;
 } EX_QUEUE_WORKER_INFO, *PEX_QUEUE_WORKER_INFO;
 

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

Modified: trunk/reactos/include/ndk/haltypes.h
--- trunk/reactos/include/ndk/haltypes.h	2005-09-04 23:48:19 UTC (rev 17650)
+++ trunk/reactos/include/ndk/haltypes.h	2005-09-05 04:48:20 UTC (rev 17651)
@@ -12,7 +12,7 @@
 /* DEPENDENCIES **************************************************************/
 
 /* EXPORTED DATA *************************************************************/
-extern ULONG NTOSAPI KdComPortInUse;
+extern ULONG NTSYSAPI KdComPortInUse;
 
 /* CONSTANTS *****************************************************************/
 
@@ -50,9 +50,9 @@
 } HAL_PRIVATE_DISPATCH, *PHAL_PRIVATE_DISPATCH;
 
 #ifdef __NTOSKRNL__
-extern NTOSAPI HAL_PRIVATE_DISPATCH HalPrivateDispatchTable;
+extern HAL_PRIVATE_DISPATCH NTSYSAPI HalPrivateDispatchTable;
 #else
-extern NTOSAPI PHAL_PRIVATE_DISPATCH HalPrivateDispatchTable;
+extern PHAL_PRIVATE_DISPATCH NTSYSAPI HalPrivateDispatchTable;
 #endif
 
 #define HAL_PRIVATE_DISPATCH_VERSION    1

Modified: trunk/reactos/include/ndk/i386/ketypes.h
--- trunk/reactos/include/ndk/i386/ketypes.h	2005-09-04 23:48:19 UTC (rev 17650)
+++ trunk/reactos/include/ndk/i386/ketypes.h	2005-09-05 04:48:20 UTC (rev 17651)
@@ -117,29 +117,29 @@
 
 typedef struct _LDT_ENTRY
 {
-    WORD LimitLow;
-    WORD BaseLow;
+    USHORT LimitLow;
+    USHORT BaseLow;
     union
     {
         struct
         {
-            BYTE BaseMid;
-            BYTE Flags1;
-            BYTE Flags2;
-            BYTE BaseHi;
+            UCHAR BaseMid;
+            UCHAR Flags1;
+            UCHAR Flags2;
+            UCHAR BaseHi;
         } Bytes;
         struct
         {
-            DWORD BaseMid : 8;
-            DWORD Type : 5;
-            DWORD Dpl : 2;
-            DWORD Pres : 1;
-            DWORD LimitHi : 4;
-            DWORD Sys : 1;
-            DWORD Reserved_0 : 1;
-            DWORD Default_Big : 1;
-            DWORD Granularity : 1;
-            DWORD BaseHi : 8;
+            ULONG BaseMid : 8;
+            ULONG Type : 5;
+            ULONG Dpl : 2;
+            ULONG Pres : 1;
+            ULONG LimitHi : 4;
+            ULONG Sys : 1;
+            ULONG Reserved_0 : 1;
+            ULONG Default_Big : 1;
+            ULONG Granularity : 1;
+            ULONG BaseHi : 8;
         } Bits;
     } HighWord;
 } LDT_ENTRY, *PLDT_ENTRY, *LPLDT_ENTRY;
@@ -216,28 +216,28 @@
 
 typedef struct _DESCRIPTOR
 {
-    WORD Pad;
-    WORD Limit;
-    DWORD Base;
+    USHORT Pad;
+    USHORT Limit;
+    ULONG Base;
 } KDESCRIPTOR, *PKDESCRIPTOR;
 
 typedef struct _KSPECIAL_REGISTERS
 {
-    DWORD Cr0;
-    DWORD Cr2;
-    DWORD Cr3;
-    DWORD Cr4;
-    DWORD KernelDr0;
-    DWORD KernelDr1;
-    DWORD KernelDr2;
-    DWORD KernelDr3;
-    DWORD KernelDr6;
-    DWORD KernelDr7;
+    ULONG Cr0;
+    ULONG Cr2;
+    ULONG Cr3;
+    ULONG Cr4;
+    ULONG KernelDr0;
+    ULONG KernelDr1;
+    ULONG KernelDr2;
+    ULONG KernelDr3;
+    ULONG KernelDr6;
+    ULONG KernelDr7;
     KDESCRIPTOR Gdtr;
     KDESCRIPTOR Idtr;
-    WORD Tr;
-    WORD Ldtr;
-    DWORD Reserved[6];
+    USHORT Tr;
+    USHORT Ldtr;
+    ULONG Reserved[6];
 } KSPECIAL_REGISTERS, *PKSPECIAL_REGISTERS;
 
 #pragma pack(push,4)
@@ -384,32 +384,45 @@
  */
 typedef struct _KIPCR
 {
-    KPCR_TIB  Tib;                /* 00 */
-    struct _KPCR  *Self;          /* 1C */
-    struct _KPRCB  *Prcb;         /* 20 */
-    KIRQL  Irql;                  /* 24 */
-    ULONG  IRR;                   /* 28 */
-    ULONG  IrrActive;             /* 2C */
-    ULONG  IDR;                   /* 30 */
-    PVOID  KdVersionBlock;        /* 34 */
-    PUSHORT  IDT;                 /* 38 */
-    PUSHORT  GDT;                 /* 3C */
-    struct _KTSS  *TSS;           /* 40 */
-    USHORT  MajorVersion;         /* 44 */
-    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 */
+    union
+    {
+        NT_TIB NtTib;
+        struct 
+        {
+            struct _EXCEPTION_REGISTRATION_RECORD *Used_ExceptionList;
+            PVOID Used_StackBase;
+            PVOID PerfGlobalGroupMask;
+            PVOID TssCopy;
+            ULONG ContextSwitches;
+            KAFFINITY SetMemberCopy;
+            PVOID Used_Self;
+        };
+    };
+    struct _KPCR *Self;          /* 1C */
+    struct _KPRCB *Prcb;         /* 20 */
+    KIRQL Irql;                  /* 24 */
+    ULONG IRR;                   /* 28 */
+    ULONG IrrActive;             /* 2C */
+    ULONG IDR;                   /* 30 */
+    PVOID KdVersionBlock;        /* 34 */
+    PUSHORT IDT;                 /* 38 */
+    PUSHORT GDT;                 /* 3C */
+    struct _KTSS *TSS;           /* 40 */
+    USHORT MajorVersion;         /* 44 */
+    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;
 
 #pragma pack(pop)
@@ -507,9 +520,6 @@
 #include <poppack.h>
 
 /* i386 Doesn't have Exception Frames */
-typedef struct _KEXCEPTION_FRAME
-{
+typedef struct _KEXCEPTION_FRAME KEXCEPTION_FRAME, *PKEXCEPTION_FRAME;
 
-} KEXCEPTION_FRAME, *PKEXCEPTION_FRAME;
-
 #endif

Modified: trunk/reactos/include/ndk/inbvfuncs.h
--- trunk/reactos/include/ndk/inbvfuncs.h	2005-09-04 23:48:19 UTC (rev 17650)
+++ trunk/reactos/include/ndk/inbvfuncs.h	2005-09-05 04:48:20 UTC (rev 17651)
@@ -16,53 +16,53 @@
 /* PROTOTYPES ****************************************************************/
 
 VOID
-STDCALL
+NTAPI
 InbvAcquireDisplayOwnership(VOID);
 
 BOOLEAN
-STDCALL
+NTAPI
 InbvCheckDisplayOwnership(VOID);
 
 BOOLEAN
-STDCALL
+NTAPI
 InbvDisplayString(
     IN PCHAR String
 );
 
 VOID
-STDCALL
+NTAPI
 InbvEnableBootDriver(
     IN BOOLEAN Enable
 );
 
 BOOLEAN
-STDCALL
+NTAPI
 InbvEnableDisplayString(
     IN BOOLEAN Enable
 );
 
 VOID
-STDCALL
+NTAPI
 InbvInstallDisplayStringFilter(
     IN PVOID Unknown
 );
 
 BOOLEAN
-STDCALL
+NTAPI
 InbvIsBootDriverInstalled(VOID);
 
 VOID
-STDCALL
+NTAPI
 InbvNotifyDisplayOwnershipLost(
     IN PVOID Callback
 );
 
 BOOLEAN
-STDCALL
+NTAPI
 InbvResetDisplay(VOID);
 
 VOID
-STDCALL
+NTAPI
 InbvSetScrollRegion(
     IN ULONG Left,
     IN ULONG Top,
@@ -71,13 +71,13 @@
 );
 
 VOID
-STDCALL
+NTAPI
 InbvSetTextColor(
     IN ULONG Color
 );
 
 VOID
-STDCALL
+NTAPI
 InbvSolidColorFill(
     IN ULONG Left,
     IN ULONG Top,
@@ -87,15 +87,15 @@
 );
 
 VOID
-STDCALL
+NTAPI
 VidCleanUp(VOID);
 
-BOOL
-STDCALL
+BOOLEAN
+NTAPI
 VidResetDisplay(VOID);
 
 BOOLEAN
-STDCALL
+NTAPI
 VidIsBootDriverInstalled(VOID);
 
 #endif

Modified: trunk/reactos/include/ndk/kdfuncs.h
--- trunk/reactos/include/ndk/kdfuncs.h	2005-09-04 23:48:19 UTC (rev 17650)
+++ trunk/reactos/include/ndk/kdfuncs.h	2005-09-05 04:48:20 UTC (rev 17651)
@@ -14,79 +14,79 @@
 
 /* PROTOTYPES ****************************************************************/
 
-BYTE
-STDCALL
+UCHAR
+NTAPI
 KdPollBreakIn(VOID);
 
 BOOLEAN
-STDCALL
+NTAPI
 KdPortInitialize(
     PKD_PORT_INFORMATION PortInformation,
-    DWORD Unknown1,
-    DWORD Unknown2
+    ULONG Unknown1,
+    ULONG Unknown2
 );
 
 BOOLEAN
-STDCALL
+NTAPI
 KdPortInitializeEx(
     PKD_PORT_INFORMATION PortInformation,
-    DWORD Unknown1,
-    DWORD Unknown2
+    ULONG Unknown1,
+    ULONG Unknown2
 );
 
 BOOLEAN
-STDCALL
+NTAPI
 KdPortGetByte(
     PUCHAR ByteRecieved
 );
 
 BOOLEAN
-STDCALL
+NTAPI
 KdPortGetByteEx(
     PKD_PORT_INFORMATION PortInformation,
     PUCHAR ByteRecieved
 );
 
 BOOLEAN
-STDCALL
+NTAPI
 KdPortPollByte(
     PUCHAR ByteRecieved
 );
 
 BOOLEAN
-STDCALL
+NTAPI
 KdPortPollByteEx(
     PKD_PORT_INFORMATION PortInformation,
     PUCHAR ByteRecieved
 );
 
 VOID
-STDCALL
+NTAPI
 KdPortPutByte(
     UCHAR ByteToSend
 );
 
 VOID
-STDCALL
+NTAPI
 KdPortPutByteEx(
     PKD_PORT_INFORMATION PortInformation,
     UCHAR ByteToSend
 );
 
 VOID
-STDCALL
+NTAPI
 KdPortRestore(VOID);
 
 VOID
-STDCALL
+NTAPI
 KdPortSave (VOID);
 
 BOOLEAN
-STDCALL
+NTAPI
 KdPortDisableInterrupts(VOID);
 
 BOOLEAN
-STDCALL
+NTAPI
 KdPortEnableInterrupts(VOID);
 
 #endif

Modified: trunk/reactos/include/ndk/kefuncs.h
--- trunk/reactos/include/ndk/kefuncs.h	2005-09-04 23:48:19 UTC (rev 17650)
+++ trunk/reactos/include/ndk/kefuncs.h	2005-09-05 04:48:20 UTC (rev 17651)
@@ -14,8 +14,18 @@
 
 /* PROTOTYPES ****************************************************************/
 
+BOOLEAN
+NTAPI
+KeAddSystemServiceTable(
+    PULONG_PTR Base,
+    PULONG Count OPTIONAL,
+    ULONG Limit,
+    PUCHAR Number,
+    ULONG Index
+);
+
 VOID
-STDCALL
+NTAPI
 KeInitializeApc(
     IN PKAPC  Apc,
     IN PKTHREAD  Thread,
@@ -28,7 +38,7 @@
 );
 
 VOID
-STDCALL
+NTAPI
 KeEnterKernelDebugger(VOID);
 
 VOID
@@ -44,7 +54,7 @@
 );
 
 VOID
-STDCALL
+NTAPI
 KiDeliverApc(
     IN KPROCESSOR_MODE PreviousMode,
     IN PVOID Reserved,
@@ -52,81 +62,34 @@
 );
 
 VOID
-STDCALL
+NTAPI
 KiDispatchInterrupt(VOID);
 
-
-BOOLEAN
-STDCALL
-KeAreApcsDisabled(
-    VOID
-    );
-
 VOID
-STDCALL
-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
+NTAPI
 KeTerminateThread(
     IN KPRIORITY        Increment
 );
 
 BOOLEAN
-STDCALL
+NTAPI
 KeIsAttachedProcess(VOID);
 
 BOOLEAN
-STDCALL
+NTAPI
 KeIsExecutingDpc(
     VOID
 );
 
 VOID
-STDCALL
+NTAPI
 KeSetEventBoostPriority(
     IN PKEVENT Event,
     IN PKTHREAD *Thread OPTIONAL
 );
 
 PCONFIGURATION_COMPONENT_DATA
-STDCALL
+NTAPI
 KeFindConfigurationNextEntry(
     IN PCONFIGURATION_COMPONENT_DATA Child,
     IN CONFIGURATION_CLASS Class,
@@ -136,7 +99,7 @@
 );
 
 PCONFIGURATION_COMPONENT_DATA
-STDCALL
+NTAPI
 KeFindConfigurationEntry(
     IN PCONFIGURATION_COMPONENT_DATA Child,
     IN CONFIGURATION_CLASS Class,
@@ -145,57 +108,45 @@
 );
 
 VOID
-STDCALL
+NTAPI
 KeFlushEntireTb(
     IN BOOLEAN Unknown,
     IN BOOLEAN CurrentCpuOnly
 );
 
 VOID
-STDCALL
-KeRevertToUserAffinityThread(
-    VOID
-);
-
-VOID
-STDCALL
+NTAPI
 KiCoprocessorError(
     VOID
 );
 
 VOID
-STDCALL
+NTAPI
 KiUnexpectedInterrupt(
     VOID
 );
 
 VOID
-STDCALL
+NTAPI
 KeSetDmaIoCoherency(
     IN ULONG Coherency
 );
 
 VOID
-STDCALL
+NTAPI
 KeSetProfileIrql(
     IN KIRQL ProfileIrql
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 KeSetAffinityThread(
     PKTHREAD Thread,
     KAFFINITY Affinity
 );
 
-VOID
-STDCALL
-KeSetSystemAffinityThread(
-    IN KAFFINITY Affinity
-);
-
 NTSTATUS
-STDCALL
+NTAPI
 KeUserModeCallback(
     IN ULONG FunctionID,
     IN PVOID InputBuffer,
@@ -205,14 +156,14 @@
 );
 
 VOID
-STDCALL
+NTAPI
 KeSetTimeIncrement(
     IN ULONG MaxIncrement,
     IN ULONG MinIncrement
 );
 
 VOID
-STDCALL
+NTAPI
 KeInitializeInterrupt(
     PKINTERRUPT InterruptObject,
     PKSERVICE_ROUTINE ServiceRoutine,
@@ -228,19 +179,19 @@
 );
 
 BOOLEAN
-STDCALL
+NTAPI
 KeConnectInterrupt(
     PKINTERRUPT InterruptObject
 );
 
 BOOLEAN
-STDCALL
+NTAPI
 KeDisconnectInterrupt(
     PKINTERRUPT InterruptObject
 );
 
 PKPROCESS
-STDCALL
+NTAPI
 KeGetCurrentProcess(
     VOID
 );
@@ -252,36 +203,10 @@
     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
-STDCALL
+NTAPI
 KeRaiseUserException(
     IN NTSTATUS ExceptionCode
     );
 
-VOID
-STDCALL
-KeFlushWriteBuffer(VOID);
-
 #endif

Modified: trunk/reactos/include/ndk/ketypes.h
--- trunk/reactos/include/ndk/ketypes.h	2005-09-04 23:48:19 UTC (rev 17650)
+++ trunk/reactos/include/ndk/ketypes.h	2005-09-05 04:48:20 UTC (rev 17651)
@@ -19,28 +19,11 @@
 #define SSDT_MAX_ENTRIES 4
 #define PROCESSOR_FEATURE_MAX 64
 #define CONTEXT_DEBUGGER (CONTEXT_FULL | CONTEXT_FLOATING_POINT)
-#define THREAD_WAIT_OBJECTS 4
-#define THREAD_ALERT 0x4
 
 #ifdef NTOS_MODE_USER
 #define SharedUserData ((KUSER_SHARED_DATA * CONST) USER_SHARED_DATA)
 #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 **************************************************************/
 
 #ifdef NTOS_MODE_USER
@@ -166,6 +149,7 @@
 
 /* FUNCTION TYPES ************************************************************/
 
+#ifdef NTOS_MODE_USER
 typedef VOID
 (NTAPI *PKNORMAL_ROUTINE)(
     IN PVOID  NormalContext,
@@ -177,6 +161,7 @@
     IN PVOID  TimerContext,
     IN ULONG  TimerLowValue,
     IN LONG  TimerHighValue);
+#endif
 
 /* TYPES *********************************************************************/
 
@@ -486,6 +471,32 @@
     ULONG                 StackCount;                /* 06C */
     LIST_ENTRY            ProcessListEntry;          /* 070 */
 } 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 */
 
+/* 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

Modified: trunk/reactos/include/ndk/ldrfuncs.h
--- trunk/reactos/include/ndk/ldrfuncs.h	2005-09-04 23:48:19 UTC (rev 17650)
+++ trunk/reactos/include/ndk/ldrfuncs.h	2005-09-05 04:48:20 UTC (rev 17651)
@@ -17,7 +17,7 @@
 /* PROTOTYPES ****************************************************************/
 
 NTSTATUS
-STDCALL
+NTAPI
 LdrAccessResource(
     IN  PVOID BaseAddress,
     IN  PIMAGE_RESOURCE_DATA_ENTRY ResourceDataEntry,
@@ -26,7 +26,7 @@
[truncated at 1000 lines; 821 more skipped]