Alexandre Julliard : ntdll: Add a custom type for the Unix functions table handle.
Alexandre Julliard
julliard at winehq.org
Tue Aug 10 16:24:08 CDT 2021
Module: wine
Branch: master
Commit: 572817948a9dbd47e781f987538fe506ee362968
URL: https://source.winehq.org/git/wine.git/?a=commit;h=572817948a9dbd47e781f987538fe506ee362968
Author: Alexandre Julliard <julliard at winehq.org>
Date: Tue Aug 10 18:07:08 2021 +0200
ntdll: Add a custom type for the Unix functions table handle.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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 */
More information about the wine-cvs
mailing list