From 74929685199fce8d1646f0b3510dbc171096a1f7 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Mon, 24 Apr 2017 00:36:03 +0200 Subject: [PATCH] ntdll-Syscall_Wrappers: Delete disabled patchset. --- ...d_only_relocs-suppress-to-the-linker.patch | 30 - ...l-Use-wrapper-functions-for-syscalls.patch | 2151 ----------------- ...d-call-the-implementation-instead-of.patch | 123 - ...should-not-call-Nt-Ex-thunk-wrappers.patch | 71 - ...ory-initialization-function-early-du.patch | 91 - patches/ntdll-Syscall_Wrappers/definition | 2 - 6 files changed, 2468 deletions(-) delete mode 100644 patches/ntdll-Syscall_Wrappers/0001-winegcc-Pass-read_only_relocs-suppress-to-the-linker.patch delete mode 100644 patches/ntdll-Syscall_Wrappers/0002-ntdll-Use-wrapper-functions-for-syscalls.patch delete mode 100644 patches/ntdll-Syscall_Wrappers/0003-ntdll-APCs-should-call-the-implementation-instead-of.patch delete mode 100644 patches/ntdll-Syscall_Wrappers/0004-ntdll-Syscalls-should-not-call-Nt-Ex-thunk-wrappers.patch delete mode 100644 patches/ntdll-Syscall_Wrappers/0005-ntdll-Run-directory-initialization-function-early-du.patch delete mode 100644 patches/ntdll-Syscall_Wrappers/definition diff --git a/patches/ntdll-Syscall_Wrappers/0001-winegcc-Pass-read_only_relocs-suppress-to-the-linker.patch b/patches/ntdll-Syscall_Wrappers/0001-winegcc-Pass-read_only_relocs-suppress-to-the-linker.patch deleted file mode 100644 index 4b70464f..00000000 --- a/patches/ntdll-Syscall_Wrappers/0001-winegcc-Pass-read_only_relocs-suppress-to-the-linker.patch +++ /dev/null @@ -1,30 +0,0 @@ -From d6feff32b27e0661406b4f24ec7932f919a9628a Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Fri, 30 Oct 2015 23:43:02 +0100 -Subject: winegcc: Pass '-read_only_relocs suppress' to the linker on OSX. - ---- - tools/winegcc/winegcc.c | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c -index ad139f5..220784b 100644 ---- a/tools/winegcc/winegcc.c -+++ b/tools/winegcc/winegcc.c -@@ -377,7 +377,12 @@ static const strarray* get_lddllflags( const struct options *opts, const strarra - strarray_add( flags, "-bundle" ); - strarray_add( flags, "-multiply_defined" ); - strarray_add( flags, "suppress" ); -- if (opts->target_cpu == CPU_POWERPC) -+ if (opts->target_cpu == CPU_x86) -+ { -+ strarray_add( flags, "-read_only_relocs" ); -+ strarray_add( flags, "suppress" ); -+ } -+ else if (opts->target_cpu == CPU_POWERPC) - { - strarray_add( flags, "-read_only_relocs" ); - strarray_add( flags, "warning" ); --- -2.6.1 - diff --git a/patches/ntdll-Syscall_Wrappers/0002-ntdll-Use-wrapper-functions-for-syscalls.patch b/patches/ntdll-Syscall_Wrappers/0002-ntdll-Use-wrapper-functions-for-syscalls.patch deleted file mode 100644 index cb07f27c..00000000 --- a/patches/ntdll-Syscall_Wrappers/0002-ntdll-Use-wrapper-functions-for-syscalls.patch +++ /dev/null @@ -1,2151 +0,0 @@ -From d4288090dcc57211aaab4c913ab9280d7cf1c8a9 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Fri, 16 Oct 2015 02:32:58 +0200 -Subject: ntdll: Use wrapper functions for syscalls. - ---- - dlls/ntdll/atom.c | 13 +++-- - dlls/ntdll/directory.c | 3 +- - dlls/ntdll/env.c | 6 ++- - dlls/ntdll/error.c | 4 +- - dlls/ntdll/file.c | 75 +++++++++++++++++--------- - dlls/ntdll/loader.c | 6 ++- - dlls/ntdll/nt.c | 93 +++++++++++++++++++++----------- - dlls/ntdll/ntdll_misc.h | 17 ++++++ - dlls/ntdll/om.c | 39 +++++++++----- - dlls/ntdll/process.c | 15 ++++-- - dlls/ntdll/reg.c | 75 +++++++++++++++++--------- - dlls/ntdll/resource.c | 16 ++++-- - dlls/ntdll/sec.c | 9 ++-- - dlls/ntdll/signal_arm.c | 3 +- - dlls/ntdll/signal_arm64.c | 3 +- - dlls/ntdll/signal_i386.c | 11 +++- - dlls/ntdll/signal_powerpc.c | 3 +- - dlls/ntdll/signal_x86_64.c | 3 +- - dlls/ntdll/sync.c | 129 +++++++++++++++++++++++++++++--------------- - dlls/ntdll/thread.c | 36 ++++++++----- - dlls/ntdll/time.c | 12 +++-- - dlls/ntdll/virtual.c | 48 +++++++++++------ - 22 files changed, 422 insertions(+), 197 deletions(-) - -diff --git a/dlls/ntdll/atom.c b/dlls/ntdll/atom.c -index 304b7f6..222fde9 100644 ---- a/dlls/ntdll/atom.c -+++ b/dlls/ntdll/atom.c -@@ -31,6 +31,7 @@ - #include "ntstatus.h" - #define WIN32_NO_STATUS - #include "windef.h" -+#include "ntdll_misc.h" - - #include "wine/server.h" - #include "wine/unicode.h" -@@ -311,7 +312,8 @@ NTSTATUS WINAPI RtlPinAtomInAtomTable( RTL_ATOM_TABLE table, RTL_ATOM atom ) - /****************************************************************** - * NtAddAtom (NTDLL.@) - */ --NTSTATUS WINAPI NtAddAtom( const WCHAR* name, ULONG length, RTL_ATOM* atom ) -+DEFINE_SYSCALL_ENTRYPOINT( NtAddAtom, 3 ); -+NTSTATUS WINAPI SYSCALL(NtAddAtom)( const WCHAR* name, ULONG length, RTL_ATOM* atom ) - { - NTSTATUS status; - -@@ -335,7 +337,8 @@ NTSTATUS WINAPI NtAddAtom( const WCHAR* name, ULONG length, RTL_ATOM* atom ) - /****************************************************************** - * NtDeleteAtom (NTDLL.@) - */ --NTSTATUS WINAPI NtDeleteAtom(RTL_ATOM atom) -+DEFINE_SYSCALL_ENTRYPOINT( NtDeleteAtom, 1 ); -+NTSTATUS WINAPI SYSCALL(NtDeleteAtom)(RTL_ATOM atom) - { - NTSTATUS status; - -@@ -352,7 +355,8 @@ NTSTATUS WINAPI NtDeleteAtom(RTL_ATOM atom) - /****************************************************************** - * NtFindAtom (NTDLL.@) - */ --NTSTATUS WINAPI NtFindAtom( const WCHAR* name, ULONG length, RTL_ATOM* atom ) -+DEFINE_SYSCALL_ENTRYPOINT( NtFindAtom, 3 ); -+NTSTATUS WINAPI SYSCALL(NtFindAtom)( const WCHAR* name, ULONG length, RTL_ATOM* atom ) - { - NTSTATUS status; - -@@ -376,7 +380,8 @@ NTSTATUS WINAPI NtFindAtom( const WCHAR* name, ULONG length, RTL_ATOM* atom ) - /****************************************************************** - * NtQueryInformationAtom (NTDLL.@) - */ --NTSTATUS WINAPI NtQueryInformationAtom( RTL_ATOM atom, ATOM_INFORMATION_CLASS class, -+DEFINE_SYSCALL_ENTRYPOINT( NtQueryInformationAtom, 5 ); -+NTSTATUS WINAPI SYSCALL(NtQueryInformationAtom)( RTL_ATOM atom, ATOM_INFORMATION_CLASS class, - PVOID ptr, ULONG size, PULONG psize ) - { - NTSTATUS status; -diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c -index 93fe594..735683f 100644 ---- a/dlls/ntdll/directory.c -+++ b/dlls/ntdll/directory.c -@@ -2210,7 +2210,8 @@ done: - * NtQueryDirectoryFile [NTDLL.@] - * ZwQueryDirectoryFile [NTDLL.@] - */ --NTSTATUS WINAPI NtQueryDirectoryFile( HANDLE handle, HANDLE event, -+DEFINE_SYSCALL_ENTRYPOINT( NtQueryDirectoryFile, 11 ); -+NTSTATUS WINAPI SYSCALL(NtQueryDirectoryFile)( HANDLE handle, HANDLE event, - PIO_APC_ROUTINE apc_routine, PVOID apc_context, - PIO_STATUS_BLOCK io, - PVOID buffer, ULONG length, -diff --git a/dlls/ntdll/env.c b/dlls/ntdll/env.c -index a5bdf0f..3b08c54 100644 ---- a/dlls/ntdll/env.c -+++ b/dlls/ntdll/env.c -@@ -37,7 +37,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(environ); - /****************************************************************************** - * NtQuerySystemEnvironmentValue [NTDLL.@] - */ --NTSYSAPI NTSTATUS WINAPI NtQuerySystemEnvironmentValue(PUNICODE_STRING VariableName, -+DEFINE_SYSCALL_ENTRYPOINT( NtQuerySystemEnvironmentValue, 4 ); -+NTSYSAPI NTSTATUS WINAPI SYSCALL(NtQuerySystemEnvironmentValue)(PUNICODE_STRING VariableName, - PWCHAR Value, - ULONG ValueBufferLength, - PULONG RequiredLength) -@@ -49,7 +50,8 @@ NTSYSAPI NTSTATUS WINAPI NtQuerySystemEnvironmentValue(PUNICODE_STRING VariableN - /****************************************************************************** - * NtQuerySystemEnvironmentValueEx [NTDLL.@] - */ --NTSYSAPI NTSTATUS WINAPI NtQuerySystemEnvironmentValueEx(PUNICODE_STRING name, LPGUID vendor, -+DEFINE_SYSCALL_ENTRYPOINT( NtQuerySystemEnvironmentValueEx, 5 ); -+NTSYSAPI NTSTATUS WINAPI SYSCALL(NtQuerySystemEnvironmentValueEx)(PUNICODE_STRING name, LPGUID vendor, - PVOID value, PULONG retlength, PULONG attrib) - { - FIXME("(%s, %s, %p, %p, %p), stub\n", debugstr_us(name), debugstr_guid(vendor), value, retlength, attrib); -diff --git a/dlls/ntdll/error.c b/dlls/ntdll/error.c -index 5c42010..12b2995 100644 ---- a/dlls/ntdll/error.c -+++ b/dlls/ntdll/error.c -@@ -29,6 +29,7 @@ - #include "windef.h" - #include "winternl.h" - #include "winerror.h" -+#include "ntdll_misc.h" - #include "wine/debug.h" - - WINE_DEFAULT_DEBUG_CHANNEL(ntdll); -@@ -132,7 +133,8 @@ DWORD WINAPI RtlGetLastWin32Error(void) - /********************************************************************** - * NtRaiseHardError (NTDLL.@) - */ --NTSTATUS WINAPI NtRaiseHardError( NTSTATUS ErrorStatus, ULONG NumberOfParameters, -+DEFINE_SYSCALL_ENTRYPOINT( NtRaiseHardError, 6 ); -+NTSTATUS WINAPI SYSCALL(NtRaiseHardError)( NTSTATUS ErrorStatus, ULONG NumberOfParameters, - PUNICODE_STRING UnicodeStringParameterMask, PVOID *Parameters, - HARDERROR_RESPONSE_OPTION ResponseOption, PHARDERROR_RESPONSE Response ) - { -diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c -index 3883e5a..a17151d 100644 ---- a/dlls/ntdll/file.c -+++ b/dlls/ntdll/file.c -@@ -296,7 +296,8 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT - * Success: 0. FileHandle and IoStatusBlock are updated. - * Failure: An NTSTATUS error code describing the error. - */ --NTSTATUS WINAPI NtOpenFile( PHANDLE handle, ACCESS_MASK access, -+DEFINE_SYSCALL_ENTRYPOINT( NtOpenFile, 6 ); -+NTSTATUS WINAPI SYSCALL(NtOpenFile)( PHANDLE handle, ACCESS_MASK access, - POBJECT_ATTRIBUTES attr, PIO_STATUS_BLOCK io, - ULONG sharing, ULONG options ) - { -@@ -328,7 +329,8 @@ NTSTATUS WINAPI NtOpenFile( PHANDLE handle, ACCESS_MASK access, - * Success: 0. handle and io are updated. - * Failure: An NTSTATUS error code describing the error. - */ --NTSTATUS WINAPI NtCreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATTRIBUTES attr, -+DEFINE_SYSCALL_ENTRYPOINT( NtCreateFile, 11 ); -+NTSTATUS WINAPI SYSCALL(NtCreateFile)( PHANDLE handle, ACCESS_MASK access, POBJECT_ATTRIBUTES attr, - PIO_STATUS_BLOCK io, PLARGE_INTEGER alloc_size, - ULONG attributes, ULONG sharing, ULONG disposition, - ULONG options, PVOID ea_buffer, ULONG ea_length ) -@@ -792,7 +794,8 @@ static NTSTATUS get_io_avail_mode( HANDLE handle, enum server_fd_type type, BOOL - * The number of bytes read. - * Failure: An NTSTATUS error code describing the error. - */ --NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent, -+DEFINE_SYSCALL_ENTRYPOINT( NtReadFile, 9 ); -+NTSTATUS WINAPI SYSCALL(NtReadFile)(HANDLE hFile, HANDLE hEvent, - PIO_APC_ROUTINE apc, void* apc_user, - PIO_STATUS_BLOCK io_status, void* buffer, ULONG length, - PLARGE_INTEGER offset, PULONG key) -@@ -1003,7 +1006,8 @@ err: - * NtReadFileScatter [NTDLL.@] - * ZwReadFileScatter [NTDLL.@] - */ --NTSTATUS WINAPI NtReadFileScatter( HANDLE file, HANDLE event, PIO_APC_ROUTINE apc, void *apc_user, -+DEFINE_SYSCALL_ENTRYPOINT( NtReadFileScatter, 9 ); -+NTSTATUS WINAPI SYSCALL(NtReadFileScatter)( HANDLE file, HANDLE event, PIO_APC_ROUTINE apc, void *apc_user, - PIO_STATUS_BLOCK io_status, FILE_SEGMENT_ELEMENT *segments, - ULONG length, PLARGE_INTEGER offset, PULONG key ) - { -@@ -1175,7 +1179,8 @@ static NTSTATUS set_pending_write( HANDLE device ) - * The number of bytes written. - * Failure: An NTSTATUS error code describing the error. - */ --NTSTATUS WINAPI NtWriteFile(HANDLE hFile, HANDLE hEvent, -+DEFINE_SYSCALL_ENTRYPOINT( NtWriteFile, 9 ); -+NTSTATUS WINAPI SYSCALL(NtWriteFile)(HANDLE hFile, HANDLE hEvent, - PIO_APC_ROUTINE apc, void* apc_user, - PIO_STATUS_BLOCK io_status, - const void* buffer, ULONG length, -@@ -1409,7 +1414,8 @@ err: - * NtWriteFileGather [NTDLL.@] - * ZwWriteFileGather [NTDLL.@] - */ --NTSTATUS WINAPI NtWriteFileGather( HANDLE file, HANDLE event, PIO_APC_ROUTINE apc, void *apc_user, -+DEFINE_SYSCALL_ENTRYPOINT( NtWriteFileGather, 9 ); -+NTSTATUS WINAPI SYSCALL(NtWriteFileGather)( HANDLE file, HANDLE event, PIO_APC_ROUTINE apc, void *apc_user, - PIO_STATUS_BLOCK io_status, FILE_SEGMENT_ELEMENT *segments, - ULONG length, PLARGE_INTEGER offset, PULONG key ) - { -@@ -1598,7 +1604,8 @@ static void ignore_server_ioctl_struct_holes (ULONG code, const void *in_buffer, - * Success: 0. IoStatusBlock is updated. - * Failure: An NTSTATUS error code describing the error. - */ --NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE handle, HANDLE event, -+DEFINE_SYSCALL_ENTRYPOINT( NtDeviceIoControlFile, 10 ); -+NTSTATUS WINAPI SYSCALL(NtDeviceIoControlFile)(HANDLE handle, HANDLE event, - PIO_APC_ROUTINE apc, PVOID apc_context, - PIO_STATUS_BLOCK io, ULONG code, - PVOID in_buffer, ULONG in_size, -@@ -1662,7 +1669,8 @@ NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE handle, HANDLE event, - * Success: 0. IoStatusBlock is updated. - * Failure: An NTSTATUS error code describing the error. - */ --NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, -+DEFINE_SYSCALL_ENTRYPOINT( NtFsControlFile, 10 ); -+NTSTATUS WINAPI SYSCALL(NtFsControlFile)(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, - PVOID apc_context, PIO_STATUS_BLOCK io, ULONG code, - PVOID in_buffer, ULONG in_size, PVOID out_buffer, ULONG out_size) - { -@@ -1905,7 +1913,8 @@ static NTSTATUS read_changes_apc( void *user, IO_STATUS_BLOCK *iosb, - /****************************************************************************** - * NtNotifyChangeDirectoryFile [NTDLL.@] - */ --NTSTATUS WINAPI NtNotifyChangeDirectoryFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, -+DEFINE_SYSCALL_ENTRYPOINT( NtNotifyChangeDirectoryFile, 9 ); -+NTSTATUS WINAPI SYSCALL(NtNotifyChangeDirectoryFile)( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, - void *apc_context, PIO_STATUS_BLOCK iosb, void *buffer, - ULONG buffer_size, ULONG filter, BOOLEAN subtree ) - { -@@ -1964,7 +1973,8 @@ NTSTATUS WINAPI NtNotifyChangeDirectoryFile( HANDLE handle, HANDLE event, PIO_AP - * Success: 0. IoStatusBlock is updated. - * Failure: An NTSTATUS error code describing the error. - */ --NTSTATUS WINAPI NtSetVolumeInformationFile( -+DEFINE_SYSCALL_ENTRYPOINT( NtSetVolumeInformationFile, 5 ); -+NTSTATUS WINAPI SYSCALL(NtSetVolumeInformationFile)( - IN HANDLE FileHandle, - PIO_STATUS_BLOCK IoStatusBlock, - PVOID FsInformation, -@@ -2269,7 +2279,8 @@ static NTSTATUS fill_name_info( const ANSI_STRING *unix_name, FILE_NAME_INFORMAT - * Success: 0. IoStatusBlock and FileInformation are updated. - * Failure: An NTSTATUS error code describing the error. - */ --NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io, -+DEFINE_SYSCALL_ENTRYPOINT( NtQueryInformationFile, 5 ); -+NTSTATUS WINAPI SYSCALL(NtQueryInformationFile)( HANDLE hFile, PIO_STATUS_BLOCK io, - PVOID ptr, LONG len, FILE_INFORMATION_CLASS class ) - { - static const size_t info_sizes[] = -@@ -2595,7 +2606,8 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io, - * Success: 0. io is updated. - * Failure: An NTSTATUS error code describing the error. - */ --NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io, -+DEFINE_SYSCALL_ENTRYPOINT( NtSetInformationFile, 5 ); -+NTSTATUS WINAPI SYSCALL(NtSetInformationFile)(HANDLE handle, PIO_STATUS_BLOCK io, - PVOID ptr, ULONG len, FILE_INFORMATION_CLASS class) - { - int fd, needs_close; -@@ -2892,7 +2904,8 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io, - /****************************************************************************** - * NtQueryFullAttributesFile (NTDLL.@) - */ --NTSTATUS WINAPI NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES *attr, -+DEFINE_SYSCALL_ENTRYPOINT( NtQueryFullAttributesFile, 2 ); -+NTSTATUS WINAPI SYSCALL(NtQueryFullAttributesFile)( const OBJECT_ATTRIBUTES *attr, - FILE_NETWORK_OPEN_INFORMATION *info ) - { - ANSI_STRING unix_name; -@@ -2936,7 +2949,8 @@ NTSTATUS WINAPI NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES *attr, - * NtQueryAttributesFile (NTDLL.@) - * ZwQueryAttributesFile (NTDLL.@) - */ --NTSTATUS WINAPI NtQueryAttributesFile( const OBJECT_ATTRIBUTES *attr, FILE_BASIC_INFORMATION *info ) -+DEFINE_SYSCALL_ENTRYPOINT( NtQueryAttributesFile, 2 ); -+NTSTATUS WINAPI SYSCALL(NtQueryAttributesFile)( const OBJECT_ATTRIBUTES *attr, FILE_BASIC_INFORMATION *info ) - { - ANSI_STRING unix_name; - NTSTATUS status; -@@ -3157,7 +3171,8 @@ static NTSTATUS get_device_info( int fd, FILE_FS_DEVICE_INFORMATION *info ) - * Success: 0. io and buffer are updated. - * Failure: An NTSTATUS error code describing the error. - */ --NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, PIO_STATUS_BLOCK io, -+DEFINE_SYSCALL_ENTRYPOINT( NtQueryVolumeInformationFile, 5 ); -+NTSTATUS WINAPI SYSCALL(NtQueryVolumeInformationFile)( HANDLE handle, PIO_STATUS_BLOCK io, - PVOID buffer, ULONG length, - FS_INFORMATION_CLASS info_class ) - { -@@ -3305,7 +3320,8 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, PIO_STATUS_BLOCK io - * Success: 0. Atrributes read into buffer - * Failure: An NTSTATUS error code describing the error. - */ --NTSTATUS WINAPI NtQueryEaFile( HANDLE hFile, PIO_STATUS_BLOCK iosb, PVOID buffer, ULONG length, -+DEFINE_SYSCALL_ENTRYPOINT( NtQueryEaFile, 9 ); -+NTSTATUS WINAPI SYSCALL(NtQueryEaFile)( HANDLE hFile, PIO_STATUS_BLOCK iosb, PVOID buffer, ULONG length, - BOOLEAN single_entry, PVOID ea_list, ULONG ea_list_len, - PULONG ea_index, BOOLEAN restart ) - { -@@ -3331,7 +3347,8 @@ NTSTATUS WINAPI NtQueryEaFile( HANDLE hFile, PIO_STATUS_BLOCK iosb, PVOID buffer - * Success: 0. Attributes are updated - * Failure: An NTSTATUS error code describing the error. - */ --NTSTATUS WINAPI NtSetEaFile( HANDLE hFile, PIO_STATUS_BLOCK iosb, PVOID buffer, ULONG length ) -+DEFINE_SYSCALL_ENTRYPOINT( NtSetEaFile, 4 ); -+NTSTATUS WINAPI SYSCALL(NtSetEaFile)( HANDLE hFile, PIO_STATUS_BLOCK iosb, PVOID buffer, ULONG length ) - { - FIXME("(%p,%p,%p,%d) stub\n", hFile, iosb, buffer, length); - return STATUS_ACCESS_DENIED; -@@ -3351,7 +3368,8 @@ NTSTATUS WINAPI NtSetEaFile( HANDLE hFile, PIO_STATUS_BLOCK iosb, PVOID buffer, - * Success: 0. IoStatusBlock is updated. - * Failure: An NTSTATUS error code describing the error. - */ --NTSTATUS WINAPI NtFlushBuffersFile( HANDLE hFile, IO_STATUS_BLOCK* IoStatusBlock ) -+DEFINE_SYSCALL_ENTRYPOINT( NtFlushBuffersFile, 2 ); -+NTSTATUS WINAPI SYSCALL(NtFlushBuffersFile)( HANDLE hFile, IO_STATUS_BLOCK* IoStatusBlock ) - { - NTSTATUS ret; - HANDLE hEvent = NULL; -@@ -3393,7 +3411,8 @@ NTSTATUS WINAPI NtFlushBuffersFile( HANDLE hFile, IO_STATUS_BLOCK* IoStatusBlock - * - * - */ --NTSTATUS WINAPI NtLockFile( HANDLE hFile, HANDLE lock_granted_event, -+DEFINE_SYSCALL_ENTRYPOINT( NtLockFile, 10 ); -+NTSTATUS WINAPI SYSCALL(NtLockFile)( HANDLE hFile, HANDLE lock_granted_event, - PIO_APC_ROUTINE apc, void* apc_user, - PIO_STATUS_BLOCK io_status, PLARGE_INTEGER offset, - PLARGE_INTEGER count, ULONG* key, BOOLEAN dont_wait, -@@ -3465,7 +3484,8 @@ NTSTATUS WINAPI NtLockFile( HANDLE hFile, HANDLE lock_granted_event, - * - * - */ --NTSTATUS WINAPI NtUnlockFile( HANDLE hFile, PIO_STATUS_BLOCK io_status, -+DEFINE_SYSCALL_ENTRYPOINT( NtUnlockFile, 5 ); -+NTSTATUS WINAPI SYSCALL(NtUnlockFile)( HANDLE hFile, PIO_STATUS_BLOCK io_status, - PLARGE_INTEGER offset, PLARGE_INTEGER count, - PULONG key ) - { -@@ -3496,7 +3516,8 @@ NTSTATUS WINAPI NtUnlockFile( HANDLE hFile, PIO_STATUS_BLOCK io_status, - * - * - */ --NTSTATUS WINAPI NtCreateNamedPipeFile( PHANDLE handle, ULONG access, -+DEFINE_SYSCALL_ENTRYPOINT( NtCreateNamedPipeFile, 14 ); -+NTSTATUS WINAPI SYSCALL(NtCreateNamedPipeFile)( PHANDLE handle, ULONG access, - POBJECT_ATTRIBUTES attr, PIO_STATUS_BLOCK iosb, - ULONG sharing, ULONG dispo, ULONG options, - ULONG pipe_type, ULONG read_mode, -@@ -3549,7 +3570,8 @@ NTSTATUS WINAPI NtCreateNamedPipeFile( PHANDLE handle, ULONG access, - * - * - */ --NTSTATUS WINAPI NtDeleteFile( POBJECT_ATTRIBUTES ObjectAttributes ) -+DEFINE_SYSCALL_ENTRYPOINT( NtDeleteFile, 1 ); -+NTSTATUS WINAPI SYSCALL(NtDeleteFile)( POBJECT_ATTRIBUTES ObjectAttributes ) - { - NTSTATUS status; - HANDLE hFile; -@@ -3569,7 +3591,8 @@ NTSTATUS WINAPI NtDeleteFile( POBJECT_ATTRIBUTES ObjectAttributes ) - * - * - */ --NTSTATUS WINAPI NtCancelIoFileEx( HANDLE hFile, PIO_STATUS_BLOCK iosb, PIO_STATUS_BLOCK io_status ) -+DEFINE_SYSCALL_ENTRYPOINT( NtCancelIoFileEx, 3 ); -+NTSTATUS WINAPI SYSCALL(NtCancelIoFileEx)( HANDLE hFile, PIO_STATUS_BLOCK iosb, PIO_STATUS_BLOCK io_status ) - { - TRACE("%p %p %p\n", hFile, iosb, io_status ); - -@@ -3590,7 +3613,8 @@ NTSTATUS WINAPI NtCancelIoFileEx( HANDLE hFile, PIO_STATUS_BLOCK iosb, PIO_STATU - * - * - */ --NTSTATUS WINAPI NtCancelIoFile( HANDLE hFile, PIO_STATUS_BLOCK io_status ) -+DEFINE_SYSCALL_ENTRYPOINT( NtCancelIoFile, 2 ); -+NTSTATUS WINAPI SYSCALL(NtCancelIoFile)( HANDLE hFile, PIO_STATUS_BLOCK io_status ) - { - TRACE("%p %p\n", hFile, io_status ); - -@@ -3623,7 +3647,8 @@ NTSTATUS WINAPI NtCancelIoFile( HANDLE hFile, PIO_STATUS_BLOCK io_status ) - * RETURNS - * An NT status code - */ --NTSTATUS WINAPI NtCreateMailslotFile(PHANDLE pHandle, ULONG DesiredAccess, -+DEFINE_SYSCALL_ENTRYPOINT( NtCreateMailslotFile, 8 ); -+NTSTATUS WINAPI SYSCALL(NtCreateMailslotFile)(PHANDLE pHandle, ULONG DesiredAccess, - POBJECT_ATTRIBUTES attr, PIO_STATUS_BLOCK IoStatusBlock, - ULONG CreateOptions, ULONG MailslotQuota, ULONG MaxMessageSize, - PLARGE_INTEGER TimeOut) -diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c -index bf1d365..423cca9 100644 ---- a/dlls/ntdll/loader.c -+++ b/dlls/ntdll/loader.c -@@ -3200,7 +3200,8 @@ PVOID WINAPI RtlPcToFileHeader( PVOID pc, PVOID *address ) - * NtLoadDriver (NTDLL.@) - * ZwLoadDriver (NTDLL.@) - */ --NTSTATUS WINAPI NtLoadDriver( const UNICODE_STRING *DriverServiceName ) -+DEFINE_SYSCALL_ENTRYPOINT( NtLoadDriver, 1 ); -+NTSTATUS WINAPI SYSCALL(NtLoadDriver)( const UNICODE_STRING *DriverServiceName ) - { - FIXME("(%p), stub!\n",DriverServiceName); - return STATUS_NOT_IMPLEMENTED; -@@ -3211,7 +3212,8 @@ NTSTATUS WINAPI NtLoadDriver( const UNICODE_STRING *DriverServiceName ) - * NtUnloadDriver (NTDLL.@) - * ZwUnloadDriver (NTDLL.@) - */ --NTSTATUS WINAPI NtUnloadDriver( const UNICODE_STRING *DriverServiceName ) -+DEFINE_SYSCALL_ENTRYPOINT( NtUnloadDriver, 1 ); -+NTSTATUS WINAPI SYSCALL(NtUnloadDriver)( const UNICODE_STRING *DriverServiceName ) - { - FIXME("(%p), stub!\n",DriverServiceName); - return STATUS_NOT_IMPLEMENTED; -diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c -index 5c8b7fd..c857072 100644 ---- a/dlls/ntdll/nt.c -+++ b/dlls/ntdll/nt.c -@@ -74,7 +74,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(ntdll); - * NtDuplicateToken [NTDLL.@] - * ZwDuplicateToken [NTDLL.@] - */ --NTSTATUS WINAPI NtDuplicateToken( -+DEFINE_SYSCALL_ENTRYPOINT( NtDuplicateToken, 6 ); -+NTSTATUS WINAPI SYSCALL(NtDuplicateToken)( - IN HANDLE ExistingToken, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, -@@ -117,7 +118,8 @@ NTSTATUS WINAPI NtDuplicateToken( - * NtOpenProcessToken [NTDLL.@] - * ZwOpenProcessToken [NTDLL.@] - */ --NTSTATUS WINAPI NtOpenProcessToken( -+DEFINE_SYSCALL_ENTRYPOINT( NtOpenProcessToken, 3 ); -+NTSTATUS WINAPI SYSCALL(NtOpenProcessToken)( - HANDLE ProcessHandle, - DWORD DesiredAccess, - HANDLE *TokenHandle) -@@ -129,7 +131,8 @@ NTSTATUS WINAPI NtOpenProcessToken( - * NtOpenProcessTokenEx [NTDLL.@] - * ZwOpenProcessTokenEx [NTDLL.@] - */ --NTSTATUS WINAPI NtOpenProcessTokenEx( HANDLE process, DWORD access, DWORD attributes, -+DEFINE_SYSCALL_ENTRYPOINT( NtOpenProcessTokenEx, 4 ); -+NTSTATUS WINAPI SYSCALL(NtOpenProcessTokenEx)( HANDLE process, DWORD access, DWORD attributes, - HANDLE *handle ) - { - NTSTATUS ret; -@@ -153,7 +156,8 @@ NTSTATUS WINAPI NtOpenProcessTokenEx( HANDLE process, DWORD access, DWORD attrib - * NtOpenThreadToken [NTDLL.@] - * ZwOpenThreadToken [NTDLL.@] - */ --NTSTATUS WINAPI NtOpenThreadToken( -+DEFINE_SYSCALL_ENTRYPOINT( NtOpenThreadToken, 4 ); -+NTSTATUS WINAPI SYSCALL(NtOpenThreadToken)( - HANDLE ThreadHandle, - DWORD DesiredAccess, - BOOLEAN OpenAsSelf, -@@ -166,7 +170,8 @@ NTSTATUS WINAPI NtOpenThreadToken( - * NtOpenThreadTokenEx [NTDLL.@] - * ZwOpenThreadTokenEx [NTDLL.@] - */ --NTSTATUS WINAPI NtOpenThreadTokenEx( HANDLE thread, DWORD access, BOOLEAN as_self, DWORD attributes, -+DEFINE_SYSCALL_ENTRYPOINT( NtOpenThreadTokenEx, 5 ); -+NTSTATUS WINAPI SYSCALL(NtOpenThreadTokenEx)( HANDLE thread, DWORD access, BOOLEAN as_self, DWORD attributes, - HANDLE *handle ) - { - NTSTATUS ret; -@@ -194,7 +199,8 @@ NTSTATUS WINAPI NtOpenThreadTokenEx( HANDLE thread, DWORD access, BOOLEAN as_sel - * - * FIXME: parameters unsafe - */ --NTSTATUS WINAPI NtAdjustPrivilegesToken( -+DEFINE_SYSCALL_ENTRYPOINT( NtAdjustPrivilegesToken, 6 ); -+NTSTATUS WINAPI SYSCALL(NtAdjustPrivilegesToken)( - IN HANDLE TokenHandle, - IN BOOLEAN DisableAllPrivileges, - IN PTOKEN_PRIVILEGES NewState, -@@ -242,7 +248,8 @@ NTSTATUS WINAPI NtAdjustPrivilegesToken( - * 0x08 SID - * - */ --NTSTATUS WINAPI NtQueryInformationToken( -+DEFINE_SYSCALL_ENTRYPOINT( NtQueryInformationToken, 5 ); -+NTSTATUS WINAPI SYSCALL(NtQueryInformationToken)( - HANDLE token, - TOKEN_INFORMATION_CLASS tokeninfoclass, - PVOID tokeninfo, -@@ -554,7 +561,8 @@ NTSTATUS WINAPI NtQueryInformationToken( - * NtSetInformationToken [NTDLL.@] - * ZwSetInformationToken [NTDLL.@] - */ --NTSTATUS WINAPI NtSetInformationToken( -+DEFINE_SYSCALL_ENTRYPOINT( NtSetInformationToken, 4 ); -+NTSTATUS WINAPI SYSCALL(NtSetInformationToken)( - HANDLE TokenHandle, - TOKEN_INFORMATION_CLASS TokenInformationClass, - PVOID TokenInformation, -@@ -604,7 +612,8 @@ NTSTATUS WINAPI NtSetInformationToken( - * NtAdjustGroupsToken [NTDLL.@] - * ZwAdjustGroupsToken [NTDLL.@] - */ --NTSTATUS WINAPI NtAdjustGroupsToken( -+DEFINE_SYSCALL_ENTRYPOINT( NtAdjustGroupsToken, 6 ); -+NTSTATUS WINAPI SYSCALL(NtAdjustGroupsToken)( - HANDLE TokenHandle, - BOOLEAN ResetToDefault, - PTOKEN_GROUPS NewState, -@@ -621,7 +630,8 @@ NTSTATUS WINAPI NtAdjustGroupsToken( - * NtPrivilegeCheck [NTDLL.@] - * ZwPrivilegeCheck [NTDLL.@] - */ --NTSTATUS WINAPI NtPrivilegeCheck( -+DEFINE_SYSCALL_ENTRYPOINT( NtPrivilegeCheck, 3 ); -+NTSTATUS WINAPI SYSCALL(NtPrivilegeCheck)( - HANDLE ClientToken, - PPRIVILEGE_SET RequiredPrivileges, - PBOOLEAN Result) -@@ -652,7 +662,8 @@ NTSTATUS WINAPI NtPrivilegeCheck( - /****************************************************************************** - * NtQuerySection [NTDLL.@] - */ --NTSTATUS WINAPI NtQuerySection( -+DEFINE_SYSCALL_ENTRYPOINT( NtQuerySection, 5 ); -+NTSTATUS WINAPI SYSCALL(NtQuerySection)( - IN HANDLE SectionHandle, - IN SECTION_INFORMATION_CLASS SectionInformationClass, - OUT PVOID SectionInformation, -@@ -672,7 +683,8 @@ NTSTATUS WINAPI NtQuerySection( - * NtCreatePort [NTDLL.@] - * ZwCreatePort [NTDLL.@] - */ --NTSTATUS WINAPI NtCreatePort(PHANDLE PortHandle,POBJECT_ATTRIBUTES ObjectAttributes, -+DEFINE_SYSCALL_ENTRYPOINT( NtCreatePort, 5 ); -+NTSTATUS WINAPI SYSCALL(NtCreatePort)(PHANDLE PortHandle,POBJECT_ATTRIBUTES ObjectAttributes, - ULONG MaxConnectInfoLength,ULONG MaxDataLength,PULONG reserved) - { - FIXME("(%p,%p,%u,%u,%p),stub!\n",PortHandle,ObjectAttributes, -@@ -684,7 +696,8 @@ NTSTATUS WINAPI NtCreatePort(PHANDLE PortHandle,POBJECT_ATTRIBUTES ObjectAttribu - * NtConnectPort [NTDLL.@] - * ZwConnectPort [NTDLL.@] - */ --NTSTATUS WINAPI NtConnectPort( -+DEFINE_SYSCALL_ENTRYPOINT( NtConnectPort, 8 ); -+NTSTATUS WINAPI SYSCALL(NtConnectPort)( - PHANDLE PortHandle, - PUNICODE_STRING PortName, - PSECURITY_QUALITY_OF_SERVICE SecurityQos, -@@ -707,7 +720,8 @@ NTSTATUS WINAPI NtConnectPort( - * NtSecureConnectPort (NTDLL.@) - * ZwSecureConnectPort (NTDLL.@) - */ --NTSTATUS WINAPI NtSecureConnectPort( -+DEFINE_SYSCALL_ENTRYPOINT( NtSecureConnectPort, 9 ); -+NTSTATUS WINAPI SYSCALL(NtSecureConnectPort)( - PHANDLE PortHandle, - PUNICODE_STRING PortName, - PSECURITY_QUALITY_OF_SERVICE SecurityQos, -@@ -729,7 +743,8 @@ NTSTATUS WINAPI NtSecureConnectPort( - * NtListenPort [NTDLL.@] - * ZwListenPort [NTDLL.@] - */ --NTSTATUS WINAPI NtListenPort(HANDLE PortHandle,PLPC_MESSAGE pLpcMessage) -+DEFINE_SYSCALL_ENTRYPOINT( NtListenPort, 2 ); -+NTSTATUS WINAPI SYSCALL(NtListenPort)(HANDLE PortHandle,PLPC_MESSAGE pLpcMessage) - { - FIXME("(%p,%p),stub!\n",PortHandle,pLpcMessage); - return STATUS_NOT_IMPLEMENTED; -@@ -739,7 +754,8 @@ NTSTATUS WINAPI NtListenPort(HANDLE PortHandle,PLPC_MESSAGE pLpcMessage) - * NtAcceptConnectPort [NTDLL.@] - * ZwAcceptConnectPort [NTDLL.@] - */ --NTSTATUS WINAPI NtAcceptConnectPort( -+DEFINE_SYSCALL_ENTRYPOINT( NtAcceptConnectPort, 6 ); -+NTSTATUS WINAPI SYSCALL(NtAcceptConnectPort)( - PHANDLE PortHandle, - ULONG PortIdentifier, - PLPC_MESSAGE pLpcMessage, -@@ -756,7 +772,8 @@ NTSTATUS WINAPI NtAcceptConnectPort( - * NtCompleteConnectPort [NTDLL.@] - * ZwCompleteConnectPort [NTDLL.@] - */ --NTSTATUS WINAPI NtCompleteConnectPort(HANDLE PortHandle) -+DEFINE_SYSCALL_ENTRYPOINT( NtCompleteConnectPort, 1 ); -+NTSTATUS WINAPI SYSCALL(NtCompleteConnectPort)(HANDLE PortHandle) - { - FIXME("(%p),stub!\n",PortHandle); - return STATUS_NOT_IMPLEMENTED; -@@ -766,7 +783,8 @@ NTSTATUS WINAPI NtCompleteConnectPort(HANDLE PortHandle) - * NtRegisterThreadTerminatePort [NTDLL.@] - * ZwRegisterThreadTerminatePort [NTDLL.@] - */ --NTSTATUS WINAPI NtRegisterThreadTerminatePort(HANDLE PortHandle) -+DEFINE_SYSCALL_ENTRYPOINT( NtRegisterThreadTerminatePort, 1 ); -+NTSTATUS WINAPI SYSCALL(NtRegisterThreadTerminatePort)(HANDLE PortHandle) - { - FIXME("(%p),stub!\n",PortHandle); - return STATUS_NOT_IMPLEMENTED; -@@ -776,7 +794,8 @@ NTSTATUS WINAPI NtRegisterThreadTerminatePort(HANDLE PortHandle) - * NtRequestWaitReplyPort [NTDLL.@] - * ZwRequestWaitReplyPort [NTDLL.@] - */ --NTSTATUS WINAPI NtRequestWaitReplyPort( -+DEFINE_SYSCALL_ENTRYPOINT( NtRequestWaitReplyPort, 3 ); -+NTSTATUS WINAPI SYSCALL(NtRequestWaitReplyPort)( - HANDLE PortHandle, - PLPC_MESSAGE pLpcMessageIn, - PLPC_MESSAGE pLpcMessageOut) -@@ -803,7 +822,8 @@ NTSTATUS WINAPI NtRequestWaitReplyPort( - * NtReplyWaitReceivePort [NTDLL.@] - * ZwReplyWaitReceivePort [NTDLL.@] - */ --NTSTATUS WINAPI NtReplyWaitReceivePort( -+DEFINE_SYSCALL_ENTRYPOINT( NtReplyWaitReceivePort, 4 ); -+NTSTATUS WINAPI SYSCALL(NtReplyWaitReceivePort)( - HANDLE PortHandle, - PULONG PortIdentifier, - PLPC_MESSAGE ReplyMessage, -@@ -821,7 +841,8 @@ NTSTATUS WINAPI NtReplyWaitReceivePort( - * NtSetIntervalProfile [NTDLL.@] - * ZwSetIntervalProfile [NTDLL.@] - */ --NTSTATUS WINAPI NtSetIntervalProfile( -+DEFINE_SYSCALL_ENTRYPOINT( NtSetIntervalProfile, 2 ); -+NTSTATUS WINAPI SYSCALL(NtSetIntervalProfile)( - ULONG Interval, - KPROFILE_SOURCE Source) - { -@@ -1838,7 +1859,8 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION ** - * Length size of the structure - * ResultLength Data written - */ --NTSTATUS WINAPI NtQuerySystemInformation( -+DEFINE_SYSCALL_ENTRYPOINT( NtQuerySystemInformation, 4 ); -+NTSTATUS WINAPI SYSCALL(NtQuerySystemInformation)( - IN SYSTEM_INFORMATION_CLASS SystemInformationClass, - OUT PVOID SystemInformation, - IN ULONG Length, -@@ -2405,7 +2427,8 @@ NTSTATUS WINAPI NtQuerySystemInformationEx(SYSTEM_INFORMATION_CLASS SystemInform - * NtSetSystemInformation [NTDLL.@] - * ZwSetSystemInformation [NTDLL.@] - */ --NTSTATUS WINAPI NtSetSystemInformation(SYSTEM_INFORMATION_CLASS SystemInformationClass, PVOID SystemInformation, ULONG Length) -+DEFINE_SYSCALL_ENTRYPOINT( NtSetSystemInformation, 3 ); -+NTSTATUS WINAPI SYSCALL(NtSetSystemInformation)(SYSTEM_INFORMATION_CLASS SystemInformationClass, PVOID SystemInformation, ULONG Length) - { - FIXME("(0x%08x,%p,0x%08x) stub\n",SystemInformationClass,SystemInformation,Length); - return STATUS_SUCCESS; -@@ -2415,7 +2438,8 @@ NTSTATUS WINAPI NtSetSystemInformation(SYSTEM_INFORMATION_CLASS SystemInformatio - * NtCreatePagingFile [NTDLL.@] - * ZwCreatePagingFile [NTDLL.@] - */ --NTSTATUS WINAPI NtCreatePagingFile( -+DEFINE_SYSCALL_ENTRYPOINT( NtCreatePagingFile, 4 ); -+NTSTATUS WINAPI SYSCALL(NtCreatePagingFile)( - PUNICODE_STRING PageFileName, - PLARGE_INTEGER MinimumSize, - PLARGE_INTEGER MaximumSize, -@@ -2430,7 +2454,8 @@ NTSTATUS WINAPI NtCreatePagingFile( - * - * writes a string to the nt-textmode screen eg. during startup - */ --NTSTATUS WINAPI NtDisplayString ( PUNICODE_STRING string ) -+DEFINE_SYSCALL_ENTRYPOINT( NtDisplayString, 1 ); -+NTSTATUS WINAPI SYSCALL(NtDisplayString) ( PUNICODE_STRING string ) - { - STRING stringA; - NTSTATUS ret; -@@ -2447,7 +2472,8 @@ NTSTATUS WINAPI NtDisplayString ( PUNICODE_STRING string ) - * NtInitiatePowerAction [NTDLL.@] - * - */ --NTSTATUS WINAPI NtInitiatePowerAction( -+DEFINE_SYSCALL_ENTRYPOINT( NtInitiatePowerAction, 4 ); -+NTSTATUS WINAPI SYSCALL(NtInitiatePowerAction)( - IN POWER_ACTION SystemAction, - IN SYSTEM_POWER_STATE MinSystemState, - IN ULONG Flags, -@@ -2491,7 +2517,8 @@ static ULONG mhz_from_cpuinfo(void) - * NtPowerInformation [NTDLL.@] - * - */ --NTSTATUS WINAPI NtPowerInformation( -+DEFINE_SYSCALL_ENTRYPOINT( NtPowerInformation, 5 ); -+NTSTATUS WINAPI SYSCALL(NtPowerInformation)( - IN POWER_INFORMATION_LEVEL InformationLevel, - IN PVOID lpInputBuffer, - IN ULONG nInputBufferSize, -@@ -2681,7 +2708,8 @@ NTSTATUS WINAPI NtPowerInformation( - * NtShutdownSystem [NTDLL.@] - * - */ --NTSTATUS WINAPI NtShutdownSystem(SHUTDOWN_ACTION Action) -+DEFINE_SYSCALL_ENTRYPOINT( NtShutdownSystem, 1 ); -+NTSTATUS WINAPI SYSCALL(NtShutdownSystem)(SHUTDOWN_ACTION Action) - { - FIXME("%d\n",Action); - return STATUS_SUCCESS; -@@ -2690,7 +2718,8 @@ NTSTATUS WINAPI NtShutdownSystem(SHUTDOWN_ACTION Action) - /****************************************************************************** - * NtAllocateLocallyUniqueId (NTDLL.@) - */ --NTSTATUS WINAPI NtAllocateLocallyUniqueId(PLUID Luid) -+DEFINE_SYSCALL_ENTRYPOINT( NtAllocateLocallyUniqueId, 1 ); -+NTSTATUS WINAPI SYSCALL(NtAllocateLocallyUniqueId)(PLUID Luid) - { - NTSTATUS status; - -@@ -2748,7 +2777,8 @@ ULONGLONG WINAPI VerSetConditionMask( ULONGLONG dwlConditionMask, DWORD dwTypeBi - * NtAccessCheckAndAuditAlarm (NTDLL.@) - * ZwAccessCheckAndAuditAlarm (NTDLL.@) - */ --NTSTATUS WINAPI NtAccessCheckAndAuditAlarm(PUNICODE_STRING SubsystemName, HANDLE HandleId, PUNICODE_STRING ObjectTypeName, -+DEFINE_SYSCALL_ENTRYPOINT( NtAccessCheckAndAuditAlarm, 11 ); -+NTSTATUS WINAPI SYSCALL(NtAccessCheckAndAuditAlarm)(PUNICODE_STRING SubsystemName, HANDLE HandleId, PUNICODE_STRING ObjectTypeName, - PUNICODE_STRING ObjectName, PSECURITY_DESCRIPTOR SecurityDescriptor, - ACCESS_MASK DesiredAccess, PGENERIC_MAPPING GenericMapping, BOOLEAN ObjectCreation, - PACCESS_MASK GrantedAccess, PBOOLEAN AccessStatus, PBOOLEAN GenerateOnClose) -@@ -2764,7 +2794,8 @@ NTSTATUS WINAPI NtAccessCheckAndAuditAlarm(PUNICODE_STRING SubsystemName, HANDLE - * NtSystemDebugControl (NTDLL.@) - * ZwSystemDebugControl (NTDLL.@) - */ --NTSTATUS WINAPI NtSystemDebugControl(SYSDBG_COMMAND command, PVOID inbuffer, ULONG inbuflength, PVOID outbuffer, -+DEFINE_SYSCALL_ENTRYPOINT( NtSystemDebugControl, 6 ); -+NTSTATUS WINAPI SYSCALL(NtSystemDebugControl)(SYSDBG_COMMAND command, PVOID inbuffer, ULONG inbuflength, PVOID outbuffer, - ULONG outbuflength, PULONG retlength) - { - FIXME("(%d, %p, %d, %p, %d, %p), stub\n", command, inbuffer, inbuflength, outbuffer, outbuflength, retlength); -diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h -index 5e4c39e..d0ed679 100644 ---- a/dlls/ntdll/ntdll_misc.h -+++ b/dlls/ntdll/ntdll_misc.h -@@ -260,6 +260,23 @@ extern HANDLE keyed_event DECLSPEC_HIDDEN; - "ret $(4*" #args ")" ) /* fake ret to make copy protections happy */ - #endif - -+#if defined(__i386__) -+ -+#define SYSCALL( name ) __syscall_ ## name -+#define DEFINE_SYSCALL_ENTRYPOINT( name, args ) \ -+ __ASM_GLOBAL_FUNC( name, \ -+ "movl $" __ASM_NAME("__syscall_") #name ",%eax\n\t" \ -+ "movl $" __ASM_NAME("call_syscall_func") ",%edx\n\t" \ -+ "call *%edx\n\t" \ -+ "ret $(4*" #args ")" ) -+ -+#else /* defined(__i386__) */ -+ -+#define SYSCALL( name ) name -+#define DEFINE_SYSCALL_ENTRYPOINT( name, args ) /* nothing */ -+ -+#endif /* defined(__i386__) */ -+ - #define HASH_STRING_ALGORITHM_DEFAULT 0 - #define HASH_STRING_ALGORITHM_X65599 1 - #define HASH_STRING_ALGORITHM_INVALID 0xffffffff -diff --git a/dlls/ntdll/om.c b/dlls/ntdll/om.c -index 1279f2b..75653bf 100644 ---- a/dlls/ntdll/om.c -+++ b/dlls/ntdll/om.c -@@ -50,7 +50,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(ntdll); - * NtQueryObject [NTDLL.@] - * ZwQueryObject [NTDLL.@] - */ --NTSTATUS WINAPI NtQueryObject(IN HANDLE handle, -+DEFINE_SYSCALL_ENTRYPOINT( NtQueryObject, 5 ); -+NTSTATUS WINAPI SYSCALL(NtQueryObject)(IN HANDLE handle, - IN OBJECT_INFORMATION_CLASS info_class, - OUT PVOID ptr, IN ULONG len, OUT PULONG used_len) - { -@@ -221,7 +222,8 @@ NTSTATUS WINAPI NtQueryObject(IN HANDLE handle, - * ZwSetInformationObject [NTDLL.@] - * - */ --NTSTATUS WINAPI NtSetInformationObject(IN HANDLE handle, -+DEFINE_SYSCALL_ENTRYPOINT( NtSetInformationObject, 4 ); -+NTSTATUS WINAPI SYSCALL(NtSetInformationObject)(IN HANDLE handle, - IN OBJECT_INFORMATION_CLASS info_class, - IN PVOID ptr, IN ULONG len) - { -@@ -263,8 +265,9 @@ NTSTATUS WINAPI NtSetInformationObject(IN HANDLE handle, - * An ntdll analogue to GetKernelObjectSecurity(). - * - */ -+DEFINE_SYSCALL_ENTRYPOINT( NtQuerySecurityObject, 5 ); - NTSTATUS WINAPI --NtQuerySecurityObject( -+SYSCALL(NtQuerySecurityObject)( - IN HANDLE Object, - IN SECURITY_INFORMATION RequestedInformation, - OUT PSECURITY_DESCRIPTOR pSecurityDescriptor, -@@ -349,7 +352,8 @@ NtQuerySecurityObject( - * NtDuplicateObject [NTDLL.@] - * ZwDuplicateObject [NTDLL.@] - */ --NTSTATUS WINAPI NtDuplicateObject( HANDLE source_process, HANDLE source, -+DEFINE_SYSCALL_ENTRYPOINT( NtDuplicateObject, 7 ); -+NTSTATUS WINAPI SYSCALL(NtDuplicateObject)( HANDLE source_process, HANDLE source, - HANDLE dest_process, PHANDLE dest, - ACCESS_MASK access, ULONG attributes, ULONG options ) - { -@@ -405,7 +409,8 @@ NTSTATUS close_handle( HANDLE handle ) - * Success: ERROR_SUCCESS. - * Failure: An NTSTATUS error code. - */ --NTSTATUS WINAPI NtClose( HANDLE Handle ) -+DEFINE_SYSCALL_ENTRYPOINT( NtClose, 1 ); -+NTSTATUS WINAPI SYSCALL(NtClose)( HANDLE Handle ) - { - return close_handle( Handle ); - } -@@ -429,7 +434,8 @@ NTSTATUS WINAPI NtClose( HANDLE Handle ) - * Success: ERROR_SUCCESS. - * Failure: An NTSTATUS error code. - */ --NTSTATUS WINAPI NtOpenDirectoryObject( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr) -+DEFINE_SYSCALL_ENTRYPOINT( NtOpenDirectoryObject, 3 ); -+NTSTATUS WINAPI SYSCALL(NtOpenDirectoryObject)( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr) - { - NTSTATUS ret; - -@@ -467,7 +473,8 @@ NTSTATUS WINAPI NtOpenDirectoryObject( HANDLE *handle, ACCESS_MASK access, const - * Success: ERROR_SUCCESS. - * Failure: An NTSTATUS error code. - */ --NTSTATUS WINAPI NtCreateDirectoryObject(PHANDLE DirectoryHandle, ACCESS_MASK DesiredAccess, -+DEFINE_SYSCALL_ENTRYPOINT( NtCreateDirectoryObject, 3 ); -+NTSTATUS WINAPI SYSCALL(NtCreateDirectoryObject)(PHANDLE DirectoryHandle, ACCESS_MASK DesiredAccess, - OBJECT_ATTRIBUTES *attr ) - { - NTSTATUS ret; -@@ -511,7 +518,8 @@ NTSTATUS WINAPI NtCreateDirectoryObject(PHANDLE DirectoryHandle, ACCESS_MASK Des - * Success: ERROR_SUCCESS. - * Failure: An NTSTATUS error code. - */ --NTSTATUS WINAPI NtQueryDirectoryObject(HANDLE handle, PDIRECTORY_BASIC_INFORMATION buffer, -+DEFINE_SYSCALL_ENTRYPOINT( NtQueryDirectoryObject, 7 ); -+NTSTATUS WINAPI SYSCALL(NtQueryDirectoryObject)(HANDLE handle, PDIRECTORY_BASIC_INFORMATION buffer, - ULONG size, BOOLEAN single_entry, BOOLEAN restart, - PULONG context, PULONG ret_size) - { -@@ -576,7 +584,8 @@ NTSTATUS WINAPI NtQueryDirectoryObject(HANDLE handle, PDIRECTORY_BASIC_INFORMATI - * Success: ERROR_SUCCESS. - * Failure: An NTSTATUS error code. - */ --NTSTATUS WINAPI NtOpenSymbolicLinkObject( HANDLE *handle, ACCESS_MASK access, -+DEFINE_SYSCALL_ENTRYPOINT( NtOpenSymbolicLinkObject, 3 ); -+NTSTATUS WINAPI SYSCALL(NtOpenSymbolicLinkObject)( HANDLE *handle, ACCESS_MASK access, - const OBJECT_ATTRIBUTES *attr) - { - NTSTATUS ret; -@@ -616,7 +625,8 @@ NTSTATUS WINAPI NtOpenSymbolicLinkObject( HANDLE *handle, ACCESS_MASK access, - * Success: ERROR_SUCCESS. - * Failure: An NTSTATUS error code. - */ --NTSTATUS WINAPI NtCreateSymbolicLinkObject(OUT PHANDLE SymbolicLinkHandle,IN ACCESS_MASK DesiredAccess, -+DEFINE_SYSCALL_ENTRYPOINT( NtCreateSymbolicLinkObject, 4 ); -+NTSTATUS WINAPI SYSCALL(NtCreateSymbolicLinkObject)(OUT PHANDLE SymbolicLinkHandle,IN ACCESS_MASK DesiredAccess, - POBJECT_ATTRIBUTES attr, PUNICODE_STRING TargetName) - { - NTSTATUS ret; -@@ -660,7 +670,8 @@ NTSTATUS WINAPI NtCreateSymbolicLinkObject(OUT PHANDLE SymbolicLinkHandle,IN ACC - * Success: ERROR_SUCCESS. - * Failure: An NTSTATUS error code. - */ --NTSTATUS WINAPI NtQuerySymbolicLinkObject( HANDLE handle, PUNICODE_STRING target, PULONG length ) -+DEFINE_SYSCALL_ENTRYPOINT( NtQuerySymbolicLinkObject, 3 ); -+NTSTATUS WINAPI SYSCALL(NtQuerySymbolicLinkObject)( HANDLE handle, PUNICODE_STRING target, PULONG length ) - { - NTSTATUS ret; - -@@ -688,7 +699,8 @@ NTSTATUS WINAPI NtQuerySymbolicLinkObject( HANDLE handle, PUNICODE_STRING target - /****************************************************************************** - * NtAllocateUuids [NTDLL.@] - */ --NTSTATUS WINAPI NtAllocateUuids( -+DEFINE_SYSCALL_ENTRYPOINT( NtAllocateUuids, 3 ); -+NTSTATUS WINAPI SYSCALL(NtAllocateUuids)( - PULARGE_INTEGER Time, - PULONG Range, - PULONG Sequence) -@@ -710,7 +722,8 @@ NTSTATUS WINAPI NtAllocateUuids( - * Success: STATUS_SUCCESS. - * Failure: An NTSTATUS error code. - */ --NTSTATUS WINAPI NtMakeTemporaryObject( HANDLE Handle ) -+DEFINE_SYSCALL_ENTRYPOINT( NtMakeTemporaryObject, 1 ); -+NTSTATUS WINAPI SYSCALL(NtMakeTemporaryObject)( HANDLE Handle ) - { - FIXME("(%p), stub.\n", Handle); - return STATUS_SUCCESS; -diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c -index a93b8fb..231d305 100644 ---- a/dlls/ntdll/process.c -+++ b/dlls/ntdll/process.c -@@ -57,7 +57,8 @@ static ULONG execute_flags = MEM_EXECUTE_OPTION_DISABLE; - * - * Native applications must kill themselves when done - */ --NTSTATUS WINAPI NtTerminateProcess( HANDLE handle, LONG exit_code ) -+DEFINE_SYSCALL_ENTRYPOINT( NtTerminateProcess, 2 ); -+NTSTATUS WINAPI SYSCALL(NtTerminateProcess)( HANDLE handle, LONG exit_code ) - { - NTSTATUS ret; - BOOL self; -@@ -145,7 +146,8 @@ static void fill_VM_COUNTERS(VM_COUNTERS* pvmi) - * ZwQueryInformationProcess [NTDLL.@] - * - */ --NTSTATUS WINAPI NtQueryInformationProcess( -+DEFINE_SYSCALL_ENTRYPOINT( NtQueryInformationProcess, 5 ); -+NTSTATUS WINAPI SYSCALL(NtQueryInformationProcess)( - IN HANDLE ProcessHandle, - IN PROCESSINFOCLASS ProcessInformationClass, - OUT PVOID ProcessInformation, -@@ -515,7 +517,8 @@ NTSTATUS WINAPI NtQueryInformationProcess( - * NtSetInformationProcess [NTDLL.@] - * ZwSetInformationProcess [NTDLL.@] - */ --NTSTATUS WINAPI NtSetInformationProcess( -+DEFINE_SYSCALL_ENTRYPOINT( NtSetInformationProcess, 4 ); -+NTSTATUS WINAPI SYSCALL(NtSetInformationProcess)( - IN HANDLE ProcessHandle, - IN PROCESSINFOCLASS ProcessInformationClass, - IN PVOID ProcessInformation, -@@ -605,7 +608,8 @@ NTSTATUS WINAPI NtSetInformationProcess( - * NtFlushInstructionCache [NTDLL.@] - * ZwFlushInstructionCache [NTDLL.@] - */ --NTSTATUS WINAPI NtFlushInstructionCache( -+DEFINE_SYSCALL_ENTRYPOINT( NtFlushInstructionCache, 3 ); -+NTSTATUS WINAPI SYSCALL(NtFlushInstructionCache)( - IN HANDLE ProcessHandle, - IN LPCVOID BaseAddress, - IN SIZE_T Size) -@@ -626,7 +630,8 @@ NTSTATUS WINAPI NtFlushInstructionCache( - * NtOpenProcess [NTDLL.@] - * ZwOpenProcess [NTDLL.@] - */ --NTSTATUS WINAPI NtOpenProcess(PHANDLE handle, ACCESS_MASK access, -+DEFINE_SYSCALL_ENTRYPOINT( NtOpenProcess, 4 ); -+NTSTATUS WINAPI SYSCALL(NtOpenProcess)(PHANDLE handle, ACCESS_MASK access, - const OBJECT_ATTRIBUTES* attr, const CLIENT_ID* cid) - { - NTSTATUS status; -diff --git a/dlls/ntdll/reg.c b/dlls/ntdll/reg.c -index 8af2181..8a7e77c 100644 ---- a/dlls/ntdll/reg.c -+++ b/dlls/ntdll/reg.c -@@ -49,7 +49,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(reg); - * NtCreateKey [NTDLL.@] - * ZwCreateKey [NTDLL.@] - */ --NTSTATUS WINAPI NtCreateKey( PHANDLE retkey, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, -+DEFINE_SYSCALL_ENTRYPOINT( NtCreateKey, 7 ); -+NTSTATUS WINAPI SYSCALL(NtCreateKey)( PHANDLE retkey, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, - ULONG TitleIndex, const UNICODE_STRING *class, ULONG options, - PULONG dispos ) - { -@@ -84,7 +85,8 @@ NTSTATUS WINAPI NtCreateKey( PHANDLE retkey, ACCESS_MASK access, const OBJECT_AT - return ret; - } - --NTSTATUS WINAPI NtCreateKeyTransacted( PHANDLE retkey, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, -+DEFINE_SYSCALL_ENTRYPOINT( NtCreateKeyTransacted, 8 ); -+NTSTATUS WINAPI SYSCALL(NtCreateKeyTransacted)( PHANDLE retkey, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, - ULONG TitleIndex, const UNICODE_STRING *class, ULONG options, - HANDLE transacted, ULONG *dispos ) - { -@@ -93,7 +95,8 @@ NTSTATUS WINAPI NtCreateKeyTransacted( PHANDLE retkey, ACCESS_MASK access, const - return STATUS_NOT_IMPLEMENTED; - } - --NTSTATUS WINAPI NtRenameKey( HANDLE handle, UNICODE_STRING *name ) -+DEFINE_SYSCALL_ENTRYPOINT( NtRenameKey, 2 ); -+NTSTATUS WINAPI SYSCALL(NtRenameKey)( HANDLE handle, UNICODE_STRING *name ) - { - FIXME( "(%p %s)\n", handle, debugstr_us(name) ); - return STATUS_NOT_IMPLEMENTED; -@@ -150,7 +153,8 @@ static NTSTATUS open_key( PHANDLE retkey, ACCESS_MASK access, const OBJECT_ATTRI - * NtOpenKeyEx [NTDLL.@] - * ZwOpenKeyEx [NTDLL.@] - */ --NTSTATUS WINAPI NtOpenKeyEx( PHANDLE retkey, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, ULONG options ) -+DEFINE_SYSCALL_ENTRYPOINT( NtOpenKeyEx, 4 ); -+NTSTATUS WINAPI SYSCALL(NtOpenKeyEx)( PHANDLE retkey, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, ULONG options ) - { - return open_key( retkey, access, attr, options ); - } -@@ -163,19 +167,22 @@ NTSTATUS WINAPI NtOpenKeyEx( PHANDLE retkey, ACCESS_MASK access, const OBJECT_AT - * IN ACCESS_MASK access - * IN POBJECT_ATTRIBUTES attr - */ --NTSTATUS WINAPI NtOpenKey( PHANDLE retkey, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) -+DEFINE_SYSCALL_ENTRYPOINT( NtOpenKey, 3 ); -+NTSTATUS WINAPI SYSCALL(NtOpenKey)( PHANDLE retkey, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) - { - return open_key( retkey, access, attr, 0 ); - } - --NTSTATUS WINAPI NtOpenKeyTransactedEx( PHANDLE retkey, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, -+DEFINE_SYSCALL_ENTRYPOINT( NtOpenKeyTransactedEx, 5 ); -+NTSTATUS WINAPI SYSCALL(NtOpenKeyTransactedEx)( PHANDLE retkey, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, - ULONG options, HANDLE transaction ) - { - FIXME( "(%p %x %p %x %p)\n", retkey, access, attr, options, transaction ); - return STATUS_NOT_IMPLEMENTED; - } - --NTSTATUS WINAPI NtOpenKeyTransacted( PHANDLE retkey, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, -+DEFINE_SYSCALL_ENTRYPOINT( NtOpenKeyTransacted, 4 ); -+NTSTATUS WINAPI SYSCALL(NtOpenKeyTransacted)( PHANDLE retkey, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, - HANDLE transaction ) - { - return NtOpenKeyTransactedEx( retkey, access, attr, 0, transaction ); -@@ -197,7 +204,8 @@ NTSTATUS WINAPI RtlpNtOpenKey( PHANDLE retkey, ACCESS_MASK access, OBJECT_ATTRIB - * NtDeleteKey [NTDLL.@] - * ZwDeleteKey [NTDLL.@] - */ --NTSTATUS WINAPI NtDeleteKey( HANDLE hkey ) -+DEFINE_SYSCALL_ENTRYPOINT( NtDeleteKey, 1 ); -+NTSTATUS WINAPI SYSCALL(NtDeleteKey)( HANDLE hkey ) - { - NTSTATUS ret; - -@@ -226,7 +234,8 @@ NTSTATUS WINAPI RtlpNtMakeTemporaryKey( HANDLE hkey ) - * NtDeleteValueKey [NTDLL.@] - * ZwDeleteValueKey [NTDLL.@] - */ --NTSTATUS WINAPI NtDeleteValueKey( HANDLE hkey, const UNICODE_STRING *name ) -+DEFINE_SYSCALL_ENTRYPOINT( NtDeleteValueKey, 2 ); -+NTSTATUS WINAPI SYSCALL(NtDeleteValueKey)( HANDLE hkey, const UNICODE_STRING *name ) - { - NTSTATUS ret; - -@@ -370,7 +379,8 @@ static NTSTATUS enumerate_key( HANDLE handle, int index, KEY_INFORMATION_CLASS i - * NOTES - * the name copied into the buffer is NOT 0-terminated - */ --NTSTATUS WINAPI NtEnumerateKey( HANDLE handle, ULONG index, KEY_INFORMATION_CLASS info_class, -+DEFINE_SYSCALL_ENTRYPOINT( NtEnumerateKey, 6 ); -+NTSTATUS WINAPI SYSCALL(NtEnumerateKey)( HANDLE handle, ULONG index, KEY_INFORMATION_CLASS info_class, - void *info, DWORD length, DWORD *result_len ) - { - /* -1 means query key, so avoid it here */ -@@ -429,7 +439,8 @@ NTSTATUS WINAPI RtlpNtEnumerateSubKey( HANDLE handle, UNICODE_STRING *out, ULONG - * NtQueryKey [NTDLL.@] - * ZwQueryKey [NTDLL.@] - */ --NTSTATUS WINAPI NtQueryKey( HANDLE handle, KEY_INFORMATION_CLASS info_class, -+DEFINE_SYSCALL_ENTRYPOINT( NtQueryKey, 5 ); -+NTSTATUS WINAPI SYSCALL(NtQueryKey)( HANDLE handle, KEY_INFORMATION_CLASS info_class, - void *info, DWORD length, DWORD *result_len ) - { - return enumerate_key( handle, -1, info_class, info, length, result_len ); -@@ -484,7 +495,8 @@ static void copy_key_value_info( KEY_VALUE_INFORMATION_CLASS info_class, void *i - * NtEnumerateValueKey [NTDLL.@] - * ZwEnumerateValueKey [NTDLL.@] - */ --NTSTATUS WINAPI NtEnumerateValueKey( HANDLE handle, ULONG index, -+DEFINE_SYSCALL_ENTRYPOINT( NtEnumerateValueKey, 6 ); -+NTSTATUS WINAPI SYSCALL(NtEnumerateValueKey)( HANDLE handle, ULONG index, - KEY_VALUE_INFORMATION_CLASS info_class, - void *info, DWORD length, DWORD *result_len ) - { -@@ -532,7 +544,8 @@ NTSTATUS WINAPI NtEnumerateValueKey( HANDLE handle, ULONG index, - * NOTES - * the name in the KeyValueInformation is never set - */ --NTSTATUS WINAPI NtQueryValueKey( HANDLE handle, const UNICODE_STRING *name, -+DEFINE_SYSCALL_ENTRYPOINT( NtQueryValueKey, 6 ); -+NTSTATUS WINAPI SYSCALL(NtQueryValueKey)( HANDLE handle, const UNICODE_STRING *name, - KEY_VALUE_INFORMATION_CLASS info_class, - void *info, DWORD length, DWORD *result_len ) - { -@@ -634,7 +647,8 @@ NTSTATUS WINAPI RtlpNtQueryValueKey( HANDLE handle, ULONG *result_type, PBYTE de - * NtFlushKey [NTDLL.@] - * ZwFlushKey [NTDLL.@] - */ --NTSTATUS WINAPI NtFlushKey(HANDLE key) -+DEFINE_SYSCALL_ENTRYPOINT( NtFlushKey, 1 ); -+NTSTATUS WINAPI SYSCALL(NtFlushKey)(HANDLE key) - { - NTSTATUS ret; - -@@ -654,7 +668,8 @@ NTSTATUS WINAPI NtFlushKey(HANDLE key) - * NtLoadKey [NTDLL.@] - * ZwLoadKey [NTDLL.@] - */ --NTSTATUS WINAPI NtLoadKey( const OBJECT_ATTRIBUTES *attr, OBJECT_ATTRIBUTES *file ) -+DEFINE_SYSCALL_ENTRYPOINT( NtLoadKey, 2 ); -+NTSTATUS WINAPI SYSCALL(NtLoadKey)( const OBJECT_ATTRIBUTES *attr, OBJECT_ATTRIBUTES *file ) - { - NTSTATUS ret; - HANDLE hive; -@@ -687,7 +702,8 @@ NTSTATUS WINAPI NtLoadKey( const OBJECT_ATTRIBUTES *attr, OBJECT_ATTRIBUTES *fil - * NtNotifyChangeMultipleKeys [NTDLL.@] - * ZwNotifyChangeMultipleKeys [NTDLL.@] - */ --NTSTATUS WINAPI NtNotifyChangeMultipleKeys( -+DEFINE_SYSCALL_ENTRYPOINT( NtNotifyChangeMultipleKeys, 12 ); -+NTSTATUS WINAPI SYSCALL(NtNotifyChangeMultipleKeys)( - HANDLE KeyHandle, - ULONG Count, - OBJECT_ATTRIBUTES *SubordinateObjects, -@@ -743,7 +759,8 @@ NTSTATUS WINAPI NtNotifyChangeMultipleKeys( - * NtNotifyChangeKey [NTDLL.@] - * ZwNotifyChangeKey [NTDLL.@] - */ --NTSTATUS WINAPI NtNotifyChangeKey( -+DEFINE_SYSCALL_ENTRYPOINT( NtNotifyChangeKey, 10 ); -+NTSTATUS WINAPI SYSCALL(NtNotifyChangeKey)( - IN HANDLE KeyHandle, - IN HANDLE Event, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, -@@ -765,7 +782,8 @@ NTSTATUS WINAPI NtNotifyChangeKey( - * ZwQueryMultipleValueKey - */ - --NTSTATUS WINAPI NtQueryMultipleValueKey( -+DEFINE_SYSCALL_ENTRYPOINT( NtQueryMultipleValueKey, 6 ); -+NTSTATUS WINAPI SYSCALL(NtQueryMultipleValueKey)( - HANDLE KeyHandle, - PKEY_MULTIPLE_VALUE_INFORMATION ListOfValuesToQuery, - ULONG NumberOfItems, -@@ -783,7 +801,8 @@ NTSTATUS WINAPI NtQueryMultipleValueKey( - * NtReplaceKey [NTDLL.@] - * ZwReplaceKey [NTDLL.@] - */ --NTSTATUS WINAPI NtReplaceKey( -+DEFINE_SYSCALL_ENTRYPOINT( NtReplaceKey, 3 ); -+NTSTATUS WINAPI SYSCALL(NtReplaceKey)( - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN HANDLE Key, - IN POBJECT_ATTRIBUTES ReplacedObjectAttributes) -@@ -796,7 +815,8 @@ NTSTATUS WINAPI NtReplaceKey( - * NtRestoreKey [NTDLL.@] - * ZwRestoreKey [NTDLL.@] - */ --NTSTATUS WINAPI NtRestoreKey( -+DEFINE_SYSCALL_ENTRYPOINT( NtRestoreKey, 3 ); -+NTSTATUS WINAPI SYSCALL(NtRestoreKey)( - HANDLE KeyHandle, - HANDLE FileHandle, - ULONG RestoreFlags) -@@ -809,7 +829,8 @@ NTSTATUS WINAPI NtRestoreKey( - * NtSaveKey [NTDLL.@] - * ZwSaveKey [NTDLL.@] - */ --NTSTATUS WINAPI NtSaveKey(IN HANDLE KeyHandle, IN HANDLE FileHandle) -+DEFINE_SYSCALL_ENTRYPOINT( NtSaveKey, 2 ); -+NTSTATUS WINAPI SYSCALL(NtSaveKey)(IN HANDLE KeyHandle, IN HANDLE FileHandle) - { - NTSTATUS ret; - -@@ -829,7 +850,8 @@ NTSTATUS WINAPI NtSaveKey(IN HANDLE KeyHandle, IN HANDLE FileHandle) - * NtSetInformationKey [NTDLL.@] - * ZwSetInformationKey [NTDLL.@] - */ --NTSTATUS WINAPI NtSetInformationKey( -+DEFINE_SYSCALL_ENTRYPOINT( NtSetInformationKey, 4 ); -+NTSTATUS WINAPI SYSCALL(NtSetInformationKey)( - IN HANDLE KeyHandle, - IN const int KeyInformationClass, - IN PVOID KeyInformation, -@@ -849,7 +871,8 @@ NTSTATUS WINAPI NtSetInformationKey( - * win95 does not care about count for REG_SZ and finds out the len by itself (js) - * NT does definitely care (aj) - */ --NTSTATUS WINAPI NtSetValueKey( HANDLE hkey, const UNICODE_STRING *name, ULONG TitleIndex, -+DEFINE_SYSCALL_ENTRYPOINT( NtSetValueKey, 6 ); -+NTSTATUS WINAPI SYSCALL(NtSetValueKey)( HANDLE hkey, const UNICODE_STRING *name, ULONG TitleIndex, - ULONG type, const void *data, ULONG count ) - { - NTSTATUS ret; -@@ -888,7 +911,8 @@ NTSTATUS WINAPI RtlpNtSetValueKey( HANDLE hkey, ULONG type, const void *data, - * NtUnloadKey [NTDLL.@] - * ZwUnloadKey [NTDLL.@] - */ --NTSTATUS WINAPI NtUnloadKey(IN POBJECT_ATTRIBUTES attr) -+DEFINE_SYSCALL_ENTRYPOINT( NtUnloadKey, 1 ); -+NTSTATUS WINAPI SYSCALL(NtUnloadKey)(IN POBJECT_ATTRIBUTES attr) - { - NTSTATUS ret; - -@@ -1495,7 +1519,8 @@ NTSTATUS WINAPI RtlWriteRegistryValue( ULONG RelativeTo, PCWSTR path, PCWSTR nam - * unless there is some app which explicitly depends on that, there is - * no good reason to reproduce that. - */ --NTSTATUS WINAPI NtQueryLicenseValue( const UNICODE_STRING *name, ULONG *result_type, -+DEFINE_SYSCALL_ENTRYPOINT( NtQueryLicenseValue, 5 ); -+NTSTATUS WINAPI SYSCALL(NtQueryLicenseValue)( const UNICODE_STRING *name, ULONG *result_type, - PVOID data, ULONG length, ULONG *result_len ) - { - static const WCHAR LicenseInformationW[] = {'M','a','c','h','i','n','e','\\', -diff --git a/dlls/ntdll/resource.c b/dlls/ntdll/resource.c -index 9635bb0..473e965 100644 ---- a/dlls/ntdll/resource.c -+++ b/dlls/ntdll/resource.c -@@ -40,6 +40,7 @@ - #include "winbase.h" - #include "winnt.h" - #include "winternl.h" -+#include "ntdll_misc.h" - #include "wine/exception.h" - #include "wine/unicode.h" - #include "wine/debug.h" -@@ -454,7 +455,8 @@ NTSTATUS WINAPI RtlFormatMessage( LPWSTR Message, UCHAR MaxWidth, - /********************************************************************** - * NtQueryDefaultLocale (NTDLL.@) - */ --NTSTATUS WINAPI NtQueryDefaultLocale( BOOLEAN user, LCID *lcid ) -+DEFINE_SYSCALL_ENTRYPOINT( NtQueryDefaultLocale, 2 ); -+NTSTATUS WINAPI SYSCALL(NtQueryDefaultLocale)( BOOLEAN user, LCID *lcid ) - { - *lcid = user ? user_lcid : system_lcid; - return STATUS_SUCCESS; -@@ -464,7 +466,8 @@ NTSTATUS WINAPI NtQueryDefaultLocale( BOOLEAN user, LCID *lcid ) - /********************************************************************** - * NtSetDefaultLocale (NTDLL.@) - */ --NTSTATUS WINAPI NtSetDefaultLocale( BOOLEAN user, LCID lcid ) -+DEFINE_SYSCALL_ENTRYPOINT( NtSetDefaultLocale, 2 ); -+NTSTATUS WINAPI SYSCALL(NtSetDefaultLocale)( BOOLEAN user, LCID lcid ) - { - if (user) user_lcid = lcid; - else -@@ -479,7 +482,8 @@ NTSTATUS WINAPI NtSetDefaultLocale( BOOLEAN user, LCID lcid ) - /********************************************************************** - * NtQueryDefaultUILanguage (NTDLL.@) - */ --NTSTATUS WINAPI NtQueryDefaultUILanguage( LANGID *lang ) -+DEFINE_SYSCALL_ENTRYPOINT( NtQueryDefaultUILanguage, 1 ); -+NTSTATUS WINAPI SYSCALL(NtQueryDefaultUILanguage)( LANGID *lang ) - { - *lang = user_ui_language; - return STATUS_SUCCESS; -@@ -489,7 +493,8 @@ NTSTATUS WINAPI NtQueryDefaultUILanguage( LANGID *lang ) - /********************************************************************** - * NtSetDefaultUILanguage (NTDLL.@) - */ --NTSTATUS WINAPI NtSetDefaultUILanguage( LANGID lang ) -+DEFINE_SYSCALL_ENTRYPOINT( NtSetDefaultUILanguage, 1 ); -+NTSTATUS WINAPI SYSCALL(NtSetDefaultUILanguage)( LANGID lang ) - { - user_ui_language = lang; - return STATUS_SUCCESS; -@@ -499,7 +504,8 @@ NTSTATUS WINAPI NtSetDefaultUILanguage( LANGID lang ) - /********************************************************************** - * NtQueryInstallUILanguage (NTDLL.@) - */ --NTSTATUS WINAPI NtQueryInstallUILanguage( LANGID *lang ) -+DEFINE_SYSCALL_ENTRYPOINT( NtQueryInstallUILanguage, 1 ); -+NTSTATUS WINAPI SYSCALL(NtQueryInstallUILanguage)( LANGID *lang ) - { - *lang = system_ui_language; - return STATUS_SUCCESS; -diff --git a/dlls/ntdll/sec.c b/dlls/ntdll/sec.c -index 125c86e..b778c9e 100644 ---- a/dlls/ntdll/sec.c -+++ b/dlls/ntdll/sec.c -@@ -1535,8 +1535,9 @@ RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL ImpersonationLevel) - /****************************************************************************** - * NtImpersonateAnonymousToken [NTDLL.@] - */ -+DEFINE_SYSCALL_ENTRYPOINT( NtImpersonateAnonymousToken, 1 ); - NTSTATUS WINAPI --NtImpersonateAnonymousToken(HANDLE thread) -+SYSCALL(NtImpersonateAnonymousToken)(HANDLE thread) - { - FIXME("(%p): stub\n", thread); - return STATUS_NOT_IMPLEMENTED; -@@ -1569,8 +1570,9 @@ NtImpersonateAnonymousToken(HANDLE thread) - * The SecurityDescriptor must have a valid owner and groups present, - * otherwise the function will fail. - */ -+DEFINE_SYSCALL_ENTRYPOINT( NtAccessCheck, 8 ); - NTSTATUS WINAPI --NtAccessCheck( -+SYSCALL(NtAccessCheck)( - PSECURITY_DESCRIPTOR SecurityDescriptor, - HANDLE ClientToken, - ACCESS_MASK DesiredAccess, -@@ -1658,7 +1660,8 @@ NtAccessCheck( - * NTSTATUS code. - * - */ --NTSTATUS WINAPI NtSetSecurityObject(HANDLE Handle, -+DEFINE_SYSCALL_ENTRYPOINT( NtSetSecurityObject, 3 ); -+NTSTATUS WINAPI SYSCALL(NtSetSecurityObject)(HANDLE Handle, - SECURITY_INFORMATION SecurityInformation, - PSECURITY_DESCRIPTOR SecurityDescriptor) - { -diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c -index 1f6da96..10e06e0 100644 ---- a/dlls/ntdll/signal_arm.c -+++ b/dlls/ntdll/signal_arm.c -@@ -1122,7 +1122,8 @@ void WINAPI RtlUnwind( void *endframe, void *target_ip, EXCEPTION_RECORD *rec, v - /******************************************************************* - * NtRaiseException (NTDLL.@) - */ --NTSTATUS WINAPI NtRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_chance ) -+DEFINE_SYSCALL_ENTRYPOINT( NtRaiseException, 3 ); -+NTSTATUS WINAPI SYSCALL(NtRaiseException)( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_chance ) - { - NTSTATUS status = raise_exception( rec, context, first_chance ); - if (status == STATUS_SUCCESS) NtSetContextThread( GetCurrentThread(), context ); -diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c -index 3a41c84..905e7cc 100644 ---- a/dlls/ntdll/signal_arm64.c -+++ b/dlls/ntdll/signal_arm64.c -@@ -866,7 +866,8 @@ void WINAPI RtlUnwind( PVOID pEndFrame, PVOID targetIp, PEXCEPTION_RECORD pRecor - /******************************************************************* - * NtRaiseException (NTDLL.@) - */ --NTSTATUS WINAPI NtRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_chance ) -+DEFINE_SYSCALL_ENTRYPOINT( NtRaiseException, 3 ); -+NTSTATUS WINAPI SYSCALL(NtRaiseException)( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_chance ) - { - NTSTATUS status = raise_exception( rec, context, first_chance ); - if (status == STATUS_SUCCESS) NtSetContextThread( GetCurrentThread(), context ); -diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c -index a3abbff..839f793 100644 ---- a/dlls/ntdll/signal_i386.c -+++ b/dlls/ntdll/signal_i386.c -@@ -2598,7 +2598,8 @@ DEFINE_REGS_ENTRYPOINT( RtlUnwind, 4 ) - /******************************************************************* - * NtRaiseException (NTDLL.@) - */ --NTSTATUS WINAPI NtRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_chance ) -+DEFINE_SYSCALL_ENTRYPOINT( NtRaiseException, 3 ); -+NTSTATUS WINAPI SYSCALL(NtRaiseException)( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_chance ) - { - NTSTATUS status = raise_exception( rec, context, first_chance ); - if (status == STATUS_SUCCESS) -@@ -2837,4 +2838,12 @@ __ASM_GLOBAL_FUNC(call_exception_handler, - __ASM_CFI(".cfi_same_value %ebp\n\t") - "ret $20" ) /* (*4) */ - -+/********************************************************************** -+ * call_syscall_func (internal) -+ */ -+__ASM_GLOBAL_FUNC( call_syscall_func, -+ "addl $4,%esp\n\t" -+ "jmp *%eax\n\t" -+ "ret" ) -+ - #endif /* __i386__ */ -diff --git a/dlls/ntdll/signal_powerpc.c b/dlls/ntdll/signal_powerpc.c -index 886da86..9ec38f5 100644 ---- a/dlls/ntdll/signal_powerpc.c -+++ b/dlls/ntdll/signal_powerpc.c -@@ -1068,7 +1068,8 @@ void WINAPI RtlUnwind( PVOID pEndFrame, PVOID targetIp, PEXCEPTION_RECORD pRecor - /******************************************************************* - * NtRaiseException (NTDLL.@) - */ --NTSTATUS WINAPI NtRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_chance ) -+DEFINE_SYSCALL_ENTRYPOINT( NtRaiseException, 3 ); -+NTSTATUS WINAPI SYSCALL(NtRaiseException)( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_chance ) - { - NTSTATUS status = raise_exception( rec, context, first_chance ); - if (status == STATUS_SUCCESS) NtSetContextThread( GetCurrentThread(), context ); -diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c -index 0c64541..ad00eb6 100644 ---- a/dlls/ntdll/signal_x86_64.c -+++ b/dlls/ntdll/signal_x86_64.c -@@ -3637,7 +3637,8 @@ EXCEPTION_DISPOSITION WINAPI __C_specific_handler( EXCEPTION_RECORD *rec, - /******************************************************************* - * NtRaiseException (NTDLL.@) - */ --NTSTATUS WINAPI NtRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_chance ) -+DEFINE_SYSCALL_ENTRYPOINT( NtRaiseException, 3 ); -+NTSTATUS WINAPI SYSCALL(NtRaiseException)( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_chance ) - { - NTSTATUS status = raise_exception( rec, context, first_chance ); - if (status == STATUS_SUCCESS) NtSetContextThread( GetCurrentThread(), context ); -diff --git a/dlls/ntdll/sync.c b/dlls/ntdll/sync.c -index e87e672..2b3d550 100644 ---- a/dlls/ntdll/sync.c -+++ b/dlls/ntdll/sync.c -@@ -173,7 +173,8 @@ NTSTATUS validate_open_object_attributes( const OBJECT_ATTRIBUTES *attr ) - /****************************************************************************** - * NtCreateSemaphore (NTDLL.@) - */ --NTSTATUS WINAPI NtCreateSemaphore( OUT PHANDLE SemaphoreHandle, -+DEFINE_SYSCALL_ENTRYPOINT( NtCreateSemaphore, 5 ); -+NTSTATUS WINAPI SYSCALL(NtCreateSemaphore)( OUT PHANDLE SemaphoreHandle, - IN ACCESS_MASK access, - IN const OBJECT_ATTRIBUTES *attr OPTIONAL, - IN LONG InitialCount, -@@ -206,7 +207,8 @@ NTSTATUS WINAPI NtCreateSemaphore( OUT PHANDLE SemaphoreHandle, - /****************************************************************************** - * NtOpenSemaphore (NTDLL.@) - */ --NTSTATUS WINAPI NtOpenSemaphore( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) -+DEFINE_SYSCALL_ENTRYPOINT( NtOpenSemaphore, 3 ); -+NTSTATUS WINAPI SYSCALL(NtOpenSemaphore)( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) - { - NTSTATUS ret; - -@@ -229,7 +231,8 @@ NTSTATUS WINAPI NtOpenSemaphore( HANDLE *handle, ACCESS_MASK access, const OBJEC - /****************************************************************************** - * NtQuerySemaphore (NTDLL.@) - */ --NTSTATUS WINAPI NtQuerySemaphore( HANDLE handle, SEMAPHORE_INFORMATION_CLASS class, -+DEFINE_SYSCALL_ENTRYPOINT( NtQuerySemaphore, 5 ); -+NTSTATUS WINAPI SYSCALL(NtQuerySemaphore)( HANDLE handle, SEMAPHORE_INFORMATION_CLASS class, - void *info, ULONG len, ULONG *ret_len ) - { - NTSTATUS ret; -@@ -261,7 +264,8 @@ NTSTATUS WINAPI NtQuerySemaphore( HANDLE handle, SEMAPHORE_INFORMATION_CLASS cla - /****************************************************************************** - * NtReleaseSemaphore (NTDLL.@) - */ --NTSTATUS WINAPI NtReleaseSemaphore( HANDLE handle, ULONG count, PULONG previous ) -+DEFINE_SYSCALL_ENTRYPOINT( NtReleaseSemaphore, 3 ); -+NTSTATUS WINAPI SYSCALL(NtReleaseSemaphore)( HANDLE handle, ULONG count, PULONG previous ) - { - NTSTATUS ret; - SERVER_START_REQ( release_semaphore ) -@@ -285,7 +289,8 @@ NTSTATUS WINAPI NtReleaseSemaphore( HANDLE handle, ULONG count, PULONG previous - * NtCreateEvent (NTDLL.@) - * ZwCreateEvent (NTDLL.@) - */ --NTSTATUS WINAPI NtCreateEvent( PHANDLE EventHandle, ACCESS_MASK DesiredAccess, -+DEFINE_SYSCALL_ENTRYPOINT( NtCreateEvent, 5 ); -+NTSTATUS WINAPI SYSCALL(NtCreateEvent)( PHANDLE EventHandle, ACCESS_MASK DesiredAccess, - const OBJECT_ATTRIBUTES *attr, EVENT_TYPE type, BOOLEAN InitialState) - { - NTSTATUS ret; -@@ -313,7 +318,8 @@ NTSTATUS WINAPI NtCreateEvent( PHANDLE EventHandle, ACCESS_MASK DesiredAccess, - * NtOpenEvent (NTDLL.@) - * ZwOpenEvent (NTDLL.@) - */ --NTSTATUS WINAPI NtOpenEvent( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) -+DEFINE_SYSCALL_ENTRYPOINT( NtOpenEvent, 3 ); -+NTSTATUS WINAPI SYSCALL(NtOpenEvent)( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) - { - NTSTATUS ret; - -@@ -338,7 +344,8 @@ NTSTATUS WINAPI NtOpenEvent( HANDLE *handle, ACCESS_MASK access, const OBJECT_AT - * NtSetEvent (NTDLL.@) - * ZwSetEvent (NTDLL.@) - */ --NTSTATUS WINAPI NtSetEvent( HANDLE handle, PULONG NumberOfThreadsReleased ) -+DEFINE_SYSCALL_ENTRYPOINT( NtSetEvent, 2 ); -+NTSTATUS WINAPI SYSCALL(NtSetEvent)( HANDLE handle, PULONG NumberOfThreadsReleased ) - { - NTSTATUS ret; - -@@ -357,7 +364,8 @@ NTSTATUS WINAPI NtSetEvent( HANDLE handle, PULONG NumberOfThreadsReleased ) - /****************************************************************************** - * NtResetEvent (NTDLL.@) - */ --NTSTATUS WINAPI NtResetEvent( HANDLE handle, PULONG NumberOfThreadsReleased ) -+DEFINE_SYSCALL_ENTRYPOINT( NtResetEvent, 2 ); -+NTSTATUS WINAPI SYSCALL(NtResetEvent)( HANDLE handle, PULONG NumberOfThreadsReleased ) - { - NTSTATUS ret; - -@@ -380,7 +388,8 @@ NTSTATUS WINAPI NtResetEvent( HANDLE handle, PULONG NumberOfThreadsReleased ) - * FIXME - * same as NtResetEvent ??? - */ --NTSTATUS WINAPI NtClearEvent ( HANDLE handle ) -+DEFINE_SYSCALL_ENTRYPOINT( NtClearEvent, 1 ); -+NTSTATUS WINAPI SYSCALL(NtClearEvent) ( HANDLE handle ) - { - return NtResetEvent( handle, NULL ); - } -@@ -391,7 +400,8 @@ NTSTATUS WINAPI NtClearEvent ( HANDLE handle ) - * FIXME - * PulseCount - */ --NTSTATUS WINAPI NtPulseEvent( HANDLE handle, PULONG PulseCount ) -+DEFINE_SYSCALL_ENTRYPOINT( NtPulseEvent, 2 ); -+NTSTATUS WINAPI SYSCALL(NtPulseEvent)( HANDLE handle, PULONG PulseCount ) - { - NTSTATUS ret; - -@@ -411,7 +421,8 @@ NTSTATUS WINAPI NtPulseEvent( HANDLE handle, PULONG PulseCount ) - /****************************************************************************** - * NtQueryEvent (NTDLL.@) - */ --NTSTATUS WINAPI NtQueryEvent( HANDLE handle, EVENT_INFORMATION_CLASS class, -+DEFINE_SYSCALL_ENTRYPOINT( NtQueryEvent, 5 ); -+NTSTATUS WINAPI SYSCALL(NtQueryEvent)( HANDLE handle, EVENT_INFORMATION_CLASS class, - void *info, ULONG len, ULONG *ret_len ) - { - NTSTATUS ret; -@@ -449,7 +460,8 @@ NTSTATUS WINAPI NtQueryEvent( HANDLE handle, EVENT_INFORMATION_CLASS class, - * NtCreateMutant [NTDLL.@] - * ZwCreateMutant [NTDLL.@] - */ --NTSTATUS WINAPI NtCreateMutant(OUT HANDLE* MutantHandle, -+DEFINE_SYSCALL_ENTRYPOINT( NtCreateMutant, 4 ); -+NTSTATUS WINAPI SYSCALL(NtCreateMutant)(OUT HANDLE* MutantHandle, - IN ACCESS_MASK access, - IN const OBJECT_ATTRIBUTES* attr OPTIONAL, - IN BOOLEAN InitialOwner) -@@ -478,7 +490,8 @@ NTSTATUS WINAPI NtCreateMutant(OUT HANDLE* MutantHandle, - * NtOpenMutant [NTDLL.@] - * ZwOpenMutant [NTDLL.@] - */ --NTSTATUS WINAPI NtOpenMutant( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) -+DEFINE_SYSCALL_ENTRYPOINT( NtOpenMutant, 3 ); -+NTSTATUS WINAPI SYSCALL(NtOpenMutant)( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) - { - NTSTATUS status; - -@@ -502,7 +515,8 @@ NTSTATUS WINAPI NtOpenMutant( HANDLE *handle, ACCESS_MASK access, const OBJECT_A - * NtReleaseMutant [NTDLL.@] - * ZwReleaseMutant [NTDLL.@] - */ --NTSTATUS WINAPI NtReleaseMutant( IN HANDLE handle, OUT PLONG prev_count OPTIONAL) -+DEFINE_SYSCALL_ENTRYPOINT( NtReleaseMutant, 2 ); -+NTSTATUS WINAPI SYSCALL(NtReleaseMutant)( IN HANDLE handle, OUT PLONG prev_count OPTIONAL) - { - NTSTATUS status; - -@@ -520,7 +534,8 @@ NTSTATUS WINAPI NtReleaseMutant( IN HANDLE handle, OUT PLONG prev_count OPTIONAL - * NtQueryMutant [NTDLL.@] - * ZwQueryMutant [NTDLL.@] - */ --NTSTATUS WINAPI NtQueryMutant(IN HANDLE handle, -+DEFINE_SYSCALL_ENTRYPOINT( NtQueryMutant, 5 ); -+NTSTATUS WINAPI SYSCALL(NtQueryMutant)(IN HANDLE handle, - IN MUTANT_INFORMATION_CLASS MutantInformationClass, - OUT PVOID MutantInformation, - IN ULONG MutantInformationLength, -@@ -539,7 +554,8 @@ NTSTATUS WINAPI NtQueryMutant(IN HANDLE handle, - * NtCreateJobObject [NTDLL.@] - * ZwCreateJobObject [NTDLL.@] - */ --NTSTATUS WINAPI NtCreateJobObject( PHANDLE handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) -+DEFINE_SYSCALL_ENTRYPOINT( NtCreateJobObject, 3 ); -+NTSTATUS WINAPI SYSCALL(NtCreateJobObject)( PHANDLE handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) - { - NTSTATUS ret; - data_size_t len; -@@ -564,7 +580,8 @@ NTSTATUS WINAPI NtCreateJobObject( PHANDLE handle, ACCESS_MASK access, const OBJ - * NtOpenJobObject [NTDLL.@] - * ZwOpenJobObject [NTDLL.@] - */ --NTSTATUS WINAPI NtOpenJobObject( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) -+DEFINE_SYSCALL_ENTRYPOINT( NtOpenJobObject, 3 ); -+NTSTATUS WINAPI SYSCALL(NtOpenJobObject)( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) - { - NTSTATUS ret; - -@@ -588,7 +605,8 @@ NTSTATUS WINAPI NtOpenJobObject( HANDLE *handle, ACCESS_MASK access, const OBJEC - * NtTerminateJobObject [NTDLL.@] - * ZwTerminateJobObject [NTDLL.@] - */ --NTSTATUS WINAPI NtTerminateJobObject( HANDLE handle, NTSTATUS status ) -+DEFINE_SYSCALL_ENTRYPOINT( NtTerminateJobObject, 2 ); -+NTSTATUS WINAPI SYSCALL(NtTerminateJobObject)( HANDLE handle, NTSTATUS status ) - { - NTSTATUS ret; - -@@ -609,7 +627,8 @@ NTSTATUS WINAPI NtTerminateJobObject( HANDLE handle, NTSTATUS status ) - * NtQueryInformationJobObject [NTDLL.@] - * ZwQueryInformationJobObject [NTDLL.@] - */ --NTSTATUS WINAPI NtQueryInformationJobObject( HANDLE handle, JOBOBJECTINFOCLASS class, PVOID info, -+DEFINE_SYSCALL_ENTRYPOINT( NtQueryInformationJobObject, 5 ); -+NTSTATUS WINAPI SYSCALL(NtQueryInformationJobObject)( HANDLE handle, JOBOBJECTINFOCLASS class, PVOID info, - ULONG len, PULONG ret_len ) - { - FIXME( "stub: %p %u %p %u %p\n", handle, class, info, len, ret_len ); -@@ -652,7 +671,8 @@ NTSTATUS WINAPI NtQueryInformationJobObject( HANDLE handle, JOBOBJECTINFOCLASS c - * NtSetInformationJobObject [NTDLL.@] - * ZwSetInformationJobObject [NTDLL.@] - */ --NTSTATUS WINAPI NtSetInformationJobObject( HANDLE handle, JOBOBJECTINFOCLASS class, PVOID info, ULONG len ) -+DEFINE_SYSCALL_ENTRYPOINT( NtSetInformationJobObject, 4 ); -+NTSTATUS WINAPI SYSCALL(NtSetInformationJobObject)( HANDLE handle, JOBOBJECTINFOCLASS class, PVOID info, ULONG len ) - { - NTSTATUS status = STATUS_NOT_IMPLEMENTED; - JOBOBJECT_BASIC_LIMIT_INFORMATION *basic_limit; -@@ -717,7 +737,8 @@ NTSTATUS WINAPI NtSetInformationJobObject( HANDLE handle, JOBOBJECTINFOCLASS cla - * NtIsProcessInJob [NTDLL.@] - * ZwIsProcessInJob [NTDLL.@] - */ --NTSTATUS WINAPI NtIsProcessInJob( HANDLE process, HANDLE job ) -+DEFINE_SYSCALL_ENTRYPOINT( NtIsProcessInJob, 2 ); -+NTSTATUS WINAPI SYSCALL(NtIsProcessInJob)( HANDLE process, HANDLE job ) - { - NTSTATUS status; - -@@ -738,7 +759,8 @@ NTSTATUS WINAPI NtIsProcessInJob( HANDLE process, HANDLE job ) - * NtAssignProcessToJobObject [NTDLL.@] - * ZwAssignProcessToJobObject [NTDLL.@] - */ --NTSTATUS WINAPI NtAssignProcessToJobObject( HANDLE job, HANDLE process ) -+DEFINE_SYSCALL_ENTRYPOINT( NtAssignProcessToJobObject, 2 ); -+NTSTATUS WINAPI SYSCALL(NtAssignProcessToJobObject)( HANDLE job, HANDLE process ) - { - NTSTATUS status; - -@@ -763,7 +785,8 @@ NTSTATUS WINAPI NtAssignProcessToJobObject( HANDLE job, HANDLE process ) - * NtCreateTimer [NTDLL.@] - * ZwCreateTimer [NTDLL.@] - */ --NTSTATUS WINAPI NtCreateTimer(OUT HANDLE *handle, -+DEFINE_SYSCALL_ENTRYPOINT( NtCreateTimer, 4 ); -+NTSTATUS WINAPI SYSCALL(NtCreateTimer)(OUT HANDLE *handle, - IN ACCESS_MASK access, - IN const OBJECT_ATTRIBUTES *attr OPTIONAL, - IN TIMER_TYPE timer_type) -@@ -796,7 +819,8 @@ NTSTATUS WINAPI NtCreateTimer(OUT HANDLE *handle, - * NtOpenTimer [NTDLL.@] - * ZwOpenTimer [NTDLL.@] - */ --NTSTATUS WINAPI NtOpenTimer( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) -+DEFINE_SYSCALL_ENTRYPOINT( NtOpenTimer, 3 ); -+NTSTATUS WINAPI SYSCALL(NtOpenTimer)( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) - { - NTSTATUS status; - -@@ -820,7 +844,8 @@ NTSTATUS WINAPI NtOpenTimer( HANDLE *handle, ACCESS_MASK access, const OBJECT_AT - * NtSetTimer [NTDLL.@] - * ZwSetTimer [NTDLL.@] - */ --NTSTATUS WINAPI NtSetTimer(IN HANDLE handle, -+DEFINE_SYSCALL_ENTRYPOINT( NtSetTimer, 7 ); -+NTSTATUS WINAPI SYSCALL(NtSetTimer)(IN HANDLE handle, - IN const LARGE_INTEGER* when, - IN PTIMER_APC_ROUTINE callback, - IN PVOID callback_arg, -@@ -854,7 +879,8 @@ NTSTATUS WINAPI NtSetTimer(IN HANDLE handle, - * NtCancelTimer [NTDLL.@] - * ZwCancelTimer [NTDLL.@] - */ --NTSTATUS WINAPI NtCancelTimer(IN HANDLE handle, OUT BOOLEAN* state) -+DEFINE_SYSCALL_ENTRYPOINT( NtCancelTimer, 2 ); -+NTSTATUS WINAPI SYSCALL(NtCancelTimer)(IN HANDLE handle, OUT BOOLEAN* state) - { - NTSTATUS status; - -@@ -888,7 +914,8 @@ NTSTATUS WINAPI NtCancelTimer(IN HANDLE handle, OUT BOOLEAN* state) - * STATUS_ACCESS_DENIED, if TimerHandle does not have TIMER_QUERY_STATE access - * to the timer. - */ --NTSTATUS WINAPI NtQueryTimer( -+DEFINE_SYSCALL_ENTRYPOINT( NtQueryTimer, 5 ); -+NTSTATUS WINAPI SYSCALL(NtQueryTimer)( - HANDLE TimerHandle, - TIMER_INFORMATION_CLASS TimerInformationClass, - PVOID TimerInformation, -@@ -939,7 +966,8 @@ NTSTATUS WINAPI NtQueryTimer( - /****************************************************************************** - * NtQueryTimerResolution [NTDLL.@] - */ --NTSTATUS WINAPI NtQueryTimerResolution(OUT ULONG* min_resolution, -+DEFINE_SYSCALL_ENTRYPOINT( NtQueryTimerResolution, 3 ); -+NTSTATUS WINAPI SYSCALL(NtQueryTimerResolution)(OUT ULONG* min_resolution, - OUT ULONG* max_resolution, - OUT ULONG* current_resolution) - { -@@ -952,7 +980,8 @@ NTSTATUS WINAPI NtQueryTimerResolution(OUT ULONG* min_resolution, - /****************************************************************************** - * NtSetTimerResolution [NTDLL.@] - */ --NTSTATUS WINAPI NtSetTimerResolution(IN ULONG resolution, -+DEFINE_SYSCALL_ENTRYPOINT( NtSetTimerResolution, 3 ); -+NTSTATUS WINAPI SYSCALL(NtSetTimerResolution)(IN ULONG resolution, - IN BOOLEAN set_resolution, - OUT ULONG* current_resolution ) - { -@@ -985,7 +1014,8 @@ static NTSTATUS wait_objects( DWORD count, const HANDLE *handles, - /****************************************************************** - * NtWaitForMultipleObjects (NTDLL.@) - */ --NTSTATUS WINAPI NtWaitForMultipleObjects( DWORD count, const HANDLE *handles, -+DEFINE_SYSCALL_ENTRYPOINT( NtWaitForMultipleObjects, 5 ); -+NTSTATUS WINAPI SYSCALL(NtWaitForMultipleObjects)( DWORD count, const HANDLE *handles, - BOOLEAN wait_any, BOOLEAN alertable, - const LARGE_INTEGER *timeout ) - { -@@ -996,7 +1026,8 @@ NTSTATUS WINAPI NtWaitForMultipleObjects( DWORD count, const HANDLE *handles, - /****************************************************************** - * NtWaitForSingleObject (NTDLL.@) - */ --NTSTATUS WINAPI NtWaitForSingleObject(HANDLE handle, BOOLEAN alertable, const LARGE_INTEGER *timeout ) -+DEFINE_SYSCALL_ENTRYPOINT( NtWaitForSingleObject, 3 ); -+NTSTATUS WINAPI SYSCALL(NtWaitForSingleObject)(HANDLE handle, BOOLEAN alertable, const LARGE_INTEGER *timeout ) - { - return wait_objects( 1, &handle, FALSE, alertable, timeout ); - } -@@ -1005,7 +1036,8 @@ NTSTATUS WINAPI NtWaitForSingleObject(HANDLE handle, BOOLEAN alertable, const LA - /****************************************************************** - * NtSignalAndWaitForSingleObject (NTDLL.@) - */ --NTSTATUS WINAPI NtSignalAndWaitForSingleObject( HANDLE hSignalObject, HANDLE hWaitObject, -+DEFINE_SYSCALL_ENTRYPOINT( NtSignalAndWaitForSingleObject, 4 ); -+NTSTATUS WINAPI SYSCALL(NtSignalAndWaitForSingleObject)( HANDLE hSignalObject, HANDLE hWaitObject, - BOOLEAN alertable, const LARGE_INTEGER *timeout ) - { - select_op_t select_op; -@@ -1024,7 +1056,8 @@ NTSTATUS WINAPI NtSignalAndWaitForSingleObject( HANDLE hSignalObject, HANDLE hWa - /****************************************************************** - * NtYieldExecution (NTDLL.@) - */ --NTSTATUS WINAPI NtYieldExecution(void) -+DEFINE_SYSCALL_ENTRYPOINT( NtYieldExecution, 0 ); -+NTSTATUS WINAPI SYSCALL(NtYieldExecution)(void) - { - #ifdef HAVE_SCHED_YIELD - sched_yield(); -@@ -1038,7 +1071,8 @@ NTSTATUS WINAPI NtYieldExecution(void) - /****************************************************************** - * NtDelayExecution (NTDLL.@) - */ --NTSTATUS WINAPI NtDelayExecution( BOOLEAN alertable, const LARGE_INTEGER *timeout ) -+DEFINE_SYSCALL_ENTRYPOINT( NtDelayExecution, 2 ); -+NTSTATUS WINAPI SYSCALL(NtDelayExecution)( BOOLEAN alertable, const LARGE_INTEGER *timeout ) - { - /* if alertable, we need to query the server */ - if (alertable) -@@ -1081,7 +1115,8 @@ NTSTATUS WINAPI NtDelayExecution( BOOLEAN alertable, const LARGE_INTEGER *timeou - /****************************************************************************** - * NtCreateKeyedEvent (NTDLL.@) - */ --NTSTATUS WINAPI NtCreateKeyedEvent( HANDLE *handle, ACCESS_MASK access, -+DEFINE_SYSCALL_ENTRYPOINT( NtCreateKeyedEvent, 4 ); -+NTSTATUS WINAPI SYSCALL(NtCreateKeyedEvent)( HANDLE *handle, ACCESS_MASK access, - const OBJECT_ATTRIBUTES *attr, ULONG flags ) - { - NTSTATUS ret; -@@ -1106,7 +1141,8 @@ NTSTATUS WINAPI NtCreateKeyedEvent( HANDLE *handle, ACCESS_MASK access, - /****************************************************************************** - * NtOpenKeyedEvent (NTDLL.@) - */ --NTSTATUS WINAPI NtOpenKeyedEvent( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) -+DEFINE_SYSCALL_ENTRYPOINT( NtOpenKeyedEvent, 3 ); -+NTSTATUS WINAPI SYSCALL(NtOpenKeyedEvent)( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) - { - NTSTATUS ret; - -@@ -1129,7 +1165,8 @@ NTSTATUS WINAPI NtOpenKeyedEvent( HANDLE *handle, ACCESS_MASK access, const OBJE - /****************************************************************************** - * NtWaitForKeyedEvent (NTDLL.@) - */ --NTSTATUS WINAPI NtWaitForKeyedEvent( HANDLE handle, const void *key, -+DEFINE_SYSCALL_ENTRYPOINT( NtWaitForKeyedEvent, 4 ); -+NTSTATUS WINAPI SYSCALL(NtWaitForKeyedEvent)( HANDLE handle, const void *key, - BOOLEAN alertable, const LARGE_INTEGER *timeout ) - { - select_op_t select_op; -@@ -1146,7 +1183,8 @@ NTSTATUS WINAPI NtWaitForKeyedEvent( HANDLE handle, const void *key, - /****************************************************************************** - * NtReleaseKeyedEvent (NTDLL.@) - */ --NTSTATUS WINAPI NtReleaseKeyedEvent( HANDLE handle, const void *key, -+DEFINE_SYSCALL_ENTRYPOINT( NtReleaseKeyedEvent, 4 ); -+NTSTATUS WINAPI SYSCALL(NtReleaseKeyedEvent)( HANDLE handle, const void *key, - BOOLEAN alertable, const LARGE_INTEGER *timeout ) - { - select_op_t select_op; -@@ -1173,7 +1211,8 @@ NTSTATUS WINAPI NtReleaseKeyedEvent( HANDLE handle, const void *key, - * NumberOfConcurrentThreads [I] desired number of concurrent active worker threads - * - */ --NTSTATUS WINAPI NtCreateIoCompletion( PHANDLE CompletionPort, ACCESS_MASK DesiredAccess, -+DEFINE_SYSCALL_ENTRYPOINT( NtCreateIoCompletion, 4 ); -+NTSTATUS WINAPI SYSCALL(NtCreateIoCompletion)( PHANDLE CompletionPort, ACCESS_MASK DesiredAccess, - POBJECT_ATTRIBUTES attr, ULONG NumberOfConcurrentThreads ) - { - NTSTATUS status; -@@ -1214,7 +1253,8 @@ NTSTATUS WINAPI NtCreateIoCompletion( PHANDLE CompletionPort, ACCESS_MASK Desire - * Status [I] operation status - * NumberOfBytesTransferred [I] number of bytes transferred - */ --NTSTATUS WINAPI NtSetIoCompletion( HANDLE CompletionPort, ULONG_PTR CompletionKey, -+DEFINE_SYSCALL_ENTRYPOINT( NtSetIoCompletion, 5 ); -+NTSTATUS WINAPI SYSCALL(NtSetIoCompletion)( HANDLE CompletionPort, ULONG_PTR CompletionKey, - ULONG_PTR CompletionValue, NTSTATUS Status, - SIZE_T NumberOfBytesTransferred ) - { -@@ -1250,7 +1290,8 @@ NTSTATUS WINAPI NtSetIoCompletion( HANDLE CompletionPort, ULONG_PTR CompletionKe - * WaitTime [I] optional wait time in NTDLL format - * - */ --NTSTATUS WINAPI NtRemoveIoCompletion( HANDLE CompletionPort, PULONG_PTR CompletionKey, -+DEFINE_SYSCALL_ENTRYPOINT( NtRemoveIoCompletion, 5 ); -+NTSTATUS WINAPI SYSCALL(NtRemoveIoCompletion)( HANDLE CompletionPort, PULONG_PTR CompletionKey, - PULONG_PTR CompletionValue, PIO_STATUS_BLOCK iosb, - PLARGE_INTEGER WaitTime ) - { -@@ -1293,7 +1334,8 @@ NTSTATUS WINAPI NtRemoveIoCompletion( HANDLE CompletionPort, PULONG_PTR Completi - * ObjectAttributes [I] completion object name - * - */ --NTSTATUS WINAPI NtOpenIoCompletion( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) -+DEFINE_SYSCALL_ENTRYPOINT( NtOpenIoCompletion, 3 ); -+NTSTATUS WINAPI SYSCALL(NtOpenIoCompletion)( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) - { - NTSTATUS status; - -@@ -1328,7 +1370,8 @@ NTSTATUS WINAPI NtOpenIoCompletion( HANDLE *handle, ACCESS_MASK access, const OB - * RequiredLength [O] required buffer length - * - */ --NTSTATUS WINAPI NtQueryIoCompletion( HANDLE CompletionPort, IO_COMPLETION_INFORMATION_CLASS InformationClass, -+DEFINE_SYSCALL_ENTRYPOINT( NtQueryIoCompletion, 5 ); -+NTSTATUS WINAPI SYSCALL(NtQueryIoCompletion)( HANDLE CompletionPort, IO_COMPLETION_INFORMATION_CLASS InformationClass, - PVOID CompletionInformation, ULONG BufferLength, PULONG RequiredLength ) - { - NTSTATUS status; -diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c -index 0b68185..7d9d2d7 100644 ---- a/dlls/ntdll/thread.c -+++ b/dlls/ntdll/thread.c -@@ -599,7 +599,8 @@ ULONG WINAPI RtlGetNtGlobalFlags(void) - * NtOpenThread (NTDLL.@) - * ZwOpenThread (NTDLL.@) - */ --NTSTATUS WINAPI NtOpenThread( HANDLE *handle, ACCESS_MASK access, -+DEFINE_SYSCALL_ENTRYPOINT( NtOpenThread, 4 ); -+NTSTATUS WINAPI SYSCALL(NtOpenThread)( HANDLE *handle, ACCESS_MASK access, - const OBJECT_ATTRIBUTES *attr, const CLIENT_ID *id ) - { - NTSTATUS ret; -@@ -621,7 +622,8 @@ NTSTATUS WINAPI NtOpenThread( HANDLE *handle, ACCESS_MASK access, - * NtSuspendThread (NTDLL.@) - * ZwSuspendThread (NTDLL.@) - */ --NTSTATUS WINAPI NtSuspendThread( HANDLE handle, PULONG count ) -+DEFINE_SYSCALL_ENTRYPOINT( NtSuspendThread, 2 ); -+NTSTATUS WINAPI SYSCALL(NtSuspendThread)( HANDLE handle, PULONG count ) - { - NTSTATUS ret; - -@@ -639,7 +641,8 @@ NTSTATUS WINAPI NtSuspendThread( HANDLE handle, PULONG count ) - * NtResumeThread (NTDLL.@) - * ZwResumeThread (NTDLL.@) - */ --NTSTATUS WINAPI NtResumeThread( HANDLE handle, PULONG count ) -+DEFINE_SYSCALL_ENTRYPOINT( NtResumeThread, 2 ); -+NTSTATUS WINAPI SYSCALL(NtResumeThread)( HANDLE handle, PULONG count ) - { - NTSTATUS ret; - -@@ -657,7 +660,8 @@ NTSTATUS WINAPI NtResumeThread( HANDLE handle, PULONG count ) - * NtAlertResumeThread (NTDLL.@) - * ZwAlertResumeThread (NTDLL.@) - */ --NTSTATUS WINAPI NtAlertResumeThread( HANDLE handle, PULONG count ) -+DEFINE_SYSCALL_ENTRYPOINT( NtAlertResumeThread, 2 ); -+NTSTATUS WINAPI SYSCALL(NtAlertResumeThread)( HANDLE handle, PULONG count ) - { - FIXME( "stub: should alert thread %p\n", handle ); - return NtResumeThread( handle, count ); -@@ -668,7 +672,8 @@ NTSTATUS WINAPI NtAlertResumeThread( HANDLE handle, PULONG count ) - * NtAlertThread (NTDLL.@) - * ZwAlertThread (NTDLL.@) - */ --NTSTATUS WINAPI NtAlertThread( HANDLE handle ) -+DEFINE_SYSCALL_ENTRYPOINT( NtAlertThread, 1 ); -+NTSTATUS WINAPI SYSCALL(NtAlertThread)( HANDLE handle ) - { - FIXME( "stub: %p\n", handle ); - return STATUS_NOT_IMPLEMENTED; -@@ -679,7 +684,8 @@ NTSTATUS WINAPI NtAlertThread( HANDLE handle ) - * NtTerminateThread (NTDLL.@) - * ZwTerminateThread (NTDLL.@) - */ --NTSTATUS WINAPI NtTerminateThread( HANDLE handle, LONG exit_code ) -+DEFINE_SYSCALL_ENTRYPOINT( NtTerminateThread, 2 ); -+NTSTATUS WINAPI SYSCALL(NtTerminateThread)( HANDLE handle, LONG exit_code ) - { - NTSTATUS ret; - BOOL self; -@@ -701,7 +707,8 @@ NTSTATUS WINAPI NtTerminateThread( HANDLE handle, LONG exit_code ) - /****************************************************************************** - * NtQueueApcThread (NTDLL.@) - */ --NTSTATUS WINAPI NtQueueApcThread( HANDLE handle, PNTAPCFUNC func, ULONG_PTR arg1, -+DEFINE_SYSCALL_ENTRYPOINT( NtQueueApcThread, 5 ); -+NTSTATUS WINAPI SYSCALL(NtQueueApcThread)( HANDLE handle, PNTAPCFUNC func, ULONG_PTR arg1, - ULONG_PTR arg2, ULONG_PTR arg3 ) - { - NTSTATUS ret; -@@ -728,7 +735,8 @@ NTSTATUS WINAPI NtQueueApcThread( HANDLE handle, PNTAPCFUNC func, ULONG_PTR arg1 - * NtSetContextThread (NTDLL.@) - * ZwSetContextThread (NTDLL.@) - */ --NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context ) -+DEFINE_SYSCALL_ENTRYPOINT( NtSetContextThread, 2 ); -+NTSTATUS WINAPI SYSCALL(NtSetContextThread)( HANDLE handle, const CONTEXT *context ) - { - NTSTATUS ret; - DWORD dummy, i; -@@ -825,7 +833,8 @@ static inline unsigned int get_server_context_flags( DWORD flags ) - * NtGetContextThread (NTDLL.@) - * ZwGetContextThread (NTDLL.@) - */ --NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) -+DEFINE_SYSCALL_ENTRYPOINT( NtGetContextThread, 2 ); -+NTSTATUS WINAPI SYSCALL(NtGetContextThread)( HANDLE handle, CONTEXT *context ) - { - NTSTATUS ret; - DWORD dummy, i; -@@ -914,7 +923,8 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) - * NtQueryInformationThread (NTDLL.@) - * ZwQueryInformationThread (NTDLL.@) - */ --NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class, -+DEFINE_SYSCALL_ENTRYPOINT( NtQueryInformationThread, 5 ); -+NTSTATUS WINAPI SYSCALL(NtQueryInformationThread)( HANDLE handle, THREADINFOCLASS class, - void *data, ULONG length, ULONG *ret_len ) - { - NTSTATUS status; -@@ -1158,7 +1168,8 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class, - * NtSetInformationThread (NTDLL.@) - * ZwSetInformationThread (NTDLL.@) - */ --NTSTATUS WINAPI NtSetInformationThread( HANDLE handle, THREADINFOCLASS class, -+DEFINE_SYSCALL_ENTRYPOINT( NtSetInformationThread, 4 ); -+NTSTATUS WINAPI SYSCALL(NtSetInformationThread)( HANDLE handle, THREADINFOCLASS class, - LPCVOID data, ULONG length ) - { - NTSTATUS status; -@@ -1317,7 +1328,8 @@ NTSTATUS WINAPI NtSetInformationThread( HANDLE handle, THREADINFOCLASS class, - * Return the processor, on which the thread is running - * - */ --ULONG WINAPI NtGetCurrentProcessorNumber(void) -+DEFINE_SYSCALL_ENTRYPOINT( NtGetCurrentProcessorNumber, 0 ); -+ULONG WINAPI SYSCALL(NtGetCurrentProcessorNumber)(void) - { - ULONG processor; - -diff --git a/dlls/ntdll/time.c b/dlls/ntdll/time.c -index 96ffcfa..e93e820 100644 ---- a/dlls/ntdll/time.c -+++ b/dlls/ntdll/time.c -@@ -457,7 +457,8 @@ void WINAPI RtlTimeToElapsedTimeFields( const LARGE_INTEGER *Time, PTIME_FIELDS - * Success: STATUS_SUCCESS. - * Failure: An NTSTATUS error code indicating the problem. - */ --NTSTATUS WINAPI NtQuerySystemTime( PLARGE_INTEGER Time ) -+DEFINE_SYSCALL_ENTRYPOINT( NtQuerySystemTime, 1 ); -+NTSTATUS WINAPI SYSCALL(NtQuerySystemTime)( PLARGE_INTEGER Time ) - { - struct timeval now; - -@@ -470,7 +471,8 @@ NTSTATUS WINAPI NtQuerySystemTime( PLARGE_INTEGER Time ) - /****************************************************************************** - * NtQueryPerformanceCounter [NTDLL.@] - */ --NTSTATUS WINAPI NtQueryPerformanceCounter( LARGE_INTEGER *counter, LARGE_INTEGER *frequency ) -+DEFINE_SYSCALL_ENTRYPOINT( NtQueryPerformanceCounter, 2 ); -+NTSTATUS WINAPI SYSCALL(NtQueryPerformanceCounter)( LARGE_INTEGER *counter, LARGE_INTEGER *frequency ) - { - if (!counter) return STATUS_ACCESS_VIOLATION; - -@@ -484,7 +486,8 @@ NTSTATUS WINAPI NtQueryPerformanceCounter( LARGE_INTEGER *counter, LARGE_INTEGER - * NtGetTickCount (NTDLL.@) - * ZwGetTickCount (NTDLL.@) - */ --ULONG WINAPI NtGetTickCount(void) -+DEFINE_SYSCALL_ENTRYPOINT( NtGetTickCount, 0 ); -+ULONG WINAPI SYSCALL(NtGetTickCount)(void) - { - return monotonic_counter() / TICKSPERMSEC; - } -@@ -936,7 +939,8 @@ NTSTATUS WINAPI RtlSetTimeZoneInformation( const RTL_TIME_ZONE_INFORMATION *tzin - * Success: STATUS_SUCCESS. - * Failure: An NTSTATUS error code indicating the problem. - */ --NTSTATUS WINAPI NtSetSystemTime(const LARGE_INTEGER *NewTime, LARGE_INTEGER *OldTime) -+DEFINE_SYSCALL_ENTRYPOINT( NtSetSystemTime, 2 ); -+NTSTATUS WINAPI SYSCALL(NtSetSystemTime)(const LARGE_INTEGER *NewTime, LARGE_INTEGER *OldTime) - { - struct timeval tv; - time_t tm_t; -diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c -index c57524a..a65d206 100644 ---- a/dlls/ntdll/virtual.c -+++ b/dlls/ntdll/virtual.c -@@ -1857,7 +1857,8 @@ void virtual_set_large_address_space(void) - * NtAllocateVirtualMemory (NTDLL.@) - * ZwAllocateVirtualMemory (NTDLL.@) - */ --NTSTATUS WINAPI NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG zero_bits, -+DEFINE_SYSCALL_ENTRYPOINT( NtAllocateVirtualMemory, 6 ); -+NTSTATUS WINAPI SYSCALL(NtAllocateVirtualMemory)( HANDLE process, PVOID *ret, ULONG zero_bits, - SIZE_T *size_ptr, ULONG type, ULONG protect ) - { - void *base; -@@ -1996,7 +1997,8 @@ NTSTATUS WINAPI NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG zero_ - * NtFreeVirtualMemory (NTDLL.@) - * ZwFreeVirtualMemory (NTDLL.@) - */ --NTSTATUS WINAPI NtFreeVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *size_ptr, ULONG type ) -+DEFINE_SYSCALL_ENTRYPOINT( NtFreeVirtualMemory, 4 ); -+NTSTATUS WINAPI SYSCALL(NtFreeVirtualMemory)( HANDLE process, PVOID *addr_ptr, SIZE_T *size_ptr, ULONG type ) - { - struct file_view *view; - char *base; -@@ -2107,7 +2109,8 @@ static BOOL is_compatible_protection( const struct file_view *view, ULONG new_pr - * NtProtectVirtualMemory (NTDLL.@) - * ZwProtectVirtualMemory (NTDLL.@) - */ --NTSTATUS WINAPI NtProtectVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *size_ptr, -+DEFINE_SYSCALL_ENTRYPOINT( NtProtectVirtualMemory, 5 ); -+NTSTATUS WINAPI SYSCALL(NtProtectVirtualMemory)( HANDLE process, PVOID *addr_ptr, SIZE_T *size_ptr, - ULONG new_prot, ULONG *old_prot ) - { - struct file_view *view; -@@ -2235,7 +2238,8 @@ static int get_free_mem_state_callback( void *start, size_t size, void *arg ) - * NtQueryVirtualMemory (NTDLL.@) - * ZwQueryVirtualMemory (NTDLL.@) - */ --NTSTATUS WINAPI NtQueryVirtualMemory( HANDLE process, LPCVOID addr, -+DEFINE_SYSCALL_ENTRYPOINT( NtQueryVirtualMemory, 6 ); -+NTSTATUS WINAPI SYSCALL(NtQueryVirtualMemory)( HANDLE process, LPCVOID addr, - MEMORY_INFORMATION_CLASS info_class, PVOID buffer, - SIZE_T len, SIZE_T *res_len ) - { -@@ -2380,7 +2384,8 @@ NTSTATUS WINAPI NtQueryVirtualMemory( HANDLE process, LPCVOID addr, - * NtLockVirtualMemory (NTDLL.@) - * ZwLockVirtualMemory (NTDLL.@) - */ --NTSTATUS WINAPI NtLockVirtualMemory( HANDLE process, PVOID *addr, SIZE_T *size, ULONG unknown ) -+DEFINE_SYSCALL_ENTRYPOINT( NtLockVirtualMemory, 4 ); -+NTSTATUS WINAPI SYSCALL(NtLockVirtualMemory)( HANDLE process, PVOID *addr, SIZE_T *size, ULONG unknown ) - { - NTSTATUS status = STATUS_SUCCESS; - -@@ -2417,7 +2422,8 @@ NTSTATUS WINAPI NtLockVirtualMemory( HANDLE process, PVOID *addr, SIZE_T *size, - * NtUnlockVirtualMemory (NTDLL.@) - * ZwUnlockVirtualMemory (NTDLL.@) - */ --NTSTATUS WINAPI NtUnlockVirtualMemory( HANDLE process, PVOID *addr, SIZE_T *size, ULONG unknown ) -+DEFINE_SYSCALL_ENTRYPOINT( NtUnlockVirtualMemory, 4 ); -+NTSTATUS WINAPI SYSCALL(NtUnlockVirtualMemory)( HANDLE process, PVOID *addr, SIZE_T *size, ULONG unknown ) - { - NTSTATUS status = STATUS_SUCCESS; - -@@ -2454,7 +2460,8 @@ NTSTATUS WINAPI NtUnlockVirtualMemory( HANDLE process, PVOID *addr, SIZE_T *size - * NtCreateSection (NTDLL.@) - * ZwCreateSection (NTDLL.@) - */ --NTSTATUS WINAPI NtCreateSection( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, -+DEFINE_SYSCALL_ENTRYPOINT( NtCreateSection, 7 ); -+NTSTATUS WINAPI SYSCALL(NtCreateSection)( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, - const LARGE_INTEGER *size, ULONG protect, - ULONG sec_flags, HANDLE file ) - { -@@ -2495,7 +2502,8 @@ NTSTATUS WINAPI NtCreateSection( HANDLE *handle, ACCESS_MASK access, const OBJEC - * NtOpenSection (NTDLL.@) - * ZwOpenSection (NTDLL.@) - */ --NTSTATUS WINAPI NtOpenSection( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) -+DEFINE_SYSCALL_ENTRYPOINT( NtOpenSection, 3 ); -+NTSTATUS WINAPI SYSCALL(NtOpenSection)( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) - { - NTSTATUS ret; - -@@ -2520,7 +2528,8 @@ NTSTATUS WINAPI NtOpenSection( HANDLE *handle, ACCESS_MASK access, const OBJECT_ - * NtMapViewOfSection (NTDLL.@) - * ZwMapViewOfSection (NTDLL.@) - */ --NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_ptr, ULONG zero_bits, -+DEFINE_SYSCALL_ENTRYPOINT( NtMapViewOfSection, 10 ); -+NTSTATUS WINAPI SYSCALL(NtMapViewOfSection)( HANDLE handle, HANDLE process, PVOID *addr_ptr, ULONG zero_bits, - SIZE_T commit_size, const LARGE_INTEGER *offset_ptr, SIZE_T *size_ptr, - SECTION_INHERIT inherit, ULONG alloc_type, ULONG protect ) - { -@@ -2718,7 +2727,8 @@ done: - * NtUnmapViewOfSection (NTDLL.@) - * ZwUnmapViewOfSection (NTDLL.@) - */ --NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr ) -+DEFINE_SYSCALL_ENTRYPOINT( NtUnmapViewOfSection, 2 ); -+NTSTATUS WINAPI SYSCALL(NtUnmapViewOfSection)( HANDLE process, PVOID addr ) - { - struct file_view *view; - NTSTATUS status = STATUS_NOT_MAPPED_VIEW; -@@ -2754,7 +2764,8 @@ NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr ) - * NtFlushVirtualMemory (NTDLL.@) - * ZwFlushVirtualMemory (NTDLL.@) - */ --NTSTATUS WINAPI NtFlushVirtualMemory( HANDLE process, LPCVOID *addr_ptr, -+DEFINE_SYSCALL_ENTRYPOINT( NtFlushVirtualMemory, 4 ); -+NTSTATUS WINAPI SYSCALL(NtFlushVirtualMemory)( HANDLE process, LPCVOID *addr_ptr, - SIZE_T *size_ptr, ULONG unknown ) - { - struct file_view *view; -@@ -2802,7 +2813,8 @@ NTSTATUS WINAPI NtFlushVirtualMemory( HANDLE process, LPCVOID *addr_ptr, - * NtGetWriteWatch (NTDLL.@) - * ZwGetWriteWatch (NTDLL.@) - */ --NTSTATUS WINAPI NtGetWriteWatch( HANDLE process, ULONG flags, PVOID base, SIZE_T size, PVOID *addresses, -+DEFINE_SYSCALL_ENTRYPOINT( NtGetWriteWatch, 7 ); -+NTSTATUS WINAPI SYSCALL(NtGetWriteWatch)( HANDLE process, ULONG flags, PVOID base, SIZE_T size, PVOID *addresses, - ULONG_PTR *count, ULONG *granularity ) - { - struct file_view *view; -@@ -2850,7 +2862,8 @@ NTSTATUS WINAPI NtGetWriteWatch( HANDLE process, ULONG flags, PVOID base, SIZE_T - * NtResetWriteWatch (NTDLL.@) - * ZwResetWriteWatch (NTDLL.@) - */ --NTSTATUS WINAPI NtResetWriteWatch( HANDLE process, PVOID base, SIZE_T size ) -+DEFINE_SYSCALL_ENTRYPOINT( NtResetWriteWatch, 3 ); -+NTSTATUS WINAPI SYSCALL(NtResetWriteWatch)( HANDLE process, PVOID base, SIZE_T size ) - { - struct file_view *view; - NTSTATUS status = STATUS_SUCCESS; -@@ -2879,7 +2892,8 @@ NTSTATUS WINAPI NtResetWriteWatch( HANDLE process, PVOID base, SIZE_T size ) - * NtReadVirtualMemory (NTDLL.@) - * ZwReadVirtualMemory (NTDLL.@) - */ --NTSTATUS WINAPI NtReadVirtualMemory( HANDLE process, const void *addr, void *buffer, -+DEFINE_SYSCALL_ENTRYPOINT( NtReadVirtualMemory, 5 ); -+NTSTATUS WINAPI SYSCALL(NtReadVirtualMemory)( HANDLE process, const void *addr, void *buffer, - SIZE_T size, SIZE_T *bytes_read ) - { - NTSTATUS status; -@@ -2909,7 +2923,8 @@ NTSTATUS WINAPI NtReadVirtualMemory( HANDLE process, const void *addr, void *buf - * NtWriteVirtualMemory (NTDLL.@) - * ZwWriteVirtualMemory (NTDLL.@) - */ --NTSTATUS WINAPI NtWriteVirtualMemory( HANDLE process, void *addr, const void *buffer, -+DEFINE_SYSCALL_ENTRYPOINT( NtWriteVirtualMemory, 5 ); -+NTSTATUS WINAPI SYSCALL(NtWriteVirtualMemory)( HANDLE process, void *addr, const void *buffer, - SIZE_T size, SIZE_T *bytes_written ) - { - NTSTATUS status; -@@ -2939,7 +2954,8 @@ NTSTATUS WINAPI NtWriteVirtualMemory( HANDLE process, void *addr, const void *bu - * NtAreMappedFilesTheSame (NTDLL.@) - * ZwAreMappedFilesTheSame (NTDLL.@) - */ --NTSTATUS WINAPI NtAreMappedFilesTheSame(PVOID addr1, PVOID addr2) -+DEFINE_SYSCALL_ENTRYPOINT( NtAreMappedFilesTheSame, 2 ); -+NTSTATUS WINAPI SYSCALL(NtAreMappedFilesTheSame)(PVOID addr1, PVOID addr2) - { - struct file_view *view1, *view2; - struct stat st1, st2; --- -2.7.0 - diff --git a/patches/ntdll-Syscall_Wrappers/0003-ntdll-APCs-should-call-the-implementation-instead-of.patch b/patches/ntdll-Syscall_Wrappers/0003-ntdll-APCs-should-call-the-implementation-instead-of.patch deleted file mode 100644 index c8b5e7e3..00000000 --- a/patches/ntdll-Syscall_Wrappers/0003-ntdll-APCs-should-call-the-implementation-instead-of.patch +++ /dev/null @@ -1,123 +0,0 @@ -From 4e541d44f6cf1e1003bdc4203e50a4c2fe45fcc0 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Fri, 16 Oct 2015 05:17:26 +0200 -Subject: ntdll: APCs should call the implementation instead of the syscall - thunk. - ---- - dlls/ntdll/ntdll_misc.h | 13 +++++++++++++ - dlls/ntdll/server.c | 18 +++++++++--------- - 2 files changed, 22 insertions(+), 9 deletions(-) - -diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h -index e3f902f..5566080 100644 ---- a/dlls/ntdll/ntdll_misc.h -+++ b/dlls/ntdll/ntdll_misc.h -@@ -272,6 +272,19 @@ extern HANDLE keyed_event DECLSPEC_HIDDEN; - "call *%edx\n\t" \ - "ret $(4*" #args ")" ) - -+#define DECLARE_SYSCALL_ENTRYPOINT( name ) \ -+ extern typeof( name ) __syscall_ ## name -+ -+DECLARE_SYSCALL_ENTRYPOINT( NtAllocateVirtualMemory ); -+DECLARE_SYSCALL_ENTRYPOINT( NtFlushVirtualMemory ); -+DECLARE_SYSCALL_ENTRYPOINT( NtFreeVirtualMemory ); -+DECLARE_SYSCALL_ENTRYPOINT( NtLockVirtualMemory ); -+DECLARE_SYSCALL_ENTRYPOINT( NtMapViewOfSection ); -+DECLARE_SYSCALL_ENTRYPOINT( NtProtectVirtualMemory ); -+DECLARE_SYSCALL_ENTRYPOINT( NtQueryVirtualMemory ); -+DECLARE_SYSCALL_ENTRYPOINT( NtUnlockVirtualMemory ); -+DECLARE_SYSCALL_ENTRYPOINT( NtUnmapViewOfSection ); -+ - #else /* defined(__i386__) */ - - #define SYSCALL( name ) name -diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c -index 356d631..5d7be34 100644 ---- a/dlls/ntdll/server.c -+++ b/dlls/ntdll/server.c -@@ -424,7 +424,7 @@ static BOOL invoke_apc( const apc_call_t *call, apc_result_t *result ) - size = call->virtual_alloc.size; - if ((ULONG_PTR)addr == call->virtual_alloc.addr && size == call->virtual_alloc.size) - { -- result->virtual_alloc.status = NtAllocateVirtualMemory( NtCurrentProcess(), &addr, -+ result->virtual_alloc.status = SYSCALL(NtAllocateVirtualMemory)( NtCurrentProcess(), &addr, - call->virtual_alloc.zero_bits, &size, - call->virtual_alloc.op_type, - call->virtual_alloc.prot ); -@@ -439,7 +439,7 @@ static BOOL invoke_apc( const apc_call_t *call, apc_result_t *result ) - size = call->virtual_free.size; - if ((ULONG_PTR)addr == call->virtual_free.addr && size == call->virtual_free.size) - { -- result->virtual_free.status = NtFreeVirtualMemory( NtCurrentProcess(), &addr, &size, -+ result->virtual_free.status = SYSCALL(NtFreeVirtualMemory)( NtCurrentProcess(), &addr, &size, - call->virtual_free.op_type ); - result->virtual_free.addr = wine_server_client_ptr( addr ); - result->virtual_free.size = size; -@@ -452,7 +452,7 @@ static BOOL invoke_apc( const apc_call_t *call, apc_result_t *result ) - result->type = call->type; - addr = wine_server_get_ptr( call->virtual_query.addr ); - if ((ULONG_PTR)addr == call->virtual_query.addr) -- result->virtual_query.status = NtQueryVirtualMemory( NtCurrentProcess(), -+ result->virtual_query.status = SYSCALL(NtQueryVirtualMemory)( NtCurrentProcess(), - addr, MemoryBasicInformation, &info, - sizeof(info), NULL ); - else -@@ -476,7 +476,7 @@ static BOOL invoke_apc( const apc_call_t *call, apc_result_t *result ) - size = call->virtual_protect.size; - if ((ULONG_PTR)addr == call->virtual_protect.addr && size == call->virtual_protect.size) - { -- result->virtual_protect.status = NtProtectVirtualMemory( NtCurrentProcess(), &addr, &size, -+ result->virtual_protect.status = SYSCALL(NtProtectVirtualMemory)( NtCurrentProcess(), &addr, &size, - call->virtual_protect.prot, - &result->virtual_protect.prot ); - result->virtual_protect.addr = wine_server_client_ptr( addr ); -@@ -490,7 +490,7 @@ static BOOL invoke_apc( const apc_call_t *call, apc_result_t *result ) - size = call->virtual_flush.size; - if ((ULONG_PTR)addr == call->virtual_flush.addr && size == call->virtual_flush.size) - { -- result->virtual_flush.status = NtFlushVirtualMemory( NtCurrentProcess(), -+ result->virtual_flush.status = SYSCALL(NtFlushVirtualMemory)( NtCurrentProcess(), - (const void **)&addr, &size, 0 ); - result->virtual_flush.addr = wine_server_client_ptr( addr ); - result->virtual_flush.size = size; -@@ -503,7 +503,7 @@ static BOOL invoke_apc( const apc_call_t *call, apc_result_t *result ) - size = call->virtual_lock.size; - if ((ULONG_PTR)addr == call->virtual_lock.addr && size == call->virtual_lock.size) - { -- result->virtual_lock.status = NtLockVirtualMemory( NtCurrentProcess(), &addr, &size, 0 ); -+ result->virtual_lock.status = SYSCALL(NtLockVirtualMemory)( NtCurrentProcess(), &addr, &size, 0 ); - result->virtual_lock.addr = wine_server_client_ptr( addr ); - result->virtual_lock.size = size; - } -@@ -515,7 +515,7 @@ static BOOL invoke_apc( const apc_call_t *call, apc_result_t *result ) - size = call->virtual_unlock.size; - if ((ULONG_PTR)addr == call->virtual_unlock.addr && size == call->virtual_unlock.size) - { -- result->virtual_unlock.status = NtUnlockVirtualMemory( NtCurrentProcess(), &addr, &size, 0 ); -+ result->virtual_unlock.status = SYSCALL(NtUnlockVirtualMemory)( NtCurrentProcess(), &addr, &size, 0 ); - result->virtual_unlock.addr = wine_server_client_ptr( addr ); - result->virtual_unlock.size = size; - } -@@ -529,7 +529,7 @@ static BOOL invoke_apc( const apc_call_t *call, apc_result_t *result ) - { - LARGE_INTEGER offset; - offset.QuadPart = call->map_view.offset; -- result->map_view.status = NtMapViewOfSection( wine_server_ptr_handle(call->map_view.handle), -+ result->map_view.status = SYSCALL(NtMapViewOfSection)( wine_server_ptr_handle(call->map_view.handle), - NtCurrentProcess(), &addr, - call->map_view.zero_bits, 0, - &offset, &size, ViewShare, -@@ -544,7 +544,7 @@ static BOOL invoke_apc( const apc_call_t *call, apc_result_t *result ) - result->type = call->type; - addr = wine_server_get_ptr( call->unmap_view.addr ); - if ((ULONG_PTR)addr == call->unmap_view.addr) -- result->unmap_view.status = NtUnmapViewOfSection( NtCurrentProcess(), addr ); -+ result->unmap_view.status = SYSCALL(NtUnmapViewOfSection)( NtCurrentProcess(), addr ); - else - result->unmap_view.status = STATUS_INVALID_PARAMETER; - break; --- -2.6.1 - diff --git a/patches/ntdll-Syscall_Wrappers/0004-ntdll-Syscalls-should-not-call-Nt-Ex-thunk-wrappers.patch b/patches/ntdll-Syscall_Wrappers/0004-ntdll-Syscalls-should-not-call-Nt-Ex-thunk-wrappers.patch deleted file mode 100644 index 061be544..00000000 --- a/patches/ntdll-Syscall_Wrappers/0004-ntdll-Syscalls-should-not-call-Nt-Ex-thunk-wrappers.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 04018008d5ca9c25a5d5e9c6eed7c6c1a8938a5c Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Fri, 16 Oct 2015 05:31:11 +0200 -Subject: ntdll: Syscalls should not call Nt*Ex thunk wrappers. - ---- - dlls/ntdll/nt.c | 4 ++-- - dlls/ntdll/ntdll_misc.h | 2 ++ - dlls/ntdll/reg.c | 4 ++-- - 3 files changed, 6 insertions(+), 4 deletions(-) - -diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c -index 19d5b6e..a0d8909 100644 ---- a/dlls/ntdll/nt.c -+++ b/dlls/ntdll/nt.c -@@ -124,7 +124,7 @@ NTSTATUS WINAPI SYSCALL(NtOpenProcessToken)( - DWORD DesiredAccess, - HANDLE *TokenHandle) - { -- return NtOpenProcessTokenEx( ProcessHandle, DesiredAccess, 0, TokenHandle ); -+ return SYSCALL(NtOpenProcessTokenEx)( ProcessHandle, DesiredAccess, 0, TokenHandle ); - } - - /****************************************************************************** -@@ -163,7 +163,7 @@ NTSTATUS WINAPI SYSCALL(NtOpenThreadToken)( - BOOLEAN OpenAsSelf, - HANDLE *TokenHandle) - { -- return NtOpenThreadTokenEx( ThreadHandle, DesiredAccess, OpenAsSelf, 0, TokenHandle ); -+ return SYSCALL(NtOpenThreadTokenEx)( ThreadHandle, DesiredAccess, OpenAsSelf, 0, TokenHandle ); - } - - /****************************************************************************** -diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h -index 5566080..ee94382 100644 ---- a/dlls/ntdll/ntdll_misc.h -+++ b/dlls/ntdll/ntdll_misc.h -@@ -280,6 +280,8 @@ DECLARE_SYSCALL_ENTRYPOINT( NtFlushVirtualMemory ); - DECLARE_SYSCALL_ENTRYPOINT( NtFreeVirtualMemory ); - DECLARE_SYSCALL_ENTRYPOINT( NtLockVirtualMemory ); - DECLARE_SYSCALL_ENTRYPOINT( NtMapViewOfSection ); -+DECLARE_SYSCALL_ENTRYPOINT( NtOpenProcessTokenEx ); -+DECLARE_SYSCALL_ENTRYPOINT( NtOpenThreadTokenEx ); - DECLARE_SYSCALL_ENTRYPOINT( NtProtectVirtualMemory ); - DECLARE_SYSCALL_ENTRYPOINT( NtQueryVirtualMemory ); - DECLARE_SYSCALL_ENTRYPOINT( NtUnlockVirtualMemory ); -diff --git a/dlls/ntdll/reg.c b/dlls/ntdll/reg.c -index b74c464..406d72f 100644 ---- a/dlls/ntdll/reg.c -+++ b/dlls/ntdll/reg.c -@@ -183,7 +183,7 @@ DEFINE_SYSCALL_ENTRYPOINT( NtOpenKeyTransacted, 4 ); - NTSTATUS WINAPI SYSCALL(NtOpenKeyTransacted)( PHANDLE retkey, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, - HANDLE transaction ) - { -- return NtOpenKeyTransactedEx( retkey, access, attr, 0, transaction ); -+ return SYSCALL(NtOpenKeyTransactedEx)( retkey, access, attr, 0, transaction ); - } - - /****************************************************************************** -@@ -749,7 +749,7 @@ NTSTATUS WINAPI SYSCALL(NtNotifyChangeKey)( - IN ULONG Length, - IN BOOLEAN Asynchronous) - { -- return NtNotifyChangeMultipleKeys(KeyHandle, 0, NULL, Event, ApcRoutine, ApcContext, -+ return SYSCALL(NtNotifyChangeMultipleKeys)(KeyHandle, 0, NULL, Event, ApcRoutine, ApcContext, - IoStatusBlock, CompletionFilter, WatchSubtree, - ChangeBuffer, Length, Asynchronous); - } --- -2.6.2 - diff --git a/patches/ntdll-Syscall_Wrappers/0005-ntdll-Run-directory-initialization-function-early-du.patch b/patches/ntdll-Syscall_Wrappers/0005-ntdll-Run-directory-initialization-function-early-du.patch deleted file mode 100644 index bf543293..00000000 --- a/patches/ntdll-Syscall_Wrappers/0005-ntdll-Run-directory-initialization-function-early-du.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 3a40ae6b1e3cd67ea606a7af6938788fe470773e Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Fri, 16 Oct 2015 05:54:08 +0200 -Subject: ntdll: Run directory initialization function early during the process - startup. - ---- - dlls/ntdll/directory.c | 10 ++-------- - dlls/ntdll/loader.c | 1 + - dlls/ntdll/ntdll_misc.h | 1 + - 3 files changed, 4 insertions(+), 8 deletions(-) - -diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c -index 770cd3f..94b6d77 100644 ---- a/dlls/ntdll/directory.c -+++ b/dlls/ntdll/directory.c -@@ -176,7 +176,6 @@ union file_directory_info - }; - - static BOOL show_dot_files; --static RTL_RUN_ONCE init_once = RTL_RUN_ONCE_INIT; - - /* at some point we may want to allow Winelib apps to set this */ - static const BOOL is_case_sensitive = FALSE; -@@ -1164,11 +1163,11 @@ static BOOLEAN get_dir_case_sensitivity( const char *dir ) - - - /*********************************************************************** -- * init_options -+ * DIR_init_options - * - * Initialize the show_dot_files options. - */ --static DWORD WINAPI init_options( RTL_RUN_ONCE *once, void *param, void **context ) -+void DIR_init_options(void) - { - static const WCHAR WineW[] = {'S','o','f','t','w','a','r','e','\\','W','i','n','e',0}; - static const WCHAR ShowDotFilesW[] = {'S','h','o','w','D','o','t','F','i','l','e','s',0}; -@@ -1207,7 +1206,6 @@ static DWORD WINAPI init_options( RTL_RUN_ONCE *once, void *param, void **contex - #ifdef linux - ignore_file( "/sys" ); - #endif -- return TRUE; - } - - -@@ -1220,8 +1218,6 @@ BOOL DIR_is_hidden_file( const UNICODE_STRING *name ) - { - WCHAR *p, *end; - -- RtlRunOnceExecuteOnce( &init_once, init_options, NULL, NULL ); -- - if (show_dot_files) return FALSE; - - end = p = name->Buffer + name->Length/sizeof(WCHAR); -@@ -2278,8 +2274,6 @@ NTSTATUS WINAPI SYSCALL(NtQueryDirectoryFile)( HANDLE handle, HANDLE event, - - io->Information = 0; - -- RtlRunOnceExecuteOnce( &init_once, init_options, NULL, NULL ); -- - RtlEnterCriticalSection( &dir_section ); - - cwd = open( ".", O_RDONLY ); -diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c -index ecbc885..04cbb63 100644 ---- a/dlls/ntdll/loader.c -+++ b/dlls/ntdll/loader.c -@@ -3283,6 +3283,7 @@ void __wine_process_init(void) - umask( FILE_umask ); - - load_global_options(); -+ DIR_init_options(); - - /* setup the load callback and create ntdll modref */ - wine_dll_set_callback( load_builtin_callback ); -diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h -index 11099c5..5ba1308 100644 ---- a/dlls/ntdll/ntdll_misc.h -+++ b/dlls/ntdll/ntdll_misc.h -@@ -153,6 +153,7 @@ extern int get_file_info( const char *path, struct stat *st, ULONG *attr ) DECLS - extern NTSTATUS fill_file_info( const struct stat *st, ULONG attr, void *ptr, - FILE_INFORMATION_CLASS class ) DECLSPEC_HIDDEN; - extern NTSTATUS server_get_unix_name( HANDLE handle, ANSI_STRING *unix_name ) DECLSPEC_HIDDEN; -+extern void DIR_init_options(void) DECLSPEC_HIDDEN; - extern void DIR_init_windows_dir( const WCHAR *windir, const WCHAR *sysdir ) DECLSPEC_HIDDEN; - extern BOOL DIR_is_hidden_file( const UNICODE_STRING *name ) DECLSPEC_HIDDEN; - extern NTSTATUS DIR_unmount_device( HANDLE handle ) DECLSPEC_HIDDEN; --- -2.6.1 - diff --git a/patches/ntdll-Syscall_Wrappers/definition b/patches/ntdll-Syscall_Wrappers/definition deleted file mode 100644 index 303ef86e..00000000 --- a/patches/ntdll-Syscall_Wrappers/definition +++ /dev/null @@ -1,2 +0,0 @@ -# Fixes: [39403] Use wrapper functions for syscalls to appease Chromium sandbox (32-bit) -Disabled: true