ntdll: Add a custom type for the Unix functions table handle.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2021-08-10 18:07:08 +02:00
parent d91d05b80a
commit 572817948a
3 changed files with 7 additions and 6 deletions

View File

@ -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 );
}

View File

@ -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;

View File

@ -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 */