>From 6f085b2fbcb13a87e1078c421e4a9f6b2e6d421b Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 2 Nov 2015 12:58:48 +0100 Subject: [PATCH 3/3] ntdll: Call NtOpenFile via syscall wrapper in loader. To: wine-patches Signed-off-by: Jacek Caban --- dlls/ntdll/loader.c | 4 ++-- dlls/ntdll/ntdll_misc.h | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 831f049..e009f0e 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -2149,7 +2149,7 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, attr.ObjectName = &nt_name; attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; - if (NtOpenFile( handle, GENERIC_READ, &attr, &io, FILE_SHARE_READ|FILE_SHARE_DELETE, FILE_SYNCHRONOUS_IO_NONALERT|FILE_NON_DIRECTORY_FILE )) *handle = 0; + if (SYSCALL(NtOpenFile)( handle, GENERIC_READ, &attr, &io, FILE_SHARE_READ|FILE_SHARE_DELETE, FILE_SYNCHRONOUS_IO_NONALERT|FILE_NON_DIRECTORY_FILE )) *handle = 0; goto found; } @@ -2184,7 +2184,7 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, attr.ObjectName = &nt_name; attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; - if (NtOpenFile( handle, GENERIC_READ, &attr, &io, FILE_SHARE_READ|FILE_SHARE_DELETE, FILE_SYNCHRONOUS_IO_NONALERT|FILE_NON_DIRECTORY_FILE )) *handle = 0; + if (SYSCALL(NtOpenFile)( handle, GENERIC_READ, &attr, &io, FILE_SHARE_READ|FILE_SHARE_DELETE, FILE_SYNCHRONOUS_IO_NONALERT|FILE_NON_DIRECTORY_FILE )) *handle = 0; } found: RtlFreeUnicodeString( &nt_name ); diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index cbd19db..7d5331f 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -260,8 +260,19 @@ extern HANDLE keyed_event DECLSPEC_HIDDEN; ".byte 0x6a," #args "\n\t" /* pushl $args */ \ "call " __ASM_NAME("__wine_call_from_regs") "\n\t" \ "ret $(4*" #args ")" ) /* fake ret to make copy protections happy */ + +#define SYSCALL( name ) __syscall_ ## name +#define DECLARE_SYSCALL_ENTRYPOINT( name ) extern typeof( name ) SYSCALL( name ) + +#else + +#define SYSCALL( name ) name +#define DECLARE_SYSCALL_ENTRYPOINT( name ) + #endif +DECLARE_SYSCALL_ENTRYPOINT(NtOpenFile); + #define HASH_STRING_ALGORITHM_DEFAULT 0 #define HASH_STRING_ALGORITHM_X65599 1 #define HASH_STRING_ALGORITHM_INVALID 0xffffffff -- 2.4.9