1 /* File generated automatically by tools/make_requests; DO NOT EDIT!! */
7 #include "server/thread.h"
9 static int dump_new_process_request( struct new_process_request *req, int len )
11 fprintf( stderr, " inherit=%d,", req->inherit );
12 fprintf( stderr, " inherit_all=%d,", req->inherit_all );
13 fprintf( stderr, " start_flags=%d,", req->start_flags );
14 fprintf( stderr, " hstdin=%d,", req->hstdin );
15 fprintf( stderr, " hstdout=%d,", req->hstdout );
16 fprintf( stderr, " hstderr=%d,", req->hstderr );
17 fprintf( stderr, " cmd_line=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
21 static int dump_new_process_reply( struct new_process_reply *req, int len )
23 fprintf( stderr, " pid=%p,", req->pid );
24 fprintf( stderr, " handle=%d", req->handle );
25 return (int)sizeof(*req);
28 static int dump_new_thread_request( struct new_thread_request *req, int len )
30 fprintf( stderr, " pid=%p,", req->pid );
31 fprintf( stderr, " suspend=%d,", req->suspend );
32 fprintf( stderr, " inherit=%d", req->inherit );
33 return (int)sizeof(*req);
36 static int dump_new_thread_reply( struct new_thread_reply *req, int len )
38 fprintf( stderr, " tid=%p,", req->tid );
39 fprintf( stderr, " handle=%d", req->handle );
40 return (int)sizeof(*req);
43 static int dump_set_debug_request( struct set_debug_request *req, int len )
45 fprintf( stderr, " level=%d", req->level );
46 return (int)sizeof(*req);
49 static int dump_init_process_request( struct init_process_request *req, int len )
51 fprintf( stderr, " dummy=%d", req->dummy );
52 return (int)sizeof(*req);
55 static int dump_init_process_reply( struct init_process_reply *req, int len )
57 fprintf( stderr, " start_flags=%d,", req->start_flags );
58 fprintf( stderr, " hstdin=%d,", req->hstdin );
59 fprintf( stderr, " hstdout=%d,", req->hstdout );
60 fprintf( stderr, " hstderr=%d", req->hstderr );
61 return (int)sizeof(*req);
64 static int dump_init_thread_request( struct init_thread_request *req, int len )
66 fprintf( stderr, " unix_pid=%d", req->unix_pid );
67 return (int)sizeof(*req);
70 static int dump_init_thread_reply( struct init_thread_reply *req, int len )
72 fprintf( stderr, " pid=%p,", req->pid );
73 fprintf( stderr, " tid=%p", req->tid );
74 return (int)sizeof(*req);
77 static int dump_terminate_process_request( struct terminate_process_request *req, int len )
79 fprintf( stderr, " handle=%d,", req->handle );
80 fprintf( stderr, " exit_code=%d", req->exit_code );
81 return (int)sizeof(*req);
84 static int dump_terminate_thread_request( struct terminate_thread_request *req, int len )
86 fprintf( stderr, " handle=%d,", req->handle );
87 fprintf( stderr, " exit_code=%d", req->exit_code );
88 return (int)sizeof(*req);
91 static int dump_get_process_info_request( struct get_process_info_request *req, int len )
93 fprintf( stderr, " handle=%d", req->handle );
94 return (int)sizeof(*req);
97 static int dump_get_process_info_reply( struct get_process_info_reply *req, int len )
99 fprintf( stderr, " pid=%p,", req->pid );
100 fprintf( stderr, " exit_code=%d,", req->exit_code );
101 fprintf( stderr, " priority=%d,", req->priority );
102 fprintf( stderr, " process_affinity=%d,", req->process_affinity );
103 fprintf( stderr, " system_affinity=%d", req->system_affinity );
104 return (int)sizeof(*req);
107 static int dump_set_process_info_request( struct set_process_info_request *req, int len )
109 fprintf( stderr, " handle=%d,", req->handle );
110 fprintf( stderr, " mask=%d,", req->mask );
111 fprintf( stderr, " priority=%d,", req->priority );
112 fprintf( stderr, " affinity=%d", req->affinity );
113 return (int)sizeof(*req);
116 static int dump_get_thread_info_request( struct get_thread_info_request *req, int len )
118 fprintf( stderr, " handle=%d", req->handle );
119 return (int)sizeof(*req);
122 static int dump_get_thread_info_reply( struct get_thread_info_reply *req, int len )
124 fprintf( stderr, " tid=%p,", req->tid );
125 fprintf( stderr, " exit_code=%d,", req->exit_code );
126 fprintf( stderr, " priority=%d", req->priority );
127 return (int)sizeof(*req);
130 static int dump_set_thread_info_request( struct set_thread_info_request *req, int len )
132 fprintf( stderr, " handle=%d,", req->handle );
133 fprintf( stderr, " mask=%d,", req->mask );
134 fprintf( stderr, " priority=%d,", req->priority );
135 fprintf( stderr, " affinity=%d", req->affinity );
136 return (int)sizeof(*req);
139 static int dump_suspend_thread_request( struct suspend_thread_request *req, int len )
141 fprintf( stderr, " handle=%d", req->handle );
142 return (int)sizeof(*req);
145 static int dump_suspend_thread_reply( struct suspend_thread_reply *req, int len )
147 fprintf( stderr, " count=%d", req->count );
148 return (int)sizeof(*req);
151 static int dump_resume_thread_request( struct resume_thread_request *req, int len )
153 fprintf( stderr, " handle=%d", req->handle );
154 return (int)sizeof(*req);
157 static int dump_resume_thread_reply( struct resume_thread_reply *req, int len )
159 fprintf( stderr, " count=%d", req->count );
160 return (int)sizeof(*req);
163 static int dump_queue_apc_request( struct queue_apc_request *req, int len )
165 fprintf( stderr, " handle=%d,", req->handle );
166 fprintf( stderr, " func=%p,", req->func );
167 fprintf( stderr, " param=%p", req->param );
168 return (int)sizeof(*req);
171 static int dump_close_handle_request( struct close_handle_request *req, int len )
173 fprintf( stderr, " handle=%d", req->handle );
174 return (int)sizeof(*req);
177 static int dump_get_handle_info_request( struct get_handle_info_request *req, int len )
179 fprintf( stderr, " handle=%d", req->handle );
180 return (int)sizeof(*req);
183 static int dump_get_handle_info_reply( struct get_handle_info_reply *req, int len )
185 fprintf( stderr, " flags=%d", req->flags );
186 return (int)sizeof(*req);
189 static int dump_set_handle_info_request( struct set_handle_info_request *req, int len )
191 fprintf( stderr, " handle=%d,", req->handle );
192 fprintf( stderr, " flags=%d,", req->flags );
193 fprintf( stderr, " mask=%d", req->mask );
194 return (int)sizeof(*req);
197 static int dump_dup_handle_request( struct dup_handle_request *req, int len )
199 fprintf( stderr, " src_process=%d,", req->src_process );
200 fprintf( stderr, " src_handle=%d,", req->src_handle );
201 fprintf( stderr, " dst_process=%d,", req->dst_process );
202 fprintf( stderr, " access=%08x,", req->access );
203 fprintf( stderr, " inherit=%d,", req->inherit );
204 fprintf( stderr, " options=%d", req->options );
205 return (int)sizeof(*req);
208 static int dump_dup_handle_reply( struct dup_handle_reply *req, int len )
210 fprintf( stderr, " handle=%d", req->handle );
211 return (int)sizeof(*req);
214 static int dump_open_process_request( struct open_process_request *req, int len )
216 fprintf( stderr, " pid=%p,", req->pid );
217 fprintf( stderr, " access=%08x,", req->access );
218 fprintf( stderr, " inherit=%d", req->inherit );
219 return (int)sizeof(*req);
222 static int dump_open_process_reply( struct open_process_reply *req, int len )
224 fprintf( stderr, " handle=%d", req->handle );
225 return (int)sizeof(*req);
228 static int dump_select_request( struct select_request *req, int len )
230 fprintf( stderr, " count=%d,", req->count );
231 fprintf( stderr, " flags=%d,", req->flags );
232 fprintf( stderr, " timeout=%d", req->timeout );
233 return (int)sizeof(*req);
236 static int dump_select_reply( struct select_reply *req, int len )
238 fprintf( stderr, " signaled=%d", req->signaled );
239 return (int)sizeof(*req);
242 static int dump_create_event_request( struct create_event_request *req, int len )
244 fprintf( stderr, " manual_reset=%d,", req->manual_reset );
245 fprintf( stderr, " initial_state=%d,", req->initial_state );
246 fprintf( stderr, " inherit=%d,", req->inherit );
247 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
251 static int dump_create_event_reply( struct create_event_reply *req, int len )
253 fprintf( stderr, " handle=%d", req->handle );
254 return (int)sizeof(*req);
257 static int dump_event_op_request( struct event_op_request *req, int len )
259 fprintf( stderr, " handle=%d,", req->handle );
260 fprintf( stderr, " op=%d", req->op );
261 return (int)sizeof(*req);
264 static int dump_create_mutex_request( struct create_mutex_request *req, int len )
266 fprintf( stderr, " owned=%d,", req->owned );
267 fprintf( stderr, " inherit=%d,", req->inherit );
268 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
272 static int dump_create_mutex_reply( struct create_mutex_reply *req, int len )
274 fprintf( stderr, " handle=%d", req->handle );
275 return (int)sizeof(*req);
278 static int dump_release_mutex_request( struct release_mutex_request *req, int len )
280 fprintf( stderr, " handle=%d", req->handle );
281 return (int)sizeof(*req);
284 static int dump_create_semaphore_request( struct create_semaphore_request *req, int len )
286 fprintf( stderr, " initial=%08x,", req->initial );
287 fprintf( stderr, " max=%08x,", req->max );
288 fprintf( stderr, " inherit=%d,", req->inherit );
289 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
293 static int dump_create_semaphore_reply( struct create_semaphore_reply *req, int len )
295 fprintf( stderr, " handle=%d", req->handle );
296 return (int)sizeof(*req);
299 static int dump_release_semaphore_request( struct release_semaphore_request *req, int len )
301 fprintf( stderr, " handle=%d,", req->handle );
302 fprintf( stderr, " count=%08x", req->count );
303 return (int)sizeof(*req);
306 static int dump_release_semaphore_reply( struct release_semaphore_reply *req, int len )
308 fprintf( stderr, " prev_count=%08x", req->prev_count );
309 return (int)sizeof(*req);
312 static int dump_open_named_obj_request( struct open_named_obj_request *req, int len )
314 fprintf( stderr, " type=%d,", req->type );
315 fprintf( stderr, " access=%08x,", req->access );
316 fprintf( stderr, " inherit=%d,", req->inherit );
317 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
321 static int dump_open_named_obj_reply( struct open_named_obj_reply *req, int len )
323 fprintf( stderr, " handle=%d", req->handle );
324 return (int)sizeof(*req);
327 static int dump_create_file_request( struct create_file_request *req, int len )
329 fprintf( stderr, " access=%08x,", req->access );
330 fprintf( stderr, " inherit=%d,", req->inherit );
331 fprintf( stderr, " sharing=%08x,", req->sharing );
332 fprintf( stderr, " create=%d,", req->create );
333 fprintf( stderr, " attrs=%08x,", req->attrs );
334 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
338 static int dump_create_file_reply( struct create_file_reply *req, int len )
340 fprintf( stderr, " handle=%d", req->handle );
341 return (int)sizeof(*req);
344 static int dump_get_read_fd_request( struct get_read_fd_request *req, int len )
346 fprintf( stderr, " handle=%d", req->handle );
347 return (int)sizeof(*req);
350 static int dump_get_write_fd_request( struct get_write_fd_request *req, int len )
352 fprintf( stderr, " handle=%d", req->handle );
353 return (int)sizeof(*req);
356 static int dump_set_file_pointer_request( struct set_file_pointer_request *req, int len )
358 fprintf( stderr, " handle=%d,", req->handle );
359 fprintf( stderr, " low=%d,", req->low );
360 fprintf( stderr, " high=%d,", req->high );
361 fprintf( stderr, " whence=%d", req->whence );
362 return (int)sizeof(*req);
365 static int dump_set_file_pointer_reply( struct set_file_pointer_reply *req, int len )
367 fprintf( stderr, " low=%d,", req->low );
368 fprintf( stderr, " high=%d", req->high );
369 return (int)sizeof(*req);
372 static int dump_truncate_file_request( struct truncate_file_request *req, int len )
374 fprintf( stderr, " handle=%d", req->handle );
375 return (int)sizeof(*req);
378 static int dump_set_file_time_request( struct set_file_time_request *req, int len )
380 fprintf( stderr, " handle=%d,", req->handle );
381 fprintf( stderr, " access_time=%ld,", req->access_time );
382 fprintf( stderr, " write_time=%ld", req->write_time );
383 return (int)sizeof(*req);
386 static int dump_flush_file_request( struct flush_file_request *req, int len )
388 fprintf( stderr, " handle=%d", req->handle );
389 return (int)sizeof(*req);
392 static int dump_get_file_info_request( struct get_file_info_request *req, int len )
394 fprintf( stderr, " handle=%d", req->handle );
395 return (int)sizeof(*req);
398 static int dump_get_file_info_reply( struct get_file_info_reply *req, int len )
400 fprintf( stderr, " type=%d,", req->type );
401 fprintf( stderr, " attr=%d,", req->attr );
402 fprintf( stderr, " access_time=%ld,", req->access_time );
403 fprintf( stderr, " write_time=%ld,", req->write_time );
404 fprintf( stderr, " size_high=%d,", req->size_high );
405 fprintf( stderr, " size_low=%d,", req->size_low );
406 fprintf( stderr, " links=%d,", req->links );
407 fprintf( stderr, " index_high=%d,", req->index_high );
408 fprintf( stderr, " index_low=%d,", req->index_low );
409 fprintf( stderr, " serial=%08x", req->serial );
410 return (int)sizeof(*req);
413 static int dump_lock_file_request( struct lock_file_request *req, int len )
415 fprintf( stderr, " handle=%d,", req->handle );
416 fprintf( stderr, " offset_low=%08x,", req->offset_low );
417 fprintf( stderr, " offset_high=%08x,", req->offset_high );
418 fprintf( stderr, " count_low=%08x,", req->count_low );
419 fprintf( stderr, " count_high=%08x", req->count_high );
420 return (int)sizeof(*req);
423 static int dump_unlock_file_request( struct unlock_file_request *req, int len )
425 fprintf( stderr, " handle=%d,", req->handle );
426 fprintf( stderr, " offset_low=%08x,", req->offset_low );
427 fprintf( stderr, " offset_high=%08x,", req->offset_high );
428 fprintf( stderr, " count_low=%08x,", req->count_low );
429 fprintf( stderr, " count_high=%08x", req->count_high );
430 return (int)sizeof(*req);
433 static int dump_create_pipe_request( struct create_pipe_request *req, int len )
435 fprintf( stderr, " inherit=%d", req->inherit );
436 return (int)sizeof(*req);
439 static int dump_create_pipe_reply( struct create_pipe_reply *req, int len )
441 fprintf( stderr, " handle_read=%d,", req->handle_read );
442 fprintf( stderr, " handle_write=%d", req->handle_write );
443 return (int)sizeof(*req);
446 static int dump_alloc_console_request( struct alloc_console_request *req, int len )
448 return (int)sizeof(*req);
451 static int dump_free_console_request( struct free_console_request *req, int len )
453 return (int)sizeof(*req);
456 static int dump_open_console_request( struct open_console_request *req, int len )
458 fprintf( stderr, " output=%d,", req->output );
459 fprintf( stderr, " access=%08x,", req->access );
460 fprintf( stderr, " inherit=%d", req->inherit );
461 return (int)sizeof(*req);
464 static int dump_open_console_reply( struct open_console_reply *req, int len )
466 fprintf( stderr, " handle=%d", req->handle );
467 return (int)sizeof(*req);
470 static int dump_set_console_fd_request( struct set_console_fd_request *req, int len )
472 fprintf( stderr, " handle=%d,", req->handle );
473 fprintf( stderr, " pid=%d", req->pid );
474 return (int)sizeof(*req);
477 static int dump_get_console_mode_request( struct get_console_mode_request *req, int len )
479 fprintf( stderr, " handle=%d", req->handle );
480 return (int)sizeof(*req);
483 static int dump_get_console_mode_reply( struct get_console_mode_reply *req, int len )
485 fprintf( stderr, " mode=%d", req->mode );
486 return (int)sizeof(*req);
489 static int dump_set_console_mode_request( struct set_console_mode_request *req, int len )
491 fprintf( stderr, " handle=%d,", req->handle );
492 fprintf( stderr, " mode=%d", req->mode );
493 return (int)sizeof(*req);
496 static int dump_set_console_info_request( struct set_console_info_request *req, int len )
498 fprintf( stderr, " handle=%d,", req->handle );
499 fprintf( stderr, " mask=%d,", req->mask );
500 fprintf( stderr, " cursor_size=%d,", req->cursor_size );
501 fprintf( stderr, " cursor_visible=%d,", req->cursor_visible );
502 fprintf( stderr, " title=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
506 static int dump_get_console_info_request( struct get_console_info_request *req, int len )
508 fprintf( stderr, " handle=%d", req->handle );
509 return (int)sizeof(*req);
512 static int dump_get_console_info_reply( struct get_console_info_reply *req, int len )
514 fprintf( stderr, " cursor_size=%d,", req->cursor_size );
515 fprintf( stderr, " cursor_visible=%d,", req->cursor_visible );
516 fprintf( stderr, " pid=%d", req->pid );
517 return (int)sizeof(*req);
520 static int dump_write_console_input_request( struct write_console_input_request *req, int len )
522 fprintf( stderr, " handle=%d,", req->handle );
523 fprintf( stderr, " count=%d", req->count );
524 return (int)sizeof(*req);
527 static int dump_write_console_input_reply( struct write_console_input_reply *req, int len )
529 fprintf( stderr, " written=%d", req->written );
530 return (int)sizeof(*req);
533 static int dump_read_console_input_request( struct read_console_input_request *req, int len )
535 fprintf( stderr, " handle=%d,", req->handle );
536 fprintf( stderr, " count=%d,", req->count );
537 fprintf( stderr, " flush=%d", req->flush );
538 return (int)sizeof(*req);
541 static int dump_read_console_input_reply( struct read_console_input_reply *req, int len )
543 return (int)sizeof(*req);
546 static int dump_create_change_notification_request( struct create_change_notification_request *req, int len )
548 fprintf( stderr, " subtree=%d,", req->subtree );
549 fprintf( stderr, " filter=%d", req->filter );
550 return (int)sizeof(*req);
553 static int dump_create_change_notification_reply( struct create_change_notification_reply *req, int len )
555 fprintf( stderr, " handle=%d", req->handle );
556 return (int)sizeof(*req);
559 static int dump_create_mapping_request( struct create_mapping_request *req, int len )
561 fprintf( stderr, " size_high=%d,", req->size_high );
562 fprintf( stderr, " size_low=%d,", req->size_low );
563 fprintf( stderr, " protect=%d,", req->protect );
564 fprintf( stderr, " inherit=%d,", req->inherit );
565 fprintf( stderr, " handle=%d,", req->handle );
566 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
570 static int dump_create_mapping_reply( struct create_mapping_reply *req, int len )
572 fprintf( stderr, " handle=%d", req->handle );
573 return (int)sizeof(*req);
576 static int dump_get_mapping_info_request( struct get_mapping_info_request *req, int len )
578 fprintf( stderr, " handle=%d", req->handle );
579 return (int)sizeof(*req);
582 static int dump_get_mapping_info_reply( struct get_mapping_info_reply *req, int len )
584 fprintf( stderr, " size_high=%d,", req->size_high );
585 fprintf( stderr, " size_low=%d,", req->size_low );
586 fprintf( stderr, " protect=%d", req->protect );
587 return (int)sizeof(*req);
590 static int dump_create_device_request( struct create_device_request *req, int len )
592 fprintf( stderr, " access=%08x,", req->access );
593 fprintf( stderr, " inherit=%d,", req->inherit );
594 fprintf( stderr, " id=%d", req->id );
595 return (int)sizeof(*req);
598 static int dump_create_device_reply( struct create_device_reply *req, int len )
600 fprintf( stderr, " handle=%d", req->handle );
601 return (int)sizeof(*req);
604 static int dump_create_snapshot_request( struct create_snapshot_request *req, int len )
606 fprintf( stderr, " inherit=%d,", req->inherit );
607 fprintf( stderr, " flags=%d", req->flags );
608 return (int)sizeof(*req);
611 static int dump_create_snapshot_reply( struct create_snapshot_reply *req, int len )
613 fprintf( stderr, " handle=%d", req->handle );
614 return (int)sizeof(*req);
617 static int dump_next_process_request( struct next_process_request *req, int len )
619 fprintf( stderr, " handle=%d,", req->handle );
620 fprintf( stderr, " reset=%d", req->reset );
621 return (int)sizeof(*req);
624 static int dump_next_process_reply( struct next_process_reply *req, int len )
626 fprintf( stderr, " pid=%p,", req->pid );
627 fprintf( stderr, " threads=%d,", req->threads );
628 fprintf( stderr, " priority=%d", req->priority );
629 return (int)sizeof(*req);
634 int (*dump_req)( void *data, int len );
635 void (*dump_reply)( void *data );
638 static const struct dumper dumpers[REQ_NB_REQUESTS] =
640 { (int(*)(void *,int))dump_new_process_request,
641 (void(*)())dump_new_process_reply },
642 { (int(*)(void *,int))dump_new_thread_request,
643 (void(*)())dump_new_thread_reply },
644 { (int(*)(void *,int))dump_set_debug_request,
646 { (int(*)(void *,int))dump_init_process_request,
647 (void(*)())dump_init_process_reply },
648 { (int(*)(void *,int))dump_init_thread_request,
649 (void(*)())dump_init_thread_reply },
650 { (int(*)(void *,int))dump_terminate_process_request,
652 { (int(*)(void *,int))dump_terminate_thread_request,
654 { (int(*)(void *,int))dump_get_process_info_request,
655 (void(*)())dump_get_process_info_reply },
656 { (int(*)(void *,int))dump_set_process_info_request,
658 { (int(*)(void *,int))dump_get_thread_info_request,
659 (void(*)())dump_get_thread_info_reply },
660 { (int(*)(void *,int))dump_set_thread_info_request,
662 { (int(*)(void *,int))dump_suspend_thread_request,
663 (void(*)())dump_suspend_thread_reply },
664 { (int(*)(void *,int))dump_resume_thread_request,
665 (void(*)())dump_resume_thread_reply },
666 { (int(*)(void *,int))dump_queue_apc_request,
668 { (int(*)(void *,int))dump_close_handle_request,
670 { (int(*)(void *,int))dump_get_handle_info_request,
671 (void(*)())dump_get_handle_info_reply },
672 { (int(*)(void *,int))dump_set_handle_info_request,
674 { (int(*)(void *,int))dump_dup_handle_request,
675 (void(*)())dump_dup_handle_reply },
676 { (int(*)(void *,int))dump_open_process_request,
677 (void(*)())dump_open_process_reply },
678 { (int(*)(void *,int))dump_select_request,
679 (void(*)())dump_select_reply },
680 { (int(*)(void *,int))dump_create_event_request,
681 (void(*)())dump_create_event_reply },
682 { (int(*)(void *,int))dump_event_op_request,
684 { (int(*)(void *,int))dump_create_mutex_request,
685 (void(*)())dump_create_mutex_reply },
686 { (int(*)(void *,int))dump_release_mutex_request,
688 { (int(*)(void *,int))dump_create_semaphore_request,
689 (void(*)())dump_create_semaphore_reply },
690 { (int(*)(void *,int))dump_release_semaphore_request,
691 (void(*)())dump_release_semaphore_reply },
692 { (int(*)(void *,int))dump_open_named_obj_request,
693 (void(*)())dump_open_named_obj_reply },
694 { (int(*)(void *,int))dump_create_file_request,
695 (void(*)())dump_create_file_reply },
696 { (int(*)(void *,int))dump_get_read_fd_request,
698 { (int(*)(void *,int))dump_get_write_fd_request,
700 { (int(*)(void *,int))dump_set_file_pointer_request,
701 (void(*)())dump_set_file_pointer_reply },
702 { (int(*)(void *,int))dump_truncate_file_request,
704 { (int(*)(void *,int))dump_set_file_time_request,
706 { (int(*)(void *,int))dump_flush_file_request,
708 { (int(*)(void *,int))dump_get_file_info_request,
709 (void(*)())dump_get_file_info_reply },
710 { (int(*)(void *,int))dump_lock_file_request,
712 { (int(*)(void *,int))dump_unlock_file_request,
714 { (int(*)(void *,int))dump_create_pipe_request,
715 (void(*)())dump_create_pipe_reply },
716 { (int(*)(void *,int))dump_alloc_console_request,
718 { (int(*)(void *,int))dump_free_console_request,
720 { (int(*)(void *,int))dump_open_console_request,
721 (void(*)())dump_open_console_reply },
722 { (int(*)(void *,int))dump_set_console_fd_request,
724 { (int(*)(void *,int))dump_get_console_mode_request,
725 (void(*)())dump_get_console_mode_reply },
726 { (int(*)(void *,int))dump_set_console_mode_request,
728 { (int(*)(void *,int))dump_set_console_info_request,
730 { (int(*)(void *,int))dump_get_console_info_request,
731 (void(*)())dump_get_console_info_reply },
732 { (int(*)(void *,int))dump_write_console_input_request,
733 (void(*)())dump_write_console_input_reply },
734 { (int(*)(void *,int))dump_read_console_input_request,
735 (void(*)())dump_read_console_input_reply },
736 { (int(*)(void *,int))dump_create_change_notification_request,
737 (void(*)())dump_create_change_notification_reply },
738 { (int(*)(void *,int))dump_create_mapping_request,
739 (void(*)())dump_create_mapping_reply },
740 { (int(*)(void *,int))dump_get_mapping_info_request,
741 (void(*)())dump_get_mapping_info_reply },
742 { (int(*)(void *,int))dump_create_device_request,
743 (void(*)())dump_create_device_reply },
744 { (int(*)(void *,int))dump_create_snapshot_request,
745 (void(*)())dump_create_snapshot_reply },
746 { (int(*)(void *,int))dump_next_process_request,
747 (void(*)())dump_next_process_reply },
750 static const char * const req_names[REQ_NB_REQUESTS] =
798 "write_console_input",
799 "read_console_input",
800 "create_change_notification",
808 void trace_request( enum request req, void *data, int len, int fd )
811 current->last_req = req;
812 fprintf( stderr, "%08x: %s(", (unsigned int)current, req_names[req] );
813 size = dumpers[req].dump_req( data, len );
814 if ((len -= size) > 0)
816 unsigned char *ptr = (unsigned char *)data + size;
817 while (len--) fprintf( stderr, ", %02x", *ptr++ );
819 if (fd != -1) fprintf( stderr, " ) fd=%d\n", fd );
820 else fprintf( stderr, " )\n" );
823 void trace_timeout(void)
825 fprintf( stderr, "%08x: *timeout*\n", (unsigned int)current );
828 void trace_kill( int exit_code )
830 fprintf( stderr,"%08x: *killed* exit_code=%d\n",
831 (unsigned int)current, exit_code );
834 void trace_reply( struct thread *thread, int type, int pass_fd,
835 struct iovec *vec, int veclen )
838 fprintf( stderr, "%08x: %s() = %d",
839 (unsigned int)thread, req_names[thread->last_req], type );
842 fprintf( stderr, " {" );
843 if (dumpers[thread->last_req].dump_reply)
845 dumpers[thread->last_req].dump_reply( vec->iov_base );
849 for (; veclen; veclen--, vec++)
851 unsigned char *ptr = vec->iov_base;
852 int len = vec->iov_len;
853 while (len--) fprintf( stderr, ", %02x", *ptr++ );
855 fprintf( stderr, " }" );
857 if (pass_fd != -1) fprintf( stderr, " fd=%d\n", pass_fd );
858 else fprintf( stderr, "\n" );