Commit 8a3ba513 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Replace the wine_server_call() syscall by a Unix call.

parent a14b4c7d
......@@ -3210,6 +3210,15 @@ NTSTATUS WINAPI __wine_unix_spawnvp( char * const argv[], int wait )
}
/***********************************************************************
* wine_server_call
*/
unsigned int CDECL wine_server_call( void *req_ptr )
{
return WINE_UNIX_CALL( unix_wine_server_call, req_ptr );
}
/******************************************************************
* LdrLoadDll (NTDLL.@)
*/
......
......@@ -1688,7 +1688,7 @@
# or 'wine_' (for user-visible functions) to avoid namespace conflicts.
# Server interface
@ cdecl -syscall -norelay wine_server_call(ptr)
@ cdecl -norelay wine_server_call(ptr)
@ cdecl -syscall wine_server_fd_to_handle(long long long ptr)
@ cdecl -syscall wine_server_handle_to_fd(long long ptr ptr)
......
......@@ -358,7 +358,6 @@ static void * const syscalls[] =
NtWriteVirtualMemory,
NtYieldExecution,
wine_nt_to_unix_file_name,
wine_server_call,
wine_server_fd_to_handle,
wine_server_handle_to_fd,
wine_unix_to_nt_file_name,
......@@ -2060,6 +2059,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
load_so_dll,
unwind_builtin_dll,
unixcall_wine_dbg_write,
unixcall_wine_server_call,
unixcall_wine_spawnvp,
system_time_precise,
};
......@@ -2078,6 +2078,7 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] =
wow64_load_so_dll,
wow64_unwind_builtin_dll,
wow64_wine_dbg_write,
wow64_wine_server_call,
wow64_wine_spawnvp,
system_time_precise,
};
......
......@@ -287,6 +287,17 @@ unsigned int CDECL wine_server_call( void *req_ptr )
/***********************************************************************
* unixcall_wine_server_call
*
* Perform a server call.
*/
NTSTATUS unixcall_wine_server_call( void *args )
{
return wine_server_call( args );
}
/***********************************************************************
* server_enter_uninterrupted_section
*/
void server_enter_uninterrupted_section( pthread_mutex_t *mutex, sigset_t *sigset )
......@@ -1764,3 +1775,42 @@ NTSTATUS WINAPI NtClose( HANDLE handle )
}
return ret;
}
#ifdef _WIN64
struct __server_request_info32
{
union
{
union generic_request req;
union generic_reply reply;
} u;
unsigned int data_count;
ULONG reply_data;
struct { ULONG ptr; data_size_t size; } data[__SERVER_MAX_DATA];
};
/**********************************************************************
* wow64_wine_server_call
*/
NTSTATUS wow64_wine_server_call( void *args )
{
struct __server_request_info32 *req32 = args;
unsigned int i;
NTSTATUS status;
struct __server_request_info req;
req.u.req = req32->u.req;
req.data_count = req32->data_count;
for (i = 0; i < req.data_count; i++)
{
req.data[i].ptr = ULongToPtr( req32->data[i].ptr );
req.data[i].size = req32->data[i].size;
}
req.reply_data = ULongToPtr( req32->reply_data );
status = wine_server_call( &req );
req32->u.reply = req.u.reply;
return status;
}
#endif /* _WIN64 */
......@@ -284,9 +284,11 @@ extern void add_completion( HANDLE handle, ULONG_PTR value, NTSTATUS status, ULO
extern void set_async_direct_result( HANDLE *async_handle, NTSTATUS status, ULONG_PTR information, BOOL mark_pending ) DECLSPEC_HIDDEN;
extern NTSTATUS unixcall_wine_dbg_write( void *args ) DECLSPEC_HIDDEN;
extern NTSTATUS unixcall_wine_server_call( void *args ) DECLSPEC_HIDDEN;
extern NTSTATUS unixcall_wine_spawnvp( void *args ) DECLSPEC_HIDDEN;
#ifdef _WIN64
extern NTSTATUS wow64_wine_dbg_write( void *args ) DECLSPEC_HIDDEN;
extern NTSTATUS wow64_wine_server_call( void *args ) DECLSPEC_HIDDEN;
extern NTSTATUS wow64_wine_spawnvp( void *args ) DECLSPEC_HIDDEN;
#endif
......
......@@ -55,6 +55,7 @@ enum ntdll_unix_funcs
unix_load_so_dll,
unix_unwind_builtin_dll,
unix_wine_dbg_write,
unix_wine_server_call,
unix_wine_spawnvp,
unix_system_time_precise,
};
......
......@@ -667,24 +667,6 @@ typedef struct
ULONG NumberOfBytes;
} MEMORY_RANGE_ENTRY32;
struct __server_iovec32
{
ULONG ptr;
data_size_t size;
};
struct __server_request_info32
{
union
{
union generic_request req;
union generic_reply reply;
} u;
unsigned int data_count;
ULONG reply_data;
struct __server_iovec32 data[__SERVER_MAX_DATA];
};
typedef struct
{
ULONG LowestStartingAddress;
......
......@@ -542,31 +542,6 @@ NTSTATUS WINAPI wow64_NtSetDefaultUILanguage( UINT *args )
/**********************************************************************
* wow64_wine_server_call
*/
NTSTATUS WINAPI wow64_wine_server_call( UINT *args )
{
struct __server_request_info32 *req32 = get_ptr( &args );
unsigned int i;
NTSTATUS status;
struct __server_request_info req;
req.u.req = req32->u.req;
req.data_count = req32->data_count;
for (i = 0; i < req.data_count; i++)
{
req.data[i].ptr = ULongToPtr( req32->data[i].ptr );
req.data[i].size = req32->data[i].size;
}
req.reply_data = ULongToPtr( req32->reply_data );
status = wine_server_call( &req );
req32->u.reply = req.u.reply;
return status;
}
/**********************************************************************
* get_syscall_num
*/
static DWORD get_syscall_num( const BYTE *syscall )
......
......@@ -258,7 +258,6 @@
SYSCALL_ENTRY( NtWriteVirtualMemory ) \
SYSCALL_ENTRY( NtYieldExecution ) \
SYSCALL_ENTRY( wine_nt_to_unix_file_name ) \
SYSCALL_ENTRY( wine_server_call ) \
SYSCALL_ENTRY( wine_server_fd_to_handle ) \
SYSCALL_ENTRY( wine_server_handle_to_fd ) \
SYSCALL_ENTRY( wine_unix_to_nt_file_name )
......
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