Handle suspend/resume_thread requests in phase STARTING correctly.
[wine/multimedia.git] / server / trace.c
bloba091d8c9c466b1547ef9f50d87ca4f73e12fea50
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 fprintf( stderr, " suspend=%d,", req->suspend );
13 fprintf( stderr, " tinherit=%d,", req->tinherit );
14 fprintf( stderr, " pinherit=%d", req->pinherit );
15 return (int)sizeof(*req);
18 static int dump_new_thread_reply( struct new_thread_reply *req, int len )
20 fprintf( stderr, " tid=%p,", req->tid );
21 fprintf( stderr, " thandle=%d,", req->thandle );
22 fprintf( stderr, " pid=%p,", req->pid );
23 fprintf( stderr, " phandle=%d", req->phandle );
24 return (int)sizeof(*req);
27 static int dump_set_debug_request( struct set_debug_request *req, int len )
29 fprintf( stderr, " level=%d", req->level );
30 return (int)sizeof(*req);
33 static int dump_init_thread_request( struct init_thread_request *req, int len )
35 fprintf( stderr, " unix_pid=%d,", req->unix_pid );
36 fprintf( stderr, " cmd_line=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
37 return len;
40 static int dump_terminate_process_request( struct terminate_process_request *req, int len )
42 fprintf( stderr, " handle=%d,", req->handle );
43 fprintf( stderr, " exit_code=%d", req->exit_code );
44 return (int)sizeof(*req);
47 static int dump_terminate_thread_request( struct terminate_thread_request *req, int len )
49 fprintf( stderr, " handle=%d,", req->handle );
50 fprintf( stderr, " exit_code=%d", req->exit_code );
51 return (int)sizeof(*req);
54 static int dump_get_process_info_request( struct get_process_info_request *req, int len )
56 fprintf( stderr, " handle=%d", req->handle );
57 return (int)sizeof(*req);
60 static int dump_get_process_info_reply( struct get_process_info_reply *req, int len )
62 fprintf( stderr, " pid=%p,", req->pid );
63 fprintf( stderr, " exit_code=%d,", req->exit_code );
64 fprintf( stderr, " priority=%d,", req->priority );
65 fprintf( stderr, " process_affinity=%d,", req->process_affinity );
66 fprintf( stderr, " system_affinity=%d", req->system_affinity );
67 return (int)sizeof(*req);
70 static int dump_set_process_info_request( struct set_process_info_request *req, int len )
72 fprintf( stderr, " handle=%d,", req->handle );
73 fprintf( stderr, " mask=%d,", req->mask );
74 fprintf( stderr, " priority=%d,", req->priority );
75 fprintf( stderr, " affinity=%d", req->affinity );
76 return (int)sizeof(*req);
79 static int dump_get_thread_info_request( struct get_thread_info_request *req, int len )
81 fprintf( stderr, " handle=%d", req->handle );
82 return (int)sizeof(*req);
85 static int dump_get_thread_info_reply( struct get_thread_info_reply *req, int len )
87 fprintf( stderr, " pid=%p,", req->pid );
88 fprintf( stderr, " exit_code=%d,", req->exit_code );
89 fprintf( stderr, " priority=%d", req->priority );
90 return (int)sizeof(*req);
93 static int dump_set_thread_info_request( struct set_thread_info_request *req, int len )
95 fprintf( stderr, " handle=%d,", req->handle );
96 fprintf( stderr, " mask=%d,", req->mask );
97 fprintf( stderr, " priority=%d,", req->priority );
98 fprintf( stderr, " affinity=%d", req->affinity );
99 return (int)sizeof(*req);
102 static int dump_suspend_thread_request( struct suspend_thread_request *req, int len )
104 fprintf( stderr, " handle=%d", req->handle );
105 return (int)sizeof(*req);
108 static int dump_suspend_thread_reply( struct suspend_thread_reply *req, int len )
110 fprintf( stderr, " count=%d", req->count );
111 return (int)sizeof(*req);
114 static int dump_resume_thread_request( struct resume_thread_request *req, int len )
116 fprintf( stderr, " handle=%d", req->handle );
117 return (int)sizeof(*req);
120 static int dump_resume_thread_reply( struct resume_thread_reply *req, int len )
122 fprintf( stderr, " count=%d", req->count );
123 return (int)sizeof(*req);
126 static int dump_queue_apc_request( struct queue_apc_request *req, int len )
128 fprintf( stderr, " handle=%d,", req->handle );
129 fprintf( stderr, " func=%p,", req->func );
130 fprintf( stderr, " param=%p", req->param );
131 return (int)sizeof(*req);
134 static int dump_close_handle_request( struct close_handle_request *req, int len )
136 fprintf( stderr, " handle=%d", req->handle );
137 return (int)sizeof(*req);
140 static int dump_get_handle_info_request( struct get_handle_info_request *req, int len )
142 fprintf( stderr, " handle=%d", req->handle );
143 return (int)sizeof(*req);
146 static int dump_get_handle_info_reply( struct get_handle_info_reply *req, int len )
148 fprintf( stderr, " flags=%d", req->flags );
149 return (int)sizeof(*req);
152 static int dump_set_handle_info_request( struct set_handle_info_request *req, int len )
154 fprintf( stderr, " handle=%d,", req->handle );
155 fprintf( stderr, " flags=%d,", req->flags );
156 fprintf( stderr, " mask=%d", req->mask );
157 return (int)sizeof(*req);
160 static int dump_dup_handle_request( struct dup_handle_request *req, int len )
162 fprintf( stderr, " src_process=%d,", req->src_process );
163 fprintf( stderr, " src_handle=%d,", req->src_handle );
164 fprintf( stderr, " dst_process=%d,", req->dst_process );
165 fprintf( stderr, " access=%08x,", req->access );
166 fprintf( stderr, " inherit=%d,", req->inherit );
167 fprintf( stderr, " options=%d", req->options );
168 return (int)sizeof(*req);
171 static int dump_dup_handle_reply( struct dup_handle_reply *req, int len )
173 fprintf( stderr, " handle=%d", req->handle );
174 return (int)sizeof(*req);
177 static int dump_open_process_request( struct open_process_request *req, int len )
179 fprintf( stderr, " pid=%p,", req->pid );
180 fprintf( stderr, " access=%08x,", req->access );
181 fprintf( stderr, " inherit=%d", req->inherit );
182 return (int)sizeof(*req);
185 static int dump_open_process_reply( struct open_process_reply *req, int len )
187 fprintf( stderr, " handle=%d", req->handle );
188 return (int)sizeof(*req);
191 static int dump_select_request( struct select_request *req, int len )
193 fprintf( stderr, " count=%d,", req->count );
194 fprintf( stderr, " flags=%d,", req->flags );
195 fprintf( stderr, " timeout=%d", req->timeout );
196 return (int)sizeof(*req);
199 static int dump_select_reply( struct select_reply *req, int len )
201 fprintf( stderr, " signaled=%d", req->signaled );
202 return (int)sizeof(*req);
205 static int dump_create_event_request( struct create_event_request *req, int len )
207 fprintf( stderr, " manual_reset=%d,", req->manual_reset );
208 fprintf( stderr, " initial_state=%d,", req->initial_state );
209 fprintf( stderr, " inherit=%d,", req->inherit );
210 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
211 return len;
214 static int dump_create_event_reply( struct create_event_reply *req, int len )
216 fprintf( stderr, " handle=%d", req->handle );
217 return (int)sizeof(*req);
220 static int dump_event_op_request( struct event_op_request *req, int len )
222 fprintf( stderr, " handle=%d,", req->handle );
223 fprintf( stderr, " op=%d", req->op );
224 return (int)sizeof(*req);
227 static int dump_create_mutex_request( struct create_mutex_request *req, int len )
229 fprintf( stderr, " owned=%d,", req->owned );
230 fprintf( stderr, " inherit=%d,", req->inherit );
231 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
232 return len;
235 static int dump_create_mutex_reply( struct create_mutex_reply *req, int len )
237 fprintf( stderr, " handle=%d", req->handle );
238 return (int)sizeof(*req);
241 static int dump_release_mutex_request( struct release_mutex_request *req, int len )
243 fprintf( stderr, " handle=%d", req->handle );
244 return (int)sizeof(*req);
247 static int dump_create_semaphore_request( struct create_semaphore_request *req, int len )
249 fprintf( stderr, " initial=%08x,", req->initial );
250 fprintf( stderr, " max=%08x,", req->max );
251 fprintf( stderr, " inherit=%d,", req->inherit );
252 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
253 return len;
256 static int dump_create_semaphore_reply( struct create_semaphore_reply *req, int len )
258 fprintf( stderr, " handle=%d", req->handle );
259 return (int)sizeof(*req);
262 static int dump_release_semaphore_request( struct release_semaphore_request *req, int len )
264 fprintf( stderr, " handle=%d,", req->handle );
265 fprintf( stderr, " count=%08x", req->count );
266 return (int)sizeof(*req);
269 static int dump_release_semaphore_reply( struct release_semaphore_reply *req, int len )
271 fprintf( stderr, " prev_count=%08x", req->prev_count );
272 return (int)sizeof(*req);
275 static int dump_open_named_obj_request( struct open_named_obj_request *req, int len )
277 fprintf( stderr, " type=%d,", req->type );
278 fprintf( stderr, " access=%08x,", req->access );
279 fprintf( stderr, " inherit=%d,", req->inherit );
280 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
281 return len;
284 static int dump_open_named_obj_reply( struct open_named_obj_reply *req, int len )
286 fprintf( stderr, " handle=%d", req->handle );
287 return (int)sizeof(*req);
290 static int dump_create_file_request( struct create_file_request *req, int len )
292 fprintf( stderr, " access=%08x,", req->access );
293 fprintf( stderr, " inherit=%d,", req->inherit );
294 fprintf( stderr, " sharing=%08x,", req->sharing );
295 fprintf( stderr, " create=%d,", req->create );
296 fprintf( stderr, " attrs=%08x,", req->attrs );
297 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
298 return len;
301 static int dump_create_file_reply( struct create_file_reply *req, int len )
303 fprintf( stderr, " handle=%d", req->handle );
304 return (int)sizeof(*req);
307 static int dump_get_read_fd_request( struct get_read_fd_request *req, int len )
309 fprintf( stderr, " handle=%d", req->handle );
310 return (int)sizeof(*req);
313 static int dump_get_write_fd_request( struct get_write_fd_request *req, int len )
315 fprintf( stderr, " handle=%d", req->handle );
316 return (int)sizeof(*req);
319 static int dump_set_file_pointer_request( struct set_file_pointer_request *req, int len )
321 fprintf( stderr, " handle=%d,", req->handle );
322 fprintf( stderr, " low=%d,", req->low );
323 fprintf( stderr, " high=%d,", req->high );
324 fprintf( stderr, " whence=%d", req->whence );
325 return (int)sizeof(*req);
328 static int dump_set_file_pointer_reply( struct set_file_pointer_reply *req, int len )
330 fprintf( stderr, " low=%d,", req->low );
331 fprintf( stderr, " high=%d", req->high );
332 return (int)sizeof(*req);
335 static int dump_truncate_file_request( struct truncate_file_request *req, int len )
337 fprintf( stderr, " handle=%d", req->handle );
338 return (int)sizeof(*req);
341 static int dump_set_file_time_request( struct set_file_time_request *req, int len )
343 fprintf( stderr, " handle=%d,", req->handle );
344 fprintf( stderr, " access_time=%ld,", req->access_time );
345 fprintf( stderr, " write_time=%ld", req->write_time );
346 return (int)sizeof(*req);
349 static int dump_flush_file_request( struct flush_file_request *req, int len )
351 fprintf( stderr, " handle=%d", req->handle );
352 return (int)sizeof(*req);
355 static int dump_get_file_info_request( struct get_file_info_request *req, int len )
357 fprintf( stderr, " handle=%d", req->handle );
358 return (int)sizeof(*req);
361 static int dump_get_file_info_reply( struct get_file_info_reply *req, int len )
363 fprintf( stderr, " type=%d,", req->type );
364 fprintf( stderr, " attr=%d,", req->attr );
365 fprintf( stderr, " access_time=%ld,", req->access_time );
366 fprintf( stderr, " write_time=%ld,", req->write_time );
367 fprintf( stderr, " size_high=%d,", req->size_high );
368 fprintf( stderr, " size_low=%d,", req->size_low );
369 fprintf( stderr, " links=%d,", req->links );
370 fprintf( stderr, " index_high=%d,", req->index_high );
371 fprintf( stderr, " index_low=%d,", req->index_low );
372 fprintf( stderr, " serial=%08x", req->serial );
373 return (int)sizeof(*req);
376 static int dump_lock_file_request( struct lock_file_request *req, int len )
378 fprintf( stderr, " handle=%d,", req->handle );
379 fprintf( stderr, " offset_low=%08x,", req->offset_low );
380 fprintf( stderr, " offset_high=%08x,", req->offset_high );
381 fprintf( stderr, " count_low=%08x,", req->count_low );
382 fprintf( stderr, " count_high=%08x", req->count_high );
383 return (int)sizeof(*req);
386 static int dump_unlock_file_request( struct unlock_file_request *req, int len )
388 fprintf( stderr, " handle=%d,", req->handle );
389 fprintf( stderr, " offset_low=%08x,", req->offset_low );
390 fprintf( stderr, " offset_high=%08x,", req->offset_high );
391 fprintf( stderr, " count_low=%08x,", req->count_low );
392 fprintf( stderr, " count_high=%08x", req->count_high );
393 return (int)sizeof(*req);
396 static int dump_create_pipe_request( struct create_pipe_request *req, int len )
398 fprintf( stderr, " inherit=%d", req->inherit );
399 return (int)sizeof(*req);
402 static int dump_create_pipe_reply( struct create_pipe_reply *req, int len )
404 fprintf( stderr, " handle_read=%d,", req->handle_read );
405 fprintf( stderr, " handle_write=%d", req->handle_write );
406 return (int)sizeof(*req);
409 static int dump_alloc_console_request( struct alloc_console_request *req, int len )
411 return (int)sizeof(*req);
414 static int dump_free_console_request( struct free_console_request *req, int len )
416 return (int)sizeof(*req);
419 static int dump_open_console_request( struct open_console_request *req, int len )
421 fprintf( stderr, " output=%d,", req->output );
422 fprintf( stderr, " access=%08x,", req->access );
423 fprintf( stderr, " inherit=%d", req->inherit );
424 return (int)sizeof(*req);
427 static int dump_open_console_reply( struct open_console_reply *req, int len )
429 fprintf( stderr, " handle=%d", req->handle );
430 return (int)sizeof(*req);
433 static int dump_set_console_fd_request( struct set_console_fd_request *req, int len )
435 fprintf( stderr, " handle=%d,", req->handle );
436 fprintf( stderr, " pid=%d", req->pid );
437 return (int)sizeof(*req);
440 static int dump_get_console_mode_request( struct get_console_mode_request *req, int len )
442 fprintf( stderr, " handle=%d", req->handle );
443 return (int)sizeof(*req);
446 static int dump_get_console_mode_reply( struct get_console_mode_reply *req, int len )
448 fprintf( stderr, " mode=%d", req->mode );
449 return (int)sizeof(*req);
452 static int dump_set_console_mode_request( struct set_console_mode_request *req, int len )
454 fprintf( stderr, " handle=%d,", req->handle );
455 fprintf( stderr, " mode=%d", req->mode );
456 return (int)sizeof(*req);
459 static int dump_set_console_info_request( struct set_console_info_request *req, int len )
461 fprintf( stderr, " handle=%d,", req->handle );
462 fprintf( stderr, " mask=%d,", req->mask );
463 fprintf( stderr, " cursor_size=%d,", req->cursor_size );
464 fprintf( stderr, " cursor_visible=%d,", req->cursor_visible );
465 fprintf( stderr, " title=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
466 return len;
469 static int dump_get_console_info_request( struct get_console_info_request *req, int len )
471 fprintf( stderr, " handle=%d", req->handle );
472 return (int)sizeof(*req);
475 static int dump_get_console_info_reply( struct get_console_info_reply *req, int len )
477 fprintf( stderr, " cursor_size=%d,", req->cursor_size );
478 fprintf( stderr, " cursor_visible=%d,", req->cursor_visible );
479 fprintf( stderr, " pid=%d", req->pid );
480 return (int)sizeof(*req);
483 static int dump_write_console_input_request( struct write_console_input_request *req, int len )
485 fprintf( stderr, " handle=%d,", req->handle );
486 fprintf( stderr, " count=%d", req->count );
487 return (int)sizeof(*req);
490 static int dump_write_console_input_reply( struct write_console_input_reply *req, int len )
492 fprintf( stderr, " written=%d", req->written );
493 return (int)sizeof(*req);
496 static int dump_read_console_input_request( struct read_console_input_request *req, int len )
498 fprintf( stderr, " handle=%d,", req->handle );
499 fprintf( stderr, " count=%d,", req->count );
500 fprintf( stderr, " flush=%d", req->flush );
501 return (int)sizeof(*req);
504 static int dump_read_console_input_reply( struct read_console_input_reply *req, int len )
506 return (int)sizeof(*req);
509 static int dump_create_change_notification_request( struct create_change_notification_request *req, int len )
511 fprintf( stderr, " subtree=%d,", req->subtree );
512 fprintf( stderr, " filter=%d", req->filter );
513 return (int)sizeof(*req);
516 static int dump_create_change_notification_reply( struct create_change_notification_reply *req, int len )
518 fprintf( stderr, " handle=%d", req->handle );
519 return (int)sizeof(*req);
522 static int dump_create_mapping_request( struct create_mapping_request *req, int len )
524 fprintf( stderr, " size_high=%d,", req->size_high );
525 fprintf( stderr, " size_low=%d,", req->size_low );
526 fprintf( stderr, " protect=%d,", req->protect );
527 fprintf( stderr, " inherit=%d,", req->inherit );
528 fprintf( stderr, " handle=%d,", req->handle );
529 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
530 return len;
533 static int dump_create_mapping_reply( struct create_mapping_reply *req, int len )
535 fprintf( stderr, " handle=%d", req->handle );
536 return (int)sizeof(*req);
539 static int dump_get_mapping_info_request( struct get_mapping_info_request *req, int len )
541 fprintf( stderr, " handle=%d", req->handle );
542 return (int)sizeof(*req);
545 static int dump_get_mapping_info_reply( struct get_mapping_info_reply *req, int len )
547 fprintf( stderr, " size_high=%d,", req->size_high );
548 fprintf( stderr, " size_low=%d,", req->size_low );
549 fprintf( stderr, " protect=%d", req->protect );
550 return (int)sizeof(*req);
553 static int dump_create_device_request( struct create_device_request *req, int len )
555 fprintf( stderr, " access=%08x,", req->access );
556 fprintf( stderr, " inherit=%d,", req->inherit );
557 fprintf( stderr, " id=%d", req->id );
558 return (int)sizeof(*req);
561 static int dump_create_device_reply( struct create_device_reply *req, int len )
563 fprintf( stderr, " handle=%d", req->handle );
564 return (int)sizeof(*req);
567 static int dump_create_snapshot_request( struct create_snapshot_request *req, int len )
569 fprintf( stderr, " inherit=%d,", req->inherit );
570 fprintf( stderr, " flags=%d", req->flags );
571 return (int)sizeof(*req);
574 static int dump_create_snapshot_reply( struct create_snapshot_reply *req, int len )
576 fprintf( stderr, " handle=%d", req->handle );
577 return (int)sizeof(*req);
580 static int dump_next_process_request( struct next_process_request *req, int len )
582 fprintf( stderr, " handle=%d,", req->handle );
583 fprintf( stderr, " reset=%d", req->reset );
584 return (int)sizeof(*req);
587 static int dump_next_process_reply( struct next_process_reply *req, int len )
589 fprintf( stderr, " pid=%p,", req->pid );
590 fprintf( stderr, " threads=%d,", req->threads );
591 fprintf( stderr, " priority=%d", req->priority );
592 return (int)sizeof(*req);
595 struct dumper
597 int (*dump_req)( void *data, int len );
598 void (*dump_reply)( void *data );
601 static const struct dumper dumpers[REQ_NB_REQUESTS] =
603 { (int(*)(void *,int))dump_new_thread_request,
604 (void(*)())dump_new_thread_reply },
605 { (int(*)(void *,int))dump_set_debug_request,
606 (void(*)())0 },
607 { (int(*)(void *,int))dump_init_thread_request,
608 (void(*)())0 },
609 { (int(*)(void *,int))dump_terminate_process_request,
610 (void(*)())0 },
611 { (int(*)(void *,int))dump_terminate_thread_request,
612 (void(*)())0 },
613 { (int(*)(void *,int))dump_get_process_info_request,
614 (void(*)())dump_get_process_info_reply },
615 { (int(*)(void *,int))dump_set_process_info_request,
616 (void(*)())0 },
617 { (int(*)(void *,int))dump_get_thread_info_request,
618 (void(*)())dump_get_thread_info_reply },
619 { (int(*)(void *,int))dump_set_thread_info_request,
620 (void(*)())0 },
621 { (int(*)(void *,int))dump_suspend_thread_request,
622 (void(*)())dump_suspend_thread_reply },
623 { (int(*)(void *,int))dump_resume_thread_request,
624 (void(*)())dump_resume_thread_reply },
625 { (int(*)(void *,int))dump_queue_apc_request,
626 (void(*)())0 },
627 { (int(*)(void *,int))dump_close_handle_request,
628 (void(*)())0 },
629 { (int(*)(void *,int))dump_get_handle_info_request,
630 (void(*)())dump_get_handle_info_reply },
631 { (int(*)(void *,int))dump_set_handle_info_request,
632 (void(*)())0 },
633 { (int(*)(void *,int))dump_dup_handle_request,
634 (void(*)())dump_dup_handle_reply },
635 { (int(*)(void *,int))dump_open_process_request,
636 (void(*)())dump_open_process_reply },
637 { (int(*)(void *,int))dump_select_request,
638 (void(*)())dump_select_reply },
639 { (int(*)(void *,int))dump_create_event_request,
640 (void(*)())dump_create_event_reply },
641 { (int(*)(void *,int))dump_event_op_request,
642 (void(*)())0 },
643 { (int(*)(void *,int))dump_create_mutex_request,
644 (void(*)())dump_create_mutex_reply },
645 { (int(*)(void *,int))dump_release_mutex_request,
646 (void(*)())0 },
647 { (int(*)(void *,int))dump_create_semaphore_request,
648 (void(*)())dump_create_semaphore_reply },
649 { (int(*)(void *,int))dump_release_semaphore_request,
650 (void(*)())dump_release_semaphore_reply },
651 { (int(*)(void *,int))dump_open_named_obj_request,
652 (void(*)())dump_open_named_obj_reply },
653 { (int(*)(void *,int))dump_create_file_request,
654 (void(*)())dump_create_file_reply },
655 { (int(*)(void *,int))dump_get_read_fd_request,
656 (void(*)())0 },
657 { (int(*)(void *,int))dump_get_write_fd_request,
658 (void(*)())0 },
659 { (int(*)(void *,int))dump_set_file_pointer_request,
660 (void(*)())dump_set_file_pointer_reply },
661 { (int(*)(void *,int))dump_truncate_file_request,
662 (void(*)())0 },
663 { (int(*)(void *,int))dump_set_file_time_request,
664 (void(*)())0 },
665 { (int(*)(void *,int))dump_flush_file_request,
666 (void(*)())0 },
667 { (int(*)(void *,int))dump_get_file_info_request,
668 (void(*)())dump_get_file_info_reply },
669 { (int(*)(void *,int))dump_lock_file_request,
670 (void(*)())0 },
671 { (int(*)(void *,int))dump_unlock_file_request,
672 (void(*)())0 },
673 { (int(*)(void *,int))dump_create_pipe_request,
674 (void(*)())dump_create_pipe_reply },
675 { (int(*)(void *,int))dump_alloc_console_request,
676 (void(*)())0 },
677 { (int(*)(void *,int))dump_free_console_request,
678 (void(*)())0 },
679 { (int(*)(void *,int))dump_open_console_request,
680 (void(*)())dump_open_console_reply },
681 { (int(*)(void *,int))dump_set_console_fd_request,
682 (void(*)())0 },
683 { (int(*)(void *,int))dump_get_console_mode_request,
684 (void(*)())dump_get_console_mode_reply },
685 { (int(*)(void *,int))dump_set_console_mode_request,
686 (void(*)())0 },
687 { (int(*)(void *,int))dump_set_console_info_request,
688 (void(*)())0 },
689 { (int(*)(void *,int))dump_get_console_info_request,
690 (void(*)())dump_get_console_info_reply },
691 { (int(*)(void *,int))dump_write_console_input_request,
692 (void(*)())dump_write_console_input_reply },
693 { (int(*)(void *,int))dump_read_console_input_request,
694 (void(*)())dump_read_console_input_reply },
695 { (int(*)(void *,int))dump_create_change_notification_request,
696 (void(*)())dump_create_change_notification_reply },
697 { (int(*)(void *,int))dump_create_mapping_request,
698 (void(*)())dump_create_mapping_reply },
699 { (int(*)(void *,int))dump_get_mapping_info_request,
700 (void(*)())dump_get_mapping_info_reply },
701 { (int(*)(void *,int))dump_create_device_request,
702 (void(*)())dump_create_device_reply },
703 { (int(*)(void *,int))dump_create_snapshot_request,
704 (void(*)())dump_create_snapshot_reply },
705 { (int(*)(void *,int))dump_next_process_request,
706 (void(*)())dump_next_process_reply },
709 static const char * const req_names[REQ_NB_REQUESTS] =
711 "new_thread",
712 "set_debug",
713 "init_thread",
714 "terminate_process",
715 "terminate_thread",
716 "get_process_info",
717 "set_process_info",
718 "get_thread_info",
719 "set_thread_info",
720 "suspend_thread",
721 "resume_thread",
722 "queue_apc",
723 "close_handle",
724 "get_handle_info",
725 "set_handle_info",
726 "dup_handle",
727 "open_process",
728 "select",
729 "create_event",
730 "event_op",
731 "create_mutex",
732 "release_mutex",
733 "create_semaphore",
734 "release_semaphore",
735 "open_named_obj",
736 "create_file",
737 "get_read_fd",
738 "get_write_fd",
739 "set_file_pointer",
740 "truncate_file",
741 "set_file_time",
742 "flush_file",
743 "get_file_info",
744 "lock_file",
745 "unlock_file",
746 "create_pipe",
747 "alloc_console",
748 "free_console",
749 "open_console",
750 "set_console_fd",
751 "get_console_mode",
752 "set_console_mode",
753 "set_console_info",
754 "get_console_info",
755 "write_console_input",
756 "read_console_input",
757 "create_change_notification",
758 "create_mapping",
759 "get_mapping_info",
760 "create_device",
761 "create_snapshot",
762 "next_process",
765 void trace_request( enum request req, void *data, int len, int fd )
767 int size;
768 current->last_req = req;
769 fprintf( stderr, "%08x: %s(", (unsigned int)current, req_names[req] );
770 size = dumpers[req].dump_req( data, len );
771 if ((len -= size) > 0)
773 unsigned char *ptr = (unsigned char *)data + size;
774 while (len--) fprintf( stderr, ", %02x", *ptr++ );
776 if (fd != -1) fprintf( stderr, " ) fd=%d\n", fd );
777 else fprintf( stderr, " )\n" );
780 void trace_timeout(void)
782 fprintf( stderr, "%08x: *timeout*\n", (unsigned int)current );
785 void trace_kill( int exit_code )
787 fprintf( stderr,"%08x: *killed* exit_code=%d\n",
788 (unsigned int)current, exit_code );
791 void trace_reply( struct thread *thread, int type, int pass_fd,
792 struct iovec *vec, int veclen )
794 if (!thread) return;
795 fprintf( stderr, "%08x: %s() = %d",
796 (unsigned int)thread, req_names[thread->last_req], type );
797 if (veclen)
799 fprintf( stderr, " {" );
800 if (dumpers[thread->last_req].dump_reply)
802 dumpers[thread->last_req].dump_reply( vec->iov_base );
803 vec++;
804 veclen--;
806 for (; veclen; veclen--, vec++)
808 unsigned char *ptr = vec->iov_base;
809 int len = vec->iov_len;
810 while (len--) fprintf( stderr, ", %02x", *ptr++ );
812 fprintf( stderr, " }" );
814 if (pass_fd != -1) fprintf( stderr, " fd=%d\n", pass_fd );
815 else fprintf( stderr, "\n" );