- More NDK/MSDDK compatibility fixes.
Modified: trunk/reactos/include/ndk/ifssupp.h
Modified: trunk/reactos/include/ndk/ldrfuncs.h
Modified: trunk/reactos/include/ndk/pstypes.h
Modified: trunk/reactos/include/ndk/rtlfuncs.h
Modified: trunk/reactos/include/ndk/rtltypes.h
Modified: trunk/reactos/include/ndk/sefuncs.h
Modified: trunk/reactos/include/ndk/umtypes.h
Modified: trunk/reactos/include/ndk/zwfuncs.h
Modified: trunk/reactos/include/ndk/zwtypes.h
Modified: trunk/reactos/lib/kernel32/file/lock.c
Modified: trunk/reactos/lib/ntdll/inc/ntdll.h
Modified: trunk/reactos/lib/rtl/rtl.h
Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c
Modified: trunk/reactos/ntoskrnl/io/file.c
Modified: trunk/reactos/ntoskrnl/lpc/query.c
Modified: trunk/reactos/ntoskrnl/mm/virtual.c
Modified: trunk/reactos/ntoskrnl/se/audit.c
Modified: trunk/reactos/w32api/include/ddk/ntddk.h
Modified: trunk/reactos/w32api/include/ddk/ntifs.h
Modified: trunk/reactos/w32api/include/ddk/winddk.h
Modified: trunk/reactos/w32api/include/winnt.h

Modified: trunk/reactos/include/ndk/ifssupp.h
--- trunk/reactos/include/ndk/ifssupp.h	2005-09-05 04:48:20 UTC (rev 17651)
+++ trunk/reactos/include/ndk/ifssupp.h	2005-09-05 07:51:15 UTC (rev 17652)
@@ -112,5 +112,12 @@
     TOKEN_CONTROL ClientTokenControl;
 } SECURITY_CLIENT_CONTEXT, *PSECURITY_CLIENT_CONTEXT;
 
+typedef enum _RTL_GENERIC_COMPARE_RESULTS
+{
+    GenericLessThan,
+    GenericGreaterThan,
+    GenericEqual
+} RTL_GENERIC_COMPARE_RESULTS;
+
 #endif
 

Modified: trunk/reactos/include/ndk/ldrfuncs.h
--- trunk/reactos/include/ndk/ldrfuncs.h	2005-09-05 04:48:20 UTC (rev 17651)
+++ trunk/reactos/include/ndk/ldrfuncs.h	2005-09-05 07:51:15 UTC (rev 17652)
@@ -11,6 +11,8 @@
 
 /* DEPENDENCIES **************************************************************/
 #include "ldrtypes.h"
+/* FIXME: this needs be implemented in the w32api ddk */
+//#include "ntimage.h"
 
 /* FUNCTION TYPES ************************************************************/
 

Modified: trunk/reactos/include/ndk/pstypes.h
--- trunk/reactos/include/ndk/pstypes.h	2005-09-05 04:48:20 UTC (rev 17651)
+++ trunk/reactos/include/ndk/pstypes.h	2005-09-05 07:51:15 UTC (rev 17652)
@@ -123,6 +123,14 @@
     ProcessDebugObjectHandle,
     ProcessDebugFlags,
     ProcessHandleTracing,
+    ProcessIoPriority,
+    ProcessExecuteFlags,
+    ProcessTlsInformation,
+    ProcessCookie,
+    ProcessImageInformation,
+    ProcessCycleTime,
+    ProcessPagePriority,
+    ProcessInstrumentationCallback,
     MaxProcessInfoClass
 } PROCESSINFOCLASS;
 
@@ -147,10 +155,34 @@
     ThreadIsIoPending,
     ThreadHideFromDebugger,
     ThreadBreakOnTermination,
+    ThreadSwitchLegacyState,
+    ThreadIsTerminated,
+    ThreadLastSystemCall,
+    ThreadIoPriority,
+    ThreadCycleTime,
+    ThreadPagePriority,
+    ThreadActualBasePriority,
     MaxThreadInfoClass
 } THREADINFOCLASS;
 #endif
 
+#ifndef NTOS_MODE_USER
+typedef enum _JOBOBJECTINFOCLASS
+{
+    JobObjectBasicAccountingInformation = 1,
+    JobObjectBasicLimitInformation,
+    JobObjectBasicProcessIdList,
+    JobObjectBasicUIRestrictions,
+    JobObjectSecurityLimitInformation,
+    JobObjectEndOfJobTimeInformation,
+    JobObjectAssociateCompletionPortInformation,
+    JobObjectBasicAndIoAccountingInformation,
+    JobObjectExtendedLimitInformation,
+    JobObjectJobSetInformation,
+    MaxJobObjectInfoClass
+} JOBOBJECTINFOCLASS;
+#endif
+
 /* FUNCTION TYPES ************************************************************/
 typedef VOID (NTAPI *PPEBLOCKROUTINE)(PVOID);
 
@@ -360,6 +392,53 @@
     UCHAR BooleanSpare[3];                  /* FB9h */
 } TEB, *PTEB;
 
+#ifdef NTOS_MODE_USER
+typedef struct _PROCESS_BASIC_INFORMATION
+{
+    NTSTATUS ExitStatus;
+    PPEB PebBaseAddress;
+    ULONG_PTR AffinityMask;
+    KPRIORITY BasePriority;
+    ULONG_PTR UniqueProcessId;
+    ULONG_PTR InheritedFromUniqueProcessId;
+} PROCESS_BASIC_INFORMATION,*PPROCESS_BASIC_INFORMATION;
+
+typedef struct _PROCESS_ACCESS_TOKEN
+{
+    HANDLE Token;
+    HANDLE Thread;
+} PROCESS_ACCESS_TOKEN, *PPROCESS_ACCESS_TOKEN;
+
+typedef struct _PROCESS_DEVICEMAP_INFORMATION
+{
+    union
+    {
+        struct
+        {
+            HANDLE DirectoryHandle;
+        } Set;
+        struct
+        {
+            ULONG DriveMap;
+            UCHAR DriveType[32];
+        } Query;
+    };
+} PROCESS_DEVICEMAP_INFORMATION, *PPROCESS_DEVICEMAP_INFORMATION;
+
+typedef struct _KERNEL_USER_TIMES
+{
+    LARGE_INTEGER CreateTime;
+    LARGE_INTEGER ExitTime;
+    LARGE_INTEGER KernelTime;
+    LARGE_INTEGER UserTime;
+} KERNEL_USER_TIMES, *PKERNEL_USER_TIMES;
+
+typedef struct _PROCESS_SESSION_INFORMATION
+{
+    ULONG SessionId;
+} PROCESS_SESSION_INFORMATION, *PPROCESS_SESSION_INFORMATION;
+#endif
+
 #ifndef NTOS_MODE_USER
 /* FIXME: see note in mmtypes.h */
 #ifdef _NTOSKRNL_

Modified: trunk/reactos/include/ndk/rtlfuncs.h
--- trunk/reactos/include/ndk/rtlfuncs.h	2005-09-05 04:48:20 UTC (rev 17651)
+++ trunk/reactos/include/ndk/rtlfuncs.h	2005-09-05 07:51:15 UTC (rev 17652)
@@ -93,7 +93,7 @@
 STDCALL
 RtlCompactHeap(
     HANDLE heap,
-    DWORD flags
+    ULONG flags
 );
 
 HANDLE

Modified: trunk/reactos/include/ndk/rtltypes.h
--- trunk/reactos/include/ndk/rtltypes.h	2005-09-05 04:48:20 UTC (rev 17651)
+++ trunk/reactos/include/ndk/rtltypes.h	2005-09-05 07:51:15 UTC (rev 17652)
@@ -91,12 +91,15 @@
 #define VER_CONDITION_MASK              7
 #define VER_NUM_BITS_PER_CONDITION_MASK 3
 
+#define RTL_CRITSECT_TYPE               0
+#define RTL_RESOURCE_TYPE               1
+
+#ifdef NTOS_MODE_USER
 /* RTL String Hash Algorithms */
 #define HASH_STRING_ALGORITHM_DEFAULT   0
 #define HASH_STRING_ALGORITHM_X65599    1
 #define HASH_STRING_ALGORITHM_INVALID   0xffffffff
 
-#ifdef NTOS_MODE_USER
 /* List Macros */
 static __inline
 VOID
@@ -231,6 +234,7 @@
 
 /* ENUMERATIONS **************************************************************/
 
+#ifdef NTOS_MODE_USER
 typedef enum _TABLE_SEARCH_RESULT
 {
     TableEmptyTree,
@@ -245,6 +249,7 @@
     GenericGreaterThan,
     GenericEqual
 } RTL_GENERIC_COMPARE_RESULTS;
+#endif
 
 typedef enum
 {
@@ -281,8 +286,8 @@
     PEXCEPTION_POINTERS ExceptionPointers
 );
 
-typedef DWORD (NTAPI *PTHREAD_START_ROUTINE)(
-    LPVOID Parameter
+typedef ULONG (NTAPI *PTHREAD_START_ROUTINE)(
+    PVOID Parameter
 );
 
 typedef VOID
@@ -315,7 +320,7 @@
 typedef PVOID
 (NTAPI *PRTL_GENERIC_ALLOCATE_ROUTINE) (
     struct _RTL_GENERIC_TABLE *Table,
-    LONG ByteSize
+    CLONG ByteSize
 );
 
 typedef VOID
@@ -324,10 +329,10 @@
     PVOID Buffer
 );
 
-typedef VOID
+typedef PVOID
 (NTAPI *PRTL_AVL_ALLOCATE_ROUTINE) (
     struct _RTL_AVL_TABLE *Table,
-    LONG ByteSize
+    CLONG ByteSize
 );
 
 typedef VOID
@@ -353,11 +358,14 @@
     IN OUT PSIZE_T CommitSize
 );
 
+#ifdef NTOS_MODE_USER
 typedef BOOLEAN
 (NTAPI *PRTL_CONFLICT_RANGE_CALLBACK) (
     PVOID Context,
     struct _RTL_RANGE *Range
 );
+#endif
+
 /* TYPES *********************************************************************/
 
 #ifdef NTOS_MODE_USER
@@ -634,6 +642,30 @@
     UNICODE_STRING DosPath;
 } RTL_DRIVE_LETTER_CURDIR, *PRTL_DRIVE_LETTER_CURDIR;
 
+#ifndef NTOS_MODE_USER
+typedef struct _RTL_CRITICAL_SECTION_DEBUG
+{
+    USHORT Type;
+    USHORT CreatorBackTraceIndex;
+    struct _RTL_CRITICAL_SECTION *CriticalSection;
+    LIST_ENTRY ProcessLocksList;
+    ULONG EntryCount;
+    ULONG ContentionCount;
+    ULONG Spare[2];
+} RTL_CRITICAL_SECTION_DEBUG, *PRTL_CRITICAL_SECTION_DEBUG, RTL_RESOURCE_DEBUG, *PRTL_RESOURCE_DEBUG;
+
+typedef struct _RTL_CRITICAL_SECTION
+{
+    PRTL_CRITICAL_SECTION_DEBUG DebugInfo;
+    LONG LockCount;
+    LONG RecursionCount;
+    HANDLE OwningThread;
+    HANDLE LockSemaphore;
+    ULONG_PTR SpinCount;
+} RTL_CRITICAL_SECTION, *PRTL_CRITICAL_SECTION;
+#endif
+
+#ifdef NTOS_MODE_USER
 typedef struct _RTL_RANGE_LIST
 {
     LIST_ENTRY ListHead;
@@ -652,6 +684,16 @@
     UCHAR Flags;  /* RTL_RANGE_... flags */
 } RTL_RANGE, *PRTL_RANGE;
 
+typedef struct _RANGE_LIST_ITERATOR
+{
+    PLIST_ENTRY RangeListHead;
+    PLIST_ENTRY MergedHead;
+    PVOID Current;
+    ULONG Stamp;
+} RTL_RANGE_LIST_ITERATOR, *PRTL_RANGE_LIST_ITERATOR;
+
+#endif
+
 typedef struct _RTL_RESOURCE
 {
     RTL_CRITICAL_SECTION Lock;
@@ -665,14 +707,6 @@
     PVOID DebugInfo; /* ?? */
 } RTL_RESOURCE, *PRTL_RESOURCE;
 
-typedef struct _RANGE_LIST_ITERATOR
-{
-    PLIST_ENTRY RangeListHead;
-    PLIST_ENTRY MergedHead;
-    PVOID Current;
-    ULONG Stamp;
-} RTL_RANGE_LIST_ITERATOR, *PRTL_RANGE_LIST_ITERATOR;
-
 typedef struct _RTL_MESSAGE_RESOURCE_ENTRY
 {
     USHORT Length;
@@ -779,41 +813,41 @@
     PRTL_ATOM_TABLE_ENTRY Buckets[1];
 } RTL_ATOM_TABLE, *PRTL_ATOM_TABLE;
 
-/* Let Kernel Drivers use this */
-#if !defined(_WINBASE_H) && !defined(_WINBASE_)
-    typedef struct _SYSTEMTIME
-    {
-        WORD wYear;
-        WORD wMonth;
-        WORD wDayOfWeek;
-        WORD wDay;
-        WORD wHour;
-        WORD wMinute;
-        WORD wSecond;
-        WORD wMilliseconds;
-    } SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;
+#ifndef NTOS_MODE_USER
+    
+typedef struct _SYSTEMTIME
+{
+    USHORT wYear;
+    USHORT wMonth;
+    USHORT wDayOfWeek;
+    USHORT wDay;
+    USHORT wHour;
+    USHORT wMinute;
+    USHORT wSecond;
+    USHORT wMilliseconds;
+} SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;
 
-    typedef struct _TIME_ZONE_INFORMATION
-    {
-        LONG Bias;
-        WCHAR StandardName[32];
-        SYSTEMTIME StandardDate;
-        LONG StandardBias;
-        WCHAR DaylightName[32];
-        SYSTEMTIME DaylightDate;
-        LONG DaylightBias;
-    } TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION;
+typedef struct _TIME_ZONE_INFORMATION
+{
+    LONG Bias;
+    WCHAR StandardName[32];
+    SYSTEMTIME StandardDate;
+    LONG StandardBias;
+    WCHAR DaylightName[32];
+    SYSTEMTIME DaylightDate;
+    LONG DaylightBias;
+} TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION;
 
-    typedef enum _ACL_INFORMATION_CLASS
-    {
-        AclRevisionInformation = 1,
-        AclSizeInformation
-    } ACL_INFORMATION_CLASS;
+typedef enum _ACL_INFORMATION_CLASS
+{
+    AclRevisionInformation = 1,
+    AclSizeInformation
+} ACL_INFORMATION_CLASS;
 
-    #define TIME_ZONE_ID_UNKNOWN 0
-    #define TIME_ZONE_ID_STANDARD 1
-    #define TIME_ZONE_ID_DAYLIGHT 2
-    #define TIME_ZONE_ID_INVALID 0xFFFFFFFF
+#define TIME_ZONE_ID_UNKNOWN 0
+#define TIME_ZONE_ID_STANDARD 1
+#define TIME_ZONE_ID_DAYLIGHT 2
+#define TIME_ZONE_ID_INVALID 0xFFFFFFFF
 #endif
 
 #endif

Modified: trunk/reactos/include/ndk/sefuncs.h
--- trunk/reactos/include/ndk/sefuncs.h	2005-09-05 04:48:20 UTC (rev 17651)
+++ trunk/reactos/include/ndk/sefuncs.h	2005-09-05 07:51:15 UTC (rev 17652)
@@ -46,13 +46,6 @@
     IN BOOLEAN CaptureIfKernelMode
 );
 
-VOID
-NTAPI
-SeSetAccessStateGenericMapping(
-    IN PACCESS_STATE AccessState,
-    IN PGENERIC_MAPPING GenericMapping
-);
-
 SECURITY_IMPERSONATION_LEVEL
 NTAPI
 SeTokenImpersonationLevel(

Modified: trunk/reactos/include/ndk/umtypes.h
--- trunk/reactos/include/ndk/umtypes.h	2005-09-05 04:48:20 UTC (rev 17651)
+++ trunk/reactos/include/ndk/umtypes.h	2005-09-05 07:51:15 UTC (rev 17652)
@@ -61,15 +61,24 @@
 #undef STATUS_SXS_INVALID_DEACTIVATION
 
 #include <ntstatus.h>
-#define STATIC static
 
 /* CONSTANTS *****************************************************************/
 
 /* NTAPI/NTOSAPI Define */
+#define DECLSPEC_ADDRSAFE
 #define NTAPI __stdcall
-#define NTOSAPI
 #define FASTCALL __fastcall
-#define STDCALL __stdcall
+#if !defined(_NTSYSTEM_)
+#define NTSYSAPI     DECLSPEC_IMPORT
+#define NTSYSCALLAPI DECLSPEC_IMPORT
+#else
+#define NTSYSAPI
+#if defined(_NTDLLBUILD_)
+#define NTSYSCALLAPI
+#else
+#define NTSYSCALLAPI DECLSPEC_ADDRSAFE
+#endif
+#endif
 
 /* Native API Return Value Macros */
 #define NT_SUCCESS(x) ((x)>=0)
@@ -81,10 +90,12 @@
 /* Basic Types that aren't defined in User-Mode Headers */
 typedef CONST int CINT;
 typedef CONST char *PCSZ;
+typedef ULONG CLONG;
 typedef short CSHORT;
 typedef CSHORT *PCSHORT;
 typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS;
 typedef LONG NTSTATUS, *PNTSTATUS;
+#define STATIC static
 
 /* Basic NT Types */
 #if !defined(_NTSECAPI_H) && !defined(_SUBAUTH_H)

Modified: trunk/reactos/include/ndk/zwfuncs.h
--- trunk/reactos/include/ndk/zwfuncs.h	2005-09-05 04:48:20 UTC (rev 17651)
+++ trunk/reactos/include/ndk/zwfuncs.h	2005-09-05 07:51:15 UTC (rev 17652)
@@ -18,7 +18,7 @@
 /* PROTOTYPES ****************************************************************/
 
 NTSTATUS
-STDCALL
+NTAPI
 NtAcceptConnectPort(
     PHANDLE PortHandle,
     PVOID PortContext OPTIONAL,
@@ -29,7 +29,7 @@
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 ZwAcceptConnectPort(
     PHANDLE PortHandle,
     PVOID PortContext OPTIONAL,
@@ -40,7 +40,7 @@
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 NtAccessCheck(
     IN PSECURITY_DESCRIPTOR SecurityDescriptor,
     IN HANDLE ClientToken,
@@ -53,7 +53,7 @@
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 ZwAccessCheck(
     IN PSECURITY_DESCRIPTOR SecurityDescriptor,
     IN HANDLE ClientToken,
@@ -65,11 +65,12 @@
     OUT PNTSTATUS AccessStatus
 );
 
+NTSYSCALLAPI
 NTSTATUS
-STDCALL
+NTAPI
 NtAccessCheckAndAuditAlarm(
     IN PUNICODE_STRING SubsystemName,
-    IN PHANDLE ObjectHandle,
+    IN PVOID HandleId,
     IN PUNICODE_STRING ObjectTypeName,
     IN PUNICODE_STRING ObjectName,
     IN PSECURITY_DESCRIPTOR SecurityDescriptor,
@@ -82,7 +83,7 @@
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 NtAddAtom(
     IN     PWSTR  AtomName,
     IN     ULONG AtomNameLength,
@@ -90,7 +91,7 @@
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 ZwAddAtom(
     IN     PWSTR  AtomName,
     IN     ULONG AtomNameLength,
@@ -98,21 +99,22 @@
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 NtAddBootEntry(
     IN PUNICODE_STRING EntryName,
     IN PUNICODE_STRING EntryValue
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 ZwAddBootEntry(
     IN PUNICODE_STRING EntryName,
     IN PUNICODE_STRING EntryValue
 );
 
+NTSYSCALLAPI
 NTSTATUS
-STDCALL
+NTAPI
 NtAdjustGroupsToken(
     IN HANDLE TokenHandle,
     IN BOOLEAN  ResetToDefault,
@@ -123,7 +125,7 @@
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 ZwAdjustGroupsToken(
     IN HANDLE TokenHandle,
     IN BOOLEAN  ResetToDefault,
@@ -133,8 +135,9 @@
     OUT PULONG  ReturnLength
 );
 
+NTSYSCALLAPI
 NTSTATUS
-STDCALL
+NTAPI
 NtAdjustPrivilegesToken(
     IN HANDLE  TokenHandle,
     IN BOOLEAN  DisableAllPrivileges,
@@ -145,7 +148,7 @@
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 ZwAdjustPrivilegesToken(
     IN HANDLE  TokenHandle,
     IN BOOLEAN  DisableAllPrivileges,
@@ -156,45 +159,45 @@
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 NtAlertResumeThread(
     IN HANDLE ThreadHandle,
     OUT PULONG SuspendCount
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 ZwAlertResumeThread(
     IN HANDLE ThreadHandle,
     OUT PULONG SuspendCount
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 NtAlertThread(
     IN HANDLE ThreadHandle
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 ZwAlertThread(
     IN HANDLE ThreadHandle
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 NtAllocateLocallyUniqueId(
     OUT LUID *LocallyUniqueId
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 ZwAllocateLocallyUniqueId(
     OUT PLUID Luid
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 NtAllocateUuids(
     PULARGE_INTEGER Time,
     PULONG Range,
@@ -203,7 +206,7 @@
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 ZwAllocateUuids(
     PULARGE_INTEGER Time,
     PULONG Range,
@@ -211,8 +214,9 @@
     PUCHAR Seed
 );
 
+NTSYSCALLAPI
 NTSTATUS
-STDCALL
+NTAPI
 NtAllocateVirtualMemory(
     IN HANDLE ProcessHandle,
     IN OUT PVOID *BaseAddress,
@@ -222,8 +226,9 @@
     IN ULONG  Protect
 );
 
+NTSYSAPI
 NTSTATUS
-STDCALL
+NTAPI
 ZwAllocateVirtualMemory(
     IN HANDLE ProcessHandle,
     IN OUT PVOID *BaseAddress,
@@ -234,21 +239,21 @@
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 NtAssignProcessToJobObject(
     HANDLE JobHandle,
     HANDLE ProcessHandle
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 ZwAssignProcessToJobObject(
     HANDLE JobHandle,
     HANDLE ProcessHandle
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 NtCallbackReturn(
     PVOID Result,
     ULONG ResultLength,
@@ -256,7 +261,7 @@
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 ZwCallbackReturn(
     PVOID Result,
     ULONG ResultLength,
@@ -264,40 +269,40 @@
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 NtCancelIoFile(
     IN HANDLE FileHandle,
     OUT PIO_STATUS_BLOCK IoStatusBlock
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 ZwCancelIoFile(
     IN HANDLE FileHandle,
     OUT PIO_STATUS_BLOCK IoStatusBlock
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 NtCancelTimer(
     IN HANDLE TimerHandle,
     OUT PBOOLEAN CurrentState OPTIONAL
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 NtClearEvent(
     IN HANDLE EventHandle
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 ZwClearEvent(
     IN HANDLE EventHandle
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 NtCreateJobObject(
     PHANDLE JobHandle,
     ACCESS_MASK DesiredAccess,
@@ -305,27 +310,30 @@
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 ZwCreateJobObject(
     PHANDLE JobHandle,
     ACCESS_MASK DesiredAccess,
     POBJECT_ATTRIBUTES ObjectAttributes
 );
 
+NTSYSCALLAPI
 NTSTATUS
-STDCALL
+NTAPI
 NtClose(
     IN HANDLE Handle
 );
 
+NTSYSAPI
 NTSTATUS
-STDCALL
+NTAPI
 ZwClose(
     IN HANDLE Handle
 );
 
+NTSYSCALLAPI
 NTSTATUS
-STDCALL
+NTAPI
 NtCloseObjectAuditAlarm(
     IN PUNICODE_STRING SubsystemName,
     IN PVOID HandleId,
@@ -333,7 +341,7 @@
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 ZwCloseObjectAuditAlarm(
     IN PUNICODE_STRING SubsystemName,
     IN PVOID HandleId,
@@ -341,19 +349,20 @@
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 NtCompleteConnectPort(
     HANDLE PortHandle
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 ZwCompleteConnectPort(
     HANDLE PortHandle
 );
 
+NTSYSCALLAPI
 NTSTATUS
-STDCALL
+NTAPI
 NtConnectPort(
     PHANDLE PortHandle,
     PUNICODE_STRING PortName,
@@ -365,8 +374,9 @@
     PULONG ConnectionInformationLength OPTIONAL
 );
 
+NTSYSAPI
 NTSTATUS
-STDCALL
+NTAPI
 ZwConnectPort(
     PHANDLE PortHandle,
     PUNICODE_STRING PortName,
@@ -379,29 +389,30 @@
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 NtContinue(
     IN PCONTEXT Context,
     IN BOOLEAN TestAlert
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 ZwContinue(
     IN PCONTEXT Context,
-    IN CINT IrqLevel
+    IN BOOLEAN TestAlert
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 NtCreateDirectoryObject(
     OUT PHANDLE DirectoryHandle,
     IN ACCESS_MASK DesiredAccess,
     IN POBJECT_ATTRIBUTES ObjectAttributes
 );
 
+NTSYSAPI
 NTSTATUS
-STDCALL
+NTAPI
 ZwCreateDirectoryObject(
     OUT PHANDLE DirectoryHandle,
     IN ACCESS_MASK DesiredAccess,
@@ -409,7 +420,7 @@
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 NtCreateEvent(
     OUT PHANDLE EventHandle,
     IN ACCESS_MASK DesiredAccess,
@@ -418,8 +429,9 @@
     IN BOOLEAN InitialState
 );
 
+NTSYSAPI
 NTSTATUS
-STDCALL
+NTAPI
 ZwCreateEvent(
     OUT PHANDLE EventHandle,
     IN ACCESS_MASK DesiredAccess,
@@ -429,7 +441,7 @@
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 NtCreateEventPair(
     OUT PHANDLE EventPairHandle,
     IN ACCESS_MASK DesiredAccess,
@@ -437,15 +449,16 @@
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 ZwCreateEventPair(
     OUT PHANDLE EventPairHandle,
     IN ACCESS_MASK DesiredAccess,
     IN POBJECT_ATTRIBUTES ObjectAttributes
 );
 
+NTSYSCALLAPI
 NTSTATUS
-STDCALL
+NTAPI
 NtCreateFile(
     OUT PHANDLE FileHandle,
     IN ACCESS_MASK DesiredAccess,
@@ -460,8 +473,9 @@
     IN ULONG EaLength
 );
 
+NTSYSAPI
 NTSTATUS
-STDCALL
+NTAPI
 ZwCreateFile(
     OUT PHANDLE FileHandle,
     IN ACCESS_MASK DesiredAccess,
@@ -477,7 +491,7 @@
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 NtCreateIoCompletion(
     OUT PHANDLE             IoCompletionHandle,
     IN  ACCESS_MASK         DesiredAccess,
@@ -486,7 +500,7 @@
     );
 
 NTSTATUS
-STDCALL
+NTAPI
 ZwCreateIoCompletion(
    OUT PHANDLE             IoCompletionHandle,
    IN  ACCESS_MASK         DesiredAccess,
@@ -495,7 +509,7 @@
    );
 
 NTSTATUS
-STDCALL
+NTAPI
 NtCreateKey(
     OUT PHANDLE KeyHandle,
     IN ACCESS_MASK DesiredAccess,
@@ -506,8 +520,9 @@
     IN PULONG Disposition OPTIONAL
 );
 
+NTSYSAPI
 NTSTATUS
-STDCALL
+NTAPI
 ZwCreateKey(
     OUT PHANDLE KeyHandle,
     IN ACCESS_MASK DesiredAccess,
@@ -519,7 +534,7 @@
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 NtCreateMailslotFile(
     OUT PHANDLE MailSlotFileHandle,
     IN ACCESS_MASK DesiredAccess,
@@ -532,7 +547,7 @@
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 ZwCreateMailslotFile(
     OUT PHANDLE MailSlotFileHandle,
     IN ACCESS_MASK DesiredAccess,
@@ -545,7 +560,7 @@
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 NtCreateMutant(
     OUT PHANDLE MutantHandle,
     IN ACCESS_MASK DesiredAccess,
@@ -554,7 +569,7 @@
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 ZwCreateMutant(
     OUT PHANDLE MutantHandle,
     IN ACCESS_MASK DesiredAccess,
@@ -563,7 +578,7 @@
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 NtCreateNamedPipeFile(
     OUT PHANDLE NamedPipeFileHandle,
     IN ACCESS_MASK DesiredAccess,
@@ -582,7 +597,7 @@
 );
 
 NTSTATUS
-STDCALL
+NTAPI
 ZwCreateNamedPipeFile(
     OUT PHANDLE NamedPipeFileHandle,
     IN ACCESS_MASK DesiredAccess,
@@ -601,7 +616,7 @@
 );
 
 NTSTATUS
-STDCALL
[truncated at 1000 lines; 3984 more skipped]