COMDLG32_DllEntryPoint,COMDLG32_SetCommDlgExtendedError: delay
[wine/multimedia.git] / server / trace.c
blob66b48bd0e89932108772592e65b6a6a1355171ca
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, 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, 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, " pinherit=%d,", req->pinherit );
219 fprintf( stderr, " tinherit=%d,", req->tinherit );
220 fprintf( stderr, " inherit_all=%d,", req->inherit_all );
221 fprintf( stderr, " create_flags=%d,", req->create_flags );
222 fprintf( stderr, " start_flags=%d,", req->start_flags );
223 fprintf( stderr, " exe_file=%d,", req->exe_file );
224 fprintf( stderr, " hstdin=%d,", req->hstdin );
225 fprintf( stderr, " hstdout=%d,", req->hstdout );
226 fprintf( stderr, " hstderr=%d,", req->hstderr );
227 fprintf( stderr, " cmd_show=%d,", req->cmd_show );
228 fprintf( stderr, " env_ptr=%p,", req->env_ptr );
229 fprintf( stderr, " cmdline=" );
230 dump_string( req, req->cmdline );
233 static void dump_new_process_reply( const struct new_process_request *req )
235 fprintf( stderr, " pid=%p,", req->pid );
236 fprintf( stderr, " phandle=%d,", req->phandle );
237 fprintf( stderr, " tid=%p,", req->tid );
238 fprintf( stderr, " thandle=%d,", req->thandle );
239 fprintf( stderr, " event=%d", req->event );
242 static void dump_new_thread_request( const struct new_thread_request *req )
244 fprintf( stderr, " suspend=%d,", req->suspend );
245 fprintf( stderr, " inherit=%d", req->inherit );
248 static void dump_new_thread_reply( const struct new_thread_request *req )
250 fprintf( stderr, " tid=%p,", req->tid );
251 fprintf( stderr, " handle=%d", req->handle );
254 static void dump_boot_done_request( const struct boot_done_request *req )
256 fprintf( stderr, " debug_level=%d", req->debug_level );
259 static void dump_init_process_request( const struct init_process_request *req )
261 fprintf( stderr, " ldt_copy=%p,", req->ldt_copy );
262 fprintf( stderr, " ldt_flags=%p", req->ldt_flags );
265 static void dump_init_process_reply( const struct init_process_request *req )
267 fprintf( stderr, " start_flags=%d,", req->start_flags );
268 fprintf( stderr, " exe_file=%d,", req->exe_file );
269 fprintf( stderr, " hstdin=%d,", req->hstdin );
270 fprintf( stderr, " hstdout=%d,", req->hstdout );
271 fprintf( stderr, " hstderr=%d,", req->hstderr );
272 fprintf( stderr, " cmd_show=%d,", req->cmd_show );
273 fprintf( stderr, " env_ptr=%p,", req->env_ptr );
274 fprintf( stderr, " cmdline=" );
275 dump_string( req, req->cmdline );
278 static void dump_init_process_done_request( const struct init_process_done_request *req )
280 fprintf( stderr, " module=%p,", req->module );
281 fprintf( stderr, " entry=%p", req->entry );
284 static void dump_init_process_done_reply( const struct init_process_done_request *req )
286 fprintf( stderr, " debugged=%d", req->debugged );
289 static void dump_init_thread_request( const struct init_thread_request *req )
291 fprintf( stderr, " unix_pid=%d,", req->unix_pid );
292 fprintf( stderr, " teb=%p,", req->teb );
293 fprintf( stderr, " entry=%p", req->entry );
296 static void dump_get_thread_buffer_request( const struct get_thread_buffer_request *req )
300 static void dump_get_thread_buffer_reply( const struct get_thread_buffer_request *req )
302 fprintf( stderr, " pid=%p,", req->pid );
303 fprintf( stderr, " tid=%p,", req->tid );
304 fprintf( stderr, " boot=%d,", req->boot );
305 fprintf( stderr, " version=%d", req->version );
308 static void dump_terminate_process_request( const struct terminate_process_request *req )
310 fprintf( stderr, " handle=%d,", req->handle );
311 fprintf( stderr, " exit_code=%d", req->exit_code );
314 static void dump_terminate_process_reply( const struct terminate_process_request *req )
316 fprintf( stderr, " self=%d", req->self );
319 static void dump_terminate_thread_request( const struct terminate_thread_request *req )
321 fprintf( stderr, " handle=%d,", req->handle );
322 fprintf( stderr, " exit_code=%d", req->exit_code );
325 static void dump_terminate_thread_reply( const struct terminate_thread_request *req )
327 fprintf( stderr, " self=%d,", req->self );
328 fprintf( stderr, " last=%d", req->last );
331 static void dump_get_process_info_request( const struct get_process_info_request *req )
333 fprintf( stderr, " handle=%d", req->handle );
336 static void dump_get_process_info_reply( const struct get_process_info_request *req )
338 fprintf( stderr, " pid=%p,", req->pid );
339 fprintf( stderr, " debugged=%d,", req->debugged );
340 fprintf( stderr, " exit_code=%d,", req->exit_code );
341 fprintf( stderr, " priority=%d,", req->priority );
342 fprintf( stderr, " process_affinity=%d,", req->process_affinity );
343 fprintf( stderr, " system_affinity=%d", req->system_affinity );
346 static void dump_set_process_info_request( const struct set_process_info_request *req )
348 fprintf( stderr, " handle=%d,", req->handle );
349 fprintf( stderr, " mask=%d,", req->mask );
350 fprintf( stderr, " priority=%d,", req->priority );
351 fprintf( stderr, " affinity=%d", req->affinity );
354 static void dump_get_thread_info_request( const struct get_thread_info_request *req )
356 fprintf( stderr, " handle=%d,", req->handle );
357 fprintf( stderr, " tid_in=%p", req->tid_in );
360 static void dump_get_thread_info_reply( const struct get_thread_info_request *req )
362 fprintf( stderr, " tid=%p,", req->tid );
363 fprintf( stderr, " teb=%p,", req->teb );
364 fprintf( stderr, " exit_code=%d,", req->exit_code );
365 fprintf( stderr, " priority=%d", req->priority );
368 static void dump_set_thread_info_request( const struct set_thread_info_request *req )
370 fprintf( stderr, " handle=%d,", req->handle );
371 fprintf( stderr, " mask=%d,", req->mask );
372 fprintf( stderr, " priority=%d,", req->priority );
373 fprintf( stderr, " affinity=%d", req->affinity );
376 static void dump_suspend_thread_request( const struct suspend_thread_request *req )
378 fprintf( stderr, " handle=%d", req->handle );
381 static void dump_suspend_thread_reply( const struct suspend_thread_request *req )
383 fprintf( stderr, " count=%d", req->count );
386 static void dump_resume_thread_request( const struct resume_thread_request *req )
388 fprintf( stderr, " handle=%d", req->handle );
391 static void dump_resume_thread_reply( const struct resume_thread_request *req )
393 fprintf( stderr, " count=%d", req->count );
396 static void dump_load_dll_request( const struct load_dll_request *req )
398 fprintf( stderr, " handle=%d,", req->handle );
399 fprintf( stderr, " base=%p,", req->base );
400 fprintf( stderr, " dbg_offset=%d,", req->dbg_offset );
401 fprintf( stderr, " dbg_size=%d,", req->dbg_size );
402 fprintf( stderr, " name=%p", req->name );
405 static void dump_unload_dll_request( const struct unload_dll_request *req )
407 fprintf( stderr, " base=%p", req->base );
410 static void dump_queue_apc_request( const struct queue_apc_request *req )
412 fprintf( stderr, " handle=%d,", req->handle );
413 fprintf( stderr, " func=%p,", req->func );
414 fprintf( stderr, " param=%p", req->param );
417 static void dump_get_apcs_request( const struct get_apcs_request *req )
421 static void dump_get_apcs_reply( const struct get_apcs_request *req )
423 fprintf( stderr, " count=%d,", req->count );
424 fprintf( stderr, " apcs=" );
425 dump_varargs_get_apcs_reply( req );
428 static void dump_close_handle_request( const struct close_handle_request *req )
430 fprintf( stderr, " handle=%d", req->handle );
433 static void dump_get_handle_info_request( const struct get_handle_info_request *req )
435 fprintf( stderr, " handle=%d", req->handle );
438 static void dump_get_handle_info_reply( const struct get_handle_info_request *req )
440 fprintf( stderr, " flags=%d", req->flags );
443 static void dump_set_handle_info_request( const struct set_handle_info_request *req )
445 fprintf( stderr, " handle=%d,", req->handle );
446 fprintf( stderr, " flags=%d,", req->flags );
447 fprintf( stderr, " mask=%d", req->mask );
450 static void dump_dup_handle_request( const struct dup_handle_request *req )
452 fprintf( stderr, " src_process=%d,", req->src_process );
453 fprintf( stderr, " src_handle=%d,", req->src_handle );
454 fprintf( stderr, " dst_process=%d,", req->dst_process );
455 fprintf( stderr, " access=%08x,", req->access );
456 fprintf( stderr, " inherit=%d,", req->inherit );
457 fprintf( stderr, " options=%d", req->options );
460 static void dump_dup_handle_reply( const struct dup_handle_request *req )
462 fprintf( stderr, " handle=%d", req->handle );
465 static void dump_open_process_request( const struct open_process_request *req )
467 fprintf( stderr, " pid=%p,", req->pid );
468 fprintf( stderr, " access=%08x,", req->access );
469 fprintf( stderr, " inherit=%d", req->inherit );
472 static void dump_open_process_reply( const struct open_process_request *req )
474 fprintf( stderr, " handle=%d", req->handle );
477 static void dump_select_request( const struct select_request *req )
479 fprintf( stderr, " count=%d,", req->count );
480 fprintf( stderr, " flags=%d,", req->flags );
481 fprintf( stderr, " timeout=%d,", req->timeout );
482 fprintf( stderr, " handles=" );
483 dump_varargs_select_request( req );
486 static void dump_select_reply( const struct select_request *req )
488 fprintf( stderr, " signaled=%d", req->signaled );
491 static void dump_create_event_request( const struct create_event_request *req )
493 fprintf( stderr, " manual_reset=%d,", req->manual_reset );
494 fprintf( stderr, " initial_state=%d,", req->initial_state );
495 fprintf( stderr, " inherit=%d,", req->inherit );
496 fprintf( stderr, " name=" );
497 dump_unicode_string( req, req->name );
500 static void dump_create_event_reply( const struct create_event_request *req )
502 fprintf( stderr, " handle=%d", req->handle );
505 static void dump_event_op_request( const struct event_op_request *req )
507 fprintf( stderr, " handle=%d,", req->handle );
508 fprintf( stderr, " op=%d", req->op );
511 static void dump_open_event_request( const struct open_event_request *req )
513 fprintf( stderr, " access=%08x,", req->access );
514 fprintf( stderr, " inherit=%d,", req->inherit );
515 fprintf( stderr, " name=" );
516 dump_unicode_string( req, req->name );
519 static void dump_open_event_reply( const struct open_event_request *req )
521 fprintf( stderr, " handle=%d", req->handle );
524 static void dump_create_mutex_request( const struct create_mutex_request *req )
526 fprintf( stderr, " owned=%d,", req->owned );
527 fprintf( stderr, " inherit=%d,", req->inherit );
528 fprintf( stderr, " name=" );
529 dump_unicode_string( req, req->name );
532 static void dump_create_mutex_reply( const struct create_mutex_request *req )
534 fprintf( stderr, " handle=%d", req->handle );
537 static void dump_release_mutex_request( const struct release_mutex_request *req )
539 fprintf( stderr, " handle=%d", req->handle );
542 static void dump_open_mutex_request( const struct open_mutex_request *req )
544 fprintf( stderr, " access=%08x,", req->access );
545 fprintf( stderr, " inherit=%d,", req->inherit );
546 fprintf( stderr, " name=" );
547 dump_unicode_string( req, req->name );
550 static void dump_open_mutex_reply( const struct open_mutex_request *req )
552 fprintf( stderr, " handle=%d", req->handle );
555 static void dump_create_semaphore_request( const struct create_semaphore_request *req )
557 fprintf( stderr, " initial=%08x,", req->initial );
558 fprintf( stderr, " max=%08x,", req->max );
559 fprintf( stderr, " inherit=%d,", req->inherit );
560 fprintf( stderr, " name=" );
561 dump_unicode_string( req, req->name );
564 static void dump_create_semaphore_reply( const struct create_semaphore_request *req )
566 fprintf( stderr, " handle=%d", req->handle );
569 static void dump_release_semaphore_request( const struct release_semaphore_request *req )
571 fprintf( stderr, " handle=%d,", req->handle );
572 fprintf( stderr, " count=%08x", req->count );
575 static void dump_release_semaphore_reply( const struct release_semaphore_request *req )
577 fprintf( stderr, " prev_count=%08x", req->prev_count );
580 static void dump_open_semaphore_request( const struct open_semaphore_request *req )
582 fprintf( stderr, " access=%08x,", req->access );
583 fprintf( stderr, " inherit=%d,", req->inherit );
584 fprintf( stderr, " name=" );
585 dump_unicode_string( req, req->name );
588 static void dump_open_semaphore_reply( const struct open_semaphore_request *req )
590 fprintf( stderr, " handle=%d", req->handle );
593 static void dump_create_file_request( const struct create_file_request *req )
595 fprintf( stderr, " access=%08x,", req->access );
596 fprintf( stderr, " inherit=%d,", req->inherit );
597 fprintf( stderr, " sharing=%08x,", req->sharing );
598 fprintf( stderr, " create=%d,", req->create );
599 fprintf( stderr, " attrs=%08x,", req->attrs );
600 fprintf( stderr, " name=" );
601 dump_string( req, req->name );
604 static void dump_create_file_reply( const struct create_file_request *req )
606 fprintf( stderr, " handle=%d", req->handle );
609 static void dump_alloc_file_handle_request( const struct alloc_file_handle_request *req )
611 fprintf( stderr, " access=%08x", req->access );
614 static void dump_alloc_file_handle_reply( const struct alloc_file_handle_request *req )
616 fprintf( stderr, " handle=%d", req->handle );
619 static void dump_get_read_fd_request( const struct get_read_fd_request *req )
621 fprintf( stderr, " handle=%d", req->handle );
624 static void dump_get_write_fd_request( const struct get_write_fd_request *req )
626 fprintf( stderr, " handle=%d", req->handle );
629 static void dump_set_file_pointer_request( const struct set_file_pointer_request *req )
631 fprintf( stderr, " handle=%d,", req->handle );
632 fprintf( stderr, " low=%d,", req->low );
633 fprintf( stderr, " high=%d,", req->high );
634 fprintf( stderr, " whence=%d", req->whence );
637 static void dump_set_file_pointer_reply( const struct set_file_pointer_request *req )
639 fprintf( stderr, " new_low=%d,", req->new_low );
640 fprintf( stderr, " new_high=%d", req->new_high );
643 static void dump_truncate_file_request( const struct truncate_file_request *req )
645 fprintf( stderr, " handle=%d", req->handle );
648 static void dump_set_file_time_request( const struct set_file_time_request *req )
650 fprintf( stderr, " handle=%d,", req->handle );
651 fprintf( stderr, " access_time=%ld,", req->access_time );
652 fprintf( stderr, " write_time=%ld", req->write_time );
655 static void dump_flush_file_request( const struct flush_file_request *req )
657 fprintf( stderr, " handle=%d", req->handle );
660 static void dump_get_file_info_request( const struct get_file_info_request *req )
662 fprintf( stderr, " handle=%d", req->handle );
665 static void dump_get_file_info_reply( const struct get_file_info_request *req )
667 fprintf( stderr, " type=%d,", req->type );
668 fprintf( stderr, " attr=%d,", req->attr );
669 fprintf( stderr, " access_time=%ld,", req->access_time );
670 fprintf( stderr, " write_time=%ld,", req->write_time );
671 fprintf( stderr, " size_high=%d,", req->size_high );
672 fprintf( stderr, " size_low=%d,", req->size_low );
673 fprintf( stderr, " links=%d,", req->links );
674 fprintf( stderr, " index_high=%d,", req->index_high );
675 fprintf( stderr, " index_low=%d,", req->index_low );
676 fprintf( stderr, " serial=%08x", req->serial );
679 static void dump_lock_file_request( const struct lock_file_request *req )
681 fprintf( stderr, " handle=%d,", req->handle );
682 fprintf( stderr, " offset_low=%08x,", req->offset_low );
683 fprintf( stderr, " offset_high=%08x,", req->offset_high );
684 fprintf( stderr, " count_low=%08x,", req->count_low );
685 fprintf( stderr, " count_high=%08x", req->count_high );
688 static void dump_unlock_file_request( const struct unlock_file_request *req )
690 fprintf( stderr, " handle=%d,", req->handle );
691 fprintf( stderr, " offset_low=%08x,", req->offset_low );
692 fprintf( stderr, " offset_high=%08x,", req->offset_high );
693 fprintf( stderr, " count_low=%08x,", req->count_low );
694 fprintf( stderr, " count_high=%08x", req->count_high );
697 static void dump_create_pipe_request( const struct create_pipe_request *req )
699 fprintf( stderr, " inherit=%d", req->inherit );
702 static void dump_create_pipe_reply( const struct create_pipe_request *req )
704 fprintf( stderr, " handle_read=%d,", req->handle_read );
705 fprintf( stderr, " handle_write=%d", req->handle_write );
708 static void dump_create_socket_request( const struct create_socket_request *req )
710 fprintf( stderr, " access=%08x,", req->access );
711 fprintf( stderr, " inherit=%d,", req->inherit );
712 fprintf( stderr, " family=%d,", req->family );
713 fprintf( stderr, " type=%d,", req->type );
714 fprintf( stderr, " protocol=%d", req->protocol );
717 static void dump_create_socket_reply( const struct create_socket_request *req )
719 fprintf( stderr, " handle=%d", req->handle );
722 static void dump_accept_socket_request( const struct accept_socket_request *req )
724 fprintf( stderr, " lhandle=%d,", req->lhandle );
725 fprintf( stderr, " access=%08x,", req->access );
726 fprintf( stderr, " inherit=%d", req->inherit );
729 static void dump_accept_socket_reply( const struct accept_socket_request *req )
731 fprintf( stderr, " handle=%d", req->handle );
734 static void dump_set_socket_event_request( const struct set_socket_event_request *req )
736 fprintf( stderr, " handle=%d,", req->handle );
737 fprintf( stderr, " mask=%08x,", req->mask );
738 fprintf( stderr, " event=%d", req->event );
741 static void dump_get_socket_event_request( const struct get_socket_event_request *req )
743 fprintf( stderr, " handle=%d,", req->handle );
744 fprintf( stderr, " service=%d,", req->service );
745 fprintf( stderr, " s_event=%d,", req->s_event );
746 fprintf( stderr, " c_event=%d", req->c_event );
749 static void dump_get_socket_event_reply( const struct get_socket_event_request *req )
751 fprintf( stderr, " mask=%08x,", req->mask );
752 fprintf( stderr, " pmask=%08x,", req->pmask );
753 fprintf( stderr, " state=%08x,", req->state );
754 fprintf( stderr, " errors=" );
755 dump_varargs_get_socket_event_reply( req );
758 static void dump_enable_socket_event_request( const struct enable_socket_event_request *req )
760 fprintf( stderr, " handle=%d,", req->handle );
761 fprintf( stderr, " mask=%08x,", req->mask );
762 fprintf( stderr, " sstate=%08x,", req->sstate );
763 fprintf( stderr, " cstate=%08x", req->cstate );
766 static void dump_alloc_console_request( const struct alloc_console_request *req )
768 fprintf( stderr, " access=%08x,", req->access );
769 fprintf( stderr, " inherit=%d", req->inherit );
772 static void dump_alloc_console_reply( const struct alloc_console_request *req )
774 fprintf( stderr, " handle_in=%d,", req->handle_in );
775 fprintf( stderr, " handle_out=%d", req->handle_out );
778 static void dump_free_console_request( const struct free_console_request *req )
780 fprintf( stderr, " dummy=%d", req->dummy );
783 static void dump_open_console_request( const struct open_console_request *req )
785 fprintf( stderr, " output=%d,", req->output );
786 fprintf( stderr, " access=%08x,", req->access );
787 fprintf( stderr, " inherit=%d", req->inherit );
790 static void dump_open_console_reply( const struct open_console_request *req )
792 fprintf( stderr, " handle=%d", req->handle );
795 static void dump_set_console_fd_request( const struct set_console_fd_request *req )
797 fprintf( stderr, " handle=%d,", req->handle );
798 fprintf( stderr, " file_handle=%d,", req->file_handle );
799 fprintf( stderr, " pid=%d", req->pid );
802 static void dump_get_console_mode_request( const struct get_console_mode_request *req )
804 fprintf( stderr, " handle=%d", req->handle );
807 static void dump_get_console_mode_reply( const struct get_console_mode_request *req )
809 fprintf( stderr, " mode=%d", req->mode );
812 static void dump_set_console_mode_request( const struct set_console_mode_request *req )
814 fprintf( stderr, " handle=%d,", req->handle );
815 fprintf( stderr, " mode=%d", req->mode );
818 static void dump_set_console_info_request( const struct set_console_info_request *req )
820 fprintf( stderr, " handle=%d,", req->handle );
821 fprintf( stderr, " mask=%d,", req->mask );
822 fprintf( stderr, " cursor_size=%d,", req->cursor_size );
823 fprintf( stderr, " cursor_visible=%d,", req->cursor_visible );
824 fprintf( stderr, " title=" );
825 dump_string( req, req->title );
828 static void dump_get_console_info_request( const struct get_console_info_request *req )
830 fprintf( stderr, " handle=%d", req->handle );
833 static void dump_get_console_info_reply( const struct get_console_info_request *req )
835 fprintf( stderr, " cursor_size=%d,", req->cursor_size );
836 fprintf( stderr, " cursor_visible=%d,", req->cursor_visible );
837 fprintf( stderr, " pid=%d,", req->pid );
838 fprintf( stderr, " title=" );
839 dump_string( req, req->title );
842 static void dump_write_console_input_request( const struct write_console_input_request *req )
844 fprintf( stderr, " handle=%d,", req->handle );
845 fprintf( stderr, " count=%d", req->count );
848 static void dump_write_console_input_reply( const struct write_console_input_request *req )
850 fprintf( stderr, " written=%d", req->written );
853 static void dump_read_console_input_request( const struct read_console_input_request *req )
855 fprintf( stderr, " handle=%d,", req->handle );
856 fprintf( stderr, " count=%d,", req->count );
857 fprintf( stderr, " flush=%d", req->flush );
860 static void dump_read_console_input_reply( const struct read_console_input_request *req )
862 fprintf( stderr, " read=%d", req->read );
865 static void dump_create_change_notification_request( const struct create_change_notification_request *req )
867 fprintf( stderr, " subtree=%d,", req->subtree );
868 fprintf( stderr, " filter=%d", req->filter );
871 static void dump_create_change_notification_reply( const struct create_change_notification_request *req )
873 fprintf( stderr, " handle=%d", req->handle );
876 static void dump_create_mapping_request( const struct create_mapping_request *req )
878 fprintf( stderr, " size_high=%d,", req->size_high );
879 fprintf( stderr, " size_low=%d,", req->size_low );
880 fprintf( stderr, " protect=%d,", req->protect );
881 fprintf( stderr, " inherit=%d,", req->inherit );
882 fprintf( stderr, " file_handle=%d,", req->file_handle );
883 fprintf( stderr, " name=" );
884 dump_unicode_string( req, req->name );
887 static void dump_create_mapping_reply( const struct create_mapping_request *req )
889 fprintf( stderr, " handle=%d", req->handle );
892 static void dump_open_mapping_request( const struct open_mapping_request *req )
894 fprintf( stderr, " access=%08x,", req->access );
895 fprintf( stderr, " inherit=%d,", req->inherit );
896 fprintf( stderr, " name=" );
897 dump_unicode_string( req, req->name );
900 static void dump_open_mapping_reply( const struct open_mapping_request *req )
902 fprintf( stderr, " handle=%d", req->handle );
905 static void dump_get_mapping_info_request( const struct get_mapping_info_request *req )
907 fprintf( stderr, " handle=%d", req->handle );
910 static void dump_get_mapping_info_reply( const struct get_mapping_info_request *req )
912 fprintf( stderr, " size_high=%d,", req->size_high );
913 fprintf( stderr, " size_low=%d,", req->size_low );
914 fprintf( stderr, " protect=%d", req->protect );
917 static void dump_create_device_request( const struct create_device_request *req )
919 fprintf( stderr, " access=%08x,", req->access );
920 fprintf( stderr, " inherit=%d,", req->inherit );
921 fprintf( stderr, " id=%d", req->id );
924 static void dump_create_device_reply( const struct create_device_request *req )
926 fprintf( stderr, " handle=%d", req->handle );
929 static void dump_create_snapshot_request( const struct create_snapshot_request *req )
931 fprintf( stderr, " inherit=%d,", req->inherit );
932 fprintf( stderr, " flags=%d,", req->flags );
933 fprintf( stderr, " pid=%p", req->pid );
936 static void dump_create_snapshot_reply( const struct create_snapshot_request *req )
938 fprintf( stderr, " handle=%d", req->handle );
941 static void dump_next_process_request( const struct next_process_request *req )
943 fprintf( stderr, " handle=%d,", req->handle );
944 fprintf( stderr, " reset=%d", req->reset );
947 static void dump_next_process_reply( const struct next_process_request *req )
949 fprintf( stderr, " count=%d,", req->count );
950 fprintf( stderr, " pid=%p,", req->pid );
951 fprintf( stderr, " threads=%d,", req->threads );
952 fprintf( stderr, " priority=%d", req->priority );
955 static void dump_next_thread_request( const struct next_thread_request *req )
957 fprintf( stderr, " handle=%d,", req->handle );
958 fprintf( stderr, " reset=%d", req->reset );
961 static void dump_next_thread_reply( const struct next_thread_request *req )
963 fprintf( stderr, " count=%d,", req->count );
964 fprintf( stderr, " pid=%p,", req->pid );
965 fprintf( stderr, " tid=%p,", req->tid );
966 fprintf( stderr, " base_pri=%d,", req->base_pri );
967 fprintf( stderr, " delta_pri=%d", req->delta_pri );
970 static void dump_next_module_request( const struct next_module_request *req )
972 fprintf( stderr, " handle=%d,", req->handle );
973 fprintf( stderr, " reset=%d", req->reset );
976 static void dump_next_module_reply( const struct next_module_request *req )
978 fprintf( stderr, " pid=%p,", req->pid );
979 fprintf( stderr, " base=%p", req->base );
982 static void dump_wait_debug_event_request( const struct wait_debug_event_request *req )
984 fprintf( stderr, " timeout=%d", req->timeout );
987 static void dump_wait_debug_event_reply( const struct wait_debug_event_request *req )
989 fprintf( stderr, " pid=%p,", req->pid );
990 fprintf( stderr, " tid=%p,", req->tid );
991 fprintf( stderr, " event=" );
992 dump_debug_event_t( req, &req->event );
995 static void dump_exception_event_request( const struct exception_event_request *req )
997 fprintf( stderr, " record=" );
998 dump_exc_record( req, &req->record );
999 fprintf( stderr, "," );
1000 fprintf( stderr, " first=%d,", req->first );
1001 fprintf( stderr, " context=" );
1002 dump_context( req, &req->context );
1005 static void dump_exception_event_reply( const struct exception_event_request *req )
1007 fprintf( stderr, " status=%d", req->status );
1010 static void dump_output_debug_string_request( const struct output_debug_string_request *req )
1012 fprintf( stderr, " string=%p,", req->string );
1013 fprintf( stderr, " unicode=%d,", req->unicode );
1014 fprintf( stderr, " length=%d", req->length );
1017 static void dump_continue_debug_event_request( const struct continue_debug_event_request *req )
1019 fprintf( stderr, " pid=%p,", req->pid );
1020 fprintf( stderr, " tid=%p,", req->tid );
1021 fprintf( stderr, " status=%d", req->status );
1024 static void dump_debug_process_request( const struct debug_process_request *req )
1026 fprintf( stderr, " pid=%p", req->pid );
1029 static void dump_read_process_memory_request( const struct read_process_memory_request *req )
1031 fprintf( stderr, " handle=%d,", req->handle );
1032 fprintf( stderr, " addr=%p,", req->addr );
1033 fprintf( stderr, " len=%d", req->len );
1036 static void dump_read_process_memory_reply( const struct read_process_memory_request *req )
1038 fprintf( stderr, " data=" );
1039 dump_varargs_read_process_memory_reply( req );
1042 static void dump_write_process_memory_request( const struct write_process_memory_request *req )
1044 fprintf( stderr, " handle=%d,", req->handle );
1045 fprintf( stderr, " addr=%p,", req->addr );
1046 fprintf( stderr, " len=%d,", req->len );
1047 fprintf( stderr, " first_mask=%08x,", req->first_mask );
1048 fprintf( stderr, " last_mask=%08x,", req->last_mask );
1049 fprintf( stderr, " data=" );
1050 dump_varargs_write_process_memory_request( req );
1053 static void dump_create_key_request( const struct create_key_request *req )
1055 fprintf( stderr, " parent=%d,", req->parent );
1056 fprintf( stderr, " access=%08x,", req->access );
1057 fprintf( stderr, " options=%08x,", req->options );
1058 fprintf( stderr, " modif=%ld,", req->modif );
1059 fprintf( stderr, " name=" );
1060 dump_path_t( req, &req->name );
1061 fprintf( stderr, "," );
1062 fprintf( stderr, " class=" );
1063 dump_unicode_string( req, req->class );
1066 static void dump_create_key_reply( const struct create_key_request *req )
1068 fprintf( stderr, " hkey=%d,", req->hkey );
1069 fprintf( stderr, " created=%d", req->created );
1072 static void dump_open_key_request( const struct open_key_request *req )
1074 fprintf( stderr, " parent=%d,", req->parent );
1075 fprintf( stderr, " access=%08x,", req->access );
1076 fprintf( stderr, " name=" );
1077 dump_path_t( req, &req->name );
1080 static void dump_open_key_reply( const struct open_key_request *req )
1082 fprintf( stderr, " hkey=%d", req->hkey );
1085 static void dump_delete_key_request( const struct delete_key_request *req )
1087 fprintf( stderr, " hkey=%d,", req->hkey );
1088 fprintf( stderr, " name=" );
1089 dump_path_t( req, &req->name );
1092 static void dump_close_key_request( const struct close_key_request *req )
1094 fprintf( stderr, " hkey=%d", req->hkey );
1097 static void dump_enum_key_request( const struct enum_key_request *req )
1099 fprintf( stderr, " hkey=%d,", req->hkey );
1100 fprintf( stderr, " index=%d", req->index );
1103 static void dump_enum_key_reply( const struct enum_key_request *req )
1105 fprintf( stderr, " modif=%ld,", req->modif );
1106 fprintf( stderr, " name=" );
1107 dump_path_t( req, &req->name );
1108 fprintf( stderr, "," );
1109 fprintf( stderr, " class=" );
1110 dump_unicode_string( req, req->class );
1113 static void dump_query_key_info_request( const struct query_key_info_request *req )
1115 fprintf( stderr, " hkey=%d", req->hkey );
1118 static void dump_query_key_info_reply( const struct query_key_info_request *req )
1120 fprintf( stderr, " subkeys=%d,", req->subkeys );
1121 fprintf( stderr, " max_subkey=%d,", req->max_subkey );
1122 fprintf( stderr, " max_class=%d,", req->max_class );
1123 fprintf( stderr, " values=%d,", req->values );
1124 fprintf( stderr, " max_value=%d,", req->max_value );
1125 fprintf( stderr, " max_data=%d,", req->max_data );
1126 fprintf( stderr, " modif=%ld,", req->modif );
1127 fprintf( stderr, " name=" );
1128 dump_path_t( req, &req->name );
1129 fprintf( stderr, "," );
1130 fprintf( stderr, " class=" );
1131 dump_unicode_string( req, req->class );
1134 static void dump_set_key_value_request( const struct set_key_value_request *req )
1136 fprintf( stderr, " hkey=%d,", req->hkey );
1137 fprintf( stderr, " type=%d,", req->type );
1138 fprintf( stderr, " len=%d,", req->len );
1139 fprintf( stderr, " name=" );
1140 dump_path_t( req, &req->name );
1141 fprintf( stderr, "," );
1142 fprintf( stderr, " data=" );
1143 dump_varargs_set_key_value_request( req );
1146 static void dump_get_key_value_request( const struct get_key_value_request *req )
1148 fprintf( stderr, " hkey=%d,", req->hkey );
1149 fprintf( stderr, " name=" );
1150 dump_unicode_string( req, req->name );
1153 static void dump_get_key_value_reply( const struct get_key_value_request *req )
1155 fprintf( stderr, " type=%d,", req->type );
1156 fprintf( stderr, " len=%d,", req->len );
1157 fprintf( stderr, " data=" );
1158 dump_varargs_get_key_value_reply( req );
1161 static void dump_enum_key_value_request( const struct enum_key_value_request *req )
1163 fprintf( stderr, " hkey=%d,", req->hkey );
1164 fprintf( stderr, " index=%d", req->index );
1167 static void dump_enum_key_value_reply( const struct enum_key_value_request *req )
1169 fprintf( stderr, " type=%d,", req->type );
1170 fprintf( stderr, " len=%d,", req->len );
1171 fprintf( stderr, " name=" );
1172 dump_path_t( req, &req->name );
1173 fprintf( stderr, "," );
1174 fprintf( stderr, " data=" );
1175 dump_varargs_enum_key_value_reply( req );
1178 static void dump_delete_key_value_request( const struct delete_key_value_request *req )
1180 fprintf( stderr, " hkey=%d,", req->hkey );
1181 fprintf( stderr, " name=" );
1182 dump_path_t( req, &req->name );
1185 static void dump_load_registry_request( const struct load_registry_request *req )
1187 fprintf( stderr, " hkey=%d,", req->hkey );
1188 fprintf( stderr, " file=%d,", req->file );
1189 fprintf( stderr, " name=" );
1190 dump_path_t( req, &req->name );
1193 static void dump_save_registry_request( const struct save_registry_request *req )
1195 fprintf( stderr, " hkey=%d,", req->hkey );
1196 fprintf( stderr, " file=%d", req->file );
1199 static void dump_save_registry_atexit_request( const struct save_registry_atexit_request *req )
1201 fprintf( stderr, " hkey=%d,", req->hkey );
1202 fprintf( stderr, " file=" );
1203 dump_string( req, req->file );
1206 static void dump_set_registry_levels_request( const struct set_registry_levels_request *req )
1208 fprintf( stderr, " current=%d,", req->current );
1209 fprintf( stderr, " saving=%d,", req->saving );
1210 fprintf( stderr, " version=%d,", req->version );
1211 fprintf( stderr, " period=%d", req->period );
1214 static void dump_create_timer_request( const struct create_timer_request *req )
1216 fprintf( stderr, " inherit=%d,", req->inherit );
1217 fprintf( stderr, " manual=%d,", req->manual );
1218 fprintf( stderr, " name=" );
1219 dump_unicode_string( req, req->name );
1222 static void dump_create_timer_reply( const struct create_timer_request *req )
1224 fprintf( stderr, " handle=%d", req->handle );
1227 static void dump_open_timer_request( const struct open_timer_request *req )
1229 fprintf( stderr, " access=%08x,", req->access );
1230 fprintf( stderr, " inherit=%d,", req->inherit );
1231 fprintf( stderr, " name=" );
1232 dump_unicode_string( req, req->name );
1235 static void dump_open_timer_reply( const struct open_timer_request *req )
1237 fprintf( stderr, " handle=%d", req->handle );
1240 static void dump_set_timer_request( const struct set_timer_request *req )
1242 fprintf( stderr, " handle=%d,", req->handle );
1243 fprintf( stderr, " sec=%d,", req->sec );
1244 fprintf( stderr, " usec=%d,", req->usec );
1245 fprintf( stderr, " period=%d,", req->period );
1246 fprintf( stderr, " callback=%p,", req->callback );
1247 fprintf( stderr, " arg=%p", req->arg );
1250 static void dump_cancel_timer_request( const struct cancel_timer_request *req )
1252 fprintf( stderr, " handle=%d", req->handle );
1255 static void dump_get_thread_context_request( const struct get_thread_context_request *req )
1257 fprintf( stderr, " handle=%d,", req->handle );
1258 fprintf( stderr, " flags=%08x", req->flags );
1261 static void dump_get_thread_context_reply( const struct get_thread_context_request *req )
1263 fprintf( stderr, " context=" );
1264 dump_context( req, &req->context );
1267 static void dump_set_thread_context_request( const struct set_thread_context_request *req )
1269 fprintf( stderr, " handle=%d,", req->handle );
1270 fprintf( stderr, " flags=%08x,", req->flags );
1271 fprintf( stderr, " context=" );
1272 dump_context( req, &req->context );
1275 static void dump_get_selector_entry_request( const struct get_selector_entry_request *req )
1277 fprintf( stderr, " handle=%d,", req->handle );
1278 fprintf( stderr, " entry=%d", req->entry );
1281 static void dump_get_selector_entry_reply( const struct get_selector_entry_request *req )
1283 fprintf( stderr, " base=%08x,", req->base );
1284 fprintf( stderr, " limit=%08x,", req->limit );
1285 fprintf( stderr, " flags=%02x", req->flags );
1288 static void dump_add_atom_request( const struct add_atom_request *req )
1290 fprintf( stderr, " name=" );
1291 dump_unicode_string( req, req->name );
1294 static void dump_add_atom_reply( const struct add_atom_request *req )
1296 fprintf( stderr, " atom=%d", req->atom );
1299 static void dump_delete_atom_request( const struct delete_atom_request *req )
1301 fprintf( stderr, " atom=%d", req->atom );
1304 static void dump_find_atom_request( const struct find_atom_request *req )
1306 fprintf( stderr, " name=" );
1307 dump_unicode_string( req, req->name );
1310 static void dump_find_atom_reply( const struct find_atom_request *req )
1312 fprintf( stderr, " atom=%d", req->atom );
1315 static void dump_get_atom_name_request( const struct get_atom_name_request *req )
1317 fprintf( stderr, " atom=%d", req->atom );
1320 static void dump_get_atom_name_reply( const struct get_atom_name_request *req )
1322 fprintf( stderr, " count=%d,", req->count );
1323 fprintf( stderr, " name=" );
1324 dump_unicode_string( req, req->name );
1327 static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
1328 (dump_func)dump_new_process_request,
1329 (dump_func)dump_new_thread_request,
1330 (dump_func)dump_boot_done_request,
1331 (dump_func)dump_init_process_request,
1332 (dump_func)dump_init_process_done_request,
1333 (dump_func)dump_init_thread_request,
1334 (dump_func)dump_get_thread_buffer_request,
1335 (dump_func)dump_terminate_process_request,
1336 (dump_func)dump_terminate_thread_request,
1337 (dump_func)dump_get_process_info_request,
1338 (dump_func)dump_set_process_info_request,
1339 (dump_func)dump_get_thread_info_request,
1340 (dump_func)dump_set_thread_info_request,
1341 (dump_func)dump_suspend_thread_request,
1342 (dump_func)dump_resume_thread_request,
1343 (dump_func)dump_load_dll_request,
1344 (dump_func)dump_unload_dll_request,
1345 (dump_func)dump_queue_apc_request,
1346 (dump_func)dump_get_apcs_request,
1347 (dump_func)dump_close_handle_request,
1348 (dump_func)dump_get_handle_info_request,
1349 (dump_func)dump_set_handle_info_request,
1350 (dump_func)dump_dup_handle_request,
1351 (dump_func)dump_open_process_request,
1352 (dump_func)dump_select_request,
1353 (dump_func)dump_create_event_request,
1354 (dump_func)dump_event_op_request,
1355 (dump_func)dump_open_event_request,
1356 (dump_func)dump_create_mutex_request,
1357 (dump_func)dump_release_mutex_request,
1358 (dump_func)dump_open_mutex_request,
1359 (dump_func)dump_create_semaphore_request,
1360 (dump_func)dump_release_semaphore_request,
1361 (dump_func)dump_open_semaphore_request,
1362 (dump_func)dump_create_file_request,
1363 (dump_func)dump_alloc_file_handle_request,
1364 (dump_func)dump_get_read_fd_request,
1365 (dump_func)dump_get_write_fd_request,
1366 (dump_func)dump_set_file_pointer_request,
1367 (dump_func)dump_truncate_file_request,
1368 (dump_func)dump_set_file_time_request,
1369 (dump_func)dump_flush_file_request,
1370 (dump_func)dump_get_file_info_request,
1371 (dump_func)dump_lock_file_request,
1372 (dump_func)dump_unlock_file_request,
1373 (dump_func)dump_create_pipe_request,
1374 (dump_func)dump_create_socket_request,
1375 (dump_func)dump_accept_socket_request,
1376 (dump_func)dump_set_socket_event_request,
1377 (dump_func)dump_get_socket_event_request,
1378 (dump_func)dump_enable_socket_event_request,
1379 (dump_func)dump_alloc_console_request,
1380 (dump_func)dump_free_console_request,
1381 (dump_func)dump_open_console_request,
1382 (dump_func)dump_set_console_fd_request,
1383 (dump_func)dump_get_console_mode_request,
1384 (dump_func)dump_set_console_mode_request,
1385 (dump_func)dump_set_console_info_request,
1386 (dump_func)dump_get_console_info_request,
1387 (dump_func)dump_write_console_input_request,
1388 (dump_func)dump_read_console_input_request,
1389 (dump_func)dump_create_change_notification_request,
1390 (dump_func)dump_create_mapping_request,
1391 (dump_func)dump_open_mapping_request,
1392 (dump_func)dump_get_mapping_info_request,
1393 (dump_func)dump_create_device_request,
1394 (dump_func)dump_create_snapshot_request,
1395 (dump_func)dump_next_process_request,
1396 (dump_func)dump_next_thread_request,
1397 (dump_func)dump_next_module_request,
1398 (dump_func)dump_wait_debug_event_request,
1399 (dump_func)dump_exception_event_request,
1400 (dump_func)dump_output_debug_string_request,
1401 (dump_func)dump_continue_debug_event_request,
1402 (dump_func)dump_debug_process_request,
1403 (dump_func)dump_read_process_memory_request,
1404 (dump_func)dump_write_process_memory_request,
1405 (dump_func)dump_create_key_request,
1406 (dump_func)dump_open_key_request,
1407 (dump_func)dump_delete_key_request,
1408 (dump_func)dump_close_key_request,
1409 (dump_func)dump_enum_key_request,
1410 (dump_func)dump_query_key_info_request,
1411 (dump_func)dump_set_key_value_request,
1412 (dump_func)dump_get_key_value_request,
1413 (dump_func)dump_enum_key_value_request,
1414 (dump_func)dump_delete_key_value_request,
1415 (dump_func)dump_load_registry_request,
1416 (dump_func)dump_save_registry_request,
1417 (dump_func)dump_save_registry_atexit_request,
1418 (dump_func)dump_set_registry_levels_request,
1419 (dump_func)dump_create_timer_request,
1420 (dump_func)dump_open_timer_request,
1421 (dump_func)dump_set_timer_request,
1422 (dump_func)dump_cancel_timer_request,
1423 (dump_func)dump_get_thread_context_request,
1424 (dump_func)dump_set_thread_context_request,
1425 (dump_func)dump_get_selector_entry_request,
1426 (dump_func)dump_add_atom_request,
1427 (dump_func)dump_delete_atom_request,
1428 (dump_func)dump_find_atom_request,
1429 (dump_func)dump_get_atom_name_request,
1432 static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
1433 (dump_func)dump_new_process_reply,
1434 (dump_func)dump_new_thread_reply,
1435 (dump_func)0,
1436 (dump_func)dump_init_process_reply,
1437 (dump_func)dump_init_process_done_reply,
1438 (dump_func)0,
1439 (dump_func)dump_get_thread_buffer_reply,
1440 (dump_func)dump_terminate_process_reply,
1441 (dump_func)dump_terminate_thread_reply,
1442 (dump_func)dump_get_process_info_reply,
1443 (dump_func)0,
1444 (dump_func)dump_get_thread_info_reply,
1445 (dump_func)0,
1446 (dump_func)dump_suspend_thread_reply,
1447 (dump_func)dump_resume_thread_reply,
1448 (dump_func)0,
1449 (dump_func)0,
1450 (dump_func)0,
1451 (dump_func)dump_get_apcs_reply,
1452 (dump_func)0,
1453 (dump_func)dump_get_handle_info_reply,
1454 (dump_func)0,
1455 (dump_func)dump_dup_handle_reply,
1456 (dump_func)dump_open_process_reply,
1457 (dump_func)dump_select_reply,
1458 (dump_func)dump_create_event_reply,
1459 (dump_func)0,
1460 (dump_func)dump_open_event_reply,
1461 (dump_func)dump_create_mutex_reply,
1462 (dump_func)0,
1463 (dump_func)dump_open_mutex_reply,
1464 (dump_func)dump_create_semaphore_reply,
1465 (dump_func)dump_release_semaphore_reply,
1466 (dump_func)dump_open_semaphore_reply,
1467 (dump_func)dump_create_file_reply,
1468 (dump_func)dump_alloc_file_handle_reply,
1469 (dump_func)0,
1470 (dump_func)0,
1471 (dump_func)dump_set_file_pointer_reply,
1472 (dump_func)0,
1473 (dump_func)0,
1474 (dump_func)0,
1475 (dump_func)dump_get_file_info_reply,
1476 (dump_func)0,
1477 (dump_func)0,
1478 (dump_func)dump_create_pipe_reply,
1479 (dump_func)dump_create_socket_reply,
1480 (dump_func)dump_accept_socket_reply,
1481 (dump_func)0,
1482 (dump_func)dump_get_socket_event_reply,
1483 (dump_func)0,
1484 (dump_func)dump_alloc_console_reply,
1485 (dump_func)0,
1486 (dump_func)dump_open_console_reply,
1487 (dump_func)0,
1488 (dump_func)dump_get_console_mode_reply,
1489 (dump_func)0,
1490 (dump_func)0,
1491 (dump_func)dump_get_console_info_reply,
1492 (dump_func)dump_write_console_input_reply,
1493 (dump_func)dump_read_console_input_reply,
1494 (dump_func)dump_create_change_notification_reply,
1495 (dump_func)dump_create_mapping_reply,
1496 (dump_func)dump_open_mapping_reply,
1497 (dump_func)dump_get_mapping_info_reply,
1498 (dump_func)dump_create_device_reply,
1499 (dump_func)dump_create_snapshot_reply,
1500 (dump_func)dump_next_process_reply,
1501 (dump_func)dump_next_thread_reply,
1502 (dump_func)dump_next_module_reply,
1503 (dump_func)dump_wait_debug_event_reply,
1504 (dump_func)dump_exception_event_reply,
1505 (dump_func)0,
1506 (dump_func)0,
1507 (dump_func)0,
1508 (dump_func)dump_read_process_memory_reply,
1509 (dump_func)0,
1510 (dump_func)dump_create_key_reply,
1511 (dump_func)dump_open_key_reply,
1512 (dump_func)0,
1513 (dump_func)0,
1514 (dump_func)dump_enum_key_reply,
1515 (dump_func)dump_query_key_info_reply,
1516 (dump_func)0,
1517 (dump_func)dump_get_key_value_reply,
1518 (dump_func)dump_enum_key_value_reply,
1519 (dump_func)0,
1520 (dump_func)0,
1521 (dump_func)0,
1522 (dump_func)0,
1523 (dump_func)0,
1524 (dump_func)dump_create_timer_reply,
1525 (dump_func)dump_open_timer_reply,
1526 (dump_func)0,
1527 (dump_func)0,
1528 (dump_func)dump_get_thread_context_reply,
1529 (dump_func)0,
1530 (dump_func)dump_get_selector_entry_reply,
1531 (dump_func)dump_add_atom_reply,
1532 (dump_func)0,
1533 (dump_func)dump_find_atom_reply,
1534 (dump_func)dump_get_atom_name_reply,
1537 static const char * const req_names[REQ_NB_REQUESTS] = {
1538 "new_process",
1539 "new_thread",
1540 "boot_done",
1541 "init_process",
1542 "init_process_done",
1543 "init_thread",
1544 "get_thread_buffer",
1545 "terminate_process",
1546 "terminate_thread",
1547 "get_process_info",
1548 "set_process_info",
1549 "get_thread_info",
1550 "set_thread_info",
1551 "suspend_thread",
1552 "resume_thread",
1553 "load_dll",
1554 "unload_dll",
1555 "queue_apc",
1556 "get_apcs",
1557 "close_handle",
1558 "get_handle_info",
1559 "set_handle_info",
1560 "dup_handle",
1561 "open_process",
1562 "select",
1563 "create_event",
1564 "event_op",
1565 "open_event",
1566 "create_mutex",
1567 "release_mutex",
1568 "open_mutex",
1569 "create_semaphore",
1570 "release_semaphore",
1571 "open_semaphore",
1572 "create_file",
1573 "alloc_file_handle",
1574 "get_read_fd",
1575 "get_write_fd",
1576 "set_file_pointer",
1577 "truncate_file",
1578 "set_file_time",
1579 "flush_file",
1580 "get_file_info",
1581 "lock_file",
1582 "unlock_file",
1583 "create_pipe",
1584 "create_socket",
1585 "accept_socket",
1586 "set_socket_event",
1587 "get_socket_event",
1588 "enable_socket_event",
1589 "alloc_console",
1590 "free_console",
1591 "open_console",
1592 "set_console_fd",
1593 "get_console_mode",
1594 "set_console_mode",
1595 "set_console_info",
1596 "get_console_info",
1597 "write_console_input",
1598 "read_console_input",
1599 "create_change_notification",
1600 "create_mapping",
1601 "open_mapping",
1602 "get_mapping_info",
1603 "create_device",
1604 "create_snapshot",
1605 "next_process",
1606 "next_thread",
1607 "next_module",
1608 "wait_debug_event",
1609 "exception_event",
1610 "output_debug_string",
1611 "continue_debug_event",
1612 "debug_process",
1613 "read_process_memory",
1614 "write_process_memory",
1615 "create_key",
1616 "open_key",
1617 "delete_key",
1618 "close_key",
1619 "enum_key",
1620 "query_key_info",
1621 "set_key_value",
1622 "get_key_value",
1623 "enum_key_value",
1624 "delete_key_value",
1625 "load_registry",
1626 "save_registry",
1627 "save_registry_atexit",
1628 "set_registry_levels",
1629 "create_timer",
1630 "open_timer",
1631 "set_timer",
1632 "cancel_timer",
1633 "get_thread_context",
1634 "set_thread_context",
1635 "get_selector_entry",
1636 "add_atom",
1637 "delete_atom",
1638 "find_atom",
1639 "get_atom_name",
1642 /* ### make_requests end ### */
1643 /* Everything above this line is generated automatically by tools/make_requests */
1645 void trace_request( enum request req )
1647 current->last_req = req;
1648 if (req < REQ_NB_REQUESTS)
1650 fprintf( stderr, "%08x: %s(", (unsigned int)current, req_names[req] );
1651 req_dumpers[req]( current->buffer );
1653 else
1654 fprintf( stderr, "%08x: %d(", (unsigned int)current, req );
1655 if (current->pass_fd != -1) fprintf( stderr, " ) fd=%d\n", current->pass_fd );
1656 else fprintf( stderr, " )\n" );
1659 void trace_reply( struct thread *thread )
1661 fprintf( stderr, "%08x: %s() = %x",
1662 (unsigned int)thread, req_names[thread->last_req], thread->error );
1663 if (reply_dumpers[thread->last_req])
1665 fprintf( stderr, " {" );
1666 reply_dumpers[thread->last_req]( thread->buffer );
1667 fprintf( stderr, " }" );
1669 if (thread->pass_fd != -1) fprintf( stderr, " fd=%d\n", thread->pass_fd );
1670 else fprintf( stderr, "\n" );