From 572817948a9dbd47e781f987538fe506ee362968 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 10 Aug 2021 18:07:08 +0200 Subject: [PATCH] ntdll: Add a custom type for the Unix functions table handle. Signed-off-by: Alexandre Julliard --- dlls/ntdll/unix/loader.c | 2 +- dlls/ntdll/unix/virtual.c | 4 ++-- include/winternl.h | 7 ++++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index f5135a19f40..f1a2b9f5a79 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -1141,7 +1141,7 @@ static NTSTATUS CDECL init_unix_lib( void *module, DWORD reason, const void *ptr /*********************************************************************** * __wine_unix_call */ -NTSTATUS CDECL __wine_unix_call( UINT64 handle, unsigned int code, void *args ) +NTSTATUS CDECL __wine_unix_call( unixlib_handle_t handle, unsigned int code, void *args ) { return ((unixlib_entry_t*)(UINT_PTR)handle)[code]( args ); } diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 3532f5c8746..372447eb8af 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -4345,14 +4345,14 @@ NTSTATUS WINAPI NtQueryVirtualMemory( HANDLE process, LPCVOID addr, case MemoryWineUnixFuncs: case MemoryWineUnixWow64Funcs: - if (len != sizeof(UINT64)) return STATUS_INFO_LENGTH_MISMATCH; + if (len != sizeof(unixlib_handle_t)) return STATUS_INFO_LENGTH_MISMATCH; if (process == GetCurrentProcess()) { void *module = (void *)addr; void *funcs = NULL; status = get_builtin_unix_funcs( module, info_class == MemoryWineUnixWow64Funcs, &funcs ); - if (!status) *(UINT64 *)buffer = (UINT_PTR)funcs; + if (!status) *(unixlib_handle_t *)buffer = (UINT_PTR)funcs; return status; } return STATUS_INVALID_HANDLE; diff --git a/include/winternl.h b/include/winternl.h index 41bc56d186d..562a35a83a1 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -4612,11 +4612,12 @@ static inline PLIST_ENTRY RemoveTailList(PLIST_ENTRY le) #ifdef __WINESRC__ +typedef NTSTATUS (*unixlib_entry_t)( void *args ); +typedef UINT64 unixlib_handle_t; + /* Wine internal functions */ extern NTSTATUS CDECL __wine_init_unix_lib( HMODULE module, DWORD reason, const void *ptr_in, void *ptr_out ); -extern NTSTATUS CDECL __wine_unix_call( UINT64 handle, unsigned int code, void *args ); - -typedef NTSTATUS (*unixlib_entry_t)( void *args ); +extern NTSTATUS CDECL __wine_unix_call( unixlib_handle_t handle, unsigned int code, void *args ); /* The thread information for 16-bit threads */ /* NtCurrentTeb()->SubSystemTib points to this */