Commit 5c62fe0b authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent 7406583e
......@@ -1702,7 +1702,7 @@
@ extern -arch=arm64 __wine_current_teb
# Debugging
@ stdcall -syscall -norelay __wine_dbg_write(ptr long)
@ stdcall -norelay __wine_dbg_write(ptr long)
@ cdecl -norelay __wine_dbg_get_channel_flags(ptr)
@ cdecl -norelay __wine_dbg_header(long long str)
@ cdecl -norelay __wine_dbg_output(str)
......
......@@ -158,6 +158,16 @@ int __cdecl __wine_dbg_header( enum __wine_debug_class cls, struct __wine_debug_
}
/***********************************************************************
* __wine_dbg_write (NTDLL.@)
*/
int WINAPI __wine_dbg_write( const char *str, unsigned int len )
{
struct wine_dbg_write_params params = { str, len };
return WINE_UNIX_CALL( unix_wine_dbg_write, &params );
}
/***********************************************************************
* __wine_dbg_output (NTDLL.@)
*/
int __cdecl __wine_dbg_output( const char *str )
......
......@@ -253,12 +253,30 @@ const char * __cdecl __wine_dbg_strdup( const char *str )
}
/***********************************************************************
* __wine_dbg_write (NTDLL.@)
* unixcall_wine_dbg_write
*/
int WINAPI __wine_dbg_write( const char *str, unsigned int len )
NTSTATUS unixcall_wine_dbg_write( void *args )
{
return write( 2, str, len );
struct wine_dbg_write_params *params = args;
return write( 2, params->str, params->len );
}
#ifdef _WIN64
/***********************************************************************
* wow64_wine_dbg_write
*/
NTSTATUS wow64_wine_dbg_write( void *args )
{
struct
{
ULONG str;
unsigned int len;
} const *params32 = args;
return write( 2, ULongToPtr(params32->str), params32->len );
}
#endif
/***********************************************************************
* __wine_dbg_output (NTDLL.@)
......@@ -272,7 +290,7 @@ int __cdecl __wine_dbg_output( const char *str )
if (end)
{
ret += append_output( info, str, end + 1 - str );
__wine_dbg_write( info->output, info->out_pos );
write( 2, info->output, info->out_pos );
info->out_pos = 0;
str = end + 1;
}
......
......@@ -357,7 +357,6 @@ static void * const syscalls[] =
NtWriteFileGather,
NtWriteVirtualMemory,
NtYieldExecution,
__wine_dbg_write,
__wine_unix_spawnvp,
wine_nt_to_unix_file_name,
wine_server_call,
......@@ -2061,6 +2060,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
{
load_so_dll,
unwind_builtin_dll,
unixcall_wine_dbg_write,
system_time_precise,
};
......@@ -2077,6 +2077,7 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] =
{
wow64_load_so_dll,
wow64_unwind_builtin_dll,
wow64_wine_dbg_write,
system_time_precise,
};
......
......@@ -283,6 +283,11 @@ extern void init_cpu_info(void) DECLSPEC_HIDDEN;
extern void add_completion( HANDLE handle, ULONG_PTR value, NTSTATUS status, ULONG info, BOOL async ) DECLSPEC_HIDDEN;
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;
#ifdef _WIN64
extern NTSTATUS wow64_wine_dbg_write( void *args ) DECLSPEC_HIDDEN;
#endif
extern void dbg_init(void) DECLSPEC_HIDDEN;
extern NTSTATUS call_user_apc_dispatcher( CONTEXT *context_ptr, ULONG_PTR arg1, ULONG_PTR arg2, ULONG_PTR arg3,
......
......@@ -25,6 +25,12 @@
struct _DISPATCHER_CONTEXT;
struct wine_dbg_write_params
{
const char *str;
unsigned int len;
};
struct load_so_dll_params
{
UNICODE_STRING nt_name;
......@@ -42,6 +48,7 @@ enum ntdll_unix_funcs
{
unix_load_so_dll,
unix_unwind_builtin_dll,
unix_wine_dbg_write,
unix_system_time_precise,
};
......
......@@ -542,18 +542,6 @@ NTSTATUS WINAPI wow64_NtSetDefaultUILanguage( UINT *args )
/**********************************************************************
* wow64___wine_dbg_write
*/
NTSTATUS WINAPI wow64___wine_dbg_write( UINT *args )
{
const char *str = get_ptr( &args );
ULONG len = get_ulong( &args );
return __wine_dbg_write( str, len );
}
/**********************************************************************
* wow64___wine_unix_spawnvp
*/
NTSTATUS WINAPI wow64___wine_unix_spawnvp( UINT *args )
......
......@@ -257,7 +257,6 @@
SYSCALL_ENTRY( NtWriteFileGather ) \
SYSCALL_ENTRY( NtWriteVirtualMemory ) \
SYSCALL_ENTRY( NtYieldExecution ) \
SYSCALL_ENTRY( __wine_dbg_write ) \
SYSCALL_ENTRY( __wine_unix_spawnvp ) \
SYSCALL_ENTRY( wine_nt_to_unix_file_name ) \
SYSCALL_ENTRY( wine_server_call ) \
......
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