Started support for menubar-like toolbars.
[wine.git] / server / trace.c
blobdc8dd0722d56cb482c1336eb681ad86d20579cb1
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 );
288 fprintf( stderr, " gui=%d", req->gui );
291 static void dump_init_process_done_reply( const struct init_process_done_request *req )
293 fprintf( stderr, " debugged=%d", req->debugged );
296 static void dump_init_thread_request( const struct init_thread_request *req )
298 fprintf( stderr, " unix_pid=%d,", req->unix_pid );
299 fprintf( stderr, " teb=%p,", req->teb );
300 fprintf( stderr, " entry=%p", req->entry );
303 static void dump_get_thread_buffer_request( const struct get_thread_buffer_request *req )
307 static void dump_get_thread_buffer_reply( const struct get_thread_buffer_request *req )
309 fprintf( stderr, " pid=%p,", req->pid );
310 fprintf( stderr, " tid=%p,", req->tid );
311 fprintf( stderr, " boot=%d,", req->boot );
312 fprintf( stderr, " version=%d", req->version );
315 static void dump_terminate_process_request( const struct terminate_process_request *req )
317 fprintf( stderr, " handle=%d,", req->handle );
318 fprintf( stderr, " exit_code=%d", req->exit_code );
321 static void dump_terminate_process_reply( const struct terminate_process_request *req )
323 fprintf( stderr, " self=%d", req->self );
326 static void dump_terminate_thread_request( const struct terminate_thread_request *req )
328 fprintf( stderr, " handle=%d,", req->handle );
329 fprintf( stderr, " exit_code=%d", req->exit_code );
332 static void dump_terminate_thread_reply( const struct terminate_thread_request *req )
334 fprintf( stderr, " self=%d,", req->self );
335 fprintf( stderr, " last=%d", req->last );
338 static void dump_get_process_info_request( const struct get_process_info_request *req )
340 fprintf( stderr, " handle=%d", req->handle );
343 static void dump_get_process_info_reply( const struct get_process_info_request *req )
345 fprintf( stderr, " pid=%p,", req->pid );
346 fprintf( stderr, " debugged=%d,", req->debugged );
347 fprintf( stderr, " exit_code=%d,", req->exit_code );
348 fprintf( stderr, " priority=%d,", req->priority );
349 fprintf( stderr, " process_affinity=%d,", req->process_affinity );
350 fprintf( stderr, " system_affinity=%d", req->system_affinity );
353 static void dump_set_process_info_request( const struct set_process_info_request *req )
355 fprintf( stderr, " handle=%d,", req->handle );
356 fprintf( stderr, " mask=%d,", req->mask );
357 fprintf( stderr, " priority=%d,", req->priority );
358 fprintf( stderr, " affinity=%d", req->affinity );
361 static void dump_get_thread_info_request( const struct get_thread_info_request *req )
363 fprintf( stderr, " handle=%d,", req->handle );
364 fprintf( stderr, " tid_in=%p", req->tid_in );
367 static void dump_get_thread_info_reply( const struct get_thread_info_request *req )
369 fprintf( stderr, " tid=%p,", req->tid );
370 fprintf( stderr, " teb=%p,", req->teb );
371 fprintf( stderr, " exit_code=%d,", req->exit_code );
372 fprintf( stderr, " priority=%d", req->priority );
375 static void dump_set_thread_info_request( const struct set_thread_info_request *req )
377 fprintf( stderr, " handle=%d,", req->handle );
378 fprintf( stderr, " mask=%d,", req->mask );
379 fprintf( stderr, " priority=%d,", req->priority );
380 fprintf( stderr, " affinity=%d", req->affinity );
383 static void dump_suspend_thread_request( const struct suspend_thread_request *req )
385 fprintf( stderr, " handle=%d", req->handle );
388 static void dump_suspend_thread_reply( const struct suspend_thread_request *req )
390 fprintf( stderr, " count=%d", req->count );
393 static void dump_resume_thread_request( const struct resume_thread_request *req )
395 fprintf( stderr, " handle=%d", req->handle );
398 static void dump_resume_thread_reply( const struct resume_thread_request *req )
400 fprintf( stderr, " count=%d", req->count );
403 static void dump_load_dll_request( const struct load_dll_request *req )
405 fprintf( stderr, " handle=%d,", req->handle );
406 fprintf( stderr, " base=%p,", req->base );
407 fprintf( stderr, " dbg_offset=%d,", req->dbg_offset );
408 fprintf( stderr, " dbg_size=%d,", req->dbg_size );
409 fprintf( stderr, " name=%p", req->name );
412 static void dump_unload_dll_request( const struct unload_dll_request *req )
414 fprintf( stderr, " base=%p", req->base );
417 static void dump_queue_apc_request( const struct queue_apc_request *req )
419 fprintf( stderr, " handle=%d,", req->handle );
420 fprintf( stderr, " func=%p,", req->func );
421 fprintf( stderr, " param=%p", req->param );
424 static void dump_get_apcs_request( const struct get_apcs_request *req )
428 static void dump_get_apcs_reply( const struct get_apcs_request *req )
430 fprintf( stderr, " count=%d,", req->count );
431 fprintf( stderr, " apcs=" );
432 dump_varargs_get_apcs_reply( req );
435 static void dump_close_handle_request( const struct close_handle_request *req )
437 fprintf( stderr, " handle=%d", req->handle );
440 static void dump_get_handle_info_request( const struct get_handle_info_request *req )
442 fprintf( stderr, " handle=%d", req->handle );
445 static void dump_get_handle_info_reply( const struct get_handle_info_request *req )
447 fprintf( stderr, " flags=%d", req->flags );
450 static void dump_set_handle_info_request( const struct set_handle_info_request *req )
452 fprintf( stderr, " handle=%d,", req->handle );
453 fprintf( stderr, " flags=%d,", req->flags );
454 fprintf( stderr, " mask=%d", req->mask );
457 static void dump_dup_handle_request( const struct dup_handle_request *req )
459 fprintf( stderr, " src_process=%d,", req->src_process );
460 fprintf( stderr, " src_handle=%d,", req->src_handle );
461 fprintf( stderr, " dst_process=%d,", req->dst_process );
462 fprintf( stderr, " access=%08x,", req->access );
463 fprintf( stderr, " inherit=%d,", req->inherit );
464 fprintf( stderr, " options=%d", req->options );
467 static void dump_dup_handle_reply( const struct dup_handle_request *req )
469 fprintf( stderr, " handle=%d", req->handle );
472 static void dump_open_process_request( const struct open_process_request *req )
474 fprintf( stderr, " pid=%p,", req->pid );
475 fprintf( stderr, " access=%08x,", req->access );
476 fprintf( stderr, " inherit=%d", req->inherit );
479 static void dump_open_process_reply( const struct open_process_request *req )
481 fprintf( stderr, " handle=%d", req->handle );
484 static void dump_select_request( const struct select_request *req )
486 fprintf( stderr, " count=%d,", req->count );
487 fprintf( stderr, " flags=%d,", req->flags );
488 fprintf( stderr, " timeout=%d,", req->timeout );
489 fprintf( stderr, " handles=" );
490 dump_varargs_select_request( req );
493 static void dump_select_reply( const struct select_request *req )
495 fprintf( stderr, " signaled=%d", req->signaled );
498 static void dump_create_event_request( const struct create_event_request *req )
500 fprintf( stderr, " manual_reset=%d,", req->manual_reset );
501 fprintf( stderr, " initial_state=%d,", req->initial_state );
502 fprintf( stderr, " inherit=%d,", req->inherit );
503 fprintf( stderr, " name=" );
504 dump_unicode_string( req, req->name );
507 static void dump_create_event_reply( const struct create_event_request *req )
509 fprintf( stderr, " handle=%d", req->handle );
512 static void dump_event_op_request( const struct event_op_request *req )
514 fprintf( stderr, " handle=%d,", req->handle );
515 fprintf( stderr, " op=%d", req->op );
518 static void dump_open_event_request( const struct open_event_request *req )
520 fprintf( stderr, " access=%08x,", req->access );
521 fprintf( stderr, " inherit=%d,", req->inherit );
522 fprintf( stderr, " name=" );
523 dump_unicode_string( req, req->name );
526 static void dump_open_event_reply( const struct open_event_request *req )
528 fprintf( stderr, " handle=%d", req->handle );
531 static void dump_create_mutex_request( const struct create_mutex_request *req )
533 fprintf( stderr, " owned=%d,", req->owned );
534 fprintf( stderr, " inherit=%d,", req->inherit );
535 fprintf( stderr, " name=" );
536 dump_unicode_string( req, req->name );
539 static void dump_create_mutex_reply( const struct create_mutex_request *req )
541 fprintf( stderr, " handle=%d", req->handle );
544 static void dump_release_mutex_request( const struct release_mutex_request *req )
546 fprintf( stderr, " handle=%d", req->handle );
549 static void dump_open_mutex_request( const struct open_mutex_request *req )
551 fprintf( stderr, " access=%08x,", req->access );
552 fprintf( stderr, " inherit=%d,", req->inherit );
553 fprintf( stderr, " name=" );
554 dump_unicode_string( req, req->name );
557 static void dump_open_mutex_reply( const struct open_mutex_request *req )
559 fprintf( stderr, " handle=%d", req->handle );
562 static void dump_create_semaphore_request( const struct create_semaphore_request *req )
564 fprintf( stderr, " initial=%08x,", req->initial );
565 fprintf( stderr, " max=%08x,", req->max );
566 fprintf( stderr, " inherit=%d,", req->inherit );
567 fprintf( stderr, " name=" );
568 dump_unicode_string( req, req->name );
571 static void dump_create_semaphore_reply( const struct create_semaphore_request *req )
573 fprintf( stderr, " handle=%d", req->handle );
576 static void dump_release_semaphore_request( const struct release_semaphore_request *req )
578 fprintf( stderr, " handle=%d,", req->handle );
579 fprintf( stderr, " count=%08x", req->count );
582 static void dump_release_semaphore_reply( const struct release_semaphore_request *req )
584 fprintf( stderr, " prev_count=%08x", req->prev_count );
587 static void dump_open_semaphore_request( const struct open_semaphore_request *req )
589 fprintf( stderr, " access=%08x,", req->access );
590 fprintf( stderr, " inherit=%d,", req->inherit );
591 fprintf( stderr, " name=" );
592 dump_unicode_string( req, req->name );
595 static void dump_open_semaphore_reply( const struct open_semaphore_request *req )
597 fprintf( stderr, " handle=%d", req->handle );
600 static void dump_create_file_request( const struct create_file_request *req )
602 fprintf( stderr, " access=%08x,", req->access );
603 fprintf( stderr, " inherit=%d,", req->inherit );
604 fprintf( stderr, " sharing=%08x,", req->sharing );
605 fprintf( stderr, " create=%d,", req->create );
606 fprintf( stderr, " attrs=%08x,", req->attrs );
607 fprintf( stderr, " name=" );
608 dump_string( req, req->name );
611 static void dump_create_file_reply( const struct create_file_request *req )
613 fprintf( stderr, " handle=%d", req->handle );
616 static void dump_alloc_file_handle_request( const struct alloc_file_handle_request *req )
618 fprintf( stderr, " access=%08x", req->access );
621 static void dump_alloc_file_handle_reply( const struct alloc_file_handle_request *req )
623 fprintf( stderr, " handle=%d", req->handle );
626 static void dump_get_read_fd_request( const struct get_read_fd_request *req )
628 fprintf( stderr, " handle=%d", req->handle );
631 static void dump_get_write_fd_request( const struct get_write_fd_request *req )
633 fprintf( stderr, " handle=%d", req->handle );
636 static void dump_set_file_pointer_request( const struct set_file_pointer_request *req )
638 fprintf( stderr, " handle=%d,", req->handle );
639 fprintf( stderr, " low=%d,", req->low );
640 fprintf( stderr, " high=%d,", req->high );
641 fprintf( stderr, " whence=%d", req->whence );
644 static void dump_set_file_pointer_reply( const struct set_file_pointer_request *req )
646 fprintf( stderr, " new_low=%d,", req->new_low );
647 fprintf( stderr, " new_high=%d", req->new_high );
650 static void dump_truncate_file_request( const struct truncate_file_request *req )
652 fprintf( stderr, " handle=%d", req->handle );
655 static void dump_set_file_time_request( const struct set_file_time_request *req )
657 fprintf( stderr, " handle=%d,", req->handle );
658 fprintf( stderr, " access_time=%ld,", req->access_time );
659 fprintf( stderr, " write_time=%ld", req->write_time );
662 static void dump_flush_file_request( const struct flush_file_request *req )
664 fprintf( stderr, " handle=%d", req->handle );
667 static void dump_get_file_info_request( const struct get_file_info_request *req )
669 fprintf( stderr, " handle=%d", req->handle );
672 static void dump_get_file_info_reply( const struct get_file_info_request *req )
674 fprintf( stderr, " type=%d,", req->type );
675 fprintf( stderr, " attr=%d,", req->attr );
676 fprintf( stderr, " access_time=%ld,", req->access_time );
677 fprintf( stderr, " write_time=%ld,", req->write_time );
678 fprintf( stderr, " size_high=%d,", req->size_high );
679 fprintf( stderr, " size_low=%d,", req->size_low );
680 fprintf( stderr, " links=%d,", req->links );
681 fprintf( stderr, " index_high=%d,", req->index_high );
682 fprintf( stderr, " index_low=%d,", req->index_low );
683 fprintf( stderr, " serial=%08x", req->serial );
686 static void dump_lock_file_request( const struct lock_file_request *req )
688 fprintf( stderr, " handle=%d,", req->handle );
689 fprintf( stderr, " offset_low=%08x,", req->offset_low );
690 fprintf( stderr, " offset_high=%08x,", req->offset_high );
691 fprintf( stderr, " count_low=%08x,", req->count_low );
692 fprintf( stderr, " count_high=%08x", req->count_high );
695 static void dump_unlock_file_request( const struct unlock_file_request *req )
697 fprintf( stderr, " handle=%d,", req->handle );
698 fprintf( stderr, " offset_low=%08x,", req->offset_low );
699 fprintf( stderr, " offset_high=%08x,", req->offset_high );
700 fprintf( stderr, " count_low=%08x,", req->count_low );
701 fprintf( stderr, " count_high=%08x", req->count_high );
704 static void dump_create_pipe_request( const struct create_pipe_request *req )
706 fprintf( stderr, " inherit=%d", req->inherit );
709 static void dump_create_pipe_reply( const struct create_pipe_request *req )
711 fprintf( stderr, " handle_read=%d,", req->handle_read );
712 fprintf( stderr, " handle_write=%d", req->handle_write );
715 static void dump_create_socket_request( const struct create_socket_request *req )
717 fprintf( stderr, " access=%08x,", req->access );
718 fprintf( stderr, " inherit=%d,", req->inherit );
719 fprintf( stderr, " family=%d,", req->family );
720 fprintf( stderr, " type=%d,", req->type );
721 fprintf( stderr, " protocol=%d", req->protocol );
724 static void dump_create_socket_reply( const struct create_socket_request *req )
726 fprintf( stderr, " handle=%d", req->handle );
729 static void dump_accept_socket_request( const struct accept_socket_request *req )
731 fprintf( stderr, " lhandle=%d,", req->lhandle );
732 fprintf( stderr, " access=%08x,", req->access );
733 fprintf( stderr, " inherit=%d", req->inherit );
736 static void dump_accept_socket_reply( const struct accept_socket_request *req )
738 fprintf( stderr, " handle=%d", req->handle );
741 static void dump_set_socket_event_request( const struct set_socket_event_request *req )
743 fprintf( stderr, " handle=%d,", req->handle );
744 fprintf( stderr, " mask=%08x,", req->mask );
745 fprintf( stderr, " event=%d", req->event );
748 static void dump_get_socket_event_request( const struct get_socket_event_request *req )
750 fprintf( stderr, " handle=%d,", req->handle );
751 fprintf( stderr, " service=%d,", req->service );
752 fprintf( stderr, " s_event=%d,", req->s_event );
753 fprintf( stderr, " c_event=%d", req->c_event );
756 static void dump_get_socket_event_reply( const struct get_socket_event_request *req )
758 fprintf( stderr, " mask=%08x,", req->mask );
759 fprintf( stderr, " pmask=%08x,", req->pmask );
760 fprintf( stderr, " state=%08x,", req->state );
761 fprintf( stderr, " errors=" );
762 dump_varargs_get_socket_event_reply( req );
765 static void dump_enable_socket_event_request( const struct enable_socket_event_request *req )
767 fprintf( stderr, " handle=%d,", req->handle );
768 fprintf( stderr, " mask=%08x,", req->mask );
769 fprintf( stderr, " sstate=%08x,", req->sstate );
770 fprintf( stderr, " cstate=%08x", req->cstate );
773 static void dump_alloc_console_request( const struct alloc_console_request *req )
775 fprintf( stderr, " access=%08x,", req->access );
776 fprintf( stderr, " inherit=%d", req->inherit );
779 static void dump_alloc_console_reply( const struct alloc_console_request *req )
781 fprintf( stderr, " handle_in=%d,", req->handle_in );
782 fprintf( stderr, " handle_out=%d", req->handle_out );
785 static void dump_free_console_request( const struct free_console_request *req )
787 fprintf( stderr, " dummy=%d", req->dummy );
790 static void dump_open_console_request( const struct open_console_request *req )
792 fprintf( stderr, " output=%d,", req->output );
793 fprintf( stderr, " access=%08x,", req->access );
794 fprintf( stderr, " inherit=%d", req->inherit );
797 static void dump_open_console_reply( const struct open_console_request *req )
799 fprintf( stderr, " handle=%d", req->handle );
802 static void dump_set_console_fd_request( const struct set_console_fd_request *req )
804 fprintf( stderr, " handle=%d,", req->handle );
805 fprintf( stderr, " file_handle=%d,", req->file_handle );
806 fprintf( stderr, " pid=%d", req->pid );
809 static void dump_get_console_mode_request( const struct get_console_mode_request *req )
811 fprintf( stderr, " handle=%d", req->handle );
814 static void dump_get_console_mode_reply( const struct get_console_mode_request *req )
816 fprintf( stderr, " mode=%d", req->mode );
819 static void dump_set_console_mode_request( const struct set_console_mode_request *req )
821 fprintf( stderr, " handle=%d,", req->handle );
822 fprintf( stderr, " mode=%d", req->mode );
825 static void dump_set_console_info_request( const struct set_console_info_request *req )
827 fprintf( stderr, " handle=%d,", req->handle );
828 fprintf( stderr, " mask=%d,", req->mask );
829 fprintf( stderr, " cursor_size=%d,", req->cursor_size );
830 fprintf( stderr, " cursor_visible=%d,", req->cursor_visible );
831 fprintf( stderr, " title=" );
832 dump_string( req, req->title );
835 static void dump_get_console_info_request( const struct get_console_info_request *req )
837 fprintf( stderr, " handle=%d", req->handle );
840 static void dump_get_console_info_reply( const struct get_console_info_request *req )
842 fprintf( stderr, " cursor_size=%d,", req->cursor_size );
843 fprintf( stderr, " cursor_visible=%d,", req->cursor_visible );
844 fprintf( stderr, " pid=%d,", req->pid );
845 fprintf( stderr, " title=" );
846 dump_string( req, req->title );
849 static void dump_write_console_input_request( const struct write_console_input_request *req )
851 fprintf( stderr, " handle=%d,", req->handle );
852 fprintf( stderr, " count=%d", req->count );
855 static void dump_write_console_input_reply( const struct write_console_input_request *req )
857 fprintf( stderr, " written=%d", req->written );
860 static void dump_read_console_input_request( const struct read_console_input_request *req )
862 fprintf( stderr, " handle=%d,", req->handle );
863 fprintf( stderr, " count=%d,", req->count );
864 fprintf( stderr, " flush=%d", req->flush );
867 static void dump_read_console_input_reply( const struct read_console_input_request *req )
869 fprintf( stderr, " read=%d", req->read );
872 static void dump_create_change_notification_request( const struct create_change_notification_request *req )
874 fprintf( stderr, " subtree=%d,", req->subtree );
875 fprintf( stderr, " filter=%d", req->filter );
878 static void dump_create_change_notification_reply( const struct create_change_notification_request *req )
880 fprintf( stderr, " handle=%d", req->handle );
883 static void dump_create_mapping_request( const struct create_mapping_request *req )
885 fprintf( stderr, " size_high=%d,", req->size_high );
886 fprintf( stderr, " size_low=%d,", req->size_low );
887 fprintf( stderr, " protect=%d,", req->protect );
888 fprintf( stderr, " inherit=%d,", req->inherit );
889 fprintf( stderr, " file_handle=%d,", req->file_handle );
890 fprintf( stderr, " name=" );
891 dump_unicode_string( req, req->name );
894 static void dump_create_mapping_reply( const struct create_mapping_request *req )
896 fprintf( stderr, " handle=%d", req->handle );
899 static void dump_open_mapping_request( const struct open_mapping_request *req )
901 fprintf( stderr, " access=%08x,", req->access );
902 fprintf( stderr, " inherit=%d,", req->inherit );
903 fprintf( stderr, " name=" );
904 dump_unicode_string( req, req->name );
907 static void dump_open_mapping_reply( const struct open_mapping_request *req )
909 fprintf( stderr, " handle=%d", req->handle );
912 static void dump_get_mapping_info_request( const struct get_mapping_info_request *req )
914 fprintf( stderr, " handle=%d", req->handle );
917 static void dump_get_mapping_info_reply( const struct get_mapping_info_request *req )
919 fprintf( stderr, " size_high=%d,", req->size_high );
920 fprintf( stderr, " size_low=%d,", req->size_low );
921 fprintf( stderr, " protect=%d", req->protect );
924 static void dump_create_device_request( const struct create_device_request *req )
926 fprintf( stderr, " access=%08x,", req->access );
927 fprintf( stderr, " inherit=%d,", req->inherit );
928 fprintf( stderr, " id=%d", req->id );
931 static void dump_create_device_reply( const struct create_device_request *req )
933 fprintf( stderr, " handle=%d", req->handle );
936 static void dump_create_snapshot_request( const struct create_snapshot_request *req )
938 fprintf( stderr, " inherit=%d,", req->inherit );
939 fprintf( stderr, " flags=%d,", req->flags );
940 fprintf( stderr, " pid=%p", req->pid );
943 static void dump_create_snapshot_reply( const struct create_snapshot_request *req )
945 fprintf( stderr, " handle=%d", req->handle );
948 static void dump_next_process_request( const struct next_process_request *req )
950 fprintf( stderr, " handle=%d,", req->handle );
951 fprintf( stderr, " reset=%d", req->reset );
954 static void dump_next_process_reply( const struct next_process_request *req )
956 fprintf( stderr, " count=%d,", req->count );
957 fprintf( stderr, " pid=%p,", req->pid );
958 fprintf( stderr, " threads=%d,", req->threads );
959 fprintf( stderr, " priority=%d", req->priority );
962 static void dump_next_thread_request( const struct next_thread_request *req )
964 fprintf( stderr, " handle=%d,", req->handle );
965 fprintf( stderr, " reset=%d", req->reset );
968 static void dump_next_thread_reply( const struct next_thread_request *req )
970 fprintf( stderr, " count=%d,", req->count );
971 fprintf( stderr, " pid=%p,", req->pid );
972 fprintf( stderr, " tid=%p,", req->tid );
973 fprintf( stderr, " base_pri=%d,", req->base_pri );
974 fprintf( stderr, " delta_pri=%d", req->delta_pri );
977 static void dump_next_module_request( const struct next_module_request *req )
979 fprintf( stderr, " handle=%d,", req->handle );
980 fprintf( stderr, " reset=%d", req->reset );
983 static void dump_next_module_reply( const struct next_module_request *req )
985 fprintf( stderr, " pid=%p,", req->pid );
986 fprintf( stderr, " base=%p", req->base );
989 static void dump_wait_debug_event_request( const struct wait_debug_event_request *req )
991 fprintf( stderr, " timeout=%d", req->timeout );
994 static void dump_wait_debug_event_reply( const struct wait_debug_event_request *req )
996 fprintf( stderr, " pid=%p,", req->pid );
997 fprintf( stderr, " tid=%p,", req->tid );
998 fprintf( stderr, " event=" );
999 dump_debug_event_t( req, &req->event );
1002 static void dump_exception_event_request( const struct exception_event_request *req )
1004 fprintf( stderr, " record=" );
1005 dump_exc_record( req, &req->record );
1006 fprintf( stderr, "," );
1007 fprintf( stderr, " first=%d,", req->first );
1008 fprintf( stderr, " context=" );
1009 dump_context( req, &req->context );
1012 static void dump_exception_event_reply( const struct exception_event_request *req )
1014 fprintf( stderr, " status=%d", req->status );
1017 static void dump_output_debug_string_request( const struct output_debug_string_request *req )
1019 fprintf( stderr, " string=%p,", req->string );
1020 fprintf( stderr, " unicode=%d,", req->unicode );
1021 fprintf( stderr, " length=%d", req->length );
1024 static void dump_continue_debug_event_request( const struct continue_debug_event_request *req )
1026 fprintf( stderr, " pid=%p,", req->pid );
1027 fprintf( stderr, " tid=%p,", req->tid );
1028 fprintf( stderr, " status=%d", req->status );
1031 static void dump_debug_process_request( const struct debug_process_request *req )
1033 fprintf( stderr, " pid=%p", req->pid );
1036 static void dump_read_process_memory_request( const struct read_process_memory_request *req )
1038 fprintf( stderr, " handle=%d,", req->handle );
1039 fprintf( stderr, " addr=%p,", req->addr );
1040 fprintf( stderr, " len=%d", req->len );
1043 static void dump_read_process_memory_reply( const struct read_process_memory_request *req )
1045 fprintf( stderr, " data=" );
1046 dump_varargs_read_process_memory_reply( req );
1049 static void dump_write_process_memory_request( const struct write_process_memory_request *req )
1051 fprintf( stderr, " handle=%d,", req->handle );
1052 fprintf( stderr, " addr=%p,", req->addr );
1053 fprintf( stderr, " len=%d,", req->len );
1054 fprintf( stderr, " first_mask=%08x,", req->first_mask );
1055 fprintf( stderr, " last_mask=%08x,", req->last_mask );
1056 fprintf( stderr, " data=" );
1057 dump_varargs_write_process_memory_request( req );
1060 static void dump_create_key_request( const struct create_key_request *req )
1062 fprintf( stderr, " parent=%d,", req->parent );
1063 fprintf( stderr, " access=%08x,", req->access );
1064 fprintf( stderr, " options=%08x,", req->options );
1065 fprintf( stderr, " modif=%ld,", req->modif );
1066 fprintf( stderr, " name=" );
1067 dump_path_t( req, &req->name );
1068 fprintf( stderr, "," );
1069 fprintf( stderr, " class=" );
1070 dump_unicode_string( req, req->class );
1073 static void dump_create_key_reply( const struct create_key_request *req )
1075 fprintf( stderr, " hkey=%d,", req->hkey );
1076 fprintf( stderr, " created=%d", req->created );
1079 static void dump_open_key_request( const struct open_key_request *req )
1081 fprintf( stderr, " parent=%d,", req->parent );
1082 fprintf( stderr, " access=%08x,", req->access );
1083 fprintf( stderr, " name=" );
1084 dump_path_t( req, &req->name );
1087 static void dump_open_key_reply( const struct open_key_request *req )
1089 fprintf( stderr, " hkey=%d", req->hkey );
1092 static void dump_delete_key_request( const struct delete_key_request *req )
1094 fprintf( stderr, " hkey=%d,", req->hkey );
1095 fprintf( stderr, " name=" );
1096 dump_path_t( req, &req->name );
1099 static void dump_close_key_request( const struct close_key_request *req )
1101 fprintf( stderr, " hkey=%d", req->hkey );
1104 static void dump_enum_key_request( const struct enum_key_request *req )
1106 fprintf( stderr, " hkey=%d,", req->hkey );
1107 fprintf( stderr, " index=%d", req->index );
1110 static void dump_enum_key_reply( const struct enum_key_request *req )
1112 fprintf( stderr, " modif=%ld,", req->modif );
1113 fprintf( stderr, " name=" );
1114 dump_path_t( req, &req->name );
1115 fprintf( stderr, "," );
1116 fprintf( stderr, " class=" );
1117 dump_unicode_string( req, req->class );
1120 static void dump_query_key_info_request( const struct query_key_info_request *req )
1122 fprintf( stderr, " hkey=%d", req->hkey );
1125 static void dump_query_key_info_reply( const struct query_key_info_request *req )
1127 fprintf( stderr, " subkeys=%d,", req->subkeys );
1128 fprintf( stderr, " max_subkey=%d,", req->max_subkey );
1129 fprintf( stderr, " max_class=%d,", req->max_class );
1130 fprintf( stderr, " values=%d,", req->values );
1131 fprintf( stderr, " max_value=%d,", req->max_value );
1132 fprintf( stderr, " max_data=%d,", req->max_data );
1133 fprintf( stderr, " modif=%ld,", req->modif );
1134 fprintf( stderr, " name=" );
1135 dump_path_t( req, &req->name );
1136 fprintf( stderr, "," );
1137 fprintf( stderr, " class=" );
1138 dump_unicode_string( req, req->class );
1141 static void dump_set_key_value_request( const struct set_key_value_request *req )
1143 fprintf( stderr, " hkey=%d,", req->hkey );
1144 fprintf( stderr, " type=%d,", req->type );
1145 fprintf( stderr, " total=%08x,", req->total );
1146 fprintf( stderr, " offset=%08x,", req->offset );
1147 fprintf( stderr, " len=%08x,", req->len );
1148 fprintf( stderr, " name=" );
1149 dump_path_t( req, &req->name );
1150 fprintf( stderr, "," );
1151 fprintf( stderr, " data=" );
1152 dump_varargs_set_key_value_request( req );
1155 static void dump_get_key_value_request( const struct get_key_value_request *req )
1157 fprintf( stderr, " hkey=%d,", req->hkey );
1158 fprintf( stderr, " offset=%08x,", req->offset );
1159 fprintf( stderr, " name=" );
1160 dump_unicode_string( req, req->name );
1163 static void dump_get_key_value_reply( const struct get_key_value_request *req )
1165 fprintf( stderr, " type=%d,", req->type );
1166 fprintf( stderr, " len=%d,", req->len );
1167 fprintf( stderr, " data=" );
1168 dump_varargs_get_key_value_reply( req );
1171 static void dump_enum_key_value_request( const struct enum_key_value_request *req )
1173 fprintf( stderr, " hkey=%d,", req->hkey );
1174 fprintf( stderr, " index=%d,", req->index );
1175 fprintf( stderr, " offset=%08x", req->offset );
1178 static void dump_enum_key_value_reply( const struct enum_key_value_request *req )
1180 fprintf( stderr, " type=%d,", req->type );
1181 fprintf( stderr, " len=%d,", req->len );
1182 fprintf( stderr, " name=" );
1183 dump_path_t( req, &req->name );
1184 fprintf( stderr, "," );
1185 fprintf( stderr, " data=" );
1186 dump_varargs_enum_key_value_reply( req );
1189 static void dump_delete_key_value_request( const struct delete_key_value_request *req )
1191 fprintf( stderr, " hkey=%d,", req->hkey );
1192 fprintf( stderr, " name=" );
1193 dump_path_t( req, &req->name );
1196 static void dump_load_registry_request( const struct load_registry_request *req )
1198 fprintf( stderr, " hkey=%d,", req->hkey );
1199 fprintf( stderr, " file=%d,", req->file );
1200 fprintf( stderr, " name=" );
1201 dump_path_t( req, &req->name );
1204 static void dump_save_registry_request( const struct save_registry_request *req )
1206 fprintf( stderr, " hkey=%d,", req->hkey );
1207 fprintf( stderr, " file=%d", req->file );
1210 static void dump_save_registry_atexit_request( const struct save_registry_atexit_request *req )
1212 fprintf( stderr, " hkey=%d,", req->hkey );
1213 fprintf( stderr, " file=" );
1214 dump_string( req, req->file );
1217 static void dump_set_registry_levels_request( const struct set_registry_levels_request *req )
1219 fprintf( stderr, " current=%d,", req->current );
1220 fprintf( stderr, " saving=%d,", req->saving );
1221 fprintf( stderr, " period=%d", req->period );
1224 static void dump_create_timer_request( const struct create_timer_request *req )
1226 fprintf( stderr, " inherit=%d,", req->inherit );
1227 fprintf( stderr, " manual=%d,", req->manual );
1228 fprintf( stderr, " name=" );
1229 dump_unicode_string( req, req->name );
1232 static void dump_create_timer_reply( const struct create_timer_request *req )
1234 fprintf( stderr, " handle=%d", req->handle );
1237 static void dump_open_timer_request( const struct open_timer_request *req )
1239 fprintf( stderr, " access=%08x,", req->access );
1240 fprintf( stderr, " inherit=%d,", req->inherit );
1241 fprintf( stderr, " name=" );
1242 dump_unicode_string( req, req->name );
1245 static void dump_open_timer_reply( const struct open_timer_request *req )
1247 fprintf( stderr, " handle=%d", req->handle );
1250 static void dump_set_timer_request( const struct set_timer_request *req )
1252 fprintf( stderr, " handle=%d,", req->handle );
1253 fprintf( stderr, " sec=%d,", req->sec );
1254 fprintf( stderr, " usec=%d,", req->usec );
1255 fprintf( stderr, " period=%d,", req->period );
1256 fprintf( stderr, " callback=%p,", req->callback );
1257 fprintf( stderr, " arg=%p", req->arg );
1260 static void dump_cancel_timer_request( const struct cancel_timer_request *req )
1262 fprintf( stderr, " handle=%d", req->handle );
1265 static void dump_get_thread_context_request( const struct get_thread_context_request *req )
1267 fprintf( stderr, " handle=%d,", req->handle );
1268 fprintf( stderr, " flags=%08x", req->flags );
1271 static void dump_get_thread_context_reply( const struct get_thread_context_request *req )
1273 fprintf( stderr, " context=" );
1274 dump_context( req, &req->context );
1277 static void dump_set_thread_context_request( const struct set_thread_context_request *req )
1279 fprintf( stderr, " handle=%d,", req->handle );
1280 fprintf( stderr, " flags=%08x,", req->flags );
1281 fprintf( stderr, " context=" );
1282 dump_context( req, &req->context );
1285 static void dump_get_selector_entry_request( const struct get_selector_entry_request *req )
1287 fprintf( stderr, " handle=%d,", req->handle );
1288 fprintf( stderr, " entry=%d", req->entry );
1291 static void dump_get_selector_entry_reply( const struct get_selector_entry_request *req )
1293 fprintf( stderr, " base=%08x,", req->base );
1294 fprintf( stderr, " limit=%08x,", req->limit );
1295 fprintf( stderr, " flags=%02x", req->flags );
1298 static void dump_add_atom_request( const struct add_atom_request *req )
1300 fprintf( stderr, " local=%d,", req->local );
1301 fprintf( stderr, " name=" );
1302 dump_unicode_string( req, req->name );
1305 static void dump_add_atom_reply( const struct add_atom_request *req )
1307 fprintf( stderr, " atom=%d", req->atom );
1310 static void dump_delete_atom_request( const struct delete_atom_request *req )
1312 fprintf( stderr, " atom=%d,", req->atom );
1313 fprintf( stderr, " local=%d", req->local );
1316 static void dump_find_atom_request( const struct find_atom_request *req )
1318 fprintf( stderr, " local=%d,", req->local );
1319 fprintf( stderr, " name=" );
1320 dump_unicode_string( req, req->name );
1323 static void dump_find_atom_reply( const struct find_atom_request *req )
1325 fprintf( stderr, " atom=%d", req->atom );
1328 static void dump_get_atom_name_request( const struct get_atom_name_request *req )
1330 fprintf( stderr, " atom=%d,", req->atom );
1331 fprintf( stderr, " local=%d", req->local );
1334 static void dump_get_atom_name_reply( const struct get_atom_name_request *req )
1336 fprintf( stderr, " count=%d,", req->count );
1337 fprintf( stderr, " name=" );
1338 dump_unicode_string( req, req->name );
1341 static void dump_init_atom_table_request( const struct init_atom_table_request *req )
1343 fprintf( stderr, " entries=%d", req->entries );
1346 static void dump_get_msg_queue_request( const struct get_msg_queue_request *req )
1350 static void dump_get_msg_queue_reply( const struct get_msg_queue_request *req )
1352 fprintf( stderr, " handle=%d", req->handle );
1355 static void dump_wake_queue_request( const struct wake_queue_request *req )
1357 fprintf( stderr, " handle=%d,", req->handle );
1358 fprintf( stderr, " bits=%08x", req->bits );
1361 static void dump_wait_input_idle_request( const struct wait_input_idle_request *req )
1363 fprintf( stderr, " handle=%d,", req->handle );
1364 fprintf( stderr, " timeout=%d", req->timeout );
1367 static void dump_wait_input_idle_reply( const struct wait_input_idle_request *req )
1369 fprintf( stderr, " event=%d", req->event );
1372 static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
1373 (dump_func)dump_new_process_request,
1374 (dump_func)dump_wait_process_request,
1375 (dump_func)dump_new_thread_request,
1376 (dump_func)dump_boot_done_request,
1377 (dump_func)dump_init_process_request,
1378 (dump_func)dump_init_process_done_request,
1379 (dump_func)dump_init_thread_request,
1380 (dump_func)dump_get_thread_buffer_request,
1381 (dump_func)dump_terminate_process_request,
1382 (dump_func)dump_terminate_thread_request,
1383 (dump_func)dump_get_process_info_request,
1384 (dump_func)dump_set_process_info_request,
1385 (dump_func)dump_get_thread_info_request,
1386 (dump_func)dump_set_thread_info_request,
1387 (dump_func)dump_suspend_thread_request,
1388 (dump_func)dump_resume_thread_request,
1389 (dump_func)dump_load_dll_request,
1390 (dump_func)dump_unload_dll_request,
1391 (dump_func)dump_queue_apc_request,
1392 (dump_func)dump_get_apcs_request,
1393 (dump_func)dump_close_handle_request,
1394 (dump_func)dump_get_handle_info_request,
1395 (dump_func)dump_set_handle_info_request,
1396 (dump_func)dump_dup_handle_request,
1397 (dump_func)dump_open_process_request,
1398 (dump_func)dump_select_request,
1399 (dump_func)dump_create_event_request,
1400 (dump_func)dump_event_op_request,
1401 (dump_func)dump_open_event_request,
1402 (dump_func)dump_create_mutex_request,
1403 (dump_func)dump_release_mutex_request,
1404 (dump_func)dump_open_mutex_request,
1405 (dump_func)dump_create_semaphore_request,
1406 (dump_func)dump_release_semaphore_request,
1407 (dump_func)dump_open_semaphore_request,
1408 (dump_func)dump_create_file_request,
1409 (dump_func)dump_alloc_file_handle_request,
1410 (dump_func)dump_get_read_fd_request,
1411 (dump_func)dump_get_write_fd_request,
1412 (dump_func)dump_set_file_pointer_request,
1413 (dump_func)dump_truncate_file_request,
1414 (dump_func)dump_set_file_time_request,
1415 (dump_func)dump_flush_file_request,
1416 (dump_func)dump_get_file_info_request,
1417 (dump_func)dump_lock_file_request,
1418 (dump_func)dump_unlock_file_request,
1419 (dump_func)dump_create_pipe_request,
1420 (dump_func)dump_create_socket_request,
1421 (dump_func)dump_accept_socket_request,
1422 (dump_func)dump_set_socket_event_request,
1423 (dump_func)dump_get_socket_event_request,
1424 (dump_func)dump_enable_socket_event_request,
1425 (dump_func)dump_alloc_console_request,
1426 (dump_func)dump_free_console_request,
1427 (dump_func)dump_open_console_request,
1428 (dump_func)dump_set_console_fd_request,
1429 (dump_func)dump_get_console_mode_request,
1430 (dump_func)dump_set_console_mode_request,
1431 (dump_func)dump_set_console_info_request,
1432 (dump_func)dump_get_console_info_request,
1433 (dump_func)dump_write_console_input_request,
1434 (dump_func)dump_read_console_input_request,
1435 (dump_func)dump_create_change_notification_request,
1436 (dump_func)dump_create_mapping_request,
1437 (dump_func)dump_open_mapping_request,
1438 (dump_func)dump_get_mapping_info_request,
1439 (dump_func)dump_create_device_request,
1440 (dump_func)dump_create_snapshot_request,
1441 (dump_func)dump_next_process_request,
1442 (dump_func)dump_next_thread_request,
1443 (dump_func)dump_next_module_request,
1444 (dump_func)dump_wait_debug_event_request,
1445 (dump_func)dump_exception_event_request,
1446 (dump_func)dump_output_debug_string_request,
1447 (dump_func)dump_continue_debug_event_request,
1448 (dump_func)dump_debug_process_request,
1449 (dump_func)dump_read_process_memory_request,
1450 (dump_func)dump_write_process_memory_request,
1451 (dump_func)dump_create_key_request,
1452 (dump_func)dump_open_key_request,
1453 (dump_func)dump_delete_key_request,
1454 (dump_func)dump_close_key_request,
1455 (dump_func)dump_enum_key_request,
1456 (dump_func)dump_query_key_info_request,
1457 (dump_func)dump_set_key_value_request,
1458 (dump_func)dump_get_key_value_request,
1459 (dump_func)dump_enum_key_value_request,
1460 (dump_func)dump_delete_key_value_request,
1461 (dump_func)dump_load_registry_request,
1462 (dump_func)dump_save_registry_request,
1463 (dump_func)dump_save_registry_atexit_request,
1464 (dump_func)dump_set_registry_levels_request,
1465 (dump_func)dump_create_timer_request,
1466 (dump_func)dump_open_timer_request,
1467 (dump_func)dump_set_timer_request,
1468 (dump_func)dump_cancel_timer_request,
1469 (dump_func)dump_get_thread_context_request,
1470 (dump_func)dump_set_thread_context_request,
1471 (dump_func)dump_get_selector_entry_request,
1472 (dump_func)dump_add_atom_request,
1473 (dump_func)dump_delete_atom_request,
1474 (dump_func)dump_find_atom_request,
1475 (dump_func)dump_get_atom_name_request,
1476 (dump_func)dump_init_atom_table_request,
1477 (dump_func)dump_get_msg_queue_request,
1478 (dump_func)dump_wake_queue_request,
1479 (dump_func)dump_wait_input_idle_request,
1482 static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
1483 (dump_func)0,
1484 (dump_func)dump_wait_process_reply,
1485 (dump_func)dump_new_thread_reply,
1486 (dump_func)0,
1487 (dump_func)dump_init_process_reply,
1488 (dump_func)dump_init_process_done_reply,
1489 (dump_func)0,
1490 (dump_func)dump_get_thread_buffer_reply,
1491 (dump_func)dump_terminate_process_reply,
1492 (dump_func)dump_terminate_thread_reply,
1493 (dump_func)dump_get_process_info_reply,
1494 (dump_func)0,
1495 (dump_func)dump_get_thread_info_reply,
1496 (dump_func)0,
1497 (dump_func)dump_suspend_thread_reply,
1498 (dump_func)dump_resume_thread_reply,
1499 (dump_func)0,
1500 (dump_func)0,
1501 (dump_func)0,
1502 (dump_func)dump_get_apcs_reply,
1503 (dump_func)0,
1504 (dump_func)dump_get_handle_info_reply,
1505 (dump_func)0,
1506 (dump_func)dump_dup_handle_reply,
1507 (dump_func)dump_open_process_reply,
1508 (dump_func)dump_select_reply,
1509 (dump_func)dump_create_event_reply,
1510 (dump_func)0,
1511 (dump_func)dump_open_event_reply,
1512 (dump_func)dump_create_mutex_reply,
1513 (dump_func)0,
1514 (dump_func)dump_open_mutex_reply,
1515 (dump_func)dump_create_semaphore_reply,
1516 (dump_func)dump_release_semaphore_reply,
1517 (dump_func)dump_open_semaphore_reply,
1518 (dump_func)dump_create_file_reply,
1519 (dump_func)dump_alloc_file_handle_reply,
1520 (dump_func)0,
1521 (dump_func)0,
1522 (dump_func)dump_set_file_pointer_reply,
1523 (dump_func)0,
1524 (dump_func)0,
1525 (dump_func)0,
1526 (dump_func)dump_get_file_info_reply,
1527 (dump_func)0,
1528 (dump_func)0,
1529 (dump_func)dump_create_pipe_reply,
1530 (dump_func)dump_create_socket_reply,
1531 (dump_func)dump_accept_socket_reply,
1532 (dump_func)0,
1533 (dump_func)dump_get_socket_event_reply,
1534 (dump_func)0,
1535 (dump_func)dump_alloc_console_reply,
1536 (dump_func)0,
1537 (dump_func)dump_open_console_reply,
1538 (dump_func)0,
1539 (dump_func)dump_get_console_mode_reply,
1540 (dump_func)0,
1541 (dump_func)0,
1542 (dump_func)dump_get_console_info_reply,
1543 (dump_func)dump_write_console_input_reply,
1544 (dump_func)dump_read_console_input_reply,
1545 (dump_func)dump_create_change_notification_reply,
1546 (dump_func)dump_create_mapping_reply,
1547 (dump_func)dump_open_mapping_reply,
1548 (dump_func)dump_get_mapping_info_reply,
1549 (dump_func)dump_create_device_reply,
1550 (dump_func)dump_create_snapshot_reply,
1551 (dump_func)dump_next_process_reply,
1552 (dump_func)dump_next_thread_reply,
1553 (dump_func)dump_next_module_reply,
1554 (dump_func)dump_wait_debug_event_reply,
1555 (dump_func)dump_exception_event_reply,
1556 (dump_func)0,
1557 (dump_func)0,
1558 (dump_func)0,
1559 (dump_func)dump_read_process_memory_reply,
1560 (dump_func)0,
1561 (dump_func)dump_create_key_reply,
1562 (dump_func)dump_open_key_reply,
1563 (dump_func)0,
1564 (dump_func)0,
1565 (dump_func)dump_enum_key_reply,
1566 (dump_func)dump_query_key_info_reply,
1567 (dump_func)0,
1568 (dump_func)dump_get_key_value_reply,
1569 (dump_func)dump_enum_key_value_reply,
1570 (dump_func)0,
1571 (dump_func)0,
1572 (dump_func)0,
1573 (dump_func)0,
1574 (dump_func)0,
1575 (dump_func)dump_create_timer_reply,
1576 (dump_func)dump_open_timer_reply,
1577 (dump_func)0,
1578 (dump_func)0,
1579 (dump_func)dump_get_thread_context_reply,
1580 (dump_func)0,
1581 (dump_func)dump_get_selector_entry_reply,
1582 (dump_func)dump_add_atom_reply,
1583 (dump_func)0,
1584 (dump_func)dump_find_atom_reply,
1585 (dump_func)dump_get_atom_name_reply,
1586 (dump_func)0,
1587 (dump_func)dump_get_msg_queue_reply,
1588 (dump_func)0,
1589 (dump_func)dump_wait_input_idle_reply,
1592 static const char * const req_names[REQ_NB_REQUESTS] = {
1593 "new_process",
1594 "wait_process",
1595 "new_thread",
1596 "boot_done",
1597 "init_process",
1598 "init_process_done",
1599 "init_thread",
1600 "get_thread_buffer",
1601 "terminate_process",
1602 "terminate_thread",
1603 "get_process_info",
1604 "set_process_info",
1605 "get_thread_info",
1606 "set_thread_info",
1607 "suspend_thread",
1608 "resume_thread",
1609 "load_dll",
1610 "unload_dll",
1611 "queue_apc",
1612 "get_apcs",
1613 "close_handle",
1614 "get_handle_info",
1615 "set_handle_info",
1616 "dup_handle",
1617 "open_process",
1618 "select",
1619 "create_event",
1620 "event_op",
1621 "open_event",
1622 "create_mutex",
1623 "release_mutex",
1624 "open_mutex",
1625 "create_semaphore",
1626 "release_semaphore",
1627 "open_semaphore",
1628 "create_file",
1629 "alloc_file_handle",
1630 "get_read_fd",
1631 "get_write_fd",
1632 "set_file_pointer",
1633 "truncate_file",
1634 "set_file_time",
1635 "flush_file",
1636 "get_file_info",
1637 "lock_file",
1638 "unlock_file",
1639 "create_pipe",
1640 "create_socket",
1641 "accept_socket",
1642 "set_socket_event",
1643 "get_socket_event",
1644 "enable_socket_event",
1645 "alloc_console",
1646 "free_console",
1647 "open_console",
1648 "set_console_fd",
1649 "get_console_mode",
1650 "set_console_mode",
1651 "set_console_info",
1652 "get_console_info",
1653 "write_console_input",
1654 "read_console_input",
1655 "create_change_notification",
1656 "create_mapping",
1657 "open_mapping",
1658 "get_mapping_info",
1659 "create_device",
1660 "create_snapshot",
1661 "next_process",
1662 "next_thread",
1663 "next_module",
1664 "wait_debug_event",
1665 "exception_event",
1666 "output_debug_string",
1667 "continue_debug_event",
1668 "debug_process",
1669 "read_process_memory",
1670 "write_process_memory",
1671 "create_key",
1672 "open_key",
1673 "delete_key",
1674 "close_key",
1675 "enum_key",
1676 "query_key_info",
1677 "set_key_value",
1678 "get_key_value",
1679 "enum_key_value",
1680 "delete_key_value",
1681 "load_registry",
1682 "save_registry",
1683 "save_registry_atexit",
1684 "set_registry_levels",
1685 "create_timer",
1686 "open_timer",
1687 "set_timer",
1688 "cancel_timer",
1689 "get_thread_context",
1690 "set_thread_context",
1691 "get_selector_entry",
1692 "add_atom",
1693 "delete_atom",
1694 "find_atom",
1695 "get_atom_name",
1696 "init_atom_table",
1697 "get_msg_queue",
1698 "wake_queue",
1699 "wait_input_idle",
1702 /* ### make_requests end ### */
1703 /* Everything above this line is generated automatically by tools/make_requests */
1705 void trace_request( enum request req )
1707 current->last_req = req;
1708 if (req < REQ_NB_REQUESTS)
1710 fprintf( stderr, "%08x: %s(", (unsigned int)current, req_names[req] );
1711 req_dumpers[req]( current->buffer );
1713 else
1714 fprintf( stderr, "%08x: %d(", (unsigned int)current, req );
1715 if (current->pass_fd != -1) fprintf( stderr, " ) fd=%d\n", current->pass_fd );
1716 else fprintf( stderr, " )\n" );
1719 void trace_reply( struct thread *thread )
1721 fprintf( stderr, "%08x: %s() = %x",
1722 (unsigned int)thread, req_names[thread->last_req], thread->error );
1723 if (reply_dumpers[thread->last_req])
1725 fprintf( stderr, " {" );
1726 reply_dumpers[thread->last_req]( thread->buffer );
1727 fprintf( stderr, " }" );
1729 if (thread->pass_fd != -1) fprintf( stderr, " fd=%d\n", thread->pass_fd );
1730 else fprintf( stderr, "\n" );