Commit a14b4c7d authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent 5c62fe0b
......@@ -3199,6 +3199,17 @@ NTSTATUS WINAPI __wine_unix_call( unixlib_handle_t handle, unsigned int code, vo
}
/***********************************************************************
* __wine_unix_spawnvp
*/
NTSTATUS WINAPI __wine_unix_spawnvp( char * const argv[], int wait )
{
struct wine_spawnvp_params params = { (char **)argv, wait };
return WINE_UNIX_CALL( unix_wine_spawnvp, &params );
}
/******************************************************************
* LdrLoadDll (NTDLL.@)
*/
......
......@@ -1694,7 +1694,7 @@
# Unix interface
@ stdcall __wine_unix_call(int64 long ptr)
@ stdcall -syscall __wine_unix_spawnvp(long ptr)
@ stdcall __wine_unix_spawnvp(long ptr)
@ stdcall __wine_ctrl_routine(ptr)
@ extern -private __wine_syscall_dispatcher
@ extern -private __wine_unix_call_dispatcher
......
......@@ -357,7 +357,6 @@ static void * const syscalls[] =
NtWriteFileGather,
NtWriteVirtualMemory,
NtYieldExecution,
__wine_unix_spawnvp,
wine_nt_to_unix_file_name,
wine_server_call,
wine_server_fd_to_handle,
......@@ -2061,6 +2060,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
load_so_dll,
unwind_builtin_dll,
unixcall_wine_dbg_write,
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_spawnvp,
system_time_precise,
};
......
......@@ -539,6 +539,44 @@ NTSTATUS WINAPI __wine_unix_spawnvp( char * const argv[], int wait )
/***********************************************************************
* unixcall_wine_spawnvp
*/
NTSTATUS unixcall_wine_spawnvp( void *args )
{
struct wine_spawnvp_params *params = args;
return __wine_unix_spawnvp( params->argv, params->wait );
}
#ifdef _WIN64
/***********************************************************************
* wow64_wine_spawnvp
*/
NTSTATUS wow64_wine_spawnvp( void *args )
{
struct
{
ULONG argv;
int wait;
} const *params32 = args;
ULONG *argv32 = ULongToPtr( params32->argv );
unsigned int i, count = 0;
char **argv;
NTSTATUS ret;
while (argv32[count]) count++;
argv = malloc( (count + 1) * sizeof(*argv) );
for (i = 0; i < count; i++) argv[i] = ULongToPtr( argv32[i] );
argv[count] = NULL;
ret = __wine_unix_spawnvp( argv, params32->wait );
free( argv );
return ret;
}
#endif
/***********************************************************************
* fork_and_exec
*
* Fork and exec a new Unix binary, checking for errors.
......
......@@ -284,8 +284,10 @@ 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_spawnvp( void *args ) DECLSPEC_HIDDEN;
#ifdef _WIN64
extern NTSTATUS wow64_wine_dbg_write( void *args ) DECLSPEC_HIDDEN;
extern NTSTATUS wow64_wine_spawnvp( void *args ) DECLSPEC_HIDDEN;
#endif
extern void dbg_init(void) DECLSPEC_HIDDEN;
......
......@@ -31,6 +31,12 @@ struct wine_dbg_write_params
unsigned int len;
};
struct wine_spawnvp_params
{
char **argv;
int wait;
};
struct load_so_dll_params
{
UNICODE_STRING nt_name;
......@@ -49,6 +55,7 @@ enum ntdll_unix_funcs
unix_load_so_dll,
unix_unwind_builtin_dll,
unix_wine_dbg_write,
unix_wine_spawnvp,
unix_system_time_precise,
};
......
......@@ -542,25 +542,6 @@ NTSTATUS WINAPI wow64_NtSetDefaultUILanguage( UINT *args )
/**********************************************************************
* wow64___wine_unix_spawnvp
*/
NTSTATUS WINAPI wow64___wine_unix_spawnvp( UINT *args )
{
ULONG *argv32 = get_ptr( &args );
int wait = get_ulong( &args );
unsigned int i, count = 0;
char **argv;
while (argv32[count]) count++;
argv = Wow64AllocateTemp( (count + 1) * sizeof(*argv) );
for (i = 0; i < count; i++) argv[i] = ULongToPtr( argv32[i] );
argv[count] = NULL;
return __wine_unix_spawnvp( argv, wait );
}
/**********************************************************************
* wow64_wine_server_call
*/
NTSTATUS WINAPI wow64_wine_server_call( UINT *args )
......
......@@ -257,7 +257,6 @@
SYSCALL_ENTRY( NtWriteFileGather ) \
SYSCALL_ENTRY( NtWriteVirtualMemory ) \
SYSCALL_ENTRY( NtYieldExecution ) \
SYSCALL_ENTRY( __wine_unix_spawnvp ) \
SYSCALL_ENTRY( wine_nt_to_unix_file_name ) \
SYSCALL_ENTRY( wine_server_call ) \
SYSCALL_ENTRY( wine_server_fd_to_handle ) \
......
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