Avoid crashes if 16-bit module handle was passed to the 32-bit
[wine.git] / server / trace.c
blob9bbd3387d03a98fd6459c7597d54496dac853ae2
1 /*
2 * Server request tracing
4 * Copyright (C) 1999 Alexandre Julliard
5 */
7 #include <ctype.h>
8 #include <stdio.h>
9 #include <sys/types.h>
10 #include <sys/uio.h>
11 #include "winsock2.h"
12 #include "winnt.h"
13 #include "winbase.h"
14 #include "wincon.h"
15 #include "request.h"
16 #include "unicode.h"
19 /* utility functions */
21 static void dump_uints( const int *ptr, int len )
23 fputc( '{', stderr );
24 while (len > 0)
26 fprintf( stderr, "%08x", *ptr++ );
27 if (--len) fputc( ',', stderr );
29 fputc( '}', stderr );
32 static void dump_bytes( const unsigned char *ptr, int len )
34 fputc( '{', stderr );
35 while (len > 0)
37 fprintf( stderr, "%02x", *ptr++ );
38 if (--len) fputc( ',', stderr );
40 fputc( '}', stderr );
43 static void dump_string( const void *req, const char *str )
45 int len = get_req_strlen( req, str );
46 fprintf( stderr, "\"%.*s\"", len, str );
49 static void dump_unicode_string( const void *req, const WCHAR *str )
51 size_t len = get_req_strlenW( req, str );
52 fprintf( stderr, "L\"" );
53 dump_strW( str, len, stderr, "\"\"" );
54 fputc( '\"', stderr );
57 static void dump_path_t( const void *req, const path_t *path )
59 dump_unicode_string( req, *path );
62 static void dump_exc_record( const EXCEPTION_RECORD *rec )
64 int i;
65 fprintf( stderr, "{code=%lx,flags=%lx,rec=%p,addr=%p,params={",
66 rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionRecord,
67 rec->ExceptionAddress );
68 for (i = 0; i < rec->NumberParameters; i++)
70 if (i) fputc( ',', stderr );
71 fprintf( stderr, "%lx", rec->ExceptionInformation[i] );
73 fputc( '}', stderr );
76 static void dump_varargs_ints( const void *ptr, size_t len )
78 const int *data = ptr;
79 len /= sizeof(*data);
81 fputc( '{', stderr );
82 while (len > 0)
84 fprintf( stderr, "%d", *data++ );
85 if (--len) fputc( ',', stderr );
87 fputc( '}', stderr );
90 static void dump_varargs_ptrs( const void *ptr, size_t len )
92 void * const *data = ptr;
93 len /= sizeof(*data);
95 fputc( '{', stderr );
96 while (len > 0)
98 fprintf( stderr, "%p", *data++ );
99 if (--len) fputc( ',', stderr );
101 fputc( '}', stderr );
104 static void dump_varargs_string( const void *ptr, size_t len )
106 fprintf( stderr, "\"%.*s\"", (int)len, (char *)ptr );
109 static void dump_varargs_unicode_str( const void *ptr, size_t len )
111 fprintf( stderr, "L\"" );
112 dump_strW( ptr, len / sizeof(WCHAR), stderr, "\"\"" );
113 fputc( '\"', stderr );
116 static void dump_varargs_context( const void *ptr, size_t len )
118 const CONTEXT *context = ptr;
119 #ifdef __i386__
120 fprintf( stderr, "{flags=%08lx,eax=%08lx,ebx=%08lx,ecx=%08lx,edx=%08lx,esi=%08lx,edi=%08lx,"
121 "ebp=%08lx,eip=%08lx,esp=%08lx,eflags=%08lx,cs=%04lx,ds=%04lx,es=%04lx,"
122 "fs=%04lx,gs=%04lx,dr0=%08lx,dr1=%08lx,dr2=%08lx,dr3=%08lx,dr6=%08lx,dr7=%08lx,",
123 context->ContextFlags, context->Eax, context->Ebx, context->Ecx, context->Edx,
124 context->Esi, context->Edi, context->Ebp, context->Eip, context->Esp, context->EFlags,
125 context->SegCs, context->SegDs, context->SegEs, context->SegFs, context->SegGs,
126 context->Dr0, context->Dr1, context->Dr2, context->Dr3, context->Dr6, context->Dr7 );
127 fprintf( stderr, "float=" );
128 dump_uints( (int *)&context->FloatSave, sizeof(context->FloatSave) / sizeof(int) );
129 fprintf( stderr, "}" );
130 #else
131 dump_uints( (int *)context, sizeof(*context) / sizeof(int) );
132 #endif
135 static void dump_varargs_exc_event( const void *ptr, size_t len )
137 fprintf( stderr, "{context=" );
138 dump_varargs_context( ptr, sizeof(CONTEXT) );
139 fprintf( stderr, ",rec=" );
140 dump_exc_record( (EXCEPTION_RECORD *)((CONTEXT *)ptr + 1) );
141 fputc( '}', stderr );
144 static void dump_varargs_debug_event( const void *ptr, size_t len )
146 const debug_event_t *event = ptr;
148 if (!len)
150 fprintf( stderr, "{}" );
151 return;
153 switch(event->code)
155 case EXCEPTION_DEBUG_EVENT:
156 fprintf( stderr, "{exception," );
157 dump_exc_record( &event->info.exception.record );
158 fprintf( stderr, ",first=%d}", event->info.exception.first );
159 break;
160 case CREATE_THREAD_DEBUG_EVENT:
161 fprintf( stderr, "{create_thread,thread=%d,teb=%p,start=%p}",
162 event->info.create_thread.handle, event->info.create_thread.teb,
163 event->info.create_thread.start );
164 break;
165 case CREATE_PROCESS_DEBUG_EVENT:
166 fprintf( stderr, "{create_process,file=%d,process=%d,thread=%d,base=%p,offset=%d,"
167 "size=%d,teb=%p,start=%p,name=%p,unicode=%d}",
168 event->info.create_process.file, event->info.create_process.process,
169 event->info.create_process.thread, event->info.create_process.base,
170 event->info.create_process.dbg_offset, event->info.create_process.dbg_size,
171 event->info.create_process.teb, event->info.create_process.start,
172 event->info.create_process.name, event->info.create_process.unicode );
173 break;
174 case EXIT_THREAD_DEBUG_EVENT:
175 fprintf( stderr, "{exit_thread,code=%d}", event->info.exit.exit_code );
176 break;
177 case EXIT_PROCESS_DEBUG_EVENT:
178 fprintf( stderr, "{exit_process,code=%d}", event->info.exit.exit_code );
179 break;
180 case LOAD_DLL_DEBUG_EVENT:
181 fprintf( stderr, "{load_dll,file=%d,base=%p,offset=%d,size=%d,name=%p,unicode=%d}",
182 event->info.load_dll.handle, event->info.load_dll.base,
183 event->info.load_dll.dbg_offset, event->info.load_dll.dbg_size,
184 event->info.load_dll.name, event->info.load_dll.unicode );
185 break;
186 case UNLOAD_DLL_DEBUG_EVENT:
187 fprintf( stderr, "{unload_dll,base=%p}", event->info.unload_dll.base );
188 break;
189 case OUTPUT_DEBUG_STRING_EVENT:
190 fprintf( stderr, "{output_string,data=%p,unicode=%d,len=%d}",
191 event->info.output_string.string, event->info.output_string.unicode,
192 event->info.output_string.length );
193 break;
194 case RIP_EVENT:
195 fprintf( stderr, "{rip,err=%d,type=%d}",
196 event->info.rip_info.error, event->info.rip_info.type );
197 break;
198 case 0: /* zero is the code returned on timeouts */
199 fprintf( stderr, "{}" );
200 break;
201 default:
202 fprintf( stderr, "{code=??? (%d)}", event->code );
203 break;
207 static void dump_varargs_input_records( const void *ptr, size_t len )
209 const INPUT_RECORD *rec = ptr;
210 len /= sizeof(*rec);
212 fputc( '{', stderr );
213 while (len > 0)
215 fprintf( stderr, "{%04x,...}", rec->EventType );
216 rec++;
217 if (--len) fputc( ',', stderr );
219 fputc( '}', stderr );
222 /* dumping for functions for requests that have a variable part */
224 static void dump_varargs_read_process_memory_reply( const struct read_process_memory_request *req )
226 int count = min( req->len, get_req_size( req, req->data, sizeof(int) ));
227 dump_bytes( (unsigned char *)req->data, count * sizeof(int) );
230 static void dump_varargs_write_process_memory_request( const struct write_process_memory_request *req )
232 int count = min( req->len, get_req_size( req, req->data, sizeof(int) ));
233 dump_bytes( (unsigned char *)req->data, count * sizeof(int) );
236 static void dump_varargs_set_key_value_request( const struct set_key_value_request *req )
238 int count = min( req->len, get_req_size( req, req->data, 1 ));
239 dump_bytes( req->data, count );
242 static void dump_varargs_get_key_value_reply( const struct get_key_value_request *req )
244 int count = min( req->len - req->offset, get_req_size( req, req->data, 1 ));
245 dump_bytes( req->data, count );
248 static void dump_varargs_enum_key_value_reply( const struct enum_key_value_request *req )
250 int count = min( req->len - req->offset, get_req_size( req, req->data, 1 ));
251 dump_bytes( req->data, count );
254 typedef void (*dump_func)( const void *req );
256 /* Everything below this line is generated automatically by tools/make_requests */
257 /* ### make_requests begin ### */
259 static void dump_new_process_request( const struct new_process_request *req )
261 fprintf( stderr, " inherit_all=%d,", req->inherit_all );
262 fprintf( stderr, " create_flags=%d,", req->create_flags );
263 fprintf( stderr, " start_flags=%d,", req->start_flags );
264 fprintf( stderr, " exe_file=%d,", req->exe_file );
265 fprintf( stderr, " hstdin=%d,", req->hstdin );
266 fprintf( stderr, " hstdout=%d,", req->hstdout );
267 fprintf( stderr, " hstderr=%d,", req->hstderr );
268 fprintf( stderr, " cmd_show=%d,", req->cmd_show );
269 fprintf( stderr, " alloc_fd=%d,", req->alloc_fd );
270 fprintf( stderr, " filename=" );
271 dump_varargs_string( get_req_data(req), get_req_data_size(req) );
274 static void dump_wait_process_request( const struct wait_process_request *req )
276 fprintf( stderr, " pinherit=%d,", req->pinherit );
277 fprintf( stderr, " tinherit=%d,", req->tinherit );
278 fprintf( stderr, " timeout=%d,", req->timeout );
279 fprintf( stderr, " cancel=%d", req->cancel );
282 static void dump_wait_process_reply( const struct wait_process_request *req )
284 fprintf( stderr, " pid=%p,", req->pid );
285 fprintf( stderr, " phandle=%d,", req->phandle );
286 fprintf( stderr, " tid=%p,", req->tid );
287 fprintf( stderr, " thandle=%d,", req->thandle );
288 fprintf( stderr, " event=%d", req->event );
291 static void dump_new_thread_request( const struct new_thread_request *req )
293 fprintf( stderr, " suspend=%d,", req->suspend );
294 fprintf( stderr, " inherit=%d", req->inherit );
297 static void dump_new_thread_reply( const struct new_thread_request *req )
299 fprintf( stderr, " tid=%p,", req->tid );
300 fprintf( stderr, " handle=%d", req->handle );
303 static void dump_boot_done_request( const struct boot_done_request *req )
305 fprintf( stderr, " debug_level=%d", req->debug_level );
308 static void dump_init_process_request( const struct init_process_request *req )
310 fprintf( stderr, " ldt_copy=%p,", req->ldt_copy );
311 fprintf( stderr, " ldt_flags=%p,", req->ldt_flags );
312 fprintf( stderr, " ppid=%d", req->ppid );
315 static void dump_init_process_reply( const struct init_process_request *req )
317 fprintf( stderr, " start_flags=%d,", req->start_flags );
318 fprintf( stderr, " server_start=%08x,", req->server_start );
319 fprintf( stderr, " exe_file=%d,", req->exe_file );
320 fprintf( stderr, " hstdin=%d,", req->hstdin );
321 fprintf( stderr, " hstdout=%d,", req->hstdout );
322 fprintf( stderr, " hstderr=%d,", req->hstderr );
323 fprintf( stderr, " cmd_show=%d,", req->cmd_show );
324 fprintf( stderr, " filename=" );
325 dump_varargs_string( get_req_data(req), get_req_data_size(req) );
328 static void dump_init_process_done_request( const struct init_process_done_request *req )
330 fprintf( stderr, " module=%p,", req->module );
331 fprintf( stderr, " entry=%p,", req->entry );
332 fprintf( stderr, " name=%p,", req->name );
333 fprintf( stderr, " gui=%d", req->gui );
336 static void dump_init_process_done_reply( const struct init_process_done_request *req )
338 fprintf( stderr, " debugged=%d", req->debugged );
341 static void dump_init_thread_request( const struct init_thread_request *req )
343 fprintf( stderr, " unix_pid=%d,", req->unix_pid );
344 fprintf( stderr, " teb=%p,", req->teb );
345 fprintf( stderr, " entry=%p", req->entry );
348 static void dump_get_thread_buffer_request( const struct get_thread_buffer_request *req )
352 static void dump_get_thread_buffer_reply( const struct get_thread_buffer_request *req )
354 fprintf( stderr, " pid=%p,", req->pid );
355 fprintf( stderr, " tid=%p,", req->tid );
356 fprintf( stderr, " boot=%d,", req->boot );
357 fprintf( stderr, " version=%d", req->version );
360 static void dump_terminate_process_request( const struct terminate_process_request *req )
362 fprintf( stderr, " handle=%d,", req->handle );
363 fprintf( stderr, " exit_code=%d", req->exit_code );
366 static void dump_terminate_process_reply( const struct terminate_process_request *req )
368 fprintf( stderr, " self=%d", req->self );
371 static void dump_terminate_thread_request( const struct terminate_thread_request *req )
373 fprintf( stderr, " handle=%d,", req->handle );
374 fprintf( stderr, " exit_code=%d", req->exit_code );
377 static void dump_terminate_thread_reply( const struct terminate_thread_request *req )
379 fprintf( stderr, " self=%d,", req->self );
380 fprintf( stderr, " last=%d", req->last );
383 static void dump_get_process_info_request( const struct get_process_info_request *req )
385 fprintf( stderr, " handle=%d", req->handle );
388 static void dump_get_process_info_reply( const struct get_process_info_request *req )
390 fprintf( stderr, " pid=%p,", req->pid );
391 fprintf( stderr, " debugged=%d,", req->debugged );
392 fprintf( stderr, " exit_code=%d,", req->exit_code );
393 fprintf( stderr, " priority=%d,", req->priority );
394 fprintf( stderr, " process_affinity=%d,", req->process_affinity );
395 fprintf( stderr, " system_affinity=%d", req->system_affinity );
398 static void dump_set_process_info_request( const struct set_process_info_request *req )
400 fprintf( stderr, " handle=%d,", req->handle );
401 fprintf( stderr, " mask=%d,", req->mask );
402 fprintf( stderr, " priority=%d,", req->priority );
403 fprintf( stderr, " affinity=%d", req->affinity );
406 static void dump_get_thread_info_request( const struct get_thread_info_request *req )
408 fprintf( stderr, " handle=%d,", req->handle );
409 fprintf( stderr, " tid_in=%p", req->tid_in );
412 static void dump_get_thread_info_reply( const struct get_thread_info_request *req )
414 fprintf( stderr, " tid=%p,", req->tid );
415 fprintf( stderr, " teb=%p,", req->teb );
416 fprintf( stderr, " exit_code=%d,", req->exit_code );
417 fprintf( stderr, " priority=%d", req->priority );
420 static void dump_set_thread_info_request( const struct set_thread_info_request *req )
422 fprintf( stderr, " handle=%d,", req->handle );
423 fprintf( stderr, " mask=%d,", req->mask );
424 fprintf( stderr, " priority=%d,", req->priority );
425 fprintf( stderr, " affinity=%d", req->affinity );
428 static void dump_suspend_thread_request( const struct suspend_thread_request *req )
430 fprintf( stderr, " handle=%d", req->handle );
433 static void dump_suspend_thread_reply( const struct suspend_thread_request *req )
435 fprintf( stderr, " count=%d", req->count );
438 static void dump_resume_thread_request( const struct resume_thread_request *req )
440 fprintf( stderr, " handle=%d", req->handle );
443 static void dump_resume_thread_reply( const struct resume_thread_request *req )
445 fprintf( stderr, " count=%d", req->count );
448 static void dump_load_dll_request( const struct load_dll_request *req )
450 fprintf( stderr, " handle=%d,", req->handle );
451 fprintf( stderr, " base=%p,", req->base );
452 fprintf( stderr, " dbg_offset=%d,", req->dbg_offset );
453 fprintf( stderr, " dbg_size=%d,", req->dbg_size );
454 fprintf( stderr, " name=%p", req->name );
457 static void dump_unload_dll_request( const struct unload_dll_request *req )
459 fprintf( stderr, " base=%p", req->base );
462 static void dump_queue_apc_request( const struct queue_apc_request *req )
464 fprintf( stderr, " handle=%d,", req->handle );
465 fprintf( stderr, " func=%p,", req->func );
466 fprintf( stderr, " param=%p", req->param );
469 static void dump_get_apc_request( const struct get_apc_request *req )
473 static void dump_get_apc_reply( const struct get_apc_request *req )
475 fprintf( stderr, " func=%p,", req->func );
476 fprintf( stderr, " type=%d,", req->type );
477 fprintf( stderr, " args=" );
478 dump_varargs_ptrs( get_req_data(req), get_req_data_size(req) );
481 static void dump_close_handle_request( const struct close_handle_request *req )
483 fprintf( stderr, " handle=%d", req->handle );
486 static void dump_get_handle_info_request( const struct get_handle_info_request *req )
488 fprintf( stderr, " handle=%d", req->handle );
491 static void dump_get_handle_info_reply( const struct get_handle_info_request *req )
493 fprintf( stderr, " flags=%d", req->flags );
496 static void dump_set_handle_info_request( const struct set_handle_info_request *req )
498 fprintf( stderr, " handle=%d,", req->handle );
499 fprintf( stderr, " flags=%d,", req->flags );
500 fprintf( stderr, " mask=%d", req->mask );
503 static void dump_dup_handle_request( const struct dup_handle_request *req )
505 fprintf( stderr, " src_process=%d,", req->src_process );
506 fprintf( stderr, " src_handle=%d,", req->src_handle );
507 fprintf( stderr, " dst_process=%d,", req->dst_process );
508 fprintf( stderr, " access=%08x,", req->access );
509 fprintf( stderr, " inherit=%d,", req->inherit );
510 fprintf( stderr, " options=%d", req->options );
513 static void dump_dup_handle_reply( const struct dup_handle_request *req )
515 fprintf( stderr, " handle=%d", req->handle );
518 static void dump_open_process_request( const struct open_process_request *req )
520 fprintf( stderr, " pid=%p,", req->pid );
521 fprintf( stderr, " access=%08x,", req->access );
522 fprintf( stderr, " inherit=%d", req->inherit );
525 static void dump_open_process_reply( const struct open_process_request *req )
527 fprintf( stderr, " handle=%d", req->handle );
530 static void dump_select_request( const struct select_request *req )
532 fprintf( stderr, " flags=%d,", req->flags );
533 fprintf( stderr, " timeout=%d,", req->timeout );
534 fprintf( stderr, " handles=" );
535 dump_varargs_ints( get_req_data(req), get_req_data_size(req) );
538 static void dump_select_reply( const struct select_request *req )
540 fprintf( stderr, " signaled=%d", req->signaled );
543 static void dump_create_event_request( const struct create_event_request *req )
545 fprintf( stderr, " manual_reset=%d,", req->manual_reset );
546 fprintf( stderr, " initial_state=%d,", req->initial_state );
547 fprintf( stderr, " inherit=%d,", req->inherit );
548 fprintf( stderr, " name=" );
549 dump_varargs_unicode_str( get_req_data(req), get_req_data_size(req) );
552 static void dump_create_event_reply( const struct create_event_request *req )
554 fprintf( stderr, " handle=%d", req->handle );
557 static void dump_event_op_request( const struct event_op_request *req )
559 fprintf( stderr, " handle=%d,", req->handle );
560 fprintf( stderr, " op=%d", req->op );
563 static void dump_open_event_request( const struct open_event_request *req )
565 fprintf( stderr, " access=%08x,", req->access );
566 fprintf( stderr, " inherit=%d,", req->inherit );
567 fprintf( stderr, " name=" );
568 dump_varargs_unicode_str( get_req_data(req), get_req_data_size(req) );
571 static void dump_open_event_reply( const struct open_event_request *req )
573 fprintf( stderr, " handle=%d", req->handle );
576 static void dump_create_mutex_request( const struct create_mutex_request *req )
578 fprintf( stderr, " owned=%d,", req->owned );
579 fprintf( stderr, " inherit=%d,", req->inherit );
580 fprintf( stderr, " name=" );
581 dump_varargs_unicode_str( get_req_data(req), get_req_data_size(req) );
584 static void dump_create_mutex_reply( const struct create_mutex_request *req )
586 fprintf( stderr, " handle=%d", req->handle );
589 static void dump_release_mutex_request( const struct release_mutex_request *req )
591 fprintf( stderr, " handle=%d", req->handle );
594 static void dump_open_mutex_request( const struct open_mutex_request *req )
596 fprintf( stderr, " access=%08x,", req->access );
597 fprintf( stderr, " inherit=%d,", req->inherit );
598 fprintf( stderr, " name=" );
599 dump_varargs_unicode_str( get_req_data(req), get_req_data_size(req) );
602 static void dump_open_mutex_reply( const struct open_mutex_request *req )
604 fprintf( stderr, " handle=%d", req->handle );
607 static void dump_create_semaphore_request( const struct create_semaphore_request *req )
609 fprintf( stderr, " initial=%08x,", req->initial );
610 fprintf( stderr, " max=%08x,", req->max );
611 fprintf( stderr, " inherit=%d,", req->inherit );
612 fprintf( stderr, " name=" );
613 dump_varargs_unicode_str( get_req_data(req), get_req_data_size(req) );
616 static void dump_create_semaphore_reply( const struct create_semaphore_request *req )
618 fprintf( stderr, " handle=%d", req->handle );
621 static void dump_release_semaphore_request( const struct release_semaphore_request *req )
623 fprintf( stderr, " handle=%d,", req->handle );
624 fprintf( stderr, " count=%08x", req->count );
627 static void dump_release_semaphore_reply( const struct release_semaphore_request *req )
629 fprintf( stderr, " prev_count=%08x", req->prev_count );
632 static void dump_open_semaphore_request( const struct open_semaphore_request *req )
634 fprintf( stderr, " access=%08x,", req->access );
635 fprintf( stderr, " inherit=%d,", req->inherit );
636 fprintf( stderr, " name=" );
637 dump_varargs_unicode_str( get_req_data(req), get_req_data_size(req) );
640 static void dump_open_semaphore_reply( const struct open_semaphore_request *req )
642 fprintf( stderr, " handle=%d", req->handle );
645 static void dump_create_file_request( const struct create_file_request *req )
647 fprintf( stderr, " access=%08x,", req->access );
648 fprintf( stderr, " inherit=%d,", req->inherit );
649 fprintf( stderr, " sharing=%08x,", req->sharing );
650 fprintf( stderr, " create=%d,", req->create );
651 fprintf( stderr, " attrs=%08x,", req->attrs );
652 fprintf( stderr, " filename=" );
653 dump_varargs_string( get_req_data(req), get_req_data_size(req) );
656 static void dump_create_file_reply( const struct create_file_request *req )
658 fprintf( stderr, " handle=%d", req->handle );
661 static void dump_alloc_file_handle_request( const struct alloc_file_handle_request *req )
663 fprintf( stderr, " access=%08x", req->access );
666 static void dump_alloc_file_handle_reply( const struct alloc_file_handle_request *req )
668 fprintf( stderr, " handle=%d", req->handle );
671 static void dump_get_read_fd_request( const struct get_read_fd_request *req )
673 fprintf( stderr, " handle=%d", req->handle );
676 static void dump_get_write_fd_request( const struct get_write_fd_request *req )
678 fprintf( stderr, " handle=%d", req->handle );
681 static void dump_set_file_pointer_request( const struct set_file_pointer_request *req )
683 fprintf( stderr, " handle=%d,", req->handle );
684 fprintf( stderr, " low=%d,", req->low );
685 fprintf( stderr, " high=%d,", req->high );
686 fprintf( stderr, " whence=%d", req->whence );
689 static void dump_set_file_pointer_reply( const struct set_file_pointer_request *req )
691 fprintf( stderr, " new_low=%d,", req->new_low );
692 fprintf( stderr, " new_high=%d", req->new_high );
695 static void dump_truncate_file_request( const struct truncate_file_request *req )
697 fprintf( stderr, " handle=%d", req->handle );
700 static void dump_set_file_time_request( const struct set_file_time_request *req )
702 fprintf( stderr, " handle=%d,", req->handle );
703 fprintf( stderr, " access_time=%ld,", req->access_time );
704 fprintf( stderr, " write_time=%ld", req->write_time );
707 static void dump_flush_file_request( const struct flush_file_request *req )
709 fprintf( stderr, " handle=%d", req->handle );
712 static void dump_get_file_info_request( const struct get_file_info_request *req )
714 fprintf( stderr, " handle=%d", req->handle );
717 static void dump_get_file_info_reply( const struct get_file_info_request *req )
719 fprintf( stderr, " type=%d,", req->type );
720 fprintf( stderr, " attr=%d,", req->attr );
721 fprintf( stderr, " access_time=%ld,", req->access_time );
722 fprintf( stderr, " write_time=%ld,", req->write_time );
723 fprintf( stderr, " size_high=%d,", req->size_high );
724 fprintf( stderr, " size_low=%d,", req->size_low );
725 fprintf( stderr, " links=%d,", req->links );
726 fprintf( stderr, " index_high=%d,", req->index_high );
727 fprintf( stderr, " index_low=%d,", req->index_low );
728 fprintf( stderr, " serial=%08x", req->serial );
731 static void dump_lock_file_request( const struct lock_file_request *req )
733 fprintf( stderr, " handle=%d,", req->handle );
734 fprintf( stderr, " offset_low=%08x,", req->offset_low );
735 fprintf( stderr, " offset_high=%08x,", req->offset_high );
736 fprintf( stderr, " count_low=%08x,", req->count_low );
737 fprintf( stderr, " count_high=%08x", req->count_high );
740 static void dump_unlock_file_request( const struct unlock_file_request *req )
742 fprintf( stderr, " handle=%d,", req->handle );
743 fprintf( stderr, " offset_low=%08x,", req->offset_low );
744 fprintf( stderr, " offset_high=%08x,", req->offset_high );
745 fprintf( stderr, " count_low=%08x,", req->count_low );
746 fprintf( stderr, " count_high=%08x", req->count_high );
749 static void dump_create_pipe_request( const struct create_pipe_request *req )
751 fprintf( stderr, " inherit=%d", req->inherit );
754 static void dump_create_pipe_reply( const struct create_pipe_request *req )
756 fprintf( stderr, " handle_read=%d,", req->handle_read );
757 fprintf( stderr, " handle_write=%d", req->handle_write );
760 static void dump_create_socket_request( const struct create_socket_request *req )
762 fprintf( stderr, " access=%08x,", req->access );
763 fprintf( stderr, " inherit=%d,", req->inherit );
764 fprintf( stderr, " family=%d,", req->family );
765 fprintf( stderr, " type=%d,", req->type );
766 fprintf( stderr, " protocol=%d", req->protocol );
769 static void dump_create_socket_reply( const struct create_socket_request *req )
771 fprintf( stderr, " handle=%d", req->handle );
774 static void dump_accept_socket_request( const struct accept_socket_request *req )
776 fprintf( stderr, " lhandle=%d,", req->lhandle );
777 fprintf( stderr, " access=%08x,", req->access );
778 fprintf( stderr, " inherit=%d", req->inherit );
781 static void dump_accept_socket_reply( const struct accept_socket_request *req )
783 fprintf( stderr, " handle=%d", req->handle );
786 static void dump_set_socket_event_request( const struct set_socket_event_request *req )
788 fprintf( stderr, " handle=%d,", req->handle );
789 fprintf( stderr, " mask=%08x,", req->mask );
790 fprintf( stderr, " event=%d", req->event );
793 static void dump_get_socket_event_request( const struct get_socket_event_request *req )
795 fprintf( stderr, " handle=%d,", req->handle );
796 fprintf( stderr, " service=%d,", req->service );
797 fprintf( stderr, " s_event=%d,", req->s_event );
798 fprintf( stderr, " c_event=%d", req->c_event );
801 static void dump_get_socket_event_reply( const struct get_socket_event_request *req )
803 fprintf( stderr, " mask=%08x,", req->mask );
804 fprintf( stderr, " pmask=%08x,", req->pmask );
805 fprintf( stderr, " state=%08x,", req->state );
806 fprintf( stderr, " errors=" );
807 dump_varargs_ints( get_req_data(req), get_req_data_size(req) );
810 static void dump_enable_socket_event_request( const struct enable_socket_event_request *req )
812 fprintf( stderr, " handle=%d,", req->handle );
813 fprintf( stderr, " mask=%08x,", req->mask );
814 fprintf( stderr, " sstate=%08x,", req->sstate );
815 fprintf( stderr, " cstate=%08x", req->cstate );
818 static void dump_alloc_console_request( const struct alloc_console_request *req )
820 fprintf( stderr, " access=%08x,", req->access );
821 fprintf( stderr, " inherit=%d", req->inherit );
824 static void dump_alloc_console_reply( const struct alloc_console_request *req )
826 fprintf( stderr, " handle_in=%d,", req->handle_in );
827 fprintf( stderr, " handle_out=%d", req->handle_out );
830 static void dump_free_console_request( const struct free_console_request *req )
834 static void dump_open_console_request( const struct open_console_request *req )
836 fprintf( stderr, " output=%d,", req->output );
837 fprintf( stderr, " access=%08x,", req->access );
838 fprintf( stderr, " inherit=%d", req->inherit );
841 static void dump_open_console_reply( const struct open_console_request *req )
843 fprintf( stderr, " handle=%d", req->handle );
846 static void dump_set_console_fd_request( const struct set_console_fd_request *req )
848 fprintf( stderr, " handle=%d,", req->handle );
849 fprintf( stderr, " file_handle=%d,", req->file_handle );
850 fprintf( stderr, " pid=%d", req->pid );
853 static void dump_get_console_mode_request( const struct get_console_mode_request *req )
855 fprintf( stderr, " handle=%d", req->handle );
858 static void dump_get_console_mode_reply( const struct get_console_mode_request *req )
860 fprintf( stderr, " mode=%d", req->mode );
863 static void dump_set_console_mode_request( const struct set_console_mode_request *req )
865 fprintf( stderr, " handle=%d,", req->handle );
866 fprintf( stderr, " mode=%d", req->mode );
869 static void dump_set_console_info_request( const struct set_console_info_request *req )
871 fprintf( stderr, " handle=%d,", req->handle );
872 fprintf( stderr, " mask=%d,", req->mask );
873 fprintf( stderr, " cursor_size=%d,", req->cursor_size );
874 fprintf( stderr, " cursor_visible=%d,", req->cursor_visible );
875 fprintf( stderr, " title=" );
876 dump_varargs_string( get_req_data(req), get_req_data_size(req) );
879 static void dump_get_console_info_request( const struct get_console_info_request *req )
881 fprintf( stderr, " handle=%d", req->handle );
884 static void dump_get_console_info_reply( const struct get_console_info_request *req )
886 fprintf( stderr, " cursor_size=%d,", req->cursor_size );
887 fprintf( stderr, " cursor_visible=%d,", req->cursor_visible );
888 fprintf( stderr, " pid=%d,", req->pid );
889 fprintf( stderr, " title=" );
890 dump_varargs_string( get_req_data(req), get_req_data_size(req) );
893 static void dump_write_console_input_request( const struct write_console_input_request *req )
895 fprintf( stderr, " handle=%d,", req->handle );
896 fprintf( stderr, " rec=" );
897 dump_varargs_input_records( get_req_data(req), get_req_data_size(req) );
900 static void dump_write_console_input_reply( const struct write_console_input_request *req )
902 fprintf( stderr, " written=%d", req->written );
905 static void dump_read_console_input_request( const struct read_console_input_request *req )
907 fprintf( stderr, " handle=%d,", req->handle );
908 fprintf( stderr, " flush=%d", req->flush );
911 static void dump_read_console_input_reply( const struct read_console_input_request *req )
913 fprintf( stderr, " read=%d,", req->read );
914 fprintf( stderr, " rec=" );
915 dump_varargs_input_records( get_req_data(req), get_req_data_size(req) );
918 static void dump_create_change_notification_request( const struct create_change_notification_request *req )
920 fprintf( stderr, " subtree=%d,", req->subtree );
921 fprintf( stderr, " filter=%d", req->filter );
924 static void dump_create_change_notification_reply( const struct create_change_notification_request *req )
926 fprintf( stderr, " handle=%d", req->handle );
929 static void dump_create_mapping_request( const struct create_mapping_request *req )
931 fprintf( stderr, " size_high=%d,", req->size_high );
932 fprintf( stderr, " size_low=%d,", req->size_low );
933 fprintf( stderr, " protect=%d,", req->protect );
934 fprintf( stderr, " inherit=%d,", req->inherit );
935 fprintf( stderr, " file_handle=%d,", req->file_handle );
936 fprintf( stderr, " name=" );
937 dump_varargs_unicode_str( get_req_data(req), get_req_data_size(req) );
940 static void dump_create_mapping_reply( const struct create_mapping_request *req )
942 fprintf( stderr, " handle=%d", req->handle );
945 static void dump_open_mapping_request( const struct open_mapping_request *req )
947 fprintf( stderr, " access=%08x,", req->access );
948 fprintf( stderr, " inherit=%d,", req->inherit );
949 fprintf( stderr, " name=" );
950 dump_varargs_unicode_str( get_req_data(req), get_req_data_size(req) );
953 static void dump_open_mapping_reply( const struct open_mapping_request *req )
955 fprintf( stderr, " handle=%d", req->handle );
958 static void dump_get_mapping_info_request( const struct get_mapping_info_request *req )
960 fprintf( stderr, " handle=%d", req->handle );
963 static void dump_get_mapping_info_reply( const struct get_mapping_info_request *req )
965 fprintf( stderr, " size_high=%d,", req->size_high );
966 fprintf( stderr, " size_low=%d,", req->size_low );
967 fprintf( stderr, " protect=%d,", req->protect );
968 fprintf( stderr, " header_size=%d,", req->header_size );
969 fprintf( stderr, " base=%p,", req->base );
970 fprintf( stderr, " shared_file=%d,", req->shared_file );
971 fprintf( stderr, " shared_size=%d", req->shared_size );
974 static void dump_create_device_request( const struct create_device_request *req )
976 fprintf( stderr, " access=%08x,", req->access );
977 fprintf( stderr, " inherit=%d,", req->inherit );
978 fprintf( stderr, " id=%d", req->id );
981 static void dump_create_device_reply( const struct create_device_request *req )
983 fprintf( stderr, " handle=%d", req->handle );
986 static void dump_create_snapshot_request( const struct create_snapshot_request *req )
988 fprintf( stderr, " inherit=%d,", req->inherit );
989 fprintf( stderr, " flags=%d,", req->flags );
990 fprintf( stderr, " pid=%p", req->pid );
993 static void dump_create_snapshot_reply( const struct create_snapshot_request *req )
995 fprintf( stderr, " handle=%d", req->handle );
998 static void dump_next_process_request( const struct next_process_request *req )
1000 fprintf( stderr, " handle=%d,", req->handle );
1001 fprintf( stderr, " reset=%d", req->reset );
1004 static void dump_next_process_reply( const struct next_process_request *req )
1006 fprintf( stderr, " count=%d,", req->count );
1007 fprintf( stderr, " pid=%p,", req->pid );
1008 fprintf( stderr, " threads=%d,", req->threads );
1009 fprintf( stderr, " priority=%d", req->priority );
1012 static void dump_next_thread_request( const struct next_thread_request *req )
1014 fprintf( stderr, " handle=%d,", req->handle );
1015 fprintf( stderr, " reset=%d", req->reset );
1018 static void dump_next_thread_reply( const struct next_thread_request *req )
1020 fprintf( stderr, " count=%d,", req->count );
1021 fprintf( stderr, " pid=%p,", req->pid );
1022 fprintf( stderr, " tid=%p,", req->tid );
1023 fprintf( stderr, " base_pri=%d,", req->base_pri );
1024 fprintf( stderr, " delta_pri=%d", req->delta_pri );
1027 static void dump_next_module_request( const struct next_module_request *req )
1029 fprintf( stderr, " handle=%d,", req->handle );
1030 fprintf( stderr, " reset=%d", req->reset );
1033 static void dump_next_module_reply( const struct next_module_request *req )
1035 fprintf( stderr, " pid=%p,", req->pid );
1036 fprintf( stderr, " base=%p", req->base );
1039 static void dump_wait_debug_event_request( const struct wait_debug_event_request *req )
1041 fprintf( stderr, " timeout=%d", req->timeout );
1044 static void dump_wait_debug_event_reply( const struct wait_debug_event_request *req )
1046 fprintf( stderr, " pid=%p,", req->pid );
1047 fprintf( stderr, " tid=%p,", req->tid );
1048 fprintf( stderr, " event=" );
1049 dump_varargs_debug_event( get_req_data(req), get_req_data_size(req) );
1052 static void dump_exception_event_request( const struct exception_event_request *req )
1054 fprintf( stderr, " first=%d,", req->first );
1055 fprintf( stderr, " record=" );
1056 dump_varargs_exc_event( get_req_data(req), get_req_data_size(req) );
1059 static void dump_exception_event_reply( const struct exception_event_request *req )
1061 fprintf( stderr, " status=%d,", req->status );
1062 fprintf( stderr, " context=" );
1063 dump_varargs_context( get_req_data(req), get_req_data_size(req) );
1066 static void dump_output_debug_string_request( const struct output_debug_string_request *req )
1068 fprintf( stderr, " string=%p,", req->string );
1069 fprintf( stderr, " unicode=%d,", req->unicode );
1070 fprintf( stderr, " length=%d", req->length );
1073 static void dump_continue_debug_event_request( const struct continue_debug_event_request *req )
1075 fprintf( stderr, " pid=%p,", req->pid );
1076 fprintf( stderr, " tid=%p,", req->tid );
1077 fprintf( stderr, " status=%d", req->status );
1080 static void dump_debug_process_request( const struct debug_process_request *req )
1082 fprintf( stderr, " pid=%p", req->pid );
1085 static void dump_read_process_memory_request( const struct read_process_memory_request *req )
1087 fprintf( stderr, " handle=%d,", req->handle );
1088 fprintf( stderr, " addr=%p,", req->addr );
1089 fprintf( stderr, " len=%d", req->len );
1092 static void dump_read_process_memory_reply( const struct read_process_memory_request *req )
1094 fprintf( stderr, " data=" );
1095 dump_varargs_read_process_memory_reply( req );
1098 static void dump_write_process_memory_request( const struct write_process_memory_request *req )
1100 fprintf( stderr, " handle=%d,", req->handle );
1101 fprintf( stderr, " addr=%p,", req->addr );
1102 fprintf( stderr, " len=%d,", req->len );
1103 fprintf( stderr, " first_mask=%08x,", req->first_mask );
1104 fprintf( stderr, " last_mask=%08x,", req->last_mask );
1105 fprintf( stderr, " data=" );
1106 dump_varargs_write_process_memory_request( req );
1109 static void dump_create_key_request( const struct create_key_request *req )
1111 fprintf( stderr, " parent=%d,", req->parent );
1112 fprintf( stderr, " access=%08x,", req->access );
1113 fprintf( stderr, " options=%08x,", req->options );
1114 fprintf( stderr, " modif=%ld,", req->modif );
1115 fprintf( stderr, " name=" );
1116 dump_path_t( req, &req->name );
1117 fprintf( stderr, "," );
1118 fprintf( stderr, " class=" );
1119 dump_unicode_string( req, req->class );
1122 static void dump_create_key_reply( const struct create_key_request *req )
1124 fprintf( stderr, " hkey=%d,", req->hkey );
1125 fprintf( stderr, " created=%d", req->created );
1128 static void dump_open_key_request( const struct open_key_request *req )
1130 fprintf( stderr, " parent=%d,", req->parent );
1131 fprintf( stderr, " access=%08x,", req->access );
1132 fprintf( stderr, " name=" );
1133 dump_path_t( req, &req->name );
1136 static void dump_open_key_reply( const struct open_key_request *req )
1138 fprintf( stderr, " hkey=%d", req->hkey );
1141 static void dump_delete_key_request( const struct delete_key_request *req )
1143 fprintf( stderr, " hkey=%d,", req->hkey );
1144 fprintf( stderr, " name=" );
1145 dump_path_t( req, &req->name );
1148 static void dump_close_key_request( const struct close_key_request *req )
1150 fprintf( stderr, " hkey=%d", req->hkey );
1153 static void dump_enum_key_request( const struct enum_key_request *req )
1155 fprintf( stderr, " hkey=%d,", req->hkey );
1156 fprintf( stderr, " index=%d", req->index );
1159 static void dump_enum_key_reply( const struct enum_key_request *req )
1161 fprintf( stderr, " modif=%ld,", req->modif );
1162 fprintf( stderr, " name=" );
1163 dump_path_t( req, &req->name );
1164 fprintf( stderr, "," );
1165 fprintf( stderr, " class=" );
1166 dump_unicode_string( req, req->class );
1169 static void dump_query_key_info_request( const struct query_key_info_request *req )
1171 fprintf( stderr, " hkey=%d", req->hkey );
1174 static void dump_query_key_info_reply( const struct query_key_info_request *req )
1176 fprintf( stderr, " subkeys=%d,", req->subkeys );
1177 fprintf( stderr, " max_subkey=%d,", req->max_subkey );
1178 fprintf( stderr, " max_class=%d,", req->max_class );
1179 fprintf( stderr, " values=%d,", req->values );
1180 fprintf( stderr, " max_value=%d,", req->max_value );
1181 fprintf( stderr, " max_data=%d,", req->max_data );
1182 fprintf( stderr, " modif=%ld,", req->modif );
1183 fprintf( stderr, " name=" );
1184 dump_path_t( req, &req->name );
1185 fprintf( stderr, "," );
1186 fprintf( stderr, " class=" );
1187 dump_unicode_string( req, req->class );
1190 static void dump_set_key_value_request( const struct set_key_value_request *req )
1192 fprintf( stderr, " hkey=%d,", req->hkey );
1193 fprintf( stderr, " type=%d,", req->type );
1194 fprintf( stderr, " total=%08x,", req->total );
1195 fprintf( stderr, " offset=%08x,", req->offset );
1196 fprintf( stderr, " len=%08x,", req->len );
1197 fprintf( stderr, " name=" );
1198 dump_path_t( req, &req->name );
1199 fprintf( stderr, "," );
1200 fprintf( stderr, " data=" );
1201 dump_varargs_set_key_value_request( req );
1204 static void dump_get_key_value_request( const struct get_key_value_request *req )
1206 fprintf( stderr, " hkey=%d,", req->hkey );
1207 fprintf( stderr, " offset=%08x,", req->offset );
1208 fprintf( stderr, " name=" );
1209 dump_unicode_string( req, req->name );
1212 static void dump_get_key_value_reply( const struct get_key_value_request *req )
1214 fprintf( stderr, " type=%d,", req->type );
1215 fprintf( stderr, " len=%d,", req->len );
1216 fprintf( stderr, " data=" );
1217 dump_varargs_get_key_value_reply( req );
1220 static void dump_enum_key_value_request( const struct enum_key_value_request *req )
1222 fprintf( stderr, " hkey=%d,", req->hkey );
1223 fprintf( stderr, " index=%d,", req->index );
1224 fprintf( stderr, " offset=%08x", req->offset );
1227 static void dump_enum_key_value_reply( const struct enum_key_value_request *req )
1229 fprintf( stderr, " type=%d,", req->type );
1230 fprintf( stderr, " len=%d,", req->len );
1231 fprintf( stderr, " name=" );
1232 dump_path_t( req, &req->name );
1233 fprintf( stderr, "," );
1234 fprintf( stderr, " data=" );
1235 dump_varargs_enum_key_value_reply( req );
1238 static void dump_delete_key_value_request( const struct delete_key_value_request *req )
1240 fprintf( stderr, " hkey=%d,", req->hkey );
1241 fprintf( stderr, " name=" );
1242 dump_path_t( req, &req->name );
1245 static void dump_load_registry_request( const struct load_registry_request *req )
1247 fprintf( stderr, " hkey=%d,", req->hkey );
1248 fprintf( stderr, " file=%d,", req->file );
1249 fprintf( stderr, " name=" );
1250 dump_path_t( req, &req->name );
1253 static void dump_save_registry_request( const struct save_registry_request *req )
1255 fprintf( stderr, " hkey=%d,", req->hkey );
1256 fprintf( stderr, " file=%d", req->file );
1259 static void dump_save_registry_atexit_request( const struct save_registry_atexit_request *req )
1261 fprintf( stderr, " hkey=%d,", req->hkey );
1262 fprintf( stderr, " file=" );
1263 dump_string( req, req->file );
1266 static void dump_set_registry_levels_request( const struct set_registry_levels_request *req )
1268 fprintf( stderr, " current=%d,", req->current );
1269 fprintf( stderr, " saving=%d,", req->saving );
1270 fprintf( stderr, " period=%d", req->period );
1273 static void dump_create_timer_request( const struct create_timer_request *req )
1275 fprintf( stderr, " inherit=%d,", req->inherit );
1276 fprintf( stderr, " manual=%d,", req->manual );
1277 fprintf( stderr, " name=" );
1278 dump_varargs_unicode_str( get_req_data(req), get_req_data_size(req) );
1281 static void dump_create_timer_reply( const struct create_timer_request *req )
1283 fprintf( stderr, " handle=%d", req->handle );
1286 static void dump_open_timer_request( const struct open_timer_request *req )
1288 fprintf( stderr, " access=%08x,", req->access );
1289 fprintf( stderr, " inherit=%d,", req->inherit );
1290 fprintf( stderr, " name=" );
1291 dump_varargs_unicode_str( get_req_data(req), get_req_data_size(req) );
1294 static void dump_open_timer_reply( const struct open_timer_request *req )
1296 fprintf( stderr, " handle=%d", req->handle );
1299 static void dump_set_timer_request( const struct set_timer_request *req )
1301 fprintf( stderr, " handle=%d,", req->handle );
1302 fprintf( stderr, " sec=%d,", req->sec );
1303 fprintf( stderr, " usec=%d,", req->usec );
1304 fprintf( stderr, " period=%d,", req->period );
1305 fprintf( stderr, " callback=%p,", req->callback );
1306 fprintf( stderr, " arg=%p", req->arg );
1309 static void dump_cancel_timer_request( const struct cancel_timer_request *req )
1311 fprintf( stderr, " handle=%d", req->handle );
1314 static void dump_get_thread_context_request( const struct get_thread_context_request *req )
1316 fprintf( stderr, " handle=%d,", req->handle );
1317 fprintf( stderr, " flags=%08x", req->flags );
1320 static void dump_get_thread_context_reply( const struct get_thread_context_request *req )
1322 fprintf( stderr, " context=" );
1323 dump_varargs_context( get_req_data(req), get_req_data_size(req) );
1326 static void dump_set_thread_context_request( const struct set_thread_context_request *req )
1328 fprintf( stderr, " handle=%d,", req->handle );
1329 fprintf( stderr, " flags=%08x,", req->flags );
1330 fprintf( stderr, " context=" );
1331 dump_varargs_context( get_req_data(req), get_req_data_size(req) );
1334 static void dump_get_selector_entry_request( const struct get_selector_entry_request *req )
1336 fprintf( stderr, " handle=%d,", req->handle );
1337 fprintf( stderr, " entry=%d", req->entry );
1340 static void dump_get_selector_entry_reply( const struct get_selector_entry_request *req )
1342 fprintf( stderr, " base=%08x,", req->base );
1343 fprintf( stderr, " limit=%08x,", req->limit );
1344 fprintf( stderr, " flags=%02x", req->flags );
1347 static void dump_add_atom_request( const struct add_atom_request *req )
1349 fprintf( stderr, " local=%d,", req->local );
1350 fprintf( stderr, " name=" );
1351 dump_varargs_unicode_str( get_req_data(req), get_req_data_size(req) );
1354 static void dump_add_atom_reply( const struct add_atom_request *req )
1356 fprintf( stderr, " atom=%d", req->atom );
1359 static void dump_delete_atom_request( const struct delete_atom_request *req )
1361 fprintf( stderr, " atom=%d,", req->atom );
1362 fprintf( stderr, " local=%d", req->local );
1365 static void dump_find_atom_request( const struct find_atom_request *req )
1367 fprintf( stderr, " local=%d,", req->local );
1368 fprintf( stderr, " name=" );
1369 dump_varargs_unicode_str( get_req_data(req), get_req_data_size(req) );
1372 static void dump_find_atom_reply( const struct find_atom_request *req )
1374 fprintf( stderr, " atom=%d", req->atom );
1377 static void dump_get_atom_name_request( const struct get_atom_name_request *req )
1379 fprintf( stderr, " atom=%d,", req->atom );
1380 fprintf( stderr, " local=%d", req->local );
1383 static void dump_get_atom_name_reply( const struct get_atom_name_request *req )
1385 fprintf( stderr, " count=%d,", req->count );
1386 fprintf( stderr, " name=" );
1387 dump_varargs_unicode_str( get_req_data(req), get_req_data_size(req) );
1390 static void dump_init_atom_table_request( const struct init_atom_table_request *req )
1392 fprintf( stderr, " entries=%d", req->entries );
1395 static void dump_get_msg_queue_request( const struct get_msg_queue_request *req )
1399 static void dump_get_msg_queue_reply( const struct get_msg_queue_request *req )
1401 fprintf( stderr, " handle=%d", req->handle );
1404 static void dump_wake_queue_request( const struct wake_queue_request *req )
1406 fprintf( stderr, " handle=%d,", req->handle );
1407 fprintf( stderr, " bits=%08x", req->bits );
1410 static void dump_wait_input_idle_request( const struct wait_input_idle_request *req )
1412 fprintf( stderr, " handle=%d,", req->handle );
1413 fprintf( stderr, " timeout=%d", req->timeout );
1416 static void dump_wait_input_idle_reply( const struct wait_input_idle_request *req )
1418 fprintf( stderr, " event=%d", req->event );
1421 static void dump_create_serial_request( const struct create_serial_request *req )
1423 fprintf( stderr, " access=%08x,", req->access );
1424 fprintf( stderr, " inherit=%d,", req->inherit );
1425 fprintf( stderr, " sharing=%08x,", req->sharing );
1426 fprintf( stderr, " name=" );
1427 dump_string( req, req->name );
1430 static void dump_create_serial_reply( const struct create_serial_request *req )
1432 fprintf( stderr, " handle=%d", req->handle );
1435 static void dump_get_serial_info_request( const struct get_serial_info_request *req )
1437 fprintf( stderr, " handle=%d", req->handle );
1440 static void dump_get_serial_info_reply( const struct get_serial_info_request *req )
1442 fprintf( stderr, " readinterval=%08x,", req->readinterval );
1443 fprintf( stderr, " readconst=%08x,", req->readconst );
1444 fprintf( stderr, " readmult=%08x,", req->readmult );
1445 fprintf( stderr, " writeconst=%08x,", req->writeconst );
1446 fprintf( stderr, " writemult=%08x,", req->writemult );
1447 fprintf( stderr, " eventmask=%08x,", req->eventmask );
1448 fprintf( stderr, " commerror=%08x", req->commerror );
1451 static void dump_set_serial_info_request( const struct set_serial_info_request *req )
1453 fprintf( stderr, " handle=%d,", req->handle );
1454 fprintf( stderr, " flags=%d,", req->flags );
1455 fprintf( stderr, " readinterval=%08x,", req->readinterval );
1456 fprintf( stderr, " readconst=%08x,", req->readconst );
1457 fprintf( stderr, " readmult=%08x,", req->readmult );
1458 fprintf( stderr, " writeconst=%08x,", req->writeconst );
1459 fprintf( stderr, " writemult=%08x,", req->writemult );
1460 fprintf( stderr, " eventmask=%08x,", req->eventmask );
1461 fprintf( stderr, " commerror=%08x", req->commerror );
1464 static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
1465 (dump_func)dump_new_process_request,
1466 (dump_func)dump_wait_process_request,
1467 (dump_func)dump_new_thread_request,
1468 (dump_func)dump_boot_done_request,
1469 (dump_func)dump_init_process_request,
1470 (dump_func)dump_init_process_done_request,
1471 (dump_func)dump_init_thread_request,
1472 (dump_func)dump_get_thread_buffer_request,
1473 (dump_func)dump_terminate_process_request,
1474 (dump_func)dump_terminate_thread_request,
1475 (dump_func)dump_get_process_info_request,
1476 (dump_func)dump_set_process_info_request,
1477 (dump_func)dump_get_thread_info_request,
1478 (dump_func)dump_set_thread_info_request,
1479 (dump_func)dump_suspend_thread_request,
1480 (dump_func)dump_resume_thread_request,
1481 (dump_func)dump_load_dll_request,
1482 (dump_func)dump_unload_dll_request,
1483 (dump_func)dump_queue_apc_request,
1484 (dump_func)dump_get_apc_request,
1485 (dump_func)dump_close_handle_request,
1486 (dump_func)dump_get_handle_info_request,
1487 (dump_func)dump_set_handle_info_request,
1488 (dump_func)dump_dup_handle_request,
1489 (dump_func)dump_open_process_request,
1490 (dump_func)dump_select_request,
1491 (dump_func)dump_create_event_request,
1492 (dump_func)dump_event_op_request,
1493 (dump_func)dump_open_event_request,
1494 (dump_func)dump_create_mutex_request,
1495 (dump_func)dump_release_mutex_request,
1496 (dump_func)dump_open_mutex_request,
1497 (dump_func)dump_create_semaphore_request,
1498 (dump_func)dump_release_semaphore_request,
1499 (dump_func)dump_open_semaphore_request,
1500 (dump_func)dump_create_file_request,
1501 (dump_func)dump_alloc_file_handle_request,
1502 (dump_func)dump_get_read_fd_request,
1503 (dump_func)dump_get_write_fd_request,
1504 (dump_func)dump_set_file_pointer_request,
1505 (dump_func)dump_truncate_file_request,
1506 (dump_func)dump_set_file_time_request,
1507 (dump_func)dump_flush_file_request,
1508 (dump_func)dump_get_file_info_request,
1509 (dump_func)dump_lock_file_request,
1510 (dump_func)dump_unlock_file_request,
1511 (dump_func)dump_create_pipe_request,
1512 (dump_func)dump_create_socket_request,
1513 (dump_func)dump_accept_socket_request,
1514 (dump_func)dump_set_socket_event_request,
1515 (dump_func)dump_get_socket_event_request,
1516 (dump_func)dump_enable_socket_event_request,
1517 (dump_func)dump_alloc_console_request,
1518 (dump_func)dump_free_console_request,
1519 (dump_func)dump_open_console_request,
1520 (dump_func)dump_set_console_fd_request,
1521 (dump_func)dump_get_console_mode_request,
1522 (dump_func)dump_set_console_mode_request,
1523 (dump_func)dump_set_console_info_request,
1524 (dump_func)dump_get_console_info_request,
1525 (dump_func)dump_write_console_input_request,
1526 (dump_func)dump_read_console_input_request,
1527 (dump_func)dump_create_change_notification_request,
1528 (dump_func)dump_create_mapping_request,
1529 (dump_func)dump_open_mapping_request,
1530 (dump_func)dump_get_mapping_info_request,
1531 (dump_func)dump_create_device_request,
1532 (dump_func)dump_create_snapshot_request,
1533 (dump_func)dump_next_process_request,
1534 (dump_func)dump_next_thread_request,
1535 (dump_func)dump_next_module_request,
1536 (dump_func)dump_wait_debug_event_request,
1537 (dump_func)dump_exception_event_request,
1538 (dump_func)dump_output_debug_string_request,
1539 (dump_func)dump_continue_debug_event_request,
1540 (dump_func)dump_debug_process_request,
1541 (dump_func)dump_read_process_memory_request,
1542 (dump_func)dump_write_process_memory_request,
1543 (dump_func)dump_create_key_request,
1544 (dump_func)dump_open_key_request,
1545 (dump_func)dump_delete_key_request,
1546 (dump_func)dump_close_key_request,
1547 (dump_func)dump_enum_key_request,
1548 (dump_func)dump_query_key_info_request,
1549 (dump_func)dump_set_key_value_request,
1550 (dump_func)dump_get_key_value_request,
1551 (dump_func)dump_enum_key_value_request,
1552 (dump_func)dump_delete_key_value_request,
1553 (dump_func)dump_load_registry_request,
1554 (dump_func)dump_save_registry_request,
1555 (dump_func)dump_save_registry_atexit_request,
1556 (dump_func)dump_set_registry_levels_request,
1557 (dump_func)dump_create_timer_request,
1558 (dump_func)dump_open_timer_request,
1559 (dump_func)dump_set_timer_request,
1560 (dump_func)dump_cancel_timer_request,
1561 (dump_func)dump_get_thread_context_request,
1562 (dump_func)dump_set_thread_context_request,
1563 (dump_func)dump_get_selector_entry_request,
1564 (dump_func)dump_add_atom_request,
1565 (dump_func)dump_delete_atom_request,
1566 (dump_func)dump_find_atom_request,
1567 (dump_func)dump_get_atom_name_request,
1568 (dump_func)dump_init_atom_table_request,
1569 (dump_func)dump_get_msg_queue_request,
1570 (dump_func)dump_wake_queue_request,
1571 (dump_func)dump_wait_input_idle_request,
1572 (dump_func)dump_create_serial_request,
1573 (dump_func)dump_get_serial_info_request,
1574 (dump_func)dump_set_serial_info_request,
1577 static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
1578 (dump_func)0,
1579 (dump_func)dump_wait_process_reply,
1580 (dump_func)dump_new_thread_reply,
1581 (dump_func)0,
1582 (dump_func)dump_init_process_reply,
1583 (dump_func)dump_init_process_done_reply,
1584 (dump_func)0,
1585 (dump_func)dump_get_thread_buffer_reply,
1586 (dump_func)dump_terminate_process_reply,
1587 (dump_func)dump_terminate_thread_reply,
1588 (dump_func)dump_get_process_info_reply,
1589 (dump_func)0,
1590 (dump_func)dump_get_thread_info_reply,
1591 (dump_func)0,
1592 (dump_func)dump_suspend_thread_reply,
1593 (dump_func)dump_resume_thread_reply,
1594 (dump_func)0,
1595 (dump_func)0,
1596 (dump_func)0,
1597 (dump_func)dump_get_apc_reply,
1598 (dump_func)0,
1599 (dump_func)dump_get_handle_info_reply,
1600 (dump_func)0,
1601 (dump_func)dump_dup_handle_reply,
1602 (dump_func)dump_open_process_reply,
1603 (dump_func)dump_select_reply,
1604 (dump_func)dump_create_event_reply,
1605 (dump_func)0,
1606 (dump_func)dump_open_event_reply,
1607 (dump_func)dump_create_mutex_reply,
1608 (dump_func)0,
1609 (dump_func)dump_open_mutex_reply,
1610 (dump_func)dump_create_semaphore_reply,
1611 (dump_func)dump_release_semaphore_reply,
1612 (dump_func)dump_open_semaphore_reply,
1613 (dump_func)dump_create_file_reply,
1614 (dump_func)dump_alloc_file_handle_reply,
1615 (dump_func)0,
1616 (dump_func)0,
1617 (dump_func)dump_set_file_pointer_reply,
1618 (dump_func)0,
1619 (dump_func)0,
1620 (dump_func)0,
1621 (dump_func)dump_get_file_info_reply,
1622 (dump_func)0,
1623 (dump_func)0,
1624 (dump_func)dump_create_pipe_reply,
1625 (dump_func)dump_create_socket_reply,
1626 (dump_func)dump_accept_socket_reply,
1627 (dump_func)0,
1628 (dump_func)dump_get_socket_event_reply,
1629 (dump_func)0,
1630 (dump_func)dump_alloc_console_reply,
1631 (dump_func)0,
1632 (dump_func)dump_open_console_reply,
1633 (dump_func)0,
1634 (dump_func)dump_get_console_mode_reply,
1635 (dump_func)0,
1636 (dump_func)0,
1637 (dump_func)dump_get_console_info_reply,
1638 (dump_func)dump_write_console_input_reply,
1639 (dump_func)dump_read_console_input_reply,
1640 (dump_func)dump_create_change_notification_reply,
1641 (dump_func)dump_create_mapping_reply,
1642 (dump_func)dump_open_mapping_reply,
1643 (dump_func)dump_get_mapping_info_reply,
1644 (dump_func)dump_create_device_reply,
1645 (dump_func)dump_create_snapshot_reply,
1646 (dump_func)dump_next_process_reply,
1647 (dump_func)dump_next_thread_reply,
1648 (dump_func)dump_next_module_reply,
1649 (dump_func)dump_wait_debug_event_reply,
1650 (dump_func)dump_exception_event_reply,
1651 (dump_func)0,
1652 (dump_func)0,
1653 (dump_func)0,
1654 (dump_func)dump_read_process_memory_reply,
1655 (dump_func)0,
1656 (dump_func)dump_create_key_reply,
1657 (dump_func)dump_open_key_reply,
1658 (dump_func)0,
1659 (dump_func)0,
1660 (dump_func)dump_enum_key_reply,
1661 (dump_func)dump_query_key_info_reply,
1662 (dump_func)0,
1663 (dump_func)dump_get_key_value_reply,
1664 (dump_func)dump_enum_key_value_reply,
1665 (dump_func)0,
1666 (dump_func)0,
1667 (dump_func)0,
1668 (dump_func)0,
1669 (dump_func)0,
1670 (dump_func)dump_create_timer_reply,
1671 (dump_func)dump_open_timer_reply,
1672 (dump_func)0,
1673 (dump_func)0,
1674 (dump_func)dump_get_thread_context_reply,
1675 (dump_func)0,
1676 (dump_func)dump_get_selector_entry_reply,
1677 (dump_func)dump_add_atom_reply,
1678 (dump_func)0,
1679 (dump_func)dump_find_atom_reply,
1680 (dump_func)dump_get_atom_name_reply,
1681 (dump_func)0,
1682 (dump_func)dump_get_msg_queue_reply,
1683 (dump_func)0,
1684 (dump_func)dump_wait_input_idle_reply,
1685 (dump_func)dump_create_serial_reply,
1686 (dump_func)dump_get_serial_info_reply,
1687 (dump_func)0,
1690 static const char * const req_names[REQ_NB_REQUESTS] = {
1691 "new_process",
1692 "wait_process",
1693 "new_thread",
1694 "boot_done",
1695 "init_process",
1696 "init_process_done",
1697 "init_thread",
1698 "get_thread_buffer",
1699 "terminate_process",
1700 "terminate_thread",
1701 "get_process_info",
1702 "set_process_info",
1703 "get_thread_info",
1704 "set_thread_info",
1705 "suspend_thread",
1706 "resume_thread",
1707 "load_dll",
1708 "unload_dll",
1709 "queue_apc",
1710 "get_apc",
1711 "close_handle",
1712 "get_handle_info",
1713 "set_handle_info",
1714 "dup_handle",
1715 "open_process",
1716 "select",
1717 "create_event",
1718 "event_op",
1719 "open_event",
1720 "create_mutex",
1721 "release_mutex",
1722 "open_mutex",
1723 "create_semaphore",
1724 "release_semaphore",
1725 "open_semaphore",
1726 "create_file",
1727 "alloc_file_handle",
1728 "get_read_fd",
1729 "get_write_fd",
1730 "set_file_pointer",
1731 "truncate_file",
1732 "set_file_time",
1733 "flush_file",
1734 "get_file_info",
1735 "lock_file",
1736 "unlock_file",
1737 "create_pipe",
1738 "create_socket",
1739 "accept_socket",
1740 "set_socket_event",
1741 "get_socket_event",
1742 "enable_socket_event",
1743 "alloc_console",
1744 "free_console",
1745 "open_console",
1746 "set_console_fd",
1747 "get_console_mode",
1748 "set_console_mode",
1749 "set_console_info",
1750 "get_console_info",
1751 "write_console_input",
1752 "read_console_input",
1753 "create_change_notification",
1754 "create_mapping",
1755 "open_mapping",
1756 "get_mapping_info",
1757 "create_device",
1758 "create_snapshot",
1759 "next_process",
1760 "next_thread",
1761 "next_module",
1762 "wait_debug_event",
1763 "exception_event",
1764 "output_debug_string",
1765 "continue_debug_event",
1766 "debug_process",
1767 "read_process_memory",
1768 "write_process_memory",
1769 "create_key",
1770 "open_key",
1771 "delete_key",
1772 "close_key",
1773 "enum_key",
1774 "query_key_info",
1775 "set_key_value",
1776 "get_key_value",
1777 "enum_key_value",
1778 "delete_key_value",
1779 "load_registry",
1780 "save_registry",
1781 "save_registry_atexit",
1782 "set_registry_levels",
1783 "create_timer",
1784 "open_timer",
1785 "set_timer",
1786 "cancel_timer",
1787 "get_thread_context",
1788 "set_thread_context",
1789 "get_selector_entry",
1790 "add_atom",
1791 "delete_atom",
1792 "find_atom",
1793 "get_atom_name",
1794 "init_atom_table",
1795 "get_msg_queue",
1796 "wake_queue",
1797 "wait_input_idle",
1798 "create_serial",
1799 "get_serial_info",
1800 "set_serial_info",
1803 /* ### make_requests end ### */
1804 /* Everything above this line is generated automatically by tools/make_requests */
1806 void trace_request( enum request req )
1808 current->last_req = req;
1809 if (req < REQ_NB_REQUESTS)
1811 fprintf( stderr, "%08x: %s(", (unsigned int)current, req_names[req] );
1812 req_dumpers[req]( current->buffer );
1814 else
1815 fprintf( stderr, "%08x: %d(", (unsigned int)current, req );
1816 if (current->pass_fd != -1) fprintf( stderr, " ) fd=%d\n", current->pass_fd );
1817 else fprintf( stderr, " )\n" );
1820 void trace_reply( struct thread *thread )
1822 fprintf( stderr, "%08x: %s() = %x",
1823 (unsigned int)thread, req_names[thread->last_req], thread->error );
1824 if (reply_dumpers[thread->last_req])
1826 fprintf( stderr, " {" );
1827 reply_dumpers[thread->last_req]( thread->buffer );
1828 fprintf( stderr, " }" );
1830 if (thread->pass_fd != -1) fprintf( stderr, " fd=%d\n", thread->pass_fd );
1831 else fprintf( stderr, "\n" );