Make sure all Wine processes share the same X display.
[wine.git] / server / trace.c
blob4ea9319988ad06a5a4ddbe22efa43fdd9f99b6b1
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 "request.h"
14 #include "unicode.h"
17 /* utility functions */
19 static void dump_ints( const int *ptr, int len )
21 fputc( '{', stderr );
22 while (len > 0)
24 fprintf( stderr, "%d", *ptr++ );
25 if (--len) fputc( ',', stderr );
27 fputc( '}', stderr );
30 static void dump_uints( const int *ptr, int len )
32 fputc( '{', stderr );
33 while (len > 0)
35 fprintf( stderr, "%08x", *ptr++ );
36 if (--len) fputc( ',', stderr );
38 fputc( '}', stderr );
41 static void dump_bytes( const unsigned char *ptr, int len )
43 fputc( '{', stderr );
44 while (len > 0)
46 fprintf( stderr, "%02x", *ptr++ );
47 if (--len) fputc( ',', stderr );
49 fputc( '}', stderr );
52 static void dump_string( const void *req, const char *str )
54 int len = get_req_strlen( req, str );
55 fprintf( stderr, "\"%.*s\"", len, str );
58 static void dump_unicode_string( const void *req, const WCHAR *str )
60 size_t len = get_req_strlenW( req, str );
61 fprintf( stderr, "L\"" );
62 dump_strW( str, len, stderr, "\"\"" );
63 fputc( '\"', stderr );
66 static void dump_path_t( const void *req, const path_t *path )
68 dump_unicode_string( req, *path );
71 static void dump_context( const void *req, const CONTEXT *context )
73 #ifdef __i386__
74 fprintf( stderr, "{flags=%08lx,eax=%08lx,ebx=%08lx,ecx=%08lx,edx=%08lx,esi=%08lx,edi=%08lx,"
75 "ebp=%08lx,eip=%08lx,esp=%08lx,eflags=%08lx,cs=%04lx,ds=%04lx,es=%04lx,"
76 "fs=%04lx,gs=%04lx,dr0=%08lx,dr1=%08lx,dr2=%08lx,dr3=%08lx,dr6=%08lx,dr7=%08lx,",
77 context->ContextFlags, context->Eax, context->Ebx, context->Ecx, context->Edx,
78 context->Esi, context->Edi, context->Ebp, context->Eip, context->Esp, context->EFlags,
79 context->SegCs, context->SegDs, context->SegEs, context->SegFs, context->SegGs,
80 context->Dr0, context->Dr1, context->Dr2, context->Dr3, context->Dr6, context->Dr7 );
81 fprintf( stderr, "float=" );
82 dump_uints( (int *)&context->FloatSave, sizeof(context->FloatSave) / sizeof(int) );
83 fprintf( stderr, "}" );
84 #else
85 dump_uints( (int *)context, sizeof(*context) / sizeof(int) );
86 #endif
89 static void dump_exc_record( const void *req, const EXCEPTION_RECORD *rec )
91 int i;
92 fprintf( stderr, "{code=%lx,flags=%lx,rec=%p,addr=%p,params={",
93 rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionRecord,
94 rec->ExceptionAddress );
95 for (i = 0; i < rec->NumberParameters; i++)
97 if (i) fputc( ',', stderr );
98 fprintf( stderr, "%lx", rec->ExceptionInformation[i] );
100 fputc( '}', stderr );
103 static void dump_debug_event_t( const void *req, const debug_event_t *event )
105 switch(event->code)
107 case EXCEPTION_DEBUG_EVENT:
108 fprintf( stderr, "{exception," );
109 dump_exc_record( req, &event->info.exception.record );
110 fprintf( stderr, ",first=%d}", event->info.exception.first );
111 break;
112 case CREATE_THREAD_DEBUG_EVENT:
113 fprintf( stderr, "{create_thread,thread=%d,teb=%p,start=%p}",
114 event->info.create_thread.handle, event->info.create_thread.teb,
115 event->info.create_thread.start );
116 break;
117 case CREATE_PROCESS_DEBUG_EVENT:
118 fprintf( stderr, "{create_process,file=%d,process=%d,thread=%d,base=%p,offset=%d,"
119 "size=%d,teb=%p,start=%p,name=%p,unicode=%d}",
120 event->info.create_process.file, event->info.create_process.process,
121 event->info.create_process.thread, event->info.create_process.base,
122 event->info.create_process.dbg_offset, event->info.create_process.dbg_size,
123 event->info.create_process.teb, event->info.create_process.start,
124 event->info.create_process.name, event->info.create_process.unicode );
125 break;
126 case EXIT_THREAD_DEBUG_EVENT:
127 fprintf( stderr, "{exit_thread,code=%d}", event->info.exit.exit_code );
128 break;
129 case EXIT_PROCESS_DEBUG_EVENT:
130 fprintf( stderr, "{exit_process,code=%d}", event->info.exit.exit_code );
131 break;
132 case LOAD_DLL_DEBUG_EVENT:
133 fprintf( stderr, "{load_dll,file=%d,base=%p,offset=%d,size=%d,name=%p,unicode=%d}",
134 event->info.load_dll.handle, event->info.load_dll.base,
135 event->info.load_dll.dbg_offset, event->info.load_dll.dbg_size,
136 event->info.load_dll.name, event->info.load_dll.unicode );
137 break;
138 case UNLOAD_DLL_DEBUG_EVENT:
139 fprintf( stderr, "{unload_dll,base=%p}", event->info.unload_dll.base );
140 break;
141 case OUTPUT_DEBUG_STRING_EVENT:
142 fprintf( stderr, "{output_string,data=%p,unicode=%d,len=%d}",
143 event->info.output_string.string, event->info.output_string.unicode,
144 event->info.output_string.length );
145 break;
146 case RIP_EVENT:
147 fprintf( stderr, "{rip,err=%d,type=%d}",
148 event->info.rip_info.error, event->info.rip_info.type );
149 break;
150 case 0: /* zero is the code returned on timeouts */
151 fprintf( stderr, "{}" );
152 break;
153 default:
154 fprintf( stderr, "{code=??? (%d)}", event->code );
155 break;
160 /* dumping for functions for requests that have a variable part */
162 static void dump_varargs_select_request( const struct select_request *req )
164 int count = min( req->count, get_req_size( req, req->handles, sizeof(int) ));
165 dump_ints( req->handles, count );
168 static void dump_varargs_get_apcs_reply( const struct get_apcs_request *req )
170 int i;
171 for (i = 0; i < 2 * req->count; i++)
172 fprintf( stderr, "%c%p", i ? ',' : '{', req->apcs[i] );
173 fprintf( stderr, "}" );
176 static void dump_varargs_get_socket_event_reply( const struct get_socket_event_request *req )
178 dump_ints( req->errors, FD_MAX_EVENTS );
181 static void dump_varargs_read_process_memory_reply( const struct read_process_memory_request *req )
183 int count = min( req->len, get_req_size( req, req->data, sizeof(int) ));
184 dump_bytes( (unsigned char *)req->data, count * sizeof(int) );
187 static void dump_varargs_write_process_memory_request( const struct write_process_memory_request *req )
189 int count = min( req->len, get_req_size( req, req->data, sizeof(int) ));
190 dump_bytes( (unsigned char *)req->data, count * sizeof(int) );
193 static void dump_varargs_set_key_value_request( const struct set_key_value_request *req )
195 int count = min( req->len, get_req_size( req, req->data, 1 ));
196 dump_bytes( req->data, count );
199 static void dump_varargs_get_key_value_reply( const struct get_key_value_request *req )
201 int count = min( req->len - req->offset, get_req_size( req, req->data, 1 ));
202 dump_bytes( req->data, count );
205 static void dump_varargs_enum_key_value_reply( const struct enum_key_value_request *req )
207 int count = min( req->len - req->offset, get_req_size( req, req->data, 1 ));
208 dump_bytes( req->data, count );
211 typedef void (*dump_func)( const void *req );
213 /* Everything below this line is generated automatically by tools/make_requests */
214 /* ### make_requests begin ### */
216 static void dump_new_process_request( const struct new_process_request *req )
218 fprintf( stderr, " inherit_all=%d,", req->inherit_all );
219 fprintf( stderr, " create_flags=%d,", req->create_flags );
220 fprintf( stderr, " start_flags=%d,", req->start_flags );
221 fprintf( stderr, " exe_file=%d,", req->exe_file );
222 fprintf( stderr, " hstdin=%d,", req->hstdin );
223 fprintf( stderr, " hstdout=%d,", req->hstdout );
224 fprintf( stderr, " hstderr=%d,", req->hstderr );
225 fprintf( stderr, " cmd_show=%d,", req->cmd_show );
226 fprintf( stderr, " alloc_fd=%d,", req->alloc_fd );
227 fprintf( stderr, " filename=" );
228 dump_string( req, req->filename );
231 static void dump_wait_process_request( const struct wait_process_request *req )
233 fprintf( stderr, " pinherit=%d,", req->pinherit );
234 fprintf( stderr, " tinherit=%d,", req->tinherit );
235 fprintf( stderr, " timeout=%d,", req->timeout );
236 fprintf( stderr, " cancel=%d", req->cancel );
239 static void dump_wait_process_reply( const struct wait_process_request *req )
241 fprintf( stderr, " pid=%p,", req->pid );
242 fprintf( stderr, " phandle=%d,", req->phandle );
243 fprintf( stderr, " tid=%p,", req->tid );
244 fprintf( stderr, " thandle=%d,", req->thandle );
245 fprintf( stderr, " event=%d", req->event );
248 static void dump_new_thread_request( const struct new_thread_request *req )
250 fprintf( stderr, " suspend=%d,", req->suspend );
251 fprintf( stderr, " inherit=%d", req->inherit );
254 static void dump_new_thread_reply( const struct new_thread_request *req )
256 fprintf( stderr, " tid=%p,", req->tid );
257 fprintf( stderr, " handle=%d", req->handle );
260 static void dump_boot_done_request( const struct boot_done_request *req )
262 fprintf( stderr, " debug_level=%d", req->debug_level );
265 static void dump_init_process_request( const struct init_process_request *req )
267 fprintf( stderr, " ldt_copy=%p,", req->ldt_copy );
268 fprintf( stderr, " ldt_flags=%p,", req->ldt_flags );
269 fprintf( stderr, " ppid=%d", req->ppid );
272 static void dump_init_process_reply( const struct init_process_request *req )
274 fprintf( stderr, " start_flags=%d,", req->start_flags );
275 fprintf( stderr, " exe_file=%d,", req->exe_file );
276 fprintf( stderr, " hstdin=%d,", req->hstdin );
277 fprintf( stderr, " hstdout=%d,", req->hstdout );
278 fprintf( stderr, " hstderr=%d,", req->hstderr );
279 fprintf( stderr, " cmd_show=%d,", req->cmd_show );
280 fprintf( stderr, " filename=" );
281 dump_string( req, req->filename );
284 static void dump_init_process_done_request( const struct init_process_done_request *req )
286 fprintf( stderr, " module=%p,", req->module );
287 fprintf( stderr, " entry=%p", req->entry );
290 static void dump_init_process_done_reply( const struct init_process_done_request *req )
292 fprintf( stderr, " debugged=%d", req->debugged );
295 static void dump_init_thread_request( const struct init_thread_request *req )
297 fprintf( stderr, " unix_pid=%d,", req->unix_pid );
298 fprintf( stderr, " teb=%p,", req->teb );
299 fprintf( stderr, " entry=%p", req->entry );
302 static void dump_get_thread_buffer_request( const struct get_thread_buffer_request *req )
306 static void dump_get_thread_buffer_reply( const struct get_thread_buffer_request *req )
308 fprintf( stderr, " pid=%p,", req->pid );
309 fprintf( stderr, " tid=%p,", req->tid );
310 fprintf( stderr, " boot=%d,", req->boot );
311 fprintf( stderr, " version=%d", req->version );
314 static void dump_terminate_process_request( const struct terminate_process_request *req )
316 fprintf( stderr, " handle=%d,", req->handle );
317 fprintf( stderr, " exit_code=%d", req->exit_code );
320 static void dump_terminate_process_reply( const struct terminate_process_request *req )
322 fprintf( stderr, " self=%d", req->self );
325 static void dump_terminate_thread_request( const struct terminate_thread_request *req )
327 fprintf( stderr, " handle=%d,", req->handle );
328 fprintf( stderr, " exit_code=%d", req->exit_code );
331 static void dump_terminate_thread_reply( const struct terminate_thread_request *req )
333 fprintf( stderr, " self=%d,", req->self );
334 fprintf( stderr, " last=%d", req->last );
337 static void dump_get_process_info_request( const struct get_process_info_request *req )
339 fprintf( stderr, " handle=%d", req->handle );
342 static void dump_get_process_info_reply( const struct get_process_info_request *req )
344 fprintf( stderr, " pid=%p,", req->pid );
345 fprintf( stderr, " debugged=%d,", req->debugged );
346 fprintf( stderr, " exit_code=%d,", req->exit_code );
347 fprintf( stderr, " priority=%d,", req->priority );
348 fprintf( stderr, " process_affinity=%d,", req->process_affinity );
349 fprintf( stderr, " system_affinity=%d", req->system_affinity );
352 static void dump_set_process_info_request( const struct set_process_info_request *req )
354 fprintf( stderr, " handle=%d,", req->handle );
355 fprintf( stderr, " mask=%d,", req->mask );
356 fprintf( stderr, " priority=%d,", req->priority );
357 fprintf( stderr, " affinity=%d", req->affinity );
360 static void dump_get_thread_info_request( const struct get_thread_info_request *req )
362 fprintf( stderr, " handle=%d,", req->handle );
363 fprintf( stderr, " tid_in=%p", req->tid_in );
366 static void dump_get_thread_info_reply( const struct get_thread_info_request *req )
368 fprintf( stderr, " tid=%p,", req->tid );
369 fprintf( stderr, " teb=%p,", req->teb );
370 fprintf( stderr, " exit_code=%d,", req->exit_code );
371 fprintf( stderr, " priority=%d", req->priority );
374 static void dump_set_thread_info_request( const struct set_thread_info_request *req )
376 fprintf( stderr, " handle=%d,", req->handle );
377 fprintf( stderr, " mask=%d,", req->mask );
378 fprintf( stderr, " priority=%d,", req->priority );
379 fprintf( stderr, " affinity=%d", req->affinity );
382 static void dump_suspend_thread_request( const struct suspend_thread_request *req )
384 fprintf( stderr, " handle=%d", req->handle );
387 static void dump_suspend_thread_reply( const struct suspend_thread_request *req )
389 fprintf( stderr, " count=%d", req->count );
392 static void dump_resume_thread_request( const struct resume_thread_request *req )
394 fprintf( stderr, " handle=%d", req->handle );
397 static void dump_resume_thread_reply( const struct resume_thread_request *req )
399 fprintf( stderr, " count=%d", req->count );
402 static void dump_load_dll_request( const struct load_dll_request *req )
404 fprintf( stderr, " handle=%d,", req->handle );
405 fprintf( stderr, " base=%p,", req->base );
406 fprintf( stderr, " dbg_offset=%d,", req->dbg_offset );
407 fprintf( stderr, " dbg_size=%d,", req->dbg_size );
408 fprintf( stderr, " name=%p", req->name );
411 static void dump_unload_dll_request( const struct unload_dll_request *req )
413 fprintf( stderr, " base=%p", req->base );
416 static void dump_queue_apc_request( const struct queue_apc_request *req )
418 fprintf( stderr, " handle=%d,", req->handle );
419 fprintf( stderr, " func=%p,", req->func );
420 fprintf( stderr, " param=%p", req->param );
423 static void dump_get_apcs_request( const struct get_apcs_request *req )
427 static void dump_get_apcs_reply( const struct get_apcs_request *req )
429 fprintf( stderr, " count=%d,", req->count );
430 fprintf( stderr, " apcs=" );
431 dump_varargs_get_apcs_reply( req );
434 static void dump_close_handle_request( const struct close_handle_request *req )
436 fprintf( stderr, " handle=%d", req->handle );
439 static void dump_get_handle_info_request( const struct get_handle_info_request *req )
441 fprintf( stderr, " handle=%d", req->handle );
444 static void dump_get_handle_info_reply( const struct get_handle_info_request *req )
446 fprintf( stderr, " flags=%d", req->flags );
449 static void dump_set_handle_info_request( const struct set_handle_info_request *req )
451 fprintf( stderr, " handle=%d,", req->handle );
452 fprintf( stderr, " flags=%d,", req->flags );
453 fprintf( stderr, " mask=%d", req->mask );
456 static void dump_dup_handle_request( const struct dup_handle_request *req )
458 fprintf( stderr, " src_process=%d,", req->src_process );
459 fprintf( stderr, " src_handle=%d,", req->src_handle );
460 fprintf( stderr, " dst_process=%d,", req->dst_process );
461 fprintf( stderr, " access=%08x,", req->access );
462 fprintf( stderr, " inherit=%d,", req->inherit );
463 fprintf( stderr, " options=%d", req->options );
466 static void dump_dup_handle_reply( const struct dup_handle_request *req )
468 fprintf( stderr, " handle=%d", req->handle );
471 static void dump_open_process_request( const struct open_process_request *req )
473 fprintf( stderr, " pid=%p,", req->pid );
474 fprintf( stderr, " access=%08x,", req->access );
475 fprintf( stderr, " inherit=%d", req->inherit );
478 static void dump_open_process_reply( const struct open_process_request *req )
480 fprintf( stderr, " handle=%d", req->handle );
483 static void dump_select_request( const struct select_request *req )
485 fprintf( stderr, " count=%d,", req->count );
486 fprintf( stderr, " flags=%d,", req->flags );
487 fprintf( stderr, " timeout=%d,", req->timeout );
488 fprintf( stderr, " handles=" );
489 dump_varargs_select_request( req );
492 static void dump_select_reply( const struct select_request *req )
494 fprintf( stderr, " signaled=%d", req->signaled );
497 static void dump_create_event_request( const struct create_event_request *req )
499 fprintf( stderr, " manual_reset=%d,", req->manual_reset );
500 fprintf( stderr, " initial_state=%d,", req->initial_state );
501 fprintf( stderr, " inherit=%d,", req->inherit );
502 fprintf( stderr, " name=" );
503 dump_unicode_string( req, req->name );
506 static void dump_create_event_reply( const struct create_event_request *req )
508 fprintf( stderr, " handle=%d", req->handle );
511 static void dump_event_op_request( const struct event_op_request *req )
513 fprintf( stderr, " handle=%d,", req->handle );
514 fprintf( stderr, " op=%d", req->op );
517 static void dump_open_event_request( const struct open_event_request *req )
519 fprintf( stderr, " access=%08x,", req->access );
520 fprintf( stderr, " inherit=%d,", req->inherit );
521 fprintf( stderr, " name=" );
522 dump_unicode_string( req, req->name );
525 static void dump_open_event_reply( const struct open_event_request *req )
527 fprintf( stderr, " handle=%d", req->handle );
530 static void dump_create_mutex_request( const struct create_mutex_request *req )
532 fprintf( stderr, " owned=%d,", req->owned );
533 fprintf( stderr, " inherit=%d,", req->inherit );
534 fprintf( stderr, " name=" );
535 dump_unicode_string( req, req->name );
538 static void dump_create_mutex_reply( const struct create_mutex_request *req )
540 fprintf( stderr, " handle=%d", req->handle );
543 static void dump_release_mutex_request( const struct release_mutex_request *req )
545 fprintf( stderr, " handle=%d", req->handle );
548 static void dump_open_mutex_request( const struct open_mutex_request *req )
550 fprintf( stderr, " access=%08x,", req->access );
551 fprintf( stderr, " inherit=%d,", req->inherit );
552 fprintf( stderr, " name=" );
553 dump_unicode_string( req, req->name );
556 static void dump_open_mutex_reply( const struct open_mutex_request *req )
558 fprintf( stderr, " handle=%d", req->handle );
561 static void dump_create_semaphore_request( const struct create_semaphore_request *req )
563 fprintf( stderr, " initial=%08x,", req->initial );
564 fprintf( stderr, " max=%08x,", req->max );
565 fprintf( stderr, " inherit=%d,", req->inherit );
566 fprintf( stderr, " name=" );
567 dump_unicode_string( req, req->name );
570 static void dump_create_semaphore_reply( const struct create_semaphore_request *req )
572 fprintf( stderr, " handle=%d", req->handle );
575 static void dump_release_semaphore_request( const struct release_semaphore_request *req )
577 fprintf( stderr, " handle=%d,", req->handle );
578 fprintf( stderr, " count=%08x", req->count );
581 static void dump_release_semaphore_reply( const struct release_semaphore_request *req )
583 fprintf( stderr, " prev_count=%08x", req->prev_count );
586 static void dump_open_semaphore_request( const struct open_semaphore_request *req )
588 fprintf( stderr, " access=%08x,", req->access );
589 fprintf( stderr, " inherit=%d,", req->inherit );
590 fprintf( stderr, " name=" );
591 dump_unicode_string( req, req->name );
594 static void dump_open_semaphore_reply( const struct open_semaphore_request *req )
596 fprintf( stderr, " handle=%d", req->handle );
599 static void dump_create_file_request( const struct create_file_request *req )
601 fprintf( stderr, " access=%08x,", req->access );
602 fprintf( stderr, " inherit=%d,", req->inherit );
603 fprintf( stderr, " sharing=%08x,", req->sharing );
604 fprintf( stderr, " create=%d,", req->create );
605 fprintf( stderr, " attrs=%08x,", req->attrs );
606 fprintf( stderr, " name=" );
607 dump_string( req, req->name );
610 static void dump_create_file_reply( const struct create_file_request *req )
612 fprintf( stderr, " handle=%d", req->handle );
615 static void dump_alloc_file_handle_request( const struct alloc_file_handle_request *req )
617 fprintf( stderr, " access=%08x", req->access );
620 static void dump_alloc_file_handle_reply( const struct alloc_file_handle_request *req )
622 fprintf( stderr, " handle=%d", req->handle );
625 static void dump_get_read_fd_request( const struct get_read_fd_request *req )
627 fprintf( stderr, " handle=%d", req->handle );
630 static void dump_get_write_fd_request( const struct get_write_fd_request *req )
632 fprintf( stderr, " handle=%d", req->handle );
635 static void dump_set_file_pointer_request( const struct set_file_pointer_request *req )
637 fprintf( stderr, " handle=%d,", req->handle );
638 fprintf( stderr, " low=%d,", req->low );
639 fprintf( stderr, " high=%d,", req->high );
640 fprintf( stderr, " whence=%d", req->whence );
643 static void dump_set_file_pointer_reply( const struct set_file_pointer_request *req )
645 fprintf( stderr, " new_low=%d,", req->new_low );
646 fprintf( stderr, " new_high=%d", req->new_high );
649 static void dump_truncate_file_request( const struct truncate_file_request *req )
651 fprintf( stderr, " handle=%d", req->handle );
654 static void dump_set_file_time_request( const struct set_file_time_request *req )
656 fprintf( stderr, " handle=%d,", req->handle );
657 fprintf( stderr, " access_time=%ld,", req->access_time );
658 fprintf( stderr, " write_time=%ld", req->write_time );
661 static void dump_flush_file_request( const struct flush_file_request *req )
663 fprintf( stderr, " handle=%d", req->handle );
666 static void dump_get_file_info_request( const struct get_file_info_request *req )
668 fprintf( stderr, " handle=%d", req->handle );
671 static void dump_get_file_info_reply( const struct get_file_info_request *req )
673 fprintf( stderr, " type=%d,", req->type );
674 fprintf( stderr, " attr=%d,", req->attr );
675 fprintf( stderr, " access_time=%ld,", req->access_time );
676 fprintf( stderr, " write_time=%ld,", req->write_time );
677 fprintf( stderr, " size_high=%d,", req->size_high );
678 fprintf( stderr, " size_low=%d,", req->size_low );
679 fprintf( stderr, " links=%d,", req->links );
680 fprintf( stderr, " index_high=%d,", req->index_high );
681 fprintf( stderr, " index_low=%d,", req->index_low );
682 fprintf( stderr, " serial=%08x", req->serial );
685 static void dump_lock_file_request( const struct lock_file_request *req )
687 fprintf( stderr, " handle=%d,", req->handle );
688 fprintf( stderr, " offset_low=%08x,", req->offset_low );
689 fprintf( stderr, " offset_high=%08x,", req->offset_high );
690 fprintf( stderr, " count_low=%08x,", req->count_low );
691 fprintf( stderr, " count_high=%08x", req->count_high );
694 static void dump_unlock_file_request( const struct unlock_file_request *req )
696 fprintf( stderr, " handle=%d,", req->handle );
697 fprintf( stderr, " offset_low=%08x,", req->offset_low );
698 fprintf( stderr, " offset_high=%08x,", req->offset_high );
699 fprintf( stderr, " count_low=%08x,", req->count_low );
700 fprintf( stderr, " count_high=%08x", req->count_high );
703 static void dump_create_pipe_request( const struct create_pipe_request *req )
705 fprintf( stderr, " inherit=%d", req->inherit );
708 static void dump_create_pipe_reply( const struct create_pipe_request *req )
710 fprintf( stderr, " handle_read=%d,", req->handle_read );
711 fprintf( stderr, " handle_write=%d", req->handle_write );
714 static void dump_create_socket_request( const struct create_socket_request *req )
716 fprintf( stderr, " access=%08x,", req->access );
717 fprintf( stderr, " inherit=%d,", req->inherit );
718 fprintf( stderr, " family=%d,", req->family );
719 fprintf( stderr, " type=%d,", req->type );
720 fprintf( stderr, " protocol=%d", req->protocol );
723 static void dump_create_socket_reply( const struct create_socket_request *req )
725 fprintf( stderr, " handle=%d", req->handle );
728 static void dump_accept_socket_request( const struct accept_socket_request *req )
730 fprintf( stderr, " lhandle=%d,", req->lhandle );
731 fprintf( stderr, " access=%08x,", req->access );
732 fprintf( stderr, " inherit=%d", req->inherit );
735 static void dump_accept_socket_reply( const struct accept_socket_request *req )
737 fprintf( stderr, " handle=%d", req->handle );
740 static void dump_set_socket_event_request( const struct set_socket_event_request *req )
742 fprintf( stderr, " handle=%d,", req->handle );
743 fprintf( stderr, " mask=%08x,", req->mask );
744 fprintf( stderr, " event=%d", req->event );
747 static void dump_get_socket_event_request( const struct get_socket_event_request *req )
749 fprintf( stderr, " handle=%d,", req->handle );
750 fprintf( stderr, " service=%d,", req->service );
751 fprintf( stderr, " s_event=%d,", req->s_event );
752 fprintf( stderr, " c_event=%d", req->c_event );
755 static void dump_get_socket_event_reply( const struct get_socket_event_request *req )
757 fprintf( stderr, " mask=%08x,", req->mask );
758 fprintf( stderr, " pmask=%08x,", req->pmask );
759 fprintf( stderr, " state=%08x,", req->state );
760 fprintf( stderr, " errors=" );
761 dump_varargs_get_socket_event_reply( req );
764 static void dump_enable_socket_event_request( const struct enable_socket_event_request *req )
766 fprintf( stderr, " handle=%d,", req->handle );
767 fprintf( stderr, " mask=%08x,", req->mask );
768 fprintf( stderr, " sstate=%08x,", req->sstate );
769 fprintf( stderr, " cstate=%08x", req->cstate );
772 static void dump_alloc_console_request( const struct alloc_console_request *req )
774 fprintf( stderr, " access=%08x,", req->access );
775 fprintf( stderr, " inherit=%d", req->inherit );
778 static void dump_alloc_console_reply( const struct alloc_console_request *req )
780 fprintf( stderr, " handle_in=%d,", req->handle_in );
781 fprintf( stderr, " handle_out=%d", req->handle_out );
784 static void dump_free_console_request( const struct free_console_request *req )
786 fprintf( stderr, " dummy=%d", req->dummy );
789 static void dump_open_console_request( const struct open_console_request *req )
791 fprintf( stderr, " output=%d,", req->output );
792 fprintf( stderr, " access=%08x,", req->access );
793 fprintf( stderr, " inherit=%d", req->inherit );
796 static void dump_open_console_reply( const struct open_console_request *req )
798 fprintf( stderr, " handle=%d", req->handle );
801 static void dump_set_console_fd_request( const struct set_console_fd_request *req )
803 fprintf( stderr, " handle=%d,", req->handle );
804 fprintf( stderr, " file_handle=%d,", req->file_handle );
805 fprintf( stderr, " pid=%d", req->pid );
808 static void dump_get_console_mode_request( const struct get_console_mode_request *req )
810 fprintf( stderr, " handle=%d", req->handle );
813 static void dump_get_console_mode_reply( const struct get_console_mode_request *req )
815 fprintf( stderr, " mode=%d", req->mode );
818 static void dump_set_console_mode_request( const struct set_console_mode_request *req )
820 fprintf( stderr, " handle=%d,", req->handle );
821 fprintf( stderr, " mode=%d", req->mode );
824 static void dump_set_console_info_request( const struct set_console_info_request *req )
826 fprintf( stderr, " handle=%d,", req->handle );
827 fprintf( stderr, " mask=%d,", req->mask );
828 fprintf( stderr, " cursor_size=%d,", req->cursor_size );
829 fprintf( stderr, " cursor_visible=%d,", req->cursor_visible );
830 fprintf( stderr, " title=" );
831 dump_string( req, req->title );
834 static void dump_get_console_info_request( const struct get_console_info_request *req )
836 fprintf( stderr, " handle=%d", req->handle );
839 static void dump_get_console_info_reply( const struct get_console_info_request *req )
841 fprintf( stderr, " cursor_size=%d,", req->cursor_size );
842 fprintf( stderr, " cursor_visible=%d,", req->cursor_visible );
843 fprintf( stderr, " pid=%d,", req->pid );
844 fprintf( stderr, " title=" );
845 dump_string( req, req->title );
848 static void dump_write_console_input_request( const struct write_console_input_request *req )
850 fprintf( stderr, " handle=%d,", req->handle );
851 fprintf( stderr, " count=%d", req->count );
854 static void dump_write_console_input_reply( const struct write_console_input_request *req )
856 fprintf( stderr, " written=%d", req->written );
859 static void dump_read_console_input_request( const struct read_console_input_request *req )
861 fprintf( stderr, " handle=%d,", req->handle );
862 fprintf( stderr, " count=%d,", req->count );
863 fprintf( stderr, " flush=%d", req->flush );
866 static void dump_read_console_input_reply( const struct read_console_input_request *req )
868 fprintf( stderr, " read=%d", req->read );
871 static void dump_create_change_notification_request( const struct create_change_notification_request *req )
873 fprintf( stderr, " subtree=%d,", req->subtree );
874 fprintf( stderr, " filter=%d", req->filter );
877 static void dump_create_change_notification_reply( const struct create_change_notification_request *req )
879 fprintf( stderr, " handle=%d", req->handle );
882 static void dump_create_mapping_request( const struct create_mapping_request *req )
884 fprintf( stderr, " size_high=%d,", req->size_high );
885 fprintf( stderr, " size_low=%d,", req->size_low );
886 fprintf( stderr, " protect=%d,", req->protect );
887 fprintf( stderr, " inherit=%d,", req->inherit );
888 fprintf( stderr, " file_handle=%d,", req->file_handle );
889 fprintf( stderr, " name=" );
890 dump_unicode_string( req, req->name );
893 static void dump_create_mapping_reply( const struct create_mapping_request *req )
895 fprintf( stderr, " handle=%d", req->handle );
898 static void dump_open_mapping_request( const struct open_mapping_request *req )
900 fprintf( stderr, " access=%08x,", req->access );
901 fprintf( stderr, " inherit=%d,", req->inherit );
902 fprintf( stderr, " name=" );
903 dump_unicode_string( req, req->name );
906 static void dump_open_mapping_reply( const struct open_mapping_request *req )
908 fprintf( stderr, " handle=%d", req->handle );
911 static void dump_get_mapping_info_request( const struct get_mapping_info_request *req )
913 fprintf( stderr, " handle=%d", req->handle );
916 static void dump_get_mapping_info_reply( const struct get_mapping_info_request *req )
918 fprintf( stderr, " size_high=%d,", req->size_high );
919 fprintf( stderr, " size_low=%d,", req->size_low );
920 fprintf( stderr, " protect=%d", req->protect );
923 static void dump_create_device_request( const struct create_device_request *req )
925 fprintf( stderr, " access=%08x,", req->access );
926 fprintf( stderr, " inherit=%d,", req->inherit );
927 fprintf( stderr, " id=%d", req->id );
930 static void dump_create_device_reply( const struct create_device_request *req )
932 fprintf( stderr, " handle=%d", req->handle );
935 static void dump_create_snapshot_request( const struct create_snapshot_request *req )
937 fprintf( stderr, " inherit=%d,", req->inherit );
938 fprintf( stderr, " flags=%d,", req->flags );
939 fprintf( stderr, " pid=%p", req->pid );
942 static void dump_create_snapshot_reply( const struct create_snapshot_request *req )
944 fprintf( stderr, " handle=%d", req->handle );
947 static void dump_next_process_request( const struct next_process_request *req )
949 fprintf( stderr, " handle=%d,", req->handle );
950 fprintf( stderr, " reset=%d", req->reset );
953 static void dump_next_process_reply( const struct next_process_request *req )
955 fprintf( stderr, " count=%d,", req->count );
956 fprintf( stderr, " pid=%p,", req->pid );
957 fprintf( stderr, " threads=%d,", req->threads );
958 fprintf( stderr, " priority=%d", req->priority );
961 static void dump_next_thread_request( const struct next_thread_request *req )
963 fprintf( stderr, " handle=%d,", req->handle );
964 fprintf( stderr, " reset=%d", req->reset );
967 static void dump_next_thread_reply( const struct next_thread_request *req )
969 fprintf( stderr, " count=%d,", req->count );
970 fprintf( stderr, " pid=%p,", req->pid );
971 fprintf( stderr, " tid=%p,", req->tid );
972 fprintf( stderr, " base_pri=%d,", req->base_pri );
973 fprintf( stderr, " delta_pri=%d", req->delta_pri );
976 static void dump_next_module_request( const struct next_module_request *req )
978 fprintf( stderr, " handle=%d,", req->handle );
979 fprintf( stderr, " reset=%d", req->reset );
982 static void dump_next_module_reply( const struct next_module_request *req )
984 fprintf( stderr, " pid=%p,", req->pid );
985 fprintf( stderr, " base=%p", req->base );
988 static void dump_wait_debug_event_request( const struct wait_debug_event_request *req )
990 fprintf( stderr, " timeout=%d", req->timeout );
993 static void dump_wait_debug_event_reply( const struct wait_debug_event_request *req )
995 fprintf( stderr, " pid=%p,", req->pid );
996 fprintf( stderr, " tid=%p,", req->tid );
997 fprintf( stderr, " event=" );
998 dump_debug_event_t( req, &req->event );
1001 static void dump_exception_event_request( const struct exception_event_request *req )
1003 fprintf( stderr, " record=" );
1004 dump_exc_record( req, &req->record );
1005 fprintf( stderr, "," );
1006 fprintf( stderr, " first=%d,", req->first );
1007 fprintf( stderr, " context=" );
1008 dump_context( req, &req->context );
1011 static void dump_exception_event_reply( const struct exception_event_request *req )
1013 fprintf( stderr, " status=%d", req->status );
1016 static void dump_output_debug_string_request( const struct output_debug_string_request *req )
1018 fprintf( stderr, " string=%p,", req->string );
1019 fprintf( stderr, " unicode=%d,", req->unicode );
1020 fprintf( stderr, " length=%d", req->length );
1023 static void dump_continue_debug_event_request( const struct continue_debug_event_request *req )
1025 fprintf( stderr, " pid=%p,", req->pid );
1026 fprintf( stderr, " tid=%p,", req->tid );
1027 fprintf( stderr, " status=%d", req->status );
1030 static void dump_debug_process_request( const struct debug_process_request *req )
1032 fprintf( stderr, " pid=%p", req->pid );
1035 static void dump_read_process_memory_request( const struct read_process_memory_request *req )
1037 fprintf( stderr, " handle=%d,", req->handle );
1038 fprintf( stderr, " addr=%p,", req->addr );
1039 fprintf( stderr, " len=%d", req->len );
1042 static void dump_read_process_memory_reply( const struct read_process_memory_request *req )
1044 fprintf( stderr, " data=" );
1045 dump_varargs_read_process_memory_reply( req );
1048 static void dump_write_process_memory_request( const struct write_process_memory_request *req )
1050 fprintf( stderr, " handle=%d,", req->handle );
1051 fprintf( stderr, " addr=%p,", req->addr );
1052 fprintf( stderr, " len=%d,", req->len );
1053 fprintf( stderr, " first_mask=%08x,", req->first_mask );
1054 fprintf( stderr, " last_mask=%08x,", req->last_mask );
1055 fprintf( stderr, " data=" );
1056 dump_varargs_write_process_memory_request( req );
1059 static void dump_create_key_request( const struct create_key_request *req )
1061 fprintf( stderr, " parent=%d,", req->parent );
1062 fprintf( stderr, " access=%08x,", req->access );
1063 fprintf( stderr, " options=%08x,", req->options );
1064 fprintf( stderr, " modif=%ld,", req->modif );
1065 fprintf( stderr, " name=" );
1066 dump_path_t( req, &req->name );
1067 fprintf( stderr, "," );
1068 fprintf( stderr, " class=" );
1069 dump_unicode_string( req, req->class );
1072 static void dump_create_key_reply( const struct create_key_request *req )
1074 fprintf( stderr, " hkey=%d,", req->hkey );
1075 fprintf( stderr, " created=%d", req->created );
1078 static void dump_open_key_request( const struct open_key_request *req )
1080 fprintf( stderr, " parent=%d,", req->parent );
1081 fprintf( stderr, " access=%08x,", req->access );
1082 fprintf( stderr, " name=" );
1083 dump_path_t( req, &req->name );
1086 static void dump_open_key_reply( const struct open_key_request *req )
1088 fprintf( stderr, " hkey=%d", req->hkey );
1091 static void dump_delete_key_request( const struct delete_key_request *req )
1093 fprintf( stderr, " hkey=%d,", req->hkey );
1094 fprintf( stderr, " name=" );
1095 dump_path_t( req, &req->name );
1098 static void dump_close_key_request( const struct close_key_request *req )
1100 fprintf( stderr, " hkey=%d", req->hkey );
1103 static void dump_enum_key_request( const struct enum_key_request *req )
1105 fprintf( stderr, " hkey=%d,", req->hkey );
1106 fprintf( stderr, " index=%d", req->index );
1109 static void dump_enum_key_reply( const struct enum_key_request *req )
1111 fprintf( stderr, " modif=%ld,", req->modif );
1112 fprintf( stderr, " name=" );
1113 dump_path_t( req, &req->name );
1114 fprintf( stderr, "," );
1115 fprintf( stderr, " class=" );
1116 dump_unicode_string( req, req->class );
1119 static void dump_query_key_info_request( const struct query_key_info_request *req )
1121 fprintf( stderr, " hkey=%d", req->hkey );
1124 static void dump_query_key_info_reply( const struct query_key_info_request *req )
1126 fprintf( stderr, " subkeys=%d,", req->subkeys );
1127 fprintf( stderr, " max_subkey=%d,", req->max_subkey );
1128 fprintf( stderr, " max_class=%d,", req->max_class );
1129 fprintf( stderr, " values=%d,", req->values );
1130 fprintf( stderr, " max_value=%d,", req->max_value );
1131 fprintf( stderr, " max_data=%d,", req->max_data );
1132 fprintf( stderr, " modif=%ld,", req->modif );
1133 fprintf( stderr, " name=" );
1134 dump_path_t( req, &req->name );
1135 fprintf( stderr, "," );
1136 fprintf( stderr, " class=" );
1137 dump_unicode_string( req, req->class );
1140 static void dump_set_key_value_request( const struct set_key_value_request *req )
1142 fprintf( stderr, " hkey=%d,", req->hkey );
1143 fprintf( stderr, " type=%d,", req->type );
1144 fprintf( stderr, " total=%08x,", req->total );
1145 fprintf( stderr, " offset=%08x,", req->offset );
1146 fprintf( stderr, " len=%08x,", req->len );
1147 fprintf( stderr, " name=" );
1148 dump_path_t( req, &req->name );
1149 fprintf( stderr, "," );
1150 fprintf( stderr, " data=" );
1151 dump_varargs_set_key_value_request( req );
1154 static void dump_get_key_value_request( const struct get_key_value_request *req )
1156 fprintf( stderr, " hkey=%d,", req->hkey );
1157 fprintf( stderr, " offset=%08x,", req->offset );
1158 fprintf( stderr, " name=" );
1159 dump_unicode_string( req, req->name );
1162 static void dump_get_key_value_reply( const struct get_key_value_request *req )
1164 fprintf( stderr, " type=%d,", req->type );
1165 fprintf( stderr, " len=%d,", req->len );
1166 fprintf( stderr, " data=" );
1167 dump_varargs_get_key_value_reply( req );
1170 static void dump_enum_key_value_request( const struct enum_key_value_request *req )
1172 fprintf( stderr, " hkey=%d,", req->hkey );
1173 fprintf( stderr, " index=%d,", req->index );
1174 fprintf( stderr, " offset=%08x", req->offset );
1177 static void dump_enum_key_value_reply( const struct enum_key_value_request *req )
1179 fprintf( stderr, " type=%d,", req->type );
1180 fprintf( stderr, " len=%d,", req->len );
1181 fprintf( stderr, " name=" );
1182 dump_path_t( req, &req->name );
1183 fprintf( stderr, "," );
1184 fprintf( stderr, " data=" );
1185 dump_varargs_enum_key_value_reply( req );
1188 static void dump_delete_key_value_request( const struct delete_key_value_request *req )
1190 fprintf( stderr, " hkey=%d,", req->hkey );
1191 fprintf( stderr, " name=" );
1192 dump_path_t( req, &req->name );
1195 static void dump_load_registry_request( const struct load_registry_request *req )
1197 fprintf( stderr, " hkey=%d,", req->hkey );
1198 fprintf( stderr, " file=%d,", req->file );
1199 fprintf( stderr, " name=" );
1200 dump_path_t( req, &req->name );
1203 static void dump_save_registry_request( const struct save_registry_request *req )
1205 fprintf( stderr, " hkey=%d,", req->hkey );
1206 fprintf( stderr, " file=%d", req->file );
1209 static void dump_save_registry_atexit_request( const struct save_registry_atexit_request *req )
1211 fprintf( stderr, " hkey=%d,", req->hkey );
1212 fprintf( stderr, " file=" );
1213 dump_string( req, req->file );
1216 static void dump_set_registry_levels_request( const struct set_registry_levels_request *req )
1218 fprintf( stderr, " current=%d,", req->current );
1219 fprintf( stderr, " saving=%d,", req->saving );
1220 fprintf( stderr, " period=%d", req->period );
1223 static void dump_create_timer_request( const struct create_timer_request *req )
1225 fprintf( stderr, " inherit=%d,", req->inherit );
1226 fprintf( stderr, " manual=%d,", req->manual );
1227 fprintf( stderr, " name=" );
1228 dump_unicode_string( req, req->name );
1231 static void dump_create_timer_reply( const struct create_timer_request *req )
1233 fprintf( stderr, " handle=%d", req->handle );
1236 static void dump_open_timer_request( const struct open_timer_request *req )
1238 fprintf( stderr, " access=%08x,", req->access );
1239 fprintf( stderr, " inherit=%d,", req->inherit );
1240 fprintf( stderr, " name=" );
1241 dump_unicode_string( req, req->name );
1244 static void dump_open_timer_reply( const struct open_timer_request *req )
1246 fprintf( stderr, " handle=%d", req->handle );
1249 static void dump_set_timer_request( const struct set_timer_request *req )
1251 fprintf( stderr, " handle=%d,", req->handle );
1252 fprintf( stderr, " sec=%d,", req->sec );
1253 fprintf( stderr, " usec=%d,", req->usec );
1254 fprintf( stderr, " period=%d,", req->period );
1255 fprintf( stderr, " callback=%p,", req->callback );
1256 fprintf( stderr, " arg=%p", req->arg );
1259 static void dump_cancel_timer_request( const struct cancel_timer_request *req )
1261 fprintf( stderr, " handle=%d", req->handle );
1264 static void dump_get_thread_context_request( const struct get_thread_context_request *req )
1266 fprintf( stderr, " handle=%d,", req->handle );
1267 fprintf( stderr, " flags=%08x", req->flags );
1270 static void dump_get_thread_context_reply( const struct get_thread_context_request *req )
1272 fprintf( stderr, " context=" );
1273 dump_context( req, &req->context );
1276 static void dump_set_thread_context_request( const struct set_thread_context_request *req )
1278 fprintf( stderr, " handle=%d,", req->handle );
1279 fprintf( stderr, " flags=%08x,", req->flags );
1280 fprintf( stderr, " context=" );
1281 dump_context( req, &req->context );
1284 static void dump_get_selector_entry_request( const struct get_selector_entry_request *req )
1286 fprintf( stderr, " handle=%d,", req->handle );
1287 fprintf( stderr, " entry=%d", req->entry );
1290 static void dump_get_selector_entry_reply( const struct get_selector_entry_request *req )
1292 fprintf( stderr, " base=%08x,", req->base );
1293 fprintf( stderr, " limit=%08x,", req->limit );
1294 fprintf( stderr, " flags=%02x", req->flags );
1297 static void dump_add_atom_request( const struct add_atom_request *req )
1299 fprintf( stderr, " name=" );
1300 dump_unicode_string( req, req->name );
1303 static void dump_add_atom_reply( const struct add_atom_request *req )
1305 fprintf( stderr, " atom=%d", req->atom );
1308 static void dump_delete_atom_request( const struct delete_atom_request *req )
1310 fprintf( stderr, " atom=%d", req->atom );
1313 static void dump_find_atom_request( const struct find_atom_request *req )
1315 fprintf( stderr, " name=" );
1316 dump_unicode_string( req, req->name );
1319 static void dump_find_atom_reply( const struct find_atom_request *req )
1321 fprintf( stderr, " atom=%d", req->atom );
1324 static void dump_get_atom_name_request( const struct get_atom_name_request *req )
1326 fprintf( stderr, " atom=%d", req->atom );
1329 static void dump_get_atom_name_reply( const struct get_atom_name_request *req )
1331 fprintf( stderr, " count=%d,", req->count );
1332 fprintf( stderr, " name=" );
1333 dump_unicode_string( req, req->name );
1336 static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
1337 (dump_func)dump_new_process_request,
1338 (dump_func)dump_wait_process_request,
1339 (dump_func)dump_new_thread_request,
1340 (dump_func)dump_boot_done_request,
1341 (dump_func)dump_init_process_request,
1342 (dump_func)dump_init_process_done_request,
1343 (dump_func)dump_init_thread_request,
1344 (dump_func)dump_get_thread_buffer_request,
1345 (dump_func)dump_terminate_process_request,
1346 (dump_func)dump_terminate_thread_request,
1347 (dump_func)dump_get_process_info_request,
1348 (dump_func)dump_set_process_info_request,
1349 (dump_func)dump_get_thread_info_request,
1350 (dump_func)dump_set_thread_info_request,
1351 (dump_func)dump_suspend_thread_request,
1352 (dump_func)dump_resume_thread_request,
1353 (dump_func)dump_load_dll_request,
1354 (dump_func)dump_unload_dll_request,
1355 (dump_func)dump_queue_apc_request,
1356 (dump_func)dump_get_apcs_request,
1357 (dump_func)dump_close_handle_request,
1358 (dump_func)dump_get_handle_info_request,
1359 (dump_func)dump_set_handle_info_request,
1360 (dump_func)dump_dup_handle_request,
1361 (dump_func)dump_open_process_request,
1362 (dump_func)dump_select_request,
1363 (dump_func)dump_create_event_request,
1364 (dump_func)dump_event_op_request,
1365 (dump_func)dump_open_event_request,
1366 (dump_func)dump_create_mutex_request,
1367 (dump_func)dump_release_mutex_request,
1368 (dump_func)dump_open_mutex_request,
1369 (dump_func)dump_create_semaphore_request,
1370 (dump_func)dump_release_semaphore_request,
1371 (dump_func)dump_open_semaphore_request,
1372 (dump_func)dump_create_file_request,
1373 (dump_func)dump_alloc_file_handle_request,
1374 (dump_func)dump_get_read_fd_request,
1375 (dump_func)dump_get_write_fd_request,
1376 (dump_func)dump_set_file_pointer_request,
1377 (dump_func)dump_truncate_file_request,
1378 (dump_func)dump_set_file_time_request,
1379 (dump_func)dump_flush_file_request,
1380 (dump_func)dump_get_file_info_request,
1381 (dump_func)dump_lock_file_request,
1382 (dump_func)dump_unlock_file_request,
1383 (dump_func)dump_create_pipe_request,
1384 (dump_func)dump_create_socket_request,
1385 (dump_func)dump_accept_socket_request,
1386 (dump_func)dump_set_socket_event_request,
1387 (dump_func)dump_get_socket_event_request,
1388 (dump_func)dump_enable_socket_event_request,
1389 (dump_func)dump_alloc_console_request,
1390 (dump_func)dump_free_console_request,
1391 (dump_func)dump_open_console_request,
1392 (dump_func)dump_set_console_fd_request,
1393 (dump_func)dump_get_console_mode_request,
1394 (dump_func)dump_set_console_mode_request,
1395 (dump_func)dump_set_console_info_request,
1396 (dump_func)dump_get_console_info_request,
1397 (dump_func)dump_write_console_input_request,
1398 (dump_func)dump_read_console_input_request,
1399 (dump_func)dump_create_change_notification_request,
1400 (dump_func)dump_create_mapping_request,
1401 (dump_func)dump_open_mapping_request,
1402 (dump_func)dump_get_mapping_info_request,
1403 (dump_func)dump_create_device_request,
1404 (dump_func)dump_create_snapshot_request,
1405 (dump_func)dump_next_process_request,
1406 (dump_func)dump_next_thread_request,
1407 (dump_func)dump_next_module_request,
1408 (dump_func)dump_wait_debug_event_request,
1409 (dump_func)dump_exception_event_request,
1410 (dump_func)dump_output_debug_string_request,
1411 (dump_func)dump_continue_debug_event_request,
1412 (dump_func)dump_debug_process_request,
1413 (dump_func)dump_read_process_memory_request,
1414 (dump_func)dump_write_process_memory_request,
1415 (dump_func)dump_create_key_request,
1416 (dump_func)dump_open_key_request,
1417 (dump_func)dump_delete_key_request,
1418 (dump_func)dump_close_key_request,
1419 (dump_func)dump_enum_key_request,
1420 (dump_func)dump_query_key_info_request,
1421 (dump_func)dump_set_key_value_request,
1422 (dump_func)dump_get_key_value_request,
1423 (dump_func)dump_enum_key_value_request,
1424 (dump_func)dump_delete_key_value_request,
1425 (dump_func)dump_load_registry_request,
1426 (dump_func)dump_save_registry_request,
1427 (dump_func)dump_save_registry_atexit_request,
1428 (dump_func)dump_set_registry_levels_request,
1429 (dump_func)dump_create_timer_request,
1430 (dump_func)dump_open_timer_request,
1431 (dump_func)dump_set_timer_request,
1432 (dump_func)dump_cancel_timer_request,
1433 (dump_func)dump_get_thread_context_request,
1434 (dump_func)dump_set_thread_context_request,
1435 (dump_func)dump_get_selector_entry_request,
1436 (dump_func)dump_add_atom_request,
1437 (dump_func)dump_delete_atom_request,
1438 (dump_func)dump_find_atom_request,
1439 (dump_func)dump_get_atom_name_request,
1442 static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
1443 (dump_func)0,
1444 (dump_func)dump_wait_process_reply,
1445 (dump_func)dump_new_thread_reply,
1446 (dump_func)0,
1447 (dump_func)dump_init_process_reply,
1448 (dump_func)dump_init_process_done_reply,
1449 (dump_func)0,
1450 (dump_func)dump_get_thread_buffer_reply,
1451 (dump_func)dump_terminate_process_reply,
1452 (dump_func)dump_terminate_thread_reply,
1453 (dump_func)dump_get_process_info_reply,
1454 (dump_func)0,
1455 (dump_func)dump_get_thread_info_reply,
1456 (dump_func)0,
1457 (dump_func)dump_suspend_thread_reply,
1458 (dump_func)dump_resume_thread_reply,
1459 (dump_func)0,
1460 (dump_func)0,
1461 (dump_func)0,
1462 (dump_func)dump_get_apcs_reply,
1463 (dump_func)0,
1464 (dump_func)dump_get_handle_info_reply,
1465 (dump_func)0,
1466 (dump_func)dump_dup_handle_reply,
1467 (dump_func)dump_open_process_reply,
1468 (dump_func)dump_select_reply,
1469 (dump_func)dump_create_event_reply,
1470 (dump_func)0,
1471 (dump_func)dump_open_event_reply,
1472 (dump_func)dump_create_mutex_reply,
1473 (dump_func)0,
1474 (dump_func)dump_open_mutex_reply,
1475 (dump_func)dump_create_semaphore_reply,
1476 (dump_func)dump_release_semaphore_reply,
1477 (dump_func)dump_open_semaphore_reply,
1478 (dump_func)dump_create_file_reply,
1479 (dump_func)dump_alloc_file_handle_reply,
1480 (dump_func)0,
1481 (dump_func)0,
1482 (dump_func)dump_set_file_pointer_reply,
1483 (dump_func)0,
1484 (dump_func)0,
1485 (dump_func)0,
1486 (dump_func)dump_get_file_info_reply,
1487 (dump_func)0,
1488 (dump_func)0,
1489 (dump_func)dump_create_pipe_reply,
1490 (dump_func)dump_create_socket_reply,
1491 (dump_func)dump_accept_socket_reply,
1492 (dump_func)0,
1493 (dump_func)dump_get_socket_event_reply,
1494 (dump_func)0,
1495 (dump_func)dump_alloc_console_reply,
1496 (dump_func)0,
1497 (dump_func)dump_open_console_reply,
1498 (dump_func)0,
1499 (dump_func)dump_get_console_mode_reply,
1500 (dump_func)0,
1501 (dump_func)0,
1502 (dump_func)dump_get_console_info_reply,
1503 (dump_func)dump_write_console_input_reply,
1504 (dump_func)dump_read_console_input_reply,
1505 (dump_func)dump_create_change_notification_reply,
1506 (dump_func)dump_create_mapping_reply,
1507 (dump_func)dump_open_mapping_reply,
1508 (dump_func)dump_get_mapping_info_reply,
1509 (dump_func)dump_create_device_reply,
1510 (dump_func)dump_create_snapshot_reply,
1511 (dump_func)dump_next_process_reply,
1512 (dump_func)dump_next_thread_reply,
1513 (dump_func)dump_next_module_reply,
1514 (dump_func)dump_wait_debug_event_reply,
1515 (dump_func)dump_exception_event_reply,
1516 (dump_func)0,
1517 (dump_func)0,
1518 (dump_func)0,
1519 (dump_func)dump_read_process_memory_reply,
1520 (dump_func)0,
1521 (dump_func)dump_create_key_reply,
1522 (dump_func)dump_open_key_reply,
1523 (dump_func)0,
1524 (dump_func)0,
1525 (dump_func)dump_enum_key_reply,
1526 (dump_func)dump_query_key_info_reply,
1527 (dump_func)0,
1528 (dump_func)dump_get_key_value_reply,
1529 (dump_func)dump_enum_key_value_reply,
1530 (dump_func)0,
1531 (dump_func)0,
1532 (dump_func)0,
1533 (dump_func)0,
1534 (dump_func)0,
1535 (dump_func)dump_create_timer_reply,
1536 (dump_func)dump_open_timer_reply,
1537 (dump_func)0,
1538 (dump_func)0,
1539 (dump_func)dump_get_thread_context_reply,
1540 (dump_func)0,
1541 (dump_func)dump_get_selector_entry_reply,
1542 (dump_func)dump_add_atom_reply,
1543 (dump_func)0,
1544 (dump_func)dump_find_atom_reply,
1545 (dump_func)dump_get_atom_name_reply,
1548 static const char * const req_names[REQ_NB_REQUESTS] = {
1549 "new_process",
1550 "wait_process",
1551 "new_thread",
1552 "boot_done",
1553 "init_process",
1554 "init_process_done",
1555 "init_thread",
1556 "get_thread_buffer",
1557 "terminate_process",
1558 "terminate_thread",
1559 "get_process_info",
1560 "set_process_info",
1561 "get_thread_info",
1562 "set_thread_info",
1563 "suspend_thread",
1564 "resume_thread",
1565 "load_dll",
1566 "unload_dll",
1567 "queue_apc",
1568 "get_apcs",
1569 "close_handle",
1570 "get_handle_info",
1571 "set_handle_info",
1572 "dup_handle",
1573 "open_process",
1574 "select",
1575 "create_event",
1576 "event_op",
1577 "open_event",
1578 "create_mutex",
1579 "release_mutex",
1580 "open_mutex",
1581 "create_semaphore",
1582 "release_semaphore",
1583 "open_semaphore",
1584 "create_file",
1585 "alloc_file_handle",
1586 "get_read_fd",
1587 "get_write_fd",
1588 "set_file_pointer",
1589 "truncate_file",
1590 "set_file_time",
1591 "flush_file",
1592 "get_file_info",
1593 "lock_file",
1594 "unlock_file",
1595 "create_pipe",
1596 "create_socket",
1597 "accept_socket",
1598 "set_socket_event",
1599 "get_socket_event",
1600 "enable_socket_event",
1601 "alloc_console",
1602 "free_console",
1603 "open_console",
1604 "set_console_fd",
1605 "get_console_mode",
1606 "set_console_mode",
1607 "set_console_info",
1608 "get_console_info",
1609 "write_console_input",
1610 "read_console_input",
1611 "create_change_notification",
1612 "create_mapping",
1613 "open_mapping",
1614 "get_mapping_info",
1615 "create_device",
1616 "create_snapshot",
1617 "next_process",
1618 "next_thread",
1619 "next_module",
1620 "wait_debug_event",
1621 "exception_event",
1622 "output_debug_string",
1623 "continue_debug_event",
1624 "debug_process",
1625 "read_process_memory",
1626 "write_process_memory",
1627 "create_key",
1628 "open_key",
1629 "delete_key",
1630 "close_key",
1631 "enum_key",
1632 "query_key_info",
1633 "set_key_value",
1634 "get_key_value",
1635 "enum_key_value",
1636 "delete_key_value",
1637 "load_registry",
1638 "save_registry",
1639 "save_registry_atexit",
1640 "set_registry_levels",
1641 "create_timer",
1642 "open_timer",
1643 "set_timer",
1644 "cancel_timer",
1645 "get_thread_context",
1646 "set_thread_context",
1647 "get_selector_entry",
1648 "add_atom",
1649 "delete_atom",
1650 "find_atom",
1651 "get_atom_name",
1654 /* ### make_requests end ### */
1655 /* Everything above this line is generated automatically by tools/make_requests */
1657 void trace_request( enum request req )
1659 current->last_req = req;
1660 if (req < REQ_NB_REQUESTS)
1662 fprintf( stderr, "%08x: %s(", (unsigned int)current, req_names[req] );
1663 req_dumpers[req]( current->buffer );
1665 else
1666 fprintf( stderr, "%08x: %d(", (unsigned int)current, req );
1667 if (current->pass_fd != -1) fprintf( stderr, " ) fd=%d\n", current->pass_fd );
1668 else fprintf( stderr, " )\n" );
1671 void trace_reply( struct thread *thread )
1673 fprintf( stderr, "%08x: %s() = %x",
1674 (unsigned int)thread, req_names[thread->last_req], thread->error );
1675 if (reply_dumpers[thread->last_req])
1677 fprintf( stderr, " {" );
1678 reply_dumpers[thread->last_req]( thread->buffer );
1679 fprintf( stderr, " }" );
1681 if (thread->pass_fd != -1) fprintf( stderr, " fd=%d\n", thread->pass_fd );
1682 else fprintf( stderr, "\n" );