Commit 90adeb12 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Export the Unix call dispatcher function pointer.

parent 0f67dbb5
...@@ -71,6 +71,7 @@ typedef DWORD (CALLBACK *DLLENTRYPROC)(HMODULE,DWORD,LPVOID); ...@@ -71,6 +71,7 @@ typedef DWORD (CALLBACK *DLLENTRYPROC)(HMODULE,DWORD,LPVOID);
typedef void (CALLBACK *LDRENUMPROC)(LDR_DATA_TABLE_ENTRY *, void *, BOOLEAN *); typedef void (CALLBACK *LDRENUMPROC)(LDR_DATA_TABLE_ENTRY *, void *, BOOLEAN *);
void (FASTCALL *pBaseThreadInitThunk)(DWORD,LPTHREAD_START_ROUTINE,void *) = NULL; void (FASTCALL *pBaseThreadInitThunk)(DWORD,LPTHREAD_START_ROUTINE,void *) = NULL;
NTSTATUS (WINAPI *__wine_unix_call_dispatcher)( unixlib_handle_t, unsigned int, void * ) = __wine_unix_call;
static DWORD (WINAPI *pCtrlRoutine)(void *); static DWORD (WINAPI *pCtrlRoutine)(void *);
......
...@@ -1693,7 +1693,8 @@ ...@@ -1693,7 +1693,8 @@
@ stdcall -syscall __wine_unix_call(int64 long ptr) @ stdcall -syscall __wine_unix_call(int64 long ptr)
@ stdcall -syscall __wine_unix_spawnvp(long ptr) @ stdcall -syscall __wine_unix_spawnvp(long ptr)
@ stdcall __wine_ctrl_routine(ptr) @ stdcall __wine_ctrl_routine(ptr)
@ extern __wine_syscall_dispatcher @ extern -private __wine_syscall_dispatcher
@ extern -private __wine_unix_call_dispatcher
@ extern -arch=arm64 __wine_current_teb @ extern -arch=arm64 __wine_current_teb
# Debugging # Debugging
......
...@@ -44,17 +44,17 @@ static NTSTATUS WINAPI unix_call_fallback( unixlib_handle_t handle, unsigned int ...@@ -44,17 +44,17 @@ static NTSTATUS WINAPI unix_call_fallback( unixlib_handle_t handle, unsigned int
} }
unixlib_handle_t __wine_unixlib_handle = 0; unixlib_handle_t __wine_unixlib_handle = 0;
NTSTATUS (WINAPI *__wine_unix_call_ptr)( unixlib_handle_t, unsigned int, void * ) = unix_call_fallback; NTSTATUS (WINAPI *__wine_unix_call_dispatcher)( unixlib_handle_t, unsigned int, void * ) = unix_call_fallback;
NTSTATUS WINAPI __wine_init_unix_call(void) NTSTATUS WINAPI __wine_init_unix_call(void)
{ {
NTSTATUS status; NTSTATUS status;
HMODULE module = GetModuleHandleW( L"ntdll.dll" ); HMODULE module = GetModuleHandleW( L"ntdll.dll" );
void *proc = GetProcAddress( module, "__wine_unix_call" ); void **p__wine_unix_call_dispatcher = (void **)GetProcAddress( module, "__wine_unix_call_dispatcher" );
if (!proc) return STATUS_DLL_NOT_FOUND; if (!p__wine_unix_call_dispatcher) return STATUS_DLL_NOT_FOUND;
status = NtQueryVirtualMemory( GetCurrentProcess(), image_base(), MemoryWineUnixFuncs, status = NtQueryVirtualMemory( GetCurrentProcess(), image_base(), MemoryWineUnixFuncs,
&__wine_unixlib_handle, sizeof(__wine_unixlib_handle), NULL ); &__wine_unixlib_handle, sizeof(__wine_unixlib_handle), NULL );
if (!status) __wine_unix_call_ptr = proc; if (!status) __wine_unix_call_dispatcher = *p__wine_unix_call_dispatcher;
return status; return status;
} }
...@@ -236,7 +236,7 @@ static BOOL WINAPI wine_vk_init(INIT_ONCE *once, void *param, void **context) ...@@ -236,7 +236,7 @@ static BOOL WINAPI wine_vk_init(INIT_ONCE *once, void *param, void **context)
{ {
NTSTATUS status = __wine_init_unix_call(); NTSTATUS status = __wine_init_unix_call();
p_vk_direct_unix_call = __wine_unix_call_ptr; p_vk_direct_unix_call = __wine_unix_call_dispatcher;
if (status) return FALSE; if (status) return FALSE;
return !vk_unix_call(unix_init, &p_vk_direct_unix_call); return !vk_unix_call(unix_init, &p_vk_direct_unix_call);
} }
......
...@@ -268,10 +268,10 @@ static inline ULONG ntdll_wcstoul( const WCHAR *s, WCHAR **end, int base ) ...@@ -268,10 +268,10 @@ static inline ULONG ntdll_wcstoul( const WCHAR *s, WCHAR **end, int base )
#else /* WINE_UNIX_LIB */ #else /* WINE_UNIX_LIB */
extern unixlib_handle_t __wine_unixlib_handle DECLSPEC_HIDDEN; extern unixlib_handle_t __wine_unixlib_handle DECLSPEC_HIDDEN;
extern NTSTATUS (WINAPI *__wine_unix_call_ptr)( unixlib_handle_t, unsigned int, void * ) DECLSPEC_HIDDEN; extern NTSTATUS (WINAPI *__wine_unix_call_dispatcher)( unixlib_handle_t, unsigned int, void * ) DECLSPEC_HIDDEN;
extern NTSTATUS WINAPI __wine_init_unix_call(void) DECLSPEC_HIDDEN; extern NTSTATUS WINAPI __wine_init_unix_call(void) DECLSPEC_HIDDEN;
#define WINE_UNIX_CALL(code,args) __wine_unix_call_ptr( __wine_unixlib_handle, (code), (args) ) #define WINE_UNIX_CALL(code,args) __wine_unix_call_dispatcher( __wine_unixlib_handle, (code), (args) )
#endif /* WINE_UNIX_LIB */ #endif /* WINE_UNIX_LIB */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment