RegSetValueExA/W: fixed REG_SZ string length handling for Win95.
[wine/multimedia.git] / server / trace.c
blobf1648ccc1fc75c9338e9c765010ceb937b55f048
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>
12 #include "config.h"
13 #include "winsock2.h"
14 #include "winnt.h"
15 #include "winbase.h"
16 #include "wincon.h"
17 #include "request.h"
18 #include "unicode.h"
20 static int cur_pos;
22 /* utility functions */
24 static const void *get_data( const void *req )
26 return (char *)get_req_data(req) + cur_pos;
29 static size_t get_size( const void *req )
31 return get_req_data_size(req) - cur_pos;
34 static void dump_uints( const int *ptr, int len )
36 fputc( '{', stderr );
37 while (len > 0)
39 fprintf( stderr, "%08x", *ptr++ );
40 if (--len) fputc( ',', stderr );
42 fputc( '}', stderr );
45 static void dump_context( const CONTEXT *context )
47 #ifdef __i386__
48 fprintf( stderr, "{flags=%08lx,eax=%08lx,ebx=%08lx,ecx=%08lx,edx=%08lx,esi=%08lx,edi=%08lx,"
49 "ebp=%08lx,eip=%08lx,esp=%08lx,eflags=%08lx,cs=%04lx,ds=%04lx,es=%04lx,"
50 "fs=%04lx,gs=%04lx,dr0=%08lx,dr1=%08lx,dr2=%08lx,dr3=%08lx,dr6=%08lx,dr7=%08lx,",
51 context->ContextFlags, context->Eax, context->Ebx, context->Ecx, context->Edx,
52 context->Esi, context->Edi, context->Ebp, context->Eip, context->Esp, context->EFlags,
53 context->SegCs, context->SegDs, context->SegEs, context->SegFs, context->SegGs,
54 context->Dr0, context->Dr1, context->Dr2, context->Dr3, context->Dr6, context->Dr7 );
55 fprintf( stderr, "float=" );
56 dump_uints( (int *)&context->FloatSave, sizeof(context->FloatSave) / sizeof(int) );
57 fprintf( stderr, "}" );
58 #else
59 dump_uints( (int *)context, sizeof(*context) / sizeof(int) );
60 #endif
63 static void dump_exc_record( const EXCEPTION_RECORD *rec )
65 int i;
66 fprintf( stderr, "{code=%lx,flags=%lx,rec=%p,addr=%p,params={",
67 rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionRecord,
68 rec->ExceptionAddress );
69 for (i = 0; i < min(rec->NumberParameters,EXCEPTION_MAXIMUM_PARAMETERS); i++)
71 if (i) fputc( ',', stderr );
72 fprintf( stderr, "%lx", rec->ExceptionInformation[i] );
74 fputc( '}', stderr );
77 static size_t dump_varargs_ints( const void *req )
79 const int *data = get_data(req);
80 size_t len = get_size(req) / sizeof(*data);
82 fputc( '{', stderr );
83 while (len > 0)
85 fprintf( stderr, "%d", *data++ );
86 if (--len) fputc( ',', stderr );
88 fputc( '}', stderr );
89 return get_size(req);
92 static size_t dump_varargs_handles( const void *req )
94 const handle_t *data = get_data(req);
95 size_t len = get_size(req) / sizeof(*data);
97 fputc( '{', stderr );
98 while (len > 0)
100 fprintf( stderr, "%d", *data++ );
101 if (--len) fputc( ',', stderr );
103 fputc( '}', stderr );
104 return get_size(req);
107 static size_t dump_varargs_ptrs( const void *req )
109 void * const *data = get_data(req);
110 size_t len = get_size(req) / sizeof(*data);
112 fputc( '{', stderr );
113 while (len > 0)
115 fprintf( stderr, "%p", *data++ );
116 if (--len) fputc( ',', stderr );
118 fputc( '}', stderr );
119 return get_size(req);
122 static size_t dump_varargs_bytes( const void *req )
124 const unsigned char *data = get_data(req);
125 size_t len = get_size(req);
127 fputc( '{', stderr );
128 while (len > 0)
130 fprintf( stderr, "%02x", *data++ );
131 if (--len) fputc( ',', stderr );
133 fputc( '}', stderr );
134 return get_size(req);
137 static size_t dump_varargs_string( const void *req )
139 fprintf( stderr, "\"%.*s\"", (int)get_size(req), (char *)get_data(req) );
140 return get_size(req);
143 static size_t dump_varargs_unicode_len_str( const void *req )
145 const WCHAR *str = get_data(req);
146 int len = *str++ + sizeof(WCHAR);
147 len = min( len, get_size(req) );
148 fprintf( stderr, "L\"" );
149 if (len >= sizeof(WCHAR)) dump_strW( str, (len / sizeof(WCHAR)) - 1, stderr, "\"\"" );
150 fputc( '\"', stderr );
151 return len;
154 static size_t dump_varargs_unicode_str( const void *req )
156 fprintf( stderr, "L\"" );
157 dump_strW( get_data(req), get_size(req) / sizeof(WCHAR), stderr, "\"\"" );
158 fputc( '\"', stderr );
159 return get_size(req);
162 static size_t dump_varargs_context( const void *req )
164 dump_context( get_data(req) );
165 return get_size(req);
168 static size_t dump_varargs_exc_event( const void *req )
170 const CONTEXT *ptr = get_data(req);
171 fprintf( stderr, "{context=" );
172 dump_context( ptr );
173 fprintf( stderr, ",rec=" );
174 dump_exc_record( (EXCEPTION_RECORD *)(ptr + 1) );
175 fputc( '}', stderr );
176 return get_size(req);
179 static size_t dump_varargs_debug_event( const void *req )
181 const debug_event_t *event = get_data(req);
183 if (!get_size(req))
185 fprintf( stderr, "{}" );
186 return 0;
188 switch(event->code)
190 case EXCEPTION_DEBUG_EVENT:
191 fprintf( stderr, "{exception," );
192 dump_exc_record( &event->info.exception.record );
193 fprintf( stderr, ",first=%d}", event->info.exception.first );
194 break;
195 case CREATE_THREAD_DEBUG_EVENT:
196 fprintf( stderr, "{create_thread,thread=%d,teb=%p,start=%p}",
197 event->info.create_thread.handle, event->info.create_thread.teb,
198 event->info.create_thread.start );
199 break;
200 case CREATE_PROCESS_DEBUG_EVENT:
201 fprintf( stderr, "{create_process,file=%d,process=%d,thread=%d,base=%p,offset=%d,"
202 "size=%d,teb=%p,start=%p,name=%p,unicode=%d}",
203 event->info.create_process.file, event->info.create_process.process,
204 event->info.create_process.thread, event->info.create_process.base,
205 event->info.create_process.dbg_offset, event->info.create_process.dbg_size,
206 event->info.create_process.teb, event->info.create_process.start,
207 event->info.create_process.name, event->info.create_process.unicode );
208 break;
209 case EXIT_THREAD_DEBUG_EVENT:
210 fprintf( stderr, "{exit_thread,code=%d}", event->info.exit.exit_code );
211 break;
212 case EXIT_PROCESS_DEBUG_EVENT:
213 fprintf( stderr, "{exit_process,code=%d}", event->info.exit.exit_code );
214 break;
215 case LOAD_DLL_DEBUG_EVENT:
216 fprintf( stderr, "{load_dll,file=%d,base=%p,offset=%d,size=%d,name=%p,unicode=%d}",
217 event->info.load_dll.handle, event->info.load_dll.base,
218 event->info.load_dll.dbg_offset, event->info.load_dll.dbg_size,
219 event->info.load_dll.name, event->info.load_dll.unicode );
220 break;
221 case UNLOAD_DLL_DEBUG_EVENT:
222 fprintf( stderr, "{unload_dll,base=%p}", event->info.unload_dll.base );
223 break;
224 case OUTPUT_DEBUG_STRING_EVENT:
225 fprintf( stderr, "{output_string,data=%p,unicode=%d,len=%d}",
226 event->info.output_string.string, event->info.output_string.unicode,
227 event->info.output_string.length );
228 break;
229 case RIP_EVENT:
230 fprintf( stderr, "{rip,err=%d,type=%d}",
231 event->info.rip_info.error, event->info.rip_info.type );
232 break;
233 case 0: /* zero is the code returned on timeouts */
234 fprintf( stderr, "{}" );
235 break;
236 default:
237 fprintf( stderr, "{code=??? (%d)}", event->code );
238 break;
240 return get_size(req);
243 static size_t dump_varargs_input_records( const void *req )
245 const INPUT_RECORD *rec = get_data(req);
246 size_t len = get_size(req) / sizeof(*rec);
248 fputc( '{', stderr );
249 while (len > 0)
251 fprintf( stderr, "{%04x,...}", rec->EventType );
252 rec++;
253 if (--len) fputc( ',', stderr );
255 fputc( '}', stderr );
256 return get_size(req);
259 typedef void (*dump_func)( const void *req );
261 /* Everything below this line is generated automatically by tools/make_requests */
262 /* ### make_requests begin ### */
264 static void dump_new_process_request( const struct new_process_request *req )
266 fprintf( stderr, " inherit_all=%d,", req->inherit_all );
267 fprintf( stderr, " create_flags=%d,", req->create_flags );
268 fprintf( stderr, " start_flags=%d,", req->start_flags );
269 fprintf( stderr, " exe_file=%d,", req->exe_file );
270 fprintf( stderr, " hstdin=%d,", req->hstdin );
271 fprintf( stderr, " hstdout=%d,", req->hstdout );
272 fprintf( stderr, " hstderr=%d,", req->hstderr );
273 fprintf( stderr, " cmd_show=%d,", req->cmd_show );
274 fprintf( stderr, " filename=" );
275 cur_pos += dump_varargs_string( req );
278 static void dump_new_process_reply( const struct new_process_request *req )
280 fprintf( stderr, " info=%d", req->info );
283 static void dump_get_new_process_info_request( const struct get_new_process_info_request *req )
285 fprintf( stderr, " info=%d,", req->info );
286 fprintf( stderr, " pinherit=%d,", req->pinherit );
287 fprintf( stderr, " tinherit=%d", req->tinherit );
290 static void dump_get_new_process_info_reply( const struct get_new_process_info_request *req )
292 fprintf( stderr, " pid=%p,", req->pid );
293 fprintf( stderr, " phandle=%d,", req->phandle );
294 fprintf( stderr, " tid=%p,", req->tid );
295 fprintf( stderr, " thandle=%d,", req->thandle );
296 fprintf( stderr, " event=%d", req->event );
299 static void dump_new_thread_request( const struct new_thread_request *req )
301 fprintf( stderr, " suspend=%d,", req->suspend );
302 fprintf( stderr, " inherit=%d,", req->inherit );
303 fprintf( stderr, " request_fd=%d", req->request_fd );
306 static void dump_new_thread_reply( const struct new_thread_request *req )
308 fprintf( stderr, " tid=%p,", req->tid );
309 fprintf( stderr, " handle=%d", req->handle );
312 static void dump_boot_done_request( const struct boot_done_request *req )
314 fprintf( stderr, " debug_level=%d", req->debug_level );
317 static void dump_init_process_request( const struct init_process_request *req )
319 fprintf( stderr, " ldt_copy=%p,", req->ldt_copy );
320 fprintf( stderr, " ppid=%d", req->ppid );
323 static void dump_init_process_reply( const struct init_process_request *req )
325 fprintf( stderr, " create_flags=%d,", req->create_flags );
326 fprintf( stderr, " start_flags=%d,", req->start_flags );
327 fprintf( stderr, " server_start=%08x,", req->server_start );
328 fprintf( stderr, " exe_file=%d,", req->exe_file );
329 fprintf( stderr, " hstdin=%d,", req->hstdin );
330 fprintf( stderr, " hstdout=%d,", req->hstdout );
331 fprintf( stderr, " hstderr=%d,", req->hstderr );
332 fprintf( stderr, " cmd_show=%d,", req->cmd_show );
333 fprintf( stderr, " filename=" );
334 cur_pos += dump_varargs_string( req );
337 static void dump_init_process_done_request( const struct init_process_done_request *req )
339 fprintf( stderr, " module=%p,", req->module );
340 fprintf( stderr, " entry=%p,", req->entry );
341 fprintf( stderr, " name=%p,", req->name );
342 fprintf( stderr, " exe_file=%d,", req->exe_file );
343 fprintf( stderr, " gui=%d", req->gui );
346 static void dump_init_process_done_reply( const struct init_process_done_request *req )
348 fprintf( stderr, " debugged=%d", req->debugged );
351 static void dump_init_thread_request( const struct init_thread_request *req )
353 fprintf( stderr, " unix_pid=%d,", req->unix_pid );
354 fprintf( stderr, " teb=%p,", req->teb );
355 fprintf( stderr, " entry=%p,", req->entry );
356 fprintf( stderr, " reply_fd=%d,", req->reply_fd );
357 fprintf( stderr, " wait_fd=%d", req->wait_fd );
360 static void dump_init_thread_reply( const struct init_thread_request *req )
362 fprintf( stderr, " pid=%p,", req->pid );
363 fprintf( stderr, " tid=%p,", req->tid );
364 fprintf( stderr, " boot=%d,", req->boot );
365 fprintf( stderr, " version=%d", req->version );
368 static void dump_set_thread_buffer_request( const struct set_thread_buffer_request *req )
370 fprintf( stderr, " fd=%d", req->fd );
373 static void dump_set_thread_buffer_reply( const struct set_thread_buffer_request *req )
375 fprintf( stderr, " offset=%08x,", req->offset );
376 fprintf( stderr, " size=%08x", req->size );
379 static void dump_terminate_process_request( const struct terminate_process_request *req )
381 fprintf( stderr, " handle=%d,", req->handle );
382 fprintf( stderr, " exit_code=%d", req->exit_code );
385 static void dump_terminate_process_reply( const struct terminate_process_request *req )
387 fprintf( stderr, " self=%d", req->self );
390 static void dump_terminate_thread_request( const struct terminate_thread_request *req )
392 fprintf( stderr, " handle=%d,", req->handle );
393 fprintf( stderr, " exit_code=%d", req->exit_code );
396 static void dump_terminate_thread_reply( const struct terminate_thread_request *req )
398 fprintf( stderr, " self=%d,", req->self );
399 fprintf( stderr, " last=%d", req->last );
402 static void dump_get_process_info_request( const struct get_process_info_request *req )
404 fprintf( stderr, " handle=%d", req->handle );
407 static void dump_get_process_info_reply( const struct get_process_info_request *req )
409 fprintf( stderr, " pid=%p,", req->pid );
410 fprintf( stderr, " debugged=%d,", req->debugged );
411 fprintf( stderr, " exit_code=%d,", req->exit_code );
412 fprintf( stderr, " priority=%d,", req->priority );
413 fprintf( stderr, " process_affinity=%d,", req->process_affinity );
414 fprintf( stderr, " system_affinity=%d", req->system_affinity );
417 static void dump_set_process_info_request( const struct set_process_info_request *req )
419 fprintf( stderr, " handle=%d,", req->handle );
420 fprintf( stderr, " mask=%d,", req->mask );
421 fprintf( stderr, " priority=%d,", req->priority );
422 fprintf( stderr, " affinity=%d", req->affinity );
425 static void dump_get_thread_info_request( const struct get_thread_info_request *req )
427 fprintf( stderr, " handle=%d,", req->handle );
428 fprintf( stderr, " tid_in=%p", req->tid_in );
431 static void dump_get_thread_info_reply( const struct get_thread_info_request *req )
433 fprintf( stderr, " tid=%p,", req->tid );
434 fprintf( stderr, " teb=%p,", req->teb );
435 fprintf( stderr, " exit_code=%d,", req->exit_code );
436 fprintf( stderr, " priority=%d", req->priority );
439 static void dump_set_thread_info_request( const struct set_thread_info_request *req )
441 fprintf( stderr, " handle=%d,", req->handle );
442 fprintf( stderr, " mask=%d,", req->mask );
443 fprintf( stderr, " priority=%d,", req->priority );
444 fprintf( stderr, " affinity=%d", req->affinity );
447 static void dump_suspend_thread_request( const struct suspend_thread_request *req )
449 fprintf( stderr, " handle=%d", req->handle );
452 static void dump_suspend_thread_reply( const struct suspend_thread_request *req )
454 fprintf( stderr, " count=%d", req->count );
457 static void dump_resume_thread_request( const struct resume_thread_request *req )
459 fprintf( stderr, " handle=%d", req->handle );
462 static void dump_resume_thread_reply( const struct resume_thread_request *req )
464 fprintf( stderr, " count=%d", req->count );
467 static void dump_load_dll_request( const struct load_dll_request *req )
469 fprintf( stderr, " handle=%d,", req->handle );
470 fprintf( stderr, " base=%p,", req->base );
471 fprintf( stderr, " dbg_offset=%d,", req->dbg_offset );
472 fprintf( stderr, " dbg_size=%d,", req->dbg_size );
473 fprintf( stderr, " name=%p", req->name );
476 static void dump_unload_dll_request( const struct unload_dll_request *req )
478 fprintf( stderr, " base=%p", req->base );
481 static void dump_queue_apc_request( const struct queue_apc_request *req )
483 fprintf( stderr, " handle=%d,", req->handle );
484 fprintf( stderr, " user=%d,", req->user );
485 fprintf( stderr, " func=%p,", req->func );
486 fprintf( stderr, " param=%p", req->param );
489 static void dump_get_apc_request( const struct get_apc_request *req )
491 fprintf( stderr, " alertable=%d", req->alertable );
494 static void dump_get_apc_reply( const struct get_apc_request *req )
496 fprintf( stderr, " func=%p,", req->func );
497 fprintf( stderr, " type=%d,", req->type );
498 fprintf( stderr, " args=" );
499 cur_pos += dump_varargs_ptrs( req );
502 static void dump_close_handle_request( const struct close_handle_request *req )
504 fprintf( stderr, " handle=%d", req->handle );
507 static void dump_close_handle_reply( const struct close_handle_request *req )
509 fprintf( stderr, " fd=%d", req->fd );
512 static void dump_set_handle_info_request( const struct set_handle_info_request *req )
514 fprintf( stderr, " handle=%d,", req->handle );
515 fprintf( stderr, " flags=%d,", req->flags );
516 fprintf( stderr, " mask=%d,", req->mask );
517 fprintf( stderr, " fd=%d", req->fd );
520 static void dump_set_handle_info_reply( const struct set_handle_info_request *req )
522 fprintf( stderr, " old_flags=%d,", req->old_flags );
523 fprintf( stderr, " cur_fd=%d", req->cur_fd );
526 static void dump_dup_handle_request( const struct dup_handle_request *req )
528 fprintf( stderr, " src_process=%d,", req->src_process );
529 fprintf( stderr, " src_handle=%d,", req->src_handle );
530 fprintf( stderr, " dst_process=%d,", req->dst_process );
531 fprintf( stderr, " access=%08x,", req->access );
532 fprintf( stderr, " inherit=%d,", req->inherit );
533 fprintf( stderr, " options=%d", req->options );
536 static void dump_dup_handle_reply( const struct dup_handle_request *req )
538 fprintf( stderr, " handle=%d,", req->handle );
539 fprintf( stderr, " fd=%d", req->fd );
542 static void dump_open_process_request( const struct open_process_request *req )
544 fprintf( stderr, " pid=%p,", req->pid );
545 fprintf( stderr, " access=%08x,", req->access );
546 fprintf( stderr, " inherit=%d", req->inherit );
549 static void dump_open_process_reply( const struct open_process_request *req )
551 fprintf( stderr, " handle=%d", req->handle );
554 static void dump_select_request( const struct select_request *req )
556 fprintf( stderr, " flags=%d,", req->flags );
557 fprintf( stderr, " cookie=%p,", req->cookie );
558 fprintf( stderr, " sec=%d,", req->sec );
559 fprintf( stderr, " usec=%d,", req->usec );
560 fprintf( stderr, " handles=" );
561 cur_pos += dump_varargs_handles( req );
564 static void dump_create_event_request( const struct create_event_request *req )
566 fprintf( stderr, " manual_reset=%d,", req->manual_reset );
567 fprintf( stderr, " initial_state=%d,", req->initial_state );
568 fprintf( stderr, " inherit=%d,", req->inherit );
569 fprintf( stderr, " name=" );
570 cur_pos += dump_varargs_unicode_str( req );
573 static void dump_create_event_reply( const struct create_event_request *req )
575 fprintf( stderr, " handle=%d", req->handle );
578 static void dump_event_op_request( const struct event_op_request *req )
580 fprintf( stderr, " handle=%d,", req->handle );
581 fprintf( stderr, " op=%d", req->op );
584 static void dump_open_event_request( const struct open_event_request *req )
586 fprintf( stderr, " access=%08x,", req->access );
587 fprintf( stderr, " inherit=%d,", req->inherit );
588 fprintf( stderr, " name=" );
589 cur_pos += dump_varargs_unicode_str( req );
592 static void dump_open_event_reply( const struct open_event_request *req )
594 fprintf( stderr, " handle=%d", req->handle );
597 static void dump_create_mutex_request( const struct create_mutex_request *req )
599 fprintf( stderr, " owned=%d,", req->owned );
600 fprintf( stderr, " inherit=%d,", req->inherit );
601 fprintf( stderr, " name=" );
602 cur_pos += dump_varargs_unicode_str( req );
605 static void dump_create_mutex_reply( const struct create_mutex_request *req )
607 fprintf( stderr, " handle=%d", req->handle );
610 static void dump_release_mutex_request( const struct release_mutex_request *req )
612 fprintf( stderr, " handle=%d", req->handle );
615 static void dump_open_mutex_request( const struct open_mutex_request *req )
617 fprintf( stderr, " access=%08x,", req->access );
618 fprintf( stderr, " inherit=%d,", req->inherit );
619 fprintf( stderr, " name=" );
620 cur_pos += dump_varargs_unicode_str( req );
623 static void dump_open_mutex_reply( const struct open_mutex_request *req )
625 fprintf( stderr, " handle=%d", req->handle );
628 static void dump_create_semaphore_request( const struct create_semaphore_request *req )
630 fprintf( stderr, " initial=%08x,", req->initial );
631 fprintf( stderr, " max=%08x,", req->max );
632 fprintf( stderr, " inherit=%d,", req->inherit );
633 fprintf( stderr, " name=" );
634 cur_pos += dump_varargs_unicode_str( req );
637 static void dump_create_semaphore_reply( const struct create_semaphore_request *req )
639 fprintf( stderr, " handle=%d", req->handle );
642 static void dump_release_semaphore_request( const struct release_semaphore_request *req )
644 fprintf( stderr, " handle=%d,", req->handle );
645 fprintf( stderr, " count=%08x", req->count );
648 static void dump_release_semaphore_reply( const struct release_semaphore_request *req )
650 fprintf( stderr, " prev_count=%08x", req->prev_count );
653 static void dump_open_semaphore_request( const struct open_semaphore_request *req )
655 fprintf( stderr, " access=%08x,", req->access );
656 fprintf( stderr, " inherit=%d,", req->inherit );
657 fprintf( stderr, " name=" );
658 cur_pos += dump_varargs_unicode_str( req );
661 static void dump_open_semaphore_reply( const struct open_semaphore_request *req )
663 fprintf( stderr, " handle=%d", req->handle );
666 static void dump_create_file_request( const struct create_file_request *req )
668 fprintf( stderr, " access=%08x,", req->access );
669 fprintf( stderr, " inherit=%d,", req->inherit );
670 fprintf( stderr, " sharing=%08x,", req->sharing );
671 fprintf( stderr, " create=%d,", req->create );
672 fprintf( stderr, " attrs=%08x,", req->attrs );
673 fprintf( stderr, " filename=" );
674 cur_pos += dump_varargs_string( req );
677 static void dump_create_file_reply( const struct create_file_request *req )
679 fprintf( stderr, " handle=%d", req->handle );
682 static void dump_alloc_file_handle_request( const struct alloc_file_handle_request *req )
684 fprintf( stderr, " access=%08x,", req->access );
685 fprintf( stderr, " fd=%d", req->fd );
688 static void dump_alloc_file_handle_reply( const struct alloc_file_handle_request *req )
690 fprintf( stderr, " handle=%d", req->handle );
693 static void dump_get_handle_fd_request( const struct get_handle_fd_request *req )
695 fprintf( stderr, " handle=%d,", req->handle );
696 fprintf( stderr, " access=%08x", req->access );
699 static void dump_get_handle_fd_reply( const struct get_handle_fd_request *req )
701 fprintf( stderr, " fd=%d", req->fd );
704 static void dump_set_file_pointer_request( const struct set_file_pointer_request *req )
706 fprintf( stderr, " handle=%d,", req->handle );
707 fprintf( stderr, " low=%d,", req->low );
708 fprintf( stderr, " high=%d,", req->high );
709 fprintf( stderr, " whence=%d", req->whence );
712 static void dump_set_file_pointer_reply( const struct set_file_pointer_request *req )
714 fprintf( stderr, " new_low=%d,", req->new_low );
715 fprintf( stderr, " new_high=%d", req->new_high );
718 static void dump_truncate_file_request( const struct truncate_file_request *req )
720 fprintf( stderr, " handle=%d", req->handle );
723 static void dump_set_file_time_request( const struct set_file_time_request *req )
725 fprintf( stderr, " handle=%d,", req->handle );
726 fprintf( stderr, " access_time=%ld,", req->access_time );
727 fprintf( stderr, " write_time=%ld", req->write_time );
730 static void dump_flush_file_request( const struct flush_file_request *req )
732 fprintf( stderr, " handle=%d", req->handle );
735 static void dump_get_file_info_request( const struct get_file_info_request *req )
737 fprintf( stderr, " handle=%d", req->handle );
740 static void dump_get_file_info_reply( const struct get_file_info_request *req )
742 fprintf( stderr, " type=%d,", req->type );
743 fprintf( stderr, " attr=%d,", req->attr );
744 fprintf( stderr, " access_time=%ld,", req->access_time );
745 fprintf( stderr, " write_time=%ld,", req->write_time );
746 fprintf( stderr, " size_high=%d,", req->size_high );
747 fprintf( stderr, " size_low=%d,", req->size_low );
748 fprintf( stderr, " links=%d,", req->links );
749 fprintf( stderr, " index_high=%d,", req->index_high );
750 fprintf( stderr, " index_low=%d,", req->index_low );
751 fprintf( stderr, " serial=%08x", req->serial );
754 static void dump_lock_file_request( const struct lock_file_request *req )
756 fprintf( stderr, " handle=%d,", req->handle );
757 fprintf( stderr, " offset_low=%08x,", req->offset_low );
758 fprintf( stderr, " offset_high=%08x,", req->offset_high );
759 fprintf( stderr, " count_low=%08x,", req->count_low );
760 fprintf( stderr, " count_high=%08x", req->count_high );
763 static void dump_unlock_file_request( const struct unlock_file_request *req )
765 fprintf( stderr, " handle=%d,", req->handle );
766 fprintf( stderr, " offset_low=%08x,", req->offset_low );
767 fprintf( stderr, " offset_high=%08x,", req->offset_high );
768 fprintf( stderr, " count_low=%08x,", req->count_low );
769 fprintf( stderr, " count_high=%08x", req->count_high );
772 static void dump_create_pipe_request( const struct create_pipe_request *req )
774 fprintf( stderr, " inherit=%d", req->inherit );
777 static void dump_create_pipe_reply( const struct create_pipe_request *req )
779 fprintf( stderr, " handle_read=%d,", req->handle_read );
780 fprintf( stderr, " handle_write=%d", req->handle_write );
783 static void dump_create_socket_request( const struct create_socket_request *req )
785 fprintf( stderr, " access=%08x,", req->access );
786 fprintf( stderr, " inherit=%d,", req->inherit );
787 fprintf( stderr, " family=%d,", req->family );
788 fprintf( stderr, " type=%d,", req->type );
789 fprintf( stderr, " protocol=%d", req->protocol );
792 static void dump_create_socket_reply( const struct create_socket_request *req )
794 fprintf( stderr, " handle=%d", req->handle );
797 static void dump_accept_socket_request( const struct accept_socket_request *req )
799 fprintf( stderr, " lhandle=%d,", req->lhandle );
800 fprintf( stderr, " access=%08x,", req->access );
801 fprintf( stderr, " inherit=%d", req->inherit );
804 static void dump_accept_socket_reply( const struct accept_socket_request *req )
806 fprintf( stderr, " handle=%d", req->handle );
809 static void dump_set_socket_event_request( const struct set_socket_event_request *req )
811 fprintf( stderr, " handle=%d,", req->handle );
812 fprintf( stderr, " mask=%08x,", req->mask );
813 fprintf( stderr, " event=%d", req->event );
816 static void dump_get_socket_event_request( const struct get_socket_event_request *req )
818 fprintf( stderr, " handle=%d,", req->handle );
819 fprintf( stderr, " service=%d,", req->service );
820 fprintf( stderr, " s_event=%d,", req->s_event );
821 fprintf( stderr, " c_event=%d", req->c_event );
824 static void dump_get_socket_event_reply( const struct get_socket_event_request *req )
826 fprintf( stderr, " mask=%08x,", req->mask );
827 fprintf( stderr, " pmask=%08x,", req->pmask );
828 fprintf( stderr, " state=%08x,", req->state );
829 fprintf( stderr, " errors=" );
830 cur_pos += dump_varargs_ints( req );
833 static void dump_enable_socket_event_request( const struct enable_socket_event_request *req )
835 fprintf( stderr, " handle=%d,", req->handle );
836 fprintf( stderr, " mask=%08x,", req->mask );
837 fprintf( stderr, " sstate=%08x,", req->sstate );
838 fprintf( stderr, " cstate=%08x", req->cstate );
841 static void dump_alloc_console_request( const struct alloc_console_request *req )
843 fprintf( stderr, " access=%08x,", req->access );
844 fprintf( stderr, " inherit=%d", req->inherit );
847 static void dump_alloc_console_reply( const struct alloc_console_request *req )
849 fprintf( stderr, " handle_in=%d,", req->handle_in );
850 fprintf( stderr, " handle_out=%d", req->handle_out );
853 static void dump_free_console_request( const struct free_console_request *req )
857 static void dump_open_console_request( const struct open_console_request *req )
859 fprintf( stderr, " output=%d,", req->output );
860 fprintf( stderr, " access=%08x,", req->access );
861 fprintf( stderr, " inherit=%d", req->inherit );
864 static void dump_open_console_reply( const struct open_console_request *req )
866 fprintf( stderr, " handle=%d", req->handle );
869 static void dump_set_console_fd_request( const struct set_console_fd_request *req )
871 fprintf( stderr, " handle=%d,", req->handle );
872 fprintf( stderr, " fd_in=%d,", req->fd_in );
873 fprintf( stderr, " fd_out=%d,", req->fd_out );
874 fprintf( stderr, " pid=%d", req->pid );
877 static void dump_get_console_mode_request( const struct get_console_mode_request *req )
879 fprintf( stderr, " handle=%d", req->handle );
882 static void dump_get_console_mode_reply( const struct get_console_mode_request *req )
884 fprintf( stderr, " mode=%d", req->mode );
887 static void dump_set_console_mode_request( const struct set_console_mode_request *req )
889 fprintf( stderr, " handle=%d,", req->handle );
890 fprintf( stderr, " mode=%d", req->mode );
893 static void dump_set_console_info_request( const struct set_console_info_request *req )
895 fprintf( stderr, " handle=%d,", req->handle );
896 fprintf( stderr, " mask=%d,", req->mask );
897 fprintf( stderr, " cursor_size=%d,", req->cursor_size );
898 fprintf( stderr, " cursor_visible=%d,", req->cursor_visible );
899 fprintf( stderr, " title=" );
900 cur_pos += dump_varargs_string( req );
903 static void dump_get_console_info_request( const struct get_console_info_request *req )
905 fprintf( stderr, " handle=%d", req->handle );
908 static void dump_get_console_info_reply( const struct get_console_info_request *req )
910 fprintf( stderr, " cursor_size=%d,", req->cursor_size );
911 fprintf( stderr, " cursor_visible=%d,", req->cursor_visible );
912 fprintf( stderr, " pid=%d,", req->pid );
913 fprintf( stderr, " title=" );
914 cur_pos += dump_varargs_string( req );
917 static void dump_write_console_input_request( const struct write_console_input_request *req )
919 fprintf( stderr, " handle=%d,", req->handle );
920 fprintf( stderr, " rec=" );
921 cur_pos += dump_varargs_input_records( req );
924 static void dump_write_console_input_reply( const struct write_console_input_request *req )
926 fprintf( stderr, " written=%d", req->written );
929 static void dump_read_console_input_request( const struct read_console_input_request *req )
931 fprintf( stderr, " handle=%d,", req->handle );
932 fprintf( stderr, " flush=%d", req->flush );
935 static void dump_read_console_input_reply( const struct read_console_input_request *req )
937 fprintf( stderr, " read=%d,", req->read );
938 fprintf( stderr, " rec=" );
939 cur_pos += dump_varargs_input_records( req );
942 static void dump_create_change_notification_request( const struct create_change_notification_request *req )
944 fprintf( stderr, " subtree=%d,", req->subtree );
945 fprintf( stderr, " filter=%d", req->filter );
948 static void dump_create_change_notification_reply( const struct create_change_notification_request *req )
950 fprintf( stderr, " handle=%d", req->handle );
953 static void dump_create_mapping_request( const struct create_mapping_request *req )
955 fprintf( stderr, " size_high=%d,", req->size_high );
956 fprintf( stderr, " size_low=%d,", req->size_low );
957 fprintf( stderr, " protect=%d,", req->protect );
958 fprintf( stderr, " inherit=%d,", req->inherit );
959 fprintf( stderr, " file_handle=%d,", req->file_handle );
960 fprintf( stderr, " name=" );
961 cur_pos += dump_varargs_unicode_str( req );
964 static void dump_create_mapping_reply( const struct create_mapping_request *req )
966 fprintf( stderr, " handle=%d", req->handle );
969 static void dump_open_mapping_request( const struct open_mapping_request *req )
971 fprintf( stderr, " access=%08x,", req->access );
972 fprintf( stderr, " inherit=%d,", req->inherit );
973 fprintf( stderr, " name=" );
974 cur_pos += dump_varargs_unicode_str( req );
977 static void dump_open_mapping_reply( const struct open_mapping_request *req )
979 fprintf( stderr, " handle=%d", req->handle );
982 static void dump_get_mapping_info_request( const struct get_mapping_info_request *req )
984 fprintf( stderr, " handle=%d", req->handle );
987 static void dump_get_mapping_info_reply( const struct get_mapping_info_request *req )
989 fprintf( stderr, " size_high=%d,", req->size_high );
990 fprintf( stderr, " size_low=%d,", req->size_low );
991 fprintf( stderr, " protect=%d,", req->protect );
992 fprintf( stderr, " header_size=%d,", req->header_size );
993 fprintf( stderr, " base=%p,", req->base );
994 fprintf( stderr, " shared_file=%d,", req->shared_file );
995 fprintf( stderr, " shared_size=%d", req->shared_size );
998 static void dump_create_device_request( const struct create_device_request *req )
1000 fprintf( stderr, " access=%08x,", req->access );
1001 fprintf( stderr, " inherit=%d,", req->inherit );
1002 fprintf( stderr, " id=%d", req->id );
1005 static void dump_create_device_reply( const struct create_device_request *req )
1007 fprintf( stderr, " handle=%d", req->handle );
1010 static void dump_create_snapshot_request( const struct create_snapshot_request *req )
1012 fprintf( stderr, " inherit=%d,", req->inherit );
1013 fprintf( stderr, " flags=%d,", req->flags );
1014 fprintf( stderr, " pid=%p", req->pid );
1017 static void dump_create_snapshot_reply( const struct create_snapshot_request *req )
1019 fprintf( stderr, " handle=%d", req->handle );
1022 static void dump_next_process_request( const struct next_process_request *req )
1024 fprintf( stderr, " handle=%d,", req->handle );
1025 fprintf( stderr, " reset=%d", req->reset );
1028 static void dump_next_process_reply( const struct next_process_request *req )
1030 fprintf( stderr, " count=%d,", req->count );
1031 fprintf( stderr, " pid=%p,", req->pid );
1032 fprintf( stderr, " threads=%d,", req->threads );
1033 fprintf( stderr, " priority=%d", req->priority );
1036 static void dump_next_thread_request( const struct next_thread_request *req )
1038 fprintf( stderr, " handle=%d,", req->handle );
1039 fprintf( stderr, " reset=%d", req->reset );
1042 static void dump_next_thread_reply( const struct next_thread_request *req )
1044 fprintf( stderr, " count=%d,", req->count );
1045 fprintf( stderr, " pid=%p,", req->pid );
1046 fprintf( stderr, " tid=%p,", req->tid );
1047 fprintf( stderr, " base_pri=%d,", req->base_pri );
1048 fprintf( stderr, " delta_pri=%d", req->delta_pri );
1051 static void dump_next_module_request( const struct next_module_request *req )
1053 fprintf( stderr, " handle=%d,", req->handle );
1054 fprintf( stderr, " reset=%d", req->reset );
1057 static void dump_next_module_reply( const struct next_module_request *req )
1059 fprintf( stderr, " pid=%p,", req->pid );
1060 fprintf( stderr, " base=%p", req->base );
1063 static void dump_wait_debug_event_request( const struct wait_debug_event_request *req )
1065 fprintf( stderr, " get_handle=%d", req->get_handle );
1068 static void dump_wait_debug_event_reply( const struct wait_debug_event_request *req )
1070 fprintf( stderr, " pid=%p,", req->pid );
1071 fprintf( stderr, " tid=%p,", req->tid );
1072 fprintf( stderr, " wait=%d,", req->wait );
1073 fprintf( stderr, " event=" );
1074 cur_pos += dump_varargs_debug_event( req );
1077 static void dump_queue_exception_event_request( const struct queue_exception_event_request *req )
1079 fprintf( stderr, " first=%d,", req->first );
1080 fprintf( stderr, " record=" );
1081 cur_pos += dump_varargs_exc_event( req );
1084 static void dump_queue_exception_event_reply( const struct queue_exception_event_request *req )
1086 fprintf( stderr, " handle=%d", req->handle );
1089 static void dump_get_exception_status_request( const struct get_exception_status_request *req )
1093 static void dump_get_exception_status_reply( const struct get_exception_status_request *req )
1095 fprintf( stderr, " handle=%d,", req->handle );
1096 fprintf( stderr, " status=%d,", req->status );
1097 fprintf( stderr, " context=" );
1098 cur_pos += dump_varargs_context( req );
1101 static void dump_output_debug_string_request( const struct output_debug_string_request *req )
1103 fprintf( stderr, " string=%p,", req->string );
1104 fprintf( stderr, " unicode=%d,", req->unicode );
1105 fprintf( stderr, " length=%d", req->length );
1108 static void dump_continue_debug_event_request( const struct continue_debug_event_request *req )
1110 fprintf( stderr, " pid=%p,", req->pid );
1111 fprintf( stderr, " tid=%p,", req->tid );
1112 fprintf( stderr, " status=%d", req->status );
1115 static void dump_debug_process_request( const struct debug_process_request *req )
1117 fprintf( stderr, " pid=%p", req->pid );
1120 static void dump_read_process_memory_request( const struct read_process_memory_request *req )
1122 fprintf( stderr, " handle=%d,", req->handle );
1123 fprintf( stderr, " addr=%p,", req->addr );
1124 fprintf( stderr, " len=%d", req->len );
1127 static void dump_read_process_memory_reply( const struct read_process_memory_request *req )
1129 fprintf( stderr, " data=" );
1130 cur_pos += dump_varargs_bytes( req );
1133 static void dump_write_process_memory_request( const struct write_process_memory_request *req )
1135 fprintf( stderr, " handle=%d,", req->handle );
1136 fprintf( stderr, " addr=%p,", req->addr );
1137 fprintf( stderr, " len=%d,", req->len );
1138 fprintf( stderr, " first_mask=%08x,", req->first_mask );
1139 fprintf( stderr, " last_mask=%08x,", req->last_mask );
1140 fprintf( stderr, " data=" );
1141 cur_pos += dump_varargs_bytes( req );
1144 static void dump_create_key_request( const struct create_key_request *req )
1146 fprintf( stderr, " parent=%d,", req->parent );
1147 fprintf( stderr, " access=%08x,", req->access );
1148 fprintf( stderr, " options=%08x,", req->options );
1149 fprintf( stderr, " modif=%ld,", req->modif );
1150 fprintf( stderr, " name=" );
1151 cur_pos += dump_varargs_unicode_len_str( req );
1152 fputc( ',', stderr );
1153 fprintf( stderr, " class=" );
1154 cur_pos += dump_varargs_unicode_str( req );
1157 static void dump_create_key_reply( const struct create_key_request *req )
1159 fprintf( stderr, " hkey=%d,", req->hkey );
1160 fprintf( stderr, " created=%d", req->created );
1163 static void dump_open_key_request( const struct open_key_request *req )
1165 fprintf( stderr, " parent=%d,", req->parent );
1166 fprintf( stderr, " access=%08x,", req->access );
1167 fprintf( stderr, " name=" );
1168 cur_pos += dump_varargs_unicode_str( req );
1171 static void dump_open_key_reply( const struct open_key_request *req )
1173 fprintf( stderr, " hkey=%d", req->hkey );
1176 static void dump_delete_key_request( const struct delete_key_request *req )
1178 fprintf( stderr, " hkey=%d", req->hkey );
1181 static void dump_enum_key_request( const struct enum_key_request *req )
1183 fprintf( stderr, " hkey=%d,", req->hkey );
1184 fprintf( stderr, " index=%d,", req->index );
1185 fprintf( stderr, " full=%d", req->full );
1188 static void dump_enum_key_reply( const struct enum_key_request *req )
1190 fprintf( stderr, " subkeys=%d,", req->subkeys );
1191 fprintf( stderr, " max_subkey=%d,", req->max_subkey );
1192 fprintf( stderr, " max_class=%d,", req->max_class );
1193 fprintf( stderr, " values=%d,", req->values );
1194 fprintf( stderr, " max_value=%d,", req->max_value );
1195 fprintf( stderr, " max_data=%d,", req->max_data );
1196 fprintf( stderr, " modif=%ld,", req->modif );
1197 fprintf( stderr, " name=" );
1198 cur_pos += dump_varargs_unicode_len_str( req );
1199 fputc( ',', stderr );
1200 fprintf( stderr, " class=" );
1201 cur_pos += dump_varargs_unicode_str( req );
1204 static void dump_set_key_value_request( const struct set_key_value_request *req )
1206 fprintf( stderr, " hkey=%d,", req->hkey );
1207 fprintf( stderr, " type=%d,", req->type );
1208 fprintf( stderr, " total=%08x,", req->total );
1209 fprintf( stderr, " offset=%08x,", req->offset );
1210 fprintf( stderr, " name=" );
1211 cur_pos += dump_varargs_unicode_len_str( req );
1212 fputc( ',', stderr );
1213 fprintf( stderr, " data=" );
1214 cur_pos += dump_varargs_bytes( req );
1217 static void dump_get_key_value_request( const struct get_key_value_request *req )
1219 fprintf( stderr, " hkey=%d,", req->hkey );
1220 fprintf( stderr, " offset=%08x,", req->offset );
1221 fprintf( stderr, " name=" );
1222 cur_pos += dump_varargs_unicode_len_str( req );
1225 static void dump_get_key_value_reply( const struct get_key_value_request *req )
1227 fprintf( stderr, " type=%d,", req->type );
1228 fprintf( stderr, " len=%d,", req->len );
1229 fprintf( stderr, " data=" );
1230 cur_pos += dump_varargs_bytes( req );
1233 static void dump_enum_key_value_request( const struct enum_key_value_request *req )
1235 fprintf( stderr, " hkey=%d,", req->hkey );
1236 fprintf( stderr, " index=%d,", req->index );
1237 fprintf( stderr, " offset=%08x", req->offset );
1240 static void dump_enum_key_value_reply( const struct enum_key_value_request *req )
1242 fprintf( stderr, " type=%d,", req->type );
1243 fprintf( stderr, " len=%d,", req->len );
1244 fprintf( stderr, " name=" );
1245 cur_pos += dump_varargs_unicode_len_str( req );
1246 fputc( ',', stderr );
1247 fprintf( stderr, " data=" );
1248 cur_pos += dump_varargs_bytes( req );
1251 static void dump_delete_key_value_request( const struct delete_key_value_request *req )
1253 fprintf( stderr, " hkey=%d,", req->hkey );
1254 fprintf( stderr, " name=" );
1255 cur_pos += dump_varargs_unicode_str( req );
1258 static void dump_load_registry_request( const struct load_registry_request *req )
1260 fprintf( stderr, " hkey=%d,", req->hkey );
1261 fprintf( stderr, " file=%d,", req->file );
1262 fprintf( stderr, " name=" );
1263 cur_pos += dump_varargs_unicode_str( req );
1266 static void dump_save_registry_request( const struct save_registry_request *req )
1268 fprintf( stderr, " hkey=%d,", req->hkey );
1269 fprintf( stderr, " file=%d", req->file );
1272 static void dump_save_registry_atexit_request( const struct save_registry_atexit_request *req )
1274 fprintf( stderr, " hkey=%d,", req->hkey );
1275 fprintf( stderr, " file=" );
1276 cur_pos += dump_varargs_string( req );
1279 static void dump_set_registry_levels_request( const struct set_registry_levels_request *req )
1281 fprintf( stderr, " current=%d,", req->current );
1282 fprintf( stderr, " saving=%d,", req->saving );
1283 fprintf( stderr, " period=%d", req->period );
1286 static void dump_create_timer_request( const struct create_timer_request *req )
1288 fprintf( stderr, " inherit=%d,", req->inherit );
1289 fprintf( stderr, " manual=%d,", req->manual );
1290 fprintf( stderr, " name=" );
1291 cur_pos += dump_varargs_unicode_str( req );
1294 static void dump_create_timer_reply( const struct create_timer_request *req )
1296 fprintf( stderr, " handle=%d", req->handle );
1299 static void dump_open_timer_request( const struct open_timer_request *req )
1301 fprintf( stderr, " access=%08x,", req->access );
1302 fprintf( stderr, " inherit=%d,", req->inherit );
1303 fprintf( stderr, " name=" );
1304 cur_pos += dump_varargs_unicode_str( req );
1307 static void dump_open_timer_reply( const struct open_timer_request *req )
1309 fprintf( stderr, " handle=%d", req->handle );
1312 static void dump_set_timer_request( const struct set_timer_request *req )
1314 fprintf( stderr, " handle=%d,", req->handle );
1315 fprintf( stderr, " sec=%d,", req->sec );
1316 fprintf( stderr, " usec=%d,", req->usec );
1317 fprintf( stderr, " period=%d,", req->period );
1318 fprintf( stderr, " callback=%p,", req->callback );
1319 fprintf( stderr, " arg=%p", req->arg );
1322 static void dump_cancel_timer_request( const struct cancel_timer_request *req )
1324 fprintf( stderr, " handle=%d", req->handle );
1327 static void dump_get_thread_context_request( const struct get_thread_context_request *req )
1329 fprintf( stderr, " handle=%d,", req->handle );
1330 fprintf( stderr, " flags=%08x", req->flags );
1333 static void dump_get_thread_context_reply( const struct get_thread_context_request *req )
1335 fprintf( stderr, " context=" );
1336 cur_pos += dump_varargs_context( req );
1339 static void dump_set_thread_context_request( const struct set_thread_context_request *req )
1341 fprintf( stderr, " handle=%d,", req->handle );
1342 fprintf( stderr, " flags=%08x,", req->flags );
1343 fprintf( stderr, " context=" );
1344 cur_pos += dump_varargs_context( req );
1347 static void dump_get_selector_entry_request( const struct get_selector_entry_request *req )
1349 fprintf( stderr, " handle=%d,", req->handle );
1350 fprintf( stderr, " entry=%d", req->entry );
1353 static void dump_get_selector_entry_reply( const struct get_selector_entry_request *req )
1355 fprintf( stderr, " base=%08x,", req->base );
1356 fprintf( stderr, " limit=%08x,", req->limit );
1357 fprintf( stderr, " flags=%02x", req->flags );
1360 static void dump_add_atom_request( const struct add_atom_request *req )
1362 fprintf( stderr, " local=%d,", req->local );
1363 fprintf( stderr, " name=" );
1364 cur_pos += dump_varargs_unicode_str( req );
1367 static void dump_add_atom_reply( const struct add_atom_request *req )
1369 fprintf( stderr, " atom=%d", req->atom );
1372 static void dump_delete_atom_request( const struct delete_atom_request *req )
1374 fprintf( stderr, " atom=%d,", req->atom );
1375 fprintf( stderr, " local=%d", req->local );
1378 static void dump_find_atom_request( const struct find_atom_request *req )
1380 fprintf( stderr, " local=%d,", req->local );
1381 fprintf( stderr, " name=" );
1382 cur_pos += dump_varargs_unicode_str( req );
1385 static void dump_find_atom_reply( const struct find_atom_request *req )
1387 fprintf( stderr, " atom=%d", req->atom );
1390 static void dump_get_atom_name_request( const struct get_atom_name_request *req )
1392 fprintf( stderr, " atom=%d,", req->atom );
1393 fprintf( stderr, " local=%d", req->local );
1396 static void dump_get_atom_name_reply( const struct get_atom_name_request *req )
1398 fprintf( stderr, " count=%d,", req->count );
1399 fprintf( stderr, " name=" );
1400 cur_pos += dump_varargs_unicode_str( req );
1403 static void dump_init_atom_table_request( const struct init_atom_table_request *req )
1405 fprintf( stderr, " entries=%d", req->entries );
1408 static void dump_get_msg_queue_request( const struct get_msg_queue_request *req )
1412 static void dump_get_msg_queue_reply( const struct get_msg_queue_request *req )
1414 fprintf( stderr, " handle=%d", req->handle );
1417 static void dump_wake_queue_request( const struct wake_queue_request *req )
1419 fprintf( stderr, " handle=%d,", req->handle );
1420 fprintf( stderr, " bits=%08x", req->bits );
1423 static void dump_wait_input_idle_request( const struct wait_input_idle_request *req )
1425 fprintf( stderr, " handle=%d,", req->handle );
1426 fprintf( stderr, " timeout=%d", req->timeout );
1429 static void dump_wait_input_idle_reply( const struct wait_input_idle_request *req )
1431 fprintf( stderr, " event=%d", req->event );
1434 static void dump_create_serial_request( const struct create_serial_request *req )
1436 fprintf( stderr, " access=%08x,", req->access );
1437 fprintf( stderr, " inherit=%d,", req->inherit );
1438 fprintf( stderr, " sharing=%08x,", req->sharing );
1439 fprintf( stderr, " name=" );
1440 cur_pos += dump_varargs_string( req );
1443 static void dump_create_serial_reply( const struct create_serial_request *req )
1445 fprintf( stderr, " handle=%d", req->handle );
1448 static void dump_get_serial_info_request( const struct get_serial_info_request *req )
1450 fprintf( stderr, " handle=%d", req->handle );
1453 static void dump_get_serial_info_reply( const struct get_serial_info_request *req )
1455 fprintf( stderr, " readinterval=%08x,", req->readinterval );
1456 fprintf( stderr, " readconst=%08x,", req->readconst );
1457 fprintf( stderr, " readmult=%08x,", req->readmult );
1458 fprintf( stderr, " writeconst=%08x,", req->writeconst );
1459 fprintf( stderr, " writemult=%08x,", req->writemult );
1460 fprintf( stderr, " eventmask=%08x,", req->eventmask );
1461 fprintf( stderr, " commerror=%08x", req->commerror );
1464 static void dump_set_serial_info_request( const struct set_serial_info_request *req )
1466 fprintf( stderr, " handle=%d,", req->handle );
1467 fprintf( stderr, " flags=%d,", req->flags );
1468 fprintf( stderr, " readinterval=%08x,", req->readinterval );
1469 fprintf( stderr, " readconst=%08x,", req->readconst );
1470 fprintf( stderr, " readmult=%08x,", req->readmult );
1471 fprintf( stderr, " writeconst=%08x,", req->writeconst );
1472 fprintf( stderr, " writemult=%08x,", req->writemult );
1473 fprintf( stderr, " eventmask=%08x,", req->eventmask );
1474 fprintf( stderr, " commerror=%08x", req->commerror );
1477 static void dump_create_async_request( const struct create_async_request *req )
1479 fprintf( stderr, " file_handle=%d,", req->file_handle );
1480 fprintf( stderr, " count=%d,", req->count );
1481 fprintf( stderr, " type=%d", req->type );
1484 static void dump_create_async_reply( const struct create_async_request *req )
1486 fprintf( stderr, " timeout=%d", req->timeout );
1489 static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
1490 (dump_func)dump_new_process_request,
1491 (dump_func)dump_get_new_process_info_request,
1492 (dump_func)dump_new_thread_request,
1493 (dump_func)dump_boot_done_request,
1494 (dump_func)dump_init_process_request,
1495 (dump_func)dump_init_process_done_request,
1496 (dump_func)dump_init_thread_request,
1497 (dump_func)dump_set_thread_buffer_request,
1498 (dump_func)dump_terminate_process_request,
1499 (dump_func)dump_terminate_thread_request,
1500 (dump_func)dump_get_process_info_request,
1501 (dump_func)dump_set_process_info_request,
1502 (dump_func)dump_get_thread_info_request,
1503 (dump_func)dump_set_thread_info_request,
1504 (dump_func)dump_suspend_thread_request,
1505 (dump_func)dump_resume_thread_request,
1506 (dump_func)dump_load_dll_request,
1507 (dump_func)dump_unload_dll_request,
1508 (dump_func)dump_queue_apc_request,
1509 (dump_func)dump_get_apc_request,
1510 (dump_func)dump_close_handle_request,
1511 (dump_func)dump_set_handle_info_request,
1512 (dump_func)dump_dup_handle_request,
1513 (dump_func)dump_open_process_request,
1514 (dump_func)dump_select_request,
1515 (dump_func)dump_create_event_request,
1516 (dump_func)dump_event_op_request,
1517 (dump_func)dump_open_event_request,
1518 (dump_func)dump_create_mutex_request,
1519 (dump_func)dump_release_mutex_request,
1520 (dump_func)dump_open_mutex_request,
1521 (dump_func)dump_create_semaphore_request,
1522 (dump_func)dump_release_semaphore_request,
1523 (dump_func)dump_open_semaphore_request,
1524 (dump_func)dump_create_file_request,
1525 (dump_func)dump_alloc_file_handle_request,
1526 (dump_func)dump_get_handle_fd_request,
1527 (dump_func)dump_set_file_pointer_request,
1528 (dump_func)dump_truncate_file_request,
1529 (dump_func)dump_set_file_time_request,
1530 (dump_func)dump_flush_file_request,
1531 (dump_func)dump_get_file_info_request,
1532 (dump_func)dump_lock_file_request,
1533 (dump_func)dump_unlock_file_request,
1534 (dump_func)dump_create_pipe_request,
1535 (dump_func)dump_create_socket_request,
1536 (dump_func)dump_accept_socket_request,
1537 (dump_func)dump_set_socket_event_request,
1538 (dump_func)dump_get_socket_event_request,
1539 (dump_func)dump_enable_socket_event_request,
1540 (dump_func)dump_alloc_console_request,
1541 (dump_func)dump_free_console_request,
1542 (dump_func)dump_open_console_request,
1543 (dump_func)dump_set_console_fd_request,
1544 (dump_func)dump_get_console_mode_request,
1545 (dump_func)dump_set_console_mode_request,
1546 (dump_func)dump_set_console_info_request,
1547 (dump_func)dump_get_console_info_request,
1548 (dump_func)dump_write_console_input_request,
1549 (dump_func)dump_read_console_input_request,
1550 (dump_func)dump_create_change_notification_request,
1551 (dump_func)dump_create_mapping_request,
1552 (dump_func)dump_open_mapping_request,
1553 (dump_func)dump_get_mapping_info_request,
1554 (dump_func)dump_create_device_request,
1555 (dump_func)dump_create_snapshot_request,
1556 (dump_func)dump_next_process_request,
1557 (dump_func)dump_next_thread_request,
1558 (dump_func)dump_next_module_request,
1559 (dump_func)dump_wait_debug_event_request,
1560 (dump_func)dump_queue_exception_event_request,
1561 (dump_func)dump_get_exception_status_request,
1562 (dump_func)dump_output_debug_string_request,
1563 (dump_func)dump_continue_debug_event_request,
1564 (dump_func)dump_debug_process_request,
1565 (dump_func)dump_read_process_memory_request,
1566 (dump_func)dump_write_process_memory_request,
1567 (dump_func)dump_create_key_request,
1568 (dump_func)dump_open_key_request,
1569 (dump_func)dump_delete_key_request,
1570 (dump_func)dump_enum_key_request,
1571 (dump_func)dump_set_key_value_request,
1572 (dump_func)dump_get_key_value_request,
1573 (dump_func)dump_enum_key_value_request,
1574 (dump_func)dump_delete_key_value_request,
1575 (dump_func)dump_load_registry_request,
1576 (dump_func)dump_save_registry_request,
1577 (dump_func)dump_save_registry_atexit_request,
1578 (dump_func)dump_set_registry_levels_request,
1579 (dump_func)dump_create_timer_request,
1580 (dump_func)dump_open_timer_request,
1581 (dump_func)dump_set_timer_request,
1582 (dump_func)dump_cancel_timer_request,
1583 (dump_func)dump_get_thread_context_request,
1584 (dump_func)dump_set_thread_context_request,
1585 (dump_func)dump_get_selector_entry_request,
1586 (dump_func)dump_add_atom_request,
1587 (dump_func)dump_delete_atom_request,
1588 (dump_func)dump_find_atom_request,
1589 (dump_func)dump_get_atom_name_request,
1590 (dump_func)dump_init_atom_table_request,
1591 (dump_func)dump_get_msg_queue_request,
1592 (dump_func)dump_wake_queue_request,
1593 (dump_func)dump_wait_input_idle_request,
1594 (dump_func)dump_create_serial_request,
1595 (dump_func)dump_get_serial_info_request,
1596 (dump_func)dump_set_serial_info_request,
1597 (dump_func)dump_create_async_request,
1600 static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
1601 (dump_func)dump_new_process_reply,
1602 (dump_func)dump_get_new_process_info_reply,
1603 (dump_func)dump_new_thread_reply,
1604 (dump_func)0,
1605 (dump_func)dump_init_process_reply,
1606 (dump_func)dump_init_process_done_reply,
1607 (dump_func)dump_init_thread_reply,
1608 (dump_func)dump_set_thread_buffer_reply,
1609 (dump_func)dump_terminate_process_reply,
1610 (dump_func)dump_terminate_thread_reply,
1611 (dump_func)dump_get_process_info_reply,
1612 (dump_func)0,
1613 (dump_func)dump_get_thread_info_reply,
1614 (dump_func)0,
1615 (dump_func)dump_suspend_thread_reply,
1616 (dump_func)dump_resume_thread_reply,
1617 (dump_func)0,
1618 (dump_func)0,
1619 (dump_func)0,
1620 (dump_func)dump_get_apc_reply,
1621 (dump_func)dump_close_handle_reply,
1622 (dump_func)dump_set_handle_info_reply,
1623 (dump_func)dump_dup_handle_reply,
1624 (dump_func)dump_open_process_reply,
1625 (dump_func)0,
1626 (dump_func)dump_create_event_reply,
1627 (dump_func)0,
1628 (dump_func)dump_open_event_reply,
1629 (dump_func)dump_create_mutex_reply,
1630 (dump_func)0,
1631 (dump_func)dump_open_mutex_reply,
1632 (dump_func)dump_create_semaphore_reply,
1633 (dump_func)dump_release_semaphore_reply,
1634 (dump_func)dump_open_semaphore_reply,
1635 (dump_func)dump_create_file_reply,
1636 (dump_func)dump_alloc_file_handle_reply,
1637 (dump_func)dump_get_handle_fd_reply,
1638 (dump_func)dump_set_file_pointer_reply,
1639 (dump_func)0,
1640 (dump_func)0,
1641 (dump_func)0,
1642 (dump_func)dump_get_file_info_reply,
1643 (dump_func)0,
1644 (dump_func)0,
1645 (dump_func)dump_create_pipe_reply,
1646 (dump_func)dump_create_socket_reply,
1647 (dump_func)dump_accept_socket_reply,
1648 (dump_func)0,
1649 (dump_func)dump_get_socket_event_reply,
1650 (dump_func)0,
1651 (dump_func)dump_alloc_console_reply,
1652 (dump_func)0,
1653 (dump_func)dump_open_console_reply,
1654 (dump_func)0,
1655 (dump_func)dump_get_console_mode_reply,
1656 (dump_func)0,
1657 (dump_func)0,
1658 (dump_func)dump_get_console_info_reply,
1659 (dump_func)dump_write_console_input_reply,
1660 (dump_func)dump_read_console_input_reply,
1661 (dump_func)dump_create_change_notification_reply,
1662 (dump_func)dump_create_mapping_reply,
1663 (dump_func)dump_open_mapping_reply,
1664 (dump_func)dump_get_mapping_info_reply,
1665 (dump_func)dump_create_device_reply,
1666 (dump_func)dump_create_snapshot_reply,
1667 (dump_func)dump_next_process_reply,
1668 (dump_func)dump_next_thread_reply,
1669 (dump_func)dump_next_module_reply,
1670 (dump_func)dump_wait_debug_event_reply,
1671 (dump_func)dump_queue_exception_event_reply,
1672 (dump_func)dump_get_exception_status_reply,
1673 (dump_func)0,
1674 (dump_func)0,
1675 (dump_func)0,
1676 (dump_func)dump_read_process_memory_reply,
1677 (dump_func)0,
1678 (dump_func)dump_create_key_reply,
1679 (dump_func)dump_open_key_reply,
1680 (dump_func)0,
1681 (dump_func)dump_enum_key_reply,
1682 (dump_func)0,
1683 (dump_func)dump_get_key_value_reply,
1684 (dump_func)dump_enum_key_value_reply,
1685 (dump_func)0,
1686 (dump_func)0,
1687 (dump_func)0,
1688 (dump_func)0,
1689 (dump_func)0,
1690 (dump_func)dump_create_timer_reply,
1691 (dump_func)dump_open_timer_reply,
1692 (dump_func)0,
1693 (dump_func)0,
1694 (dump_func)dump_get_thread_context_reply,
1695 (dump_func)0,
1696 (dump_func)dump_get_selector_entry_reply,
1697 (dump_func)dump_add_atom_reply,
1698 (dump_func)0,
1699 (dump_func)dump_find_atom_reply,
1700 (dump_func)dump_get_atom_name_reply,
1701 (dump_func)0,
1702 (dump_func)dump_get_msg_queue_reply,
1703 (dump_func)0,
1704 (dump_func)dump_wait_input_idle_reply,
1705 (dump_func)dump_create_serial_reply,
1706 (dump_func)dump_get_serial_info_reply,
1707 (dump_func)0,
1708 (dump_func)dump_create_async_reply,
1711 static const char * const req_names[REQ_NB_REQUESTS] = {
1712 "new_process",
1713 "get_new_process_info",
1714 "new_thread",
1715 "boot_done",
1716 "init_process",
1717 "init_process_done",
1718 "init_thread",
1719 "set_thread_buffer",
1720 "terminate_process",
1721 "terminate_thread",
1722 "get_process_info",
1723 "set_process_info",
1724 "get_thread_info",
1725 "set_thread_info",
1726 "suspend_thread",
1727 "resume_thread",
1728 "load_dll",
1729 "unload_dll",
1730 "queue_apc",
1731 "get_apc",
1732 "close_handle",
1733 "set_handle_info",
1734 "dup_handle",
1735 "open_process",
1736 "select",
1737 "create_event",
1738 "event_op",
1739 "open_event",
1740 "create_mutex",
1741 "release_mutex",
1742 "open_mutex",
1743 "create_semaphore",
1744 "release_semaphore",
1745 "open_semaphore",
1746 "create_file",
1747 "alloc_file_handle",
1748 "get_handle_fd",
1749 "set_file_pointer",
1750 "truncate_file",
1751 "set_file_time",
1752 "flush_file",
1753 "get_file_info",
1754 "lock_file",
1755 "unlock_file",
1756 "create_pipe",
1757 "create_socket",
1758 "accept_socket",
1759 "set_socket_event",
1760 "get_socket_event",
1761 "enable_socket_event",
1762 "alloc_console",
1763 "free_console",
1764 "open_console",
1765 "set_console_fd",
1766 "get_console_mode",
1767 "set_console_mode",
1768 "set_console_info",
1769 "get_console_info",
1770 "write_console_input",
1771 "read_console_input",
1772 "create_change_notification",
1773 "create_mapping",
1774 "open_mapping",
1775 "get_mapping_info",
1776 "create_device",
1777 "create_snapshot",
1778 "next_process",
1779 "next_thread",
1780 "next_module",
1781 "wait_debug_event",
1782 "queue_exception_event",
1783 "get_exception_status",
1784 "output_debug_string",
1785 "continue_debug_event",
1786 "debug_process",
1787 "read_process_memory",
1788 "write_process_memory",
1789 "create_key",
1790 "open_key",
1791 "delete_key",
1792 "enum_key",
1793 "set_key_value",
1794 "get_key_value",
1795 "enum_key_value",
1796 "delete_key_value",
1797 "load_registry",
1798 "save_registry",
1799 "save_registry_atexit",
1800 "set_registry_levels",
1801 "create_timer",
1802 "open_timer",
1803 "set_timer",
1804 "cancel_timer",
1805 "get_thread_context",
1806 "set_thread_context",
1807 "get_selector_entry",
1808 "add_atom",
1809 "delete_atom",
1810 "find_atom",
1811 "get_atom_name",
1812 "init_atom_table",
1813 "get_msg_queue",
1814 "wake_queue",
1815 "wait_input_idle",
1816 "create_serial",
1817 "get_serial_info",
1818 "set_serial_info",
1819 "create_async",
1822 /* ### make_requests end ### */
1823 /* Everything above this line is generated automatically by tools/make_requests */
1825 static const char *get_status_name( unsigned int status )
1827 #define NAME(status) { #status, STATUS_##status }
1828 static const struct
1830 const char *name;
1831 unsigned int value;
1832 } status_names[] =
1834 NAME(ACCESS_DENIED),
1835 NAME(ACCESS_VIOLATION),
1836 NAME(BUFFER_OVERFLOW),
1837 NAME(CHILD_MUST_BE_VOLATILE),
1838 NAME(DIRECTORY_NOT_EMPTY),
1839 NAME(DISK_FULL),
1840 NAME(FILE_LOCK_CONFLICT),
1841 NAME(INVALID_FILE_FOR_SECTION),
1842 NAME(INVALID_HANDLE),
1843 NAME(INVALID_PARAMETER),
1844 NAME(KEY_DELETED),
1845 NAME(MEDIA_WRITE_PROTECTED),
1846 NAME(MUTANT_NOT_OWNED),
1847 NAME(NOT_REGISTRY_FILE),
1848 NAME(NO_MEMORY),
1849 NAME(NO_MORE_ENTRIES),
1850 NAME(NO_MORE_FILES),
1851 NAME(NO_SUCH_FILE),
1852 NAME(OBJECT_NAME_COLLISION),
1853 NAME(OBJECT_NAME_INVALID),
1854 NAME(OBJECT_NAME_NOT_FOUND),
1855 NAME(OBJECT_PATH_INVALID),
1856 NAME(OBJECT_TYPE_MISMATCH),
1857 NAME(PENDING),
1858 NAME(PIPE_BROKEN),
1859 NAME(SEMAPHORE_LIMIT_EXCEEDED),
1860 NAME(SHARING_VIOLATION),
1861 NAME(SUSPEND_COUNT_EXCEEDED),
1862 NAME(TIMEOUT),
1863 NAME(TOO_MANY_OPENED_FILES),
1864 NAME(UNSUCCESSFUL),
1865 NAME(USER_APC),
1866 { NULL, 0 } /* terminator */
1868 #undef NAME
1870 int i;
1871 static char buffer[10];
1873 if (status)
1875 for (i = 0; status_names[i].name; i++)
1876 if (status_names[i].value == status) return status_names[i].name;
1878 sprintf( buffer, "%x", status );
1879 return buffer;
1882 void trace_request( struct thread *thread, const union generic_request *request )
1884 enum request req = request->header.req;
1885 cur_pos = 0;
1886 if (req < REQ_NB_REQUESTS)
1888 fprintf( stderr, "%08x: %s(", (unsigned int)thread, req_names[req] );
1889 cur_pos = 0;
1890 req_dumpers[req]( request );
1891 fprintf( stderr, " )\n" );
1893 else fprintf( stderr, "%08x: %d(?)\n", (unsigned int)thread, req );
1896 void trace_reply( struct thread *thread, const union generic_request *request )
1898 enum request req = request->header.req;
1899 if (req < REQ_NB_REQUESTS)
1901 fprintf( stderr, "%08x: %s() = %s",
1902 (unsigned int)thread, req_names[req], get_status_name(thread->error) );
1903 if (reply_dumpers[req])
1905 fprintf( stderr, " {" );
1906 cur_pos = 0;
1907 reply_dumpers[req]( request );
1908 fprintf( stderr, " }" );
1910 fputc( '\n', stderr );
1912 else fprintf( stderr, "%08x: %d() = %s\n",
1913 (unsigned int)thread, req, get_status_name(thread->error) );