Fixed compilation.
[wine/multimedia.git] / server / trace.c
blob8a35b817530a7a79665194b5bee4ae9454210d1c
1 /* File generated automatically by tools/make_requests; DO NOT EDIT!! */
3 #include <stdio.h>
4 #include <sys/types.h>
5 #include <sys/uio.h>
6 #include "server.h"
7 #include "server/thread.h"
9 static int dump_new_thread_request( struct new_thread_request *req, int len )
11 fprintf( stderr, " pid=%p", req->pid );
12 return (int)sizeof(*req);
15 static int dump_new_thread_reply( struct new_thread_reply *req, int len )
17 fprintf( stderr, " tid=%p,", req->tid );
18 fprintf( stderr, " thandle=%d,", req->thandle );
19 fprintf( stderr, " pid=%p,", req->pid );
20 fprintf( stderr, " phandle=%d", req->phandle );
21 return (int)sizeof(*req);
24 static int dump_set_debug_request( struct set_debug_request *req, int len )
26 fprintf( stderr, " level=%d", req->level );
27 return (int)sizeof(*req);
30 static int dump_init_thread_request( struct init_thread_request *req, int len )
32 fprintf( stderr, " unix_pid=%d,", req->unix_pid );
33 fprintf( stderr, " cmd_line=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
34 return len;
37 static int dump_terminate_process_request( struct terminate_process_request *req, int len )
39 fprintf( stderr, " handle=%d,", req->handle );
40 fprintf( stderr, " exit_code=%d", req->exit_code );
41 return (int)sizeof(*req);
44 static int dump_terminate_thread_request( struct terminate_thread_request *req, int len )
46 fprintf( stderr, " handle=%d,", req->handle );
47 fprintf( stderr, " exit_code=%d", req->exit_code );
48 return (int)sizeof(*req);
51 static int dump_get_process_info_request( struct get_process_info_request *req, int len )
53 fprintf( stderr, " handle=%d", req->handle );
54 return (int)sizeof(*req);
57 static int dump_get_process_info_reply( struct get_process_info_reply *req, int len )
59 fprintf( stderr, " pid=%p,", req->pid );
60 fprintf( stderr, " exit_code=%d,", req->exit_code );
61 fprintf( stderr, " priority=%d,", req->priority );
62 fprintf( stderr, " process_affinity=%d,", req->process_affinity );
63 fprintf( stderr, " system_affinity=%d", req->system_affinity );
64 return (int)sizeof(*req);
67 static int dump_set_process_info_request( struct set_process_info_request *req, int len )
69 fprintf( stderr, " handle=%d,", req->handle );
70 fprintf( stderr, " mask=%d,", req->mask );
71 fprintf( stderr, " priority=%d,", req->priority );
72 fprintf( stderr, " affinity=%d", req->affinity );
73 return (int)sizeof(*req);
76 static int dump_get_thread_info_request( struct get_thread_info_request *req, int len )
78 fprintf( stderr, " handle=%d", req->handle );
79 return (int)sizeof(*req);
82 static int dump_get_thread_info_reply( struct get_thread_info_reply *req, int len )
84 fprintf( stderr, " pid=%p,", req->pid );
85 fprintf( stderr, " exit_code=%d,", req->exit_code );
86 fprintf( stderr, " priority=%d", req->priority );
87 return (int)sizeof(*req);
90 static int dump_set_thread_info_request( struct set_thread_info_request *req, int len )
92 fprintf( stderr, " handle=%d,", req->handle );
93 fprintf( stderr, " mask=%d,", req->mask );
94 fprintf( stderr, " priority=%d,", req->priority );
95 fprintf( stderr, " affinity=%d", req->affinity );
96 return (int)sizeof(*req);
99 static int dump_suspend_thread_request( struct suspend_thread_request *req, int len )
101 fprintf( stderr, " handle=%d", req->handle );
102 return (int)sizeof(*req);
105 static int dump_suspend_thread_reply( struct suspend_thread_reply *req, int len )
107 fprintf( stderr, " count=%d", req->count );
108 return (int)sizeof(*req);
111 static int dump_resume_thread_request( struct resume_thread_request *req, int len )
113 fprintf( stderr, " handle=%d", req->handle );
114 return (int)sizeof(*req);
117 static int dump_resume_thread_reply( struct resume_thread_reply *req, int len )
119 fprintf( stderr, " count=%d", req->count );
120 return (int)sizeof(*req);
123 static int dump_queue_apc_request( struct queue_apc_request *req, int len )
125 fprintf( stderr, " handle=%d,", req->handle );
126 fprintf( stderr, " func=%p,", req->func );
127 fprintf( stderr, " param=%p", req->param );
128 return (int)sizeof(*req);
131 static int dump_close_handle_request( struct close_handle_request *req, int len )
133 fprintf( stderr, " handle=%d", req->handle );
134 return (int)sizeof(*req);
137 static int dump_get_handle_info_request( struct get_handle_info_request *req, int len )
139 fprintf( stderr, " handle=%d", req->handle );
140 return (int)sizeof(*req);
143 static int dump_get_handle_info_reply( struct get_handle_info_reply *req, int len )
145 fprintf( stderr, " flags=%d", req->flags );
146 return (int)sizeof(*req);
149 static int dump_set_handle_info_request( struct set_handle_info_request *req, int len )
151 fprintf( stderr, " handle=%d,", req->handle );
152 fprintf( stderr, " flags=%d,", req->flags );
153 fprintf( stderr, " mask=%d", req->mask );
154 return (int)sizeof(*req);
157 static int dump_dup_handle_request( struct dup_handle_request *req, int len )
159 fprintf( stderr, " src_process=%d,", req->src_process );
160 fprintf( stderr, " src_handle=%d,", req->src_handle );
161 fprintf( stderr, " dst_process=%d,", req->dst_process );
162 fprintf( stderr, " access=%08x,", req->access );
163 fprintf( stderr, " inherit=%d,", req->inherit );
164 fprintf( stderr, " options=%d", req->options );
165 return (int)sizeof(*req);
168 static int dump_dup_handle_reply( struct dup_handle_reply *req, int len )
170 fprintf( stderr, " handle=%d", req->handle );
171 return (int)sizeof(*req);
174 static int dump_open_process_request( struct open_process_request *req, int len )
176 fprintf( stderr, " pid=%p,", req->pid );
177 fprintf( stderr, " access=%08x,", req->access );
178 fprintf( stderr, " inherit=%d", req->inherit );
179 return (int)sizeof(*req);
182 static int dump_open_process_reply( struct open_process_reply *req, int len )
184 fprintf( stderr, " handle=%d", req->handle );
185 return (int)sizeof(*req);
188 static int dump_select_request( struct select_request *req, int len )
190 fprintf( stderr, " count=%d,", req->count );
191 fprintf( stderr, " flags=%d,", req->flags );
192 fprintf( stderr, " timeout=%d", req->timeout );
193 return (int)sizeof(*req);
196 static int dump_select_reply( struct select_reply *req, int len )
198 fprintf( stderr, " signaled=%d", req->signaled );
199 return (int)sizeof(*req);
202 static int dump_create_event_request( struct create_event_request *req, int len )
204 fprintf( stderr, " manual_reset=%d,", req->manual_reset );
205 fprintf( stderr, " initial_state=%d,", req->initial_state );
206 fprintf( stderr, " inherit=%d,", req->inherit );
207 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
208 return len;
211 static int dump_create_event_reply( struct create_event_reply *req, int len )
213 fprintf( stderr, " handle=%d", req->handle );
214 return (int)sizeof(*req);
217 static int dump_event_op_request( struct event_op_request *req, int len )
219 fprintf( stderr, " handle=%d,", req->handle );
220 fprintf( stderr, " op=%d", req->op );
221 return (int)sizeof(*req);
224 static int dump_create_mutex_request( struct create_mutex_request *req, int len )
226 fprintf( stderr, " owned=%d,", req->owned );
227 fprintf( stderr, " inherit=%d,", req->inherit );
228 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
229 return len;
232 static int dump_create_mutex_reply( struct create_mutex_reply *req, int len )
234 fprintf( stderr, " handle=%d", req->handle );
235 return (int)sizeof(*req);
238 static int dump_release_mutex_request( struct release_mutex_request *req, int len )
240 fprintf( stderr, " handle=%d", req->handle );
241 return (int)sizeof(*req);
244 static int dump_create_semaphore_request( struct create_semaphore_request *req, int len )
246 fprintf( stderr, " initial=%08x,", req->initial );
247 fprintf( stderr, " max=%08x,", req->max );
248 fprintf( stderr, " inherit=%d,", req->inherit );
249 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
250 return len;
253 static int dump_create_semaphore_reply( struct create_semaphore_reply *req, int len )
255 fprintf( stderr, " handle=%d", req->handle );
256 return (int)sizeof(*req);
259 static int dump_release_semaphore_request( struct release_semaphore_request *req, int len )
261 fprintf( stderr, " handle=%d,", req->handle );
262 fprintf( stderr, " count=%08x", req->count );
263 return (int)sizeof(*req);
266 static int dump_release_semaphore_reply( struct release_semaphore_reply *req, int len )
268 fprintf( stderr, " prev_count=%08x", req->prev_count );
269 return (int)sizeof(*req);
272 static int dump_open_named_obj_request( struct open_named_obj_request *req, int len )
274 fprintf( stderr, " type=%d,", req->type );
275 fprintf( stderr, " access=%08x,", req->access );
276 fprintf( stderr, " inherit=%d,", req->inherit );
277 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
278 return len;
281 static int dump_open_named_obj_reply( struct open_named_obj_reply *req, int len )
283 fprintf( stderr, " handle=%d", req->handle );
284 return (int)sizeof(*req);
287 static int dump_create_file_request( struct create_file_request *req, int len )
289 fprintf( stderr, " access=%08x,", req->access );
290 fprintf( stderr, " inherit=%d,", req->inherit );
291 fprintf( stderr, " sharing=%08x,", req->sharing );
292 fprintf( stderr, " create=%d,", req->create );
293 fprintf( stderr, " attrs=%08x,", req->attrs );
294 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
295 return len;
298 static int dump_create_file_reply( struct create_file_reply *req, int len )
300 fprintf( stderr, " handle=%d", req->handle );
301 return (int)sizeof(*req);
304 static int dump_get_read_fd_request( struct get_read_fd_request *req, int len )
306 fprintf( stderr, " handle=%d", req->handle );
307 return (int)sizeof(*req);
310 static int dump_get_write_fd_request( struct get_write_fd_request *req, int len )
312 fprintf( stderr, " handle=%d", req->handle );
313 return (int)sizeof(*req);
316 static int dump_set_file_pointer_request( struct set_file_pointer_request *req, int len )
318 fprintf( stderr, " handle=%d,", req->handle );
319 fprintf( stderr, " low=%d,", req->low );
320 fprintf( stderr, " high=%d,", req->high );
321 fprintf( stderr, " whence=%d", req->whence );
322 return (int)sizeof(*req);
325 static int dump_set_file_pointer_reply( struct set_file_pointer_reply *req, int len )
327 fprintf( stderr, " low=%d,", req->low );
328 fprintf( stderr, " high=%d", req->high );
329 return (int)sizeof(*req);
332 static int dump_truncate_file_request( struct truncate_file_request *req, int len )
334 fprintf( stderr, " handle=%d", req->handle );
335 return (int)sizeof(*req);
338 static int dump_set_file_time_request( struct set_file_time_request *req, int len )
340 fprintf( stderr, " handle=%d,", req->handle );
341 fprintf( stderr, " access_time=%ld,", req->access_time );
342 fprintf( stderr, " write_time=%ld", req->write_time );
343 return (int)sizeof(*req);
346 static int dump_flush_file_request( struct flush_file_request *req, int len )
348 fprintf( stderr, " handle=%d", req->handle );
349 return (int)sizeof(*req);
352 static int dump_get_file_info_request( struct get_file_info_request *req, int len )
354 fprintf( stderr, " handle=%d", req->handle );
355 return (int)sizeof(*req);
358 static int dump_get_file_info_reply( struct get_file_info_reply *req, int len )
360 fprintf( stderr, " type=%d,", req->type );
361 fprintf( stderr, " attr=%d,", req->attr );
362 fprintf( stderr, " access_time=%ld,", req->access_time );
363 fprintf( stderr, " write_time=%ld,", req->write_time );
364 fprintf( stderr, " size_high=%d,", req->size_high );
365 fprintf( stderr, " size_low=%d,", req->size_low );
366 fprintf( stderr, " links=%d,", req->links );
367 fprintf( stderr, " index_high=%d,", req->index_high );
368 fprintf( stderr, " index_low=%d,", req->index_low );
369 fprintf( stderr, " serial=%08x", req->serial );
370 return (int)sizeof(*req);
373 static int dump_lock_file_request( struct lock_file_request *req, int len )
375 fprintf( stderr, " handle=%d,", req->handle );
376 fprintf( stderr, " offset_low=%08x,", req->offset_low );
377 fprintf( stderr, " offset_high=%08x,", req->offset_high );
378 fprintf( stderr, " count_low=%08x,", req->count_low );
379 fprintf( stderr, " count_high=%08x", req->count_high );
380 return (int)sizeof(*req);
383 static int dump_unlock_file_request( struct unlock_file_request *req, int len )
385 fprintf( stderr, " handle=%d,", req->handle );
386 fprintf( stderr, " offset_low=%08x,", req->offset_low );
387 fprintf( stderr, " offset_high=%08x,", req->offset_high );
388 fprintf( stderr, " count_low=%08x,", req->count_low );
389 fprintf( stderr, " count_high=%08x", req->count_high );
390 return (int)sizeof(*req);
393 static int dump_create_pipe_request( struct create_pipe_request *req, int len )
395 fprintf( stderr, " inherit=%d", req->inherit );
396 return (int)sizeof(*req);
399 static int dump_create_pipe_reply( struct create_pipe_reply *req, int len )
401 fprintf( stderr, " handle_read=%d,", req->handle_read );
402 fprintf( stderr, " handle_write=%d", req->handle_write );
403 return (int)sizeof(*req);
406 static int dump_alloc_console_request( struct alloc_console_request *req, int len )
408 return (int)sizeof(*req);
411 static int dump_free_console_request( struct free_console_request *req, int len )
413 return (int)sizeof(*req);
416 static int dump_open_console_request( struct open_console_request *req, int len )
418 fprintf( stderr, " output=%d,", req->output );
419 fprintf( stderr, " access=%08x,", req->access );
420 fprintf( stderr, " inherit=%d", req->inherit );
421 return (int)sizeof(*req);
424 static int dump_open_console_reply( struct open_console_reply *req, int len )
426 fprintf( stderr, " handle=%d", req->handle );
427 return (int)sizeof(*req);
430 static int dump_set_console_fd_request( struct set_console_fd_request *req, int len )
432 fprintf( stderr, " handle=%d,", req->handle );
433 fprintf( stderr, " pid=%d", req->pid );
434 return (int)sizeof(*req);
437 static int dump_get_console_mode_request( struct get_console_mode_request *req, int len )
439 fprintf( stderr, " handle=%d", req->handle );
440 return (int)sizeof(*req);
443 static int dump_get_console_mode_reply( struct get_console_mode_reply *req, int len )
445 fprintf( stderr, " mode=%d", req->mode );
446 return (int)sizeof(*req);
449 static int dump_set_console_mode_request( struct set_console_mode_request *req, int len )
451 fprintf( stderr, " handle=%d,", req->handle );
452 fprintf( stderr, " mode=%d", req->mode );
453 return (int)sizeof(*req);
456 static int dump_set_console_info_request( struct set_console_info_request *req, int len )
458 fprintf( stderr, " handle=%d,", req->handle );
459 fprintf( stderr, " mask=%d,", req->mask );
460 fprintf( stderr, " cursor_size=%d,", req->cursor_size );
461 fprintf( stderr, " cursor_visible=%d,", req->cursor_visible );
462 fprintf( stderr, " title=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
463 return len;
466 static int dump_get_console_info_request( struct get_console_info_request *req, int len )
468 fprintf( stderr, " handle=%d", req->handle );
469 return (int)sizeof(*req);
472 static int dump_get_console_info_reply( struct get_console_info_reply *req, int len )
474 fprintf( stderr, " cursor_size=%d,", req->cursor_size );
475 fprintf( stderr, " cursor_visible=%d,", req->cursor_visible );
476 fprintf( stderr, " pid=%d", req->pid );
477 return (int)sizeof(*req);
480 static int dump_write_console_input_request( struct write_console_input_request *req, int len )
482 fprintf( stderr, " handle=%d,", req->handle );
483 fprintf( stderr, " count=%d", req->count );
484 return (int)sizeof(*req);
487 static int dump_write_console_input_reply( struct write_console_input_reply *req, int len )
489 fprintf( stderr, " written=%d", req->written );
490 return (int)sizeof(*req);
493 static int dump_read_console_input_request( struct read_console_input_request *req, int len )
495 fprintf( stderr, " handle=%d,", req->handle );
496 fprintf( stderr, " count=%d,", req->count );
497 fprintf( stderr, " flush=%d", req->flush );
498 return (int)sizeof(*req);
501 static int dump_read_console_input_reply( struct read_console_input_reply *req, int len )
503 return (int)sizeof(*req);
506 static int dump_create_change_notification_request( struct create_change_notification_request *req, int len )
508 fprintf( stderr, " subtree=%d,", req->subtree );
509 fprintf( stderr, " filter=%d", req->filter );
510 return (int)sizeof(*req);
513 static int dump_create_change_notification_reply( struct create_change_notification_reply *req, int len )
515 fprintf( stderr, " handle=%d", req->handle );
516 return (int)sizeof(*req);
519 static int dump_create_mapping_request( struct create_mapping_request *req, int len )
521 fprintf( stderr, " size_high=%d,", req->size_high );
522 fprintf( stderr, " size_low=%d,", req->size_low );
523 fprintf( stderr, " protect=%d,", req->protect );
524 fprintf( stderr, " inherit=%d,", req->inherit );
525 fprintf( stderr, " handle=%d,", req->handle );
526 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
527 return len;
530 static int dump_create_mapping_reply( struct create_mapping_reply *req, int len )
532 fprintf( stderr, " handle=%d", req->handle );
533 return (int)sizeof(*req);
536 static int dump_get_mapping_info_request( struct get_mapping_info_request *req, int len )
538 fprintf( stderr, " handle=%d", req->handle );
539 return (int)sizeof(*req);
542 static int dump_get_mapping_info_reply( struct get_mapping_info_reply *req, int len )
544 fprintf( stderr, " size_high=%d,", req->size_high );
545 fprintf( stderr, " size_low=%d,", req->size_low );
546 fprintf( stderr, " protect=%d", req->protect );
547 return (int)sizeof(*req);
550 static int dump_create_device_request( struct create_device_request *req, int len )
552 fprintf( stderr, " access=%08x,", req->access );
553 fprintf( stderr, " inherit=%d,", req->inherit );
554 fprintf( stderr, " id=%d", req->id );
555 return (int)sizeof(*req);
558 static int dump_create_device_reply( struct create_device_reply *req, int len )
560 fprintf( stderr, " handle=%d", req->handle );
561 return (int)sizeof(*req);
564 static int dump_create_snapshot_request( struct create_snapshot_request *req, int len )
566 fprintf( stderr, " inherit=%d,", req->inherit );
567 fprintf( stderr, " flags=%d", req->flags );
568 return (int)sizeof(*req);
571 static int dump_create_snapshot_reply( struct create_snapshot_reply *req, int len )
573 fprintf( stderr, " handle=%d", req->handle );
574 return (int)sizeof(*req);
577 static int dump_next_process_request( struct next_process_request *req, int len )
579 fprintf( stderr, " handle=%d,", req->handle );
580 fprintf( stderr, " reset=%d", req->reset );
581 return (int)sizeof(*req);
584 static int dump_next_process_reply( struct next_process_reply *req, int len )
586 fprintf( stderr, " pid=%p,", req->pid );
587 fprintf( stderr, " threads=%d,", req->threads );
588 fprintf( stderr, " priority=%d", req->priority );
589 return (int)sizeof(*req);
592 struct dumper
594 int (*dump_req)( void *data, int len );
595 void (*dump_reply)( void *data );
598 static const struct dumper dumpers[REQ_NB_REQUESTS] =
600 { (int(*)(void *,int))dump_new_thread_request,
601 (void(*)())dump_new_thread_reply },
602 { (int(*)(void *,int))dump_set_debug_request,
603 (void(*)())0 },
604 { (int(*)(void *,int))dump_init_thread_request,
605 (void(*)())0 },
606 { (int(*)(void *,int))dump_terminate_process_request,
607 (void(*)())0 },
608 { (int(*)(void *,int))dump_terminate_thread_request,
609 (void(*)())0 },
610 { (int(*)(void *,int))dump_get_process_info_request,
611 (void(*)())dump_get_process_info_reply },
612 { (int(*)(void *,int))dump_set_process_info_request,
613 (void(*)())0 },
614 { (int(*)(void *,int))dump_get_thread_info_request,
615 (void(*)())dump_get_thread_info_reply },
616 { (int(*)(void *,int))dump_set_thread_info_request,
617 (void(*)())0 },
618 { (int(*)(void *,int))dump_suspend_thread_request,
619 (void(*)())dump_suspend_thread_reply },
620 { (int(*)(void *,int))dump_resume_thread_request,
621 (void(*)())dump_resume_thread_reply },
622 { (int(*)(void *,int))dump_queue_apc_request,
623 (void(*)())0 },
624 { (int(*)(void *,int))dump_close_handle_request,
625 (void(*)())0 },
626 { (int(*)(void *,int))dump_get_handle_info_request,
627 (void(*)())dump_get_handle_info_reply },
628 { (int(*)(void *,int))dump_set_handle_info_request,
629 (void(*)())0 },
630 { (int(*)(void *,int))dump_dup_handle_request,
631 (void(*)())dump_dup_handle_reply },
632 { (int(*)(void *,int))dump_open_process_request,
633 (void(*)())dump_open_process_reply },
634 { (int(*)(void *,int))dump_select_request,
635 (void(*)())dump_select_reply },
636 { (int(*)(void *,int))dump_create_event_request,
637 (void(*)())dump_create_event_reply },
638 { (int(*)(void *,int))dump_event_op_request,
639 (void(*)())0 },
640 { (int(*)(void *,int))dump_create_mutex_request,
641 (void(*)())dump_create_mutex_reply },
642 { (int(*)(void *,int))dump_release_mutex_request,
643 (void(*)())0 },
644 { (int(*)(void *,int))dump_create_semaphore_request,
645 (void(*)())dump_create_semaphore_reply },
646 { (int(*)(void *,int))dump_release_semaphore_request,
647 (void(*)())dump_release_semaphore_reply },
648 { (int(*)(void *,int))dump_open_named_obj_request,
649 (void(*)())dump_open_named_obj_reply },
650 { (int(*)(void *,int))dump_create_file_request,
651 (void(*)())dump_create_file_reply },
652 { (int(*)(void *,int))dump_get_read_fd_request,
653 (void(*)())0 },
654 { (int(*)(void *,int))dump_get_write_fd_request,
655 (void(*)())0 },
656 { (int(*)(void *,int))dump_set_file_pointer_request,
657 (void(*)())dump_set_file_pointer_reply },
658 { (int(*)(void *,int))dump_truncate_file_request,
659 (void(*)())0 },
660 { (int(*)(void *,int))dump_set_file_time_request,
661 (void(*)())0 },
662 { (int(*)(void *,int))dump_flush_file_request,
663 (void(*)())0 },
664 { (int(*)(void *,int))dump_get_file_info_request,
665 (void(*)())dump_get_file_info_reply },
666 { (int(*)(void *,int))dump_lock_file_request,
667 (void(*)())0 },
668 { (int(*)(void *,int))dump_unlock_file_request,
669 (void(*)())0 },
670 { (int(*)(void *,int))dump_create_pipe_request,
671 (void(*)())dump_create_pipe_reply },
672 { (int(*)(void *,int))dump_alloc_console_request,
673 (void(*)())0 },
674 { (int(*)(void *,int))dump_free_console_request,
675 (void(*)())0 },
676 { (int(*)(void *,int))dump_open_console_request,
677 (void(*)())dump_open_console_reply },
678 { (int(*)(void *,int))dump_set_console_fd_request,
679 (void(*)())0 },
680 { (int(*)(void *,int))dump_get_console_mode_request,
681 (void(*)())dump_get_console_mode_reply },
682 { (int(*)(void *,int))dump_set_console_mode_request,
683 (void(*)())0 },
684 { (int(*)(void *,int))dump_set_console_info_request,
685 (void(*)())0 },
686 { (int(*)(void *,int))dump_get_console_info_request,
687 (void(*)())dump_get_console_info_reply },
688 { (int(*)(void *,int))dump_write_console_input_request,
689 (void(*)())dump_write_console_input_reply },
690 { (int(*)(void *,int))dump_read_console_input_request,
691 (void(*)())dump_read_console_input_reply },
692 { (int(*)(void *,int))dump_create_change_notification_request,
693 (void(*)())dump_create_change_notification_reply },
694 { (int(*)(void *,int))dump_create_mapping_request,
695 (void(*)())dump_create_mapping_reply },
696 { (int(*)(void *,int))dump_get_mapping_info_request,
697 (void(*)())dump_get_mapping_info_reply },
698 { (int(*)(void *,int))dump_create_device_request,
699 (void(*)())dump_create_device_reply },
700 { (int(*)(void *,int))dump_create_snapshot_request,
701 (void(*)())dump_create_snapshot_reply },
702 { (int(*)(void *,int))dump_next_process_request,
703 (void(*)())dump_next_process_reply },
706 static const char * const req_names[REQ_NB_REQUESTS] =
708 "new_thread",
709 "set_debug",
710 "init_thread",
711 "terminate_process",
712 "terminate_thread",
713 "get_process_info",
714 "set_process_info",
715 "get_thread_info",
716 "set_thread_info",
717 "suspend_thread",
718 "resume_thread",
719 "queue_apc",
720 "close_handle",
721 "get_handle_info",
722 "set_handle_info",
723 "dup_handle",
724 "open_process",
725 "select",
726 "create_event",
727 "event_op",
728 "create_mutex",
729 "release_mutex",
730 "create_semaphore",
731 "release_semaphore",
732 "open_named_obj",
733 "create_file",
734 "get_read_fd",
735 "get_write_fd",
736 "set_file_pointer",
737 "truncate_file",
738 "set_file_time",
739 "flush_file",
740 "get_file_info",
741 "lock_file",
742 "unlock_file",
743 "create_pipe",
744 "alloc_console",
745 "free_console",
746 "open_console",
747 "set_console_fd",
748 "get_console_mode",
749 "set_console_mode",
750 "set_console_info",
751 "get_console_info",
752 "write_console_input",
753 "read_console_input",
754 "create_change_notification",
755 "create_mapping",
756 "get_mapping_info",
757 "create_device",
758 "create_snapshot",
759 "next_process",
762 void trace_request( enum request req, void *data, int len, int fd )
764 int size;
765 current->last_req = req;
766 fprintf( stderr, "%08x: %s(", (unsigned int)current, req_names[req] );
767 size = dumpers[req].dump_req( data, len );
768 if ((len -= size) > 0)
770 unsigned char *ptr = (unsigned char *)data + size;
771 while (len--) fprintf( stderr, ", %02x", *ptr++ );
773 if (fd != -1) fprintf( stderr, " ) fd=%d\n", fd );
774 else fprintf( stderr, " )\n" );
777 void trace_timeout(void)
779 fprintf( stderr, "%08x: *timeout*\n", (unsigned int)current );
782 void trace_kill( int exit_code )
784 fprintf( stderr,"%08x: *killed* exit_code=%d\n",
785 (unsigned int)current, exit_code );
788 void trace_reply( struct thread *thread, int type, int pass_fd,
789 struct iovec *vec, int veclen )
791 if (!thread) return;
792 fprintf( stderr, "%08x: %s() = %d",
793 (unsigned int)thread, req_names[thread->last_req], type );
794 if (veclen)
796 fprintf( stderr, " {" );
797 if (dumpers[thread->last_req].dump_reply)
799 dumpers[thread->last_req].dump_reply( vec->iov_base );
800 vec++;
801 veclen--;
803 for (; veclen; veclen--, vec++)
805 unsigned char *ptr = vec->iov_base;
806 int len = vec->iov_len;
807 while (len--) fprintf( stderr, ", %02x", *ptr++ );
809 fprintf( stderr, " }" );
811 if (pass_fd != -1) fprintf( stderr, " fd=%d\n", pass_fd );
812 else fprintf( stderr, "\n" );