From 93737d5575000f8427776389bad1b0d44d93e9cc Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 29 Dec 2008 17:12:20 +0100 Subject: [PATCH] server: Store debugging output strings as client_ptr_t instead of void pointers. --- dlls/kernel32/debugger.c | 6 +++--- include/wine/server_protocol.h | 12 ++++++------ server/protocol.def | 10 +++++----- server/trace.c | 15 +++++++++------ 4 files changed, 23 insertions(+), 20 deletions(-) diff --git a/dlls/kernel32/debugger.c b/dlls/kernel32/debugger.c index b50f0c3efb0..645fca993cb 100644 --- a/dlls/kernel32/debugger.c +++ b/dlls/kernel32/debugger.c @@ -112,7 +112,7 @@ BOOL WINAPI WaitForDebugEvent( event->u.UnloadDll.lpBaseOfDll = wine_server_get_ptr( data.info.unload_dll.base ); break; case OUTPUT_DEBUG_STRING_EVENT: - event->u.DebugString.lpDebugStringData = data.info.output_string.string; + event->u.DebugString.lpDebugStringData = wine_server_get_ptr( data.info.output_string.string ); event->u.DebugString.fUnicode = data.info.output_string.unicode; event->u.DebugString.nDebugStringLength = data.info.output_string.length; break; @@ -237,7 +237,7 @@ void WINAPI OutputDebugStringA( LPCSTR str ) { SERVER_START_REQ( output_debug_string ) { - req->string = (void *)str; + req->string = wine_server_client_ptr( str ); req->unicode = 0; req->length = strlen(str) + 1; wine_server_call( req ); @@ -264,7 +264,7 @@ void WINAPI OutputDebugStringW( LPCWSTR str ) { SERVER_START_REQ( output_debug_string ) { - req->string = (void *)str; + req->string = wine_server_client_ptr( str ); req->unicode = 1; req->length = (lstrlenW(str) + 1) * sizeof(WCHAR); wine_server_call( req ); diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index d538d80be62..b263a2dfbd9 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -97,9 +97,9 @@ struct debug_event_unload_dll }; struct debug_event_output_string { - void *string; - int unicode; - int length; + client_ptr_t string; + int unicode; + data_size_t length; }; struct debug_event_rip_info { @@ -1873,9 +1873,9 @@ struct get_exception_status_reply struct output_debug_string_request { struct request_header __header; - void* string; + data_size_t length; + client_ptr_t string; int unicode; - int length; }; struct output_debug_string_reply { @@ -5052,6 +5052,6 @@ union generic_reply struct set_window_layered_info_reply set_window_layered_info_reply; }; -#define SERVER_PROTOCOL_VERSION 357 +#define SERVER_PROTOCOL_VERSION 358 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/protocol.def b/server/protocol.def index 69d59285481..6f8dd2cc3e2 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -113,9 +113,9 @@ struct debug_event_unload_dll }; struct debug_event_output_string { - void *string; /* string to display (in debugged process address space) */ - int unicode; /* is it Unicode? */ - int length; /* string length */ + client_ptr_t string; /* string to display (in debugged process address space) */ + int unicode; /* is it Unicode? */ + data_size_t length; /* string length */ }; struct debug_event_rip_info { @@ -1462,9 +1462,9 @@ enum char_info_mode /* Send an output string to the debugger */ @REQ(output_debug_string) - void* string; /* string to display (in debugged process address space) */ + data_size_t length; /* string length */ + client_ptr_t string; /* string to display (in debugged process address space) */ int unicode; /* is it Unicode? */ - int length; /* string length */ @END diff --git a/server/trace.c b/server/trace.c index 3cafe4a9429..f63e20a8440 100644 --- a/server/trace.c +++ b/server/trace.c @@ -485,9 +485,10 @@ static void dump_varargs_debug_event( data_size_t size ) fputc( '}', stderr ); break; case OUTPUT_DEBUG_STRING_EVENT: - fprintf( stderr, "{output_string,data=%p,unicode=%d,len=%d}", - event->info.output_string.string, event->info.output_string.unicode, - event->info.output_string.length ); + fprintf( stderr, "{output_string,string=" ); + dump_uint64( &event->info.output_string.string ); + fprintf( stderr, ",unicode=%d,len=%u}", + event->info.output_string.unicode, event->info.output_string.length ); break; case RIP_EVENT: fprintf( stderr, "{rip,err=%d,type=%d}", @@ -1922,9 +1923,11 @@ static void dump_get_exception_status_reply( const struct get_exception_status_r static void dump_output_debug_string_request( const struct output_debug_string_request *req ) { - fprintf( stderr, " string=%p,", req->string ); - fprintf( stderr, " unicode=%d,", req->unicode ); - fprintf( stderr, " length=%d", req->length ); + fprintf( stderr, " length=%u,", req->length ); + fprintf( stderr, " string=" ); + dump_uint64( &req->string ); + fprintf( stderr, "," ); + fprintf( stderr, " unicode=%d", req->unicode ); } static void dump_continue_debug_event_request( const struct continue_debug_event_request *req ) -- 2.11.4.GIT