1 /* File generated automatically by tools/make_requests; DO NOT EDIT!! */
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) );
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_dup_handle_request( struct dup_handle_request *req, int len )
139 fprintf( stderr, " src_process=%d,", req->src_process );
140 fprintf( stderr, " src_handle=%d,", req->src_handle );
141 fprintf( stderr, " dst_process=%d,", req->dst_process );
142 fprintf( stderr, " dst_handle=%d,", req->dst_handle );
143 fprintf( stderr, " access=%08x,", req->access );
144 fprintf( stderr, " inherit=%d,", req->inherit );
145 fprintf( stderr, " options=%d", req->options );
146 return (int)sizeof(*req);
149 static int dump_dup_handle_reply( struct dup_handle_reply *req, int len )
151 fprintf( stderr, " handle=%d", req->handle );
152 return (int)sizeof(*req);
155 static int dump_open_process_request( struct open_process_request *req, int len )
157 fprintf( stderr, " pid=%p,", req->pid );
158 fprintf( stderr, " access=%08x,", req->access );
159 fprintf( stderr, " inherit=%d", req->inherit );
160 return (int)sizeof(*req);
163 static int dump_open_process_reply( struct open_process_reply *req, int len )
165 fprintf( stderr, " handle=%d", req->handle );
166 return (int)sizeof(*req);
169 static int dump_select_request( struct select_request *req, int len )
171 fprintf( stderr, " count=%d,", req->count );
172 fprintf( stderr, " flags=%d,", req->flags );
173 fprintf( stderr, " timeout=%d", req->timeout );
174 return (int)sizeof(*req);
177 static int dump_select_reply( struct select_reply *req, int len )
179 fprintf( stderr, " signaled=%d", req->signaled );
180 return (int)sizeof(*req);
183 static int dump_create_event_request( struct create_event_request *req, int len )
185 fprintf( stderr, " manual_reset=%d,", req->manual_reset );
186 fprintf( stderr, " initial_state=%d,", req->initial_state );
187 fprintf( stderr, " inherit=%d,", req->inherit );
188 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
192 static int dump_create_event_reply( struct create_event_reply *req, int len )
194 fprintf( stderr, " handle=%d", req->handle );
195 return (int)sizeof(*req);
198 static int dump_event_op_request( struct event_op_request *req, int len )
200 fprintf( stderr, " handle=%d,", req->handle );
201 fprintf( stderr, " op=%d", req->op );
202 return (int)sizeof(*req);
205 static int dump_create_mutex_request( struct create_mutex_request *req, int len )
207 fprintf( stderr, " owned=%d,", req->owned );
208 fprintf( stderr, " inherit=%d,", req->inherit );
209 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
213 static int dump_create_mutex_reply( struct create_mutex_reply *req, int len )
215 fprintf( stderr, " handle=%d", req->handle );
216 return (int)sizeof(*req);
219 static int dump_release_mutex_request( struct release_mutex_request *req, int len )
221 fprintf( stderr, " handle=%d", req->handle );
222 return (int)sizeof(*req);
225 static int dump_create_semaphore_request( struct create_semaphore_request *req, int len )
227 fprintf( stderr, " initial=%08x,", req->initial );
228 fprintf( stderr, " max=%08x,", req->max );
229 fprintf( stderr, " inherit=%d,", req->inherit );
230 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
234 static int dump_create_semaphore_reply( struct create_semaphore_reply *req, int len )
236 fprintf( stderr, " handle=%d", req->handle );
237 return (int)sizeof(*req);
240 static int dump_release_semaphore_request( struct release_semaphore_request *req, int len )
242 fprintf( stderr, " handle=%d,", req->handle );
243 fprintf( stderr, " count=%08x", req->count );
244 return (int)sizeof(*req);
247 static int dump_release_semaphore_reply( struct release_semaphore_reply *req, int len )
249 fprintf( stderr, " prev_count=%08x", req->prev_count );
250 return (int)sizeof(*req);
253 static int dump_open_named_obj_request( struct open_named_obj_request *req, int len )
255 fprintf( stderr, " type=%d,", req->type );
256 fprintf( stderr, " access=%08x,", req->access );
257 fprintf( stderr, " inherit=%d,", req->inherit );
258 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
262 static int dump_open_named_obj_reply( struct open_named_obj_reply *req, int len )
264 fprintf( stderr, " handle=%d", req->handle );
265 return (int)sizeof(*req);
268 static int dump_create_file_request( struct create_file_request *req, int len )
270 fprintf( stderr, " access=%08x,", req->access );
271 fprintf( stderr, " inherit=%d,", req->inherit );
272 fprintf( stderr, " sharing=%08x,", req->sharing );
273 fprintf( stderr, " create=%d,", req->create );
274 fprintf( stderr, " attrs=%08x,", req->attrs );
275 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
279 static int dump_create_file_reply( struct create_file_reply *req, int len )
281 fprintf( stderr, " handle=%d", req->handle );
282 return (int)sizeof(*req);
285 static int dump_get_read_fd_request( struct get_read_fd_request *req, int len )
287 fprintf( stderr, " handle=%d", req->handle );
288 return (int)sizeof(*req);
291 static int dump_get_write_fd_request( struct get_write_fd_request *req, int len )
293 fprintf( stderr, " handle=%d", req->handle );
294 return (int)sizeof(*req);
297 static int dump_set_file_pointer_request( struct set_file_pointer_request *req, int len )
299 fprintf( stderr, " handle=%d,", req->handle );
300 fprintf( stderr, " low=%d,", req->low );
301 fprintf( stderr, " high=%d,", req->high );
302 fprintf( stderr, " whence=%d", req->whence );
303 return (int)sizeof(*req);
306 static int dump_set_file_pointer_reply( struct set_file_pointer_reply *req, int len )
308 fprintf( stderr, " low=%d,", req->low );
309 fprintf( stderr, " high=%d", req->high );
310 return (int)sizeof(*req);
313 static int dump_truncate_file_request( struct truncate_file_request *req, int len )
315 fprintf( stderr, " handle=%d", req->handle );
316 return (int)sizeof(*req);
319 static int dump_set_file_time_request( struct set_file_time_request *req, int len )
321 fprintf( stderr, " handle=%d,", req->handle );
322 fprintf( stderr, " access_time=%ld,", req->access_time );
323 fprintf( stderr, " write_time=%ld", req->write_time );
324 return (int)sizeof(*req);
327 static int dump_flush_file_request( struct flush_file_request *req, int len )
329 fprintf( stderr, " handle=%d", req->handle );
330 return (int)sizeof(*req);
333 static int dump_get_file_info_request( struct get_file_info_request *req, int len )
335 fprintf( stderr, " handle=%d", req->handle );
336 return (int)sizeof(*req);
339 static int dump_get_file_info_reply( struct get_file_info_reply *req, int len )
341 fprintf( stderr, " type=%d,", req->type );
342 fprintf( stderr, " attr=%d,", req->attr );
343 fprintf( stderr, " access_time=%ld,", req->access_time );
344 fprintf( stderr, " write_time=%ld,", req->write_time );
345 fprintf( stderr, " size_high=%d,", req->size_high );
346 fprintf( stderr, " size_low=%d,", req->size_low );
347 fprintf( stderr, " links=%d,", req->links );
348 fprintf( stderr, " index_high=%d,", req->index_high );
349 fprintf( stderr, " index_low=%d,", req->index_low );
350 fprintf( stderr, " serial=%08x", req->serial );
351 return (int)sizeof(*req);
354 static int dump_lock_file_request( struct lock_file_request *req, int len )
356 fprintf( stderr, " handle=%d,", req->handle );
357 fprintf( stderr, " offset_low=%08x,", req->offset_low );
358 fprintf( stderr, " offset_high=%08x,", req->offset_high );
359 fprintf( stderr, " count_low=%08x,", req->count_low );
360 fprintf( stderr, " count_high=%08x", req->count_high );
361 return (int)sizeof(*req);
364 static int dump_unlock_file_request( struct unlock_file_request *req, int len )
366 fprintf( stderr, " handle=%d,", req->handle );
367 fprintf( stderr, " offset_low=%08x,", req->offset_low );
368 fprintf( stderr, " offset_high=%08x,", req->offset_high );
369 fprintf( stderr, " count_low=%08x,", req->count_low );
370 fprintf( stderr, " count_high=%08x", req->count_high );
371 return (int)sizeof(*req);
374 static int dump_create_pipe_request( struct create_pipe_request *req, int len )
376 fprintf( stderr, " inherit=%d", req->inherit );
377 return (int)sizeof(*req);
380 static int dump_create_pipe_reply( struct create_pipe_reply *req, int len )
382 fprintf( stderr, " handle_read=%d,", req->handle_read );
383 fprintf( stderr, " handle_write=%d", req->handle_write );
384 return (int)sizeof(*req);
387 static int dump_alloc_console_request( struct alloc_console_request *req, int len )
389 return (int)sizeof(*req);
392 static int dump_free_console_request( struct free_console_request *req, int len )
394 return (int)sizeof(*req);
397 static int dump_open_console_request( struct open_console_request *req, int len )
399 fprintf( stderr, " output=%d,", req->output );
400 fprintf( stderr, " access=%08x,", req->access );
401 fprintf( stderr, " inherit=%d", req->inherit );
402 return (int)sizeof(*req);
405 static int dump_open_console_reply( struct open_console_reply *req, int len )
407 fprintf( stderr, " handle=%d", req->handle );
408 return (int)sizeof(*req);
411 static int dump_set_console_fd_request( struct set_console_fd_request *req, int len )
413 fprintf( stderr, " handle=%d,", req->handle );
414 fprintf( stderr, " pid=%d", req->pid );
415 return (int)sizeof(*req);
418 static int dump_get_console_mode_request( struct get_console_mode_request *req, int len )
420 fprintf( stderr, " handle=%d", req->handle );
421 return (int)sizeof(*req);
424 static int dump_get_console_mode_reply( struct get_console_mode_reply *req, int len )
426 fprintf( stderr, " mode=%d", req->mode );
427 return (int)sizeof(*req);
430 static int dump_set_console_mode_request( struct set_console_mode_request *req, int len )
432 fprintf( stderr, " handle=%d,", req->handle );
433 fprintf( stderr, " mode=%d", req->mode );
434 return (int)sizeof(*req);
437 static int dump_set_console_info_request( struct set_console_info_request *req, int len )
439 fprintf( stderr, " handle=%d,", req->handle );
440 fprintf( stderr, " mask=%d,", req->mask );
441 fprintf( stderr, " cursor_size=%d,", req->cursor_size );
442 fprintf( stderr, " cursor_visible=%d,", req->cursor_visible );
443 fprintf( stderr, " title=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
447 static int dump_get_console_info_request( struct get_console_info_request *req, int len )
449 fprintf( stderr, " handle=%d", req->handle );
450 return (int)sizeof(*req);
453 static int dump_get_console_info_reply( struct get_console_info_reply *req, int len )
455 fprintf( stderr, " cursor_size=%d,", req->cursor_size );
456 fprintf( stderr, " cursor_visible=%d,", req->cursor_visible );
457 fprintf( stderr, " pid=%d", req->pid );
458 return (int)sizeof(*req);
461 static int dump_create_change_notification_request( struct create_change_notification_request *req, int len )
463 fprintf( stderr, " subtree=%d,", req->subtree );
464 fprintf( stderr, " filter=%d", req->filter );
465 return (int)sizeof(*req);
468 static int dump_create_change_notification_reply( struct create_change_notification_reply *req, int len )
470 fprintf( stderr, " handle=%d", req->handle );
471 return (int)sizeof(*req);
474 static int dump_create_mapping_request( struct create_mapping_request *req, int len )
476 fprintf( stderr, " size_high=%d,", req->size_high );
477 fprintf( stderr, " size_low=%d,", req->size_low );
478 fprintf( stderr, " protect=%d,", req->protect );
479 fprintf( stderr, " handle=%d,", req->handle );
480 fprintf( stderr, " name=\"%.*s\"", len - (int)sizeof(*req), (char *)(req+1) );
484 static int dump_create_mapping_reply( struct create_mapping_reply *req, int len )
486 fprintf( stderr, " handle=%d", req->handle );
487 return (int)sizeof(*req);
490 static int dump_get_mapping_info_request( struct get_mapping_info_request *req, int len )
492 fprintf( stderr, " handle=%d", req->handle );
493 return (int)sizeof(*req);
496 static int dump_get_mapping_info_reply( struct get_mapping_info_reply *req, int len )
498 fprintf( stderr, " size_high=%d,", req->size_high );
499 fprintf( stderr, " size_low=%d,", req->size_low );
500 fprintf( stderr, " protect=%d", req->protect );
501 return (int)sizeof(*req);
504 static int dump_create_device_request( struct create_device_request *req, int len )
506 fprintf( stderr, " access=%08x,", req->access );
507 fprintf( stderr, " inherit=%d,", req->inherit );
508 fprintf( stderr, " id=%d", req->id );
509 return (int)sizeof(*req);
512 static int dump_create_device_reply( struct create_device_reply *req, int len )
514 fprintf( stderr, " handle=%d", req->handle );
515 return (int)sizeof(*req);
520 int (*dump_req)( void *data, int len );
521 void (*dump_reply)( void *data );
524 static const struct dumper dumpers[REQ_NB_REQUESTS] =
526 { (int(*)(void *,int))dump_new_thread_request,
527 (void(*)())dump_new_thread_reply },
528 { (int(*)(void *,int))dump_set_debug_request,
530 { (int(*)(void *,int))dump_init_thread_request,
532 { (int(*)(void *,int))dump_terminate_process_request,
534 { (int(*)(void *,int))dump_terminate_thread_request,
536 { (int(*)(void *,int))dump_get_process_info_request,
537 (void(*)())dump_get_process_info_reply },
538 { (int(*)(void *,int))dump_set_process_info_request,
540 { (int(*)(void *,int))dump_get_thread_info_request,
541 (void(*)())dump_get_thread_info_reply },
542 { (int(*)(void *,int))dump_set_thread_info_request,
544 { (int(*)(void *,int))dump_suspend_thread_request,
545 (void(*)())dump_suspend_thread_reply },
546 { (int(*)(void *,int))dump_resume_thread_request,
547 (void(*)())dump_resume_thread_reply },
548 { (int(*)(void *,int))dump_queue_apc_request,
550 { (int(*)(void *,int))dump_close_handle_request,
552 { (int(*)(void *,int))dump_dup_handle_request,
553 (void(*)())dump_dup_handle_reply },
554 { (int(*)(void *,int))dump_open_process_request,
555 (void(*)())dump_open_process_reply },
556 { (int(*)(void *,int))dump_select_request,
557 (void(*)())dump_select_reply },
558 { (int(*)(void *,int))dump_create_event_request,
559 (void(*)())dump_create_event_reply },
560 { (int(*)(void *,int))dump_event_op_request,
562 { (int(*)(void *,int))dump_create_mutex_request,
563 (void(*)())dump_create_mutex_reply },
564 { (int(*)(void *,int))dump_release_mutex_request,
566 { (int(*)(void *,int))dump_create_semaphore_request,
567 (void(*)())dump_create_semaphore_reply },
568 { (int(*)(void *,int))dump_release_semaphore_request,
569 (void(*)())dump_release_semaphore_reply },
570 { (int(*)(void *,int))dump_open_named_obj_request,
571 (void(*)())dump_open_named_obj_reply },
572 { (int(*)(void *,int))dump_create_file_request,
573 (void(*)())dump_create_file_reply },
574 { (int(*)(void *,int))dump_get_read_fd_request,
576 { (int(*)(void *,int))dump_get_write_fd_request,
578 { (int(*)(void *,int))dump_set_file_pointer_request,
579 (void(*)())dump_set_file_pointer_reply },
580 { (int(*)(void *,int))dump_truncate_file_request,
582 { (int(*)(void *,int))dump_set_file_time_request,
584 { (int(*)(void *,int))dump_flush_file_request,
586 { (int(*)(void *,int))dump_get_file_info_request,
587 (void(*)())dump_get_file_info_reply },
588 { (int(*)(void *,int))dump_lock_file_request,
590 { (int(*)(void *,int))dump_unlock_file_request,
592 { (int(*)(void *,int))dump_create_pipe_request,
593 (void(*)())dump_create_pipe_reply },
594 { (int(*)(void *,int))dump_alloc_console_request,
596 { (int(*)(void *,int))dump_free_console_request,
598 { (int(*)(void *,int))dump_open_console_request,
599 (void(*)())dump_open_console_reply },
600 { (int(*)(void *,int))dump_set_console_fd_request,
602 { (int(*)(void *,int))dump_get_console_mode_request,
603 (void(*)())dump_get_console_mode_reply },
604 { (int(*)(void *,int))dump_set_console_mode_request,
606 { (int(*)(void *,int))dump_set_console_info_request,
608 { (int(*)(void *,int))dump_get_console_info_request,
609 (void(*)())dump_get_console_info_reply },
610 { (int(*)(void *,int))dump_create_change_notification_request,
611 (void(*)())dump_create_change_notification_reply },
612 { (int(*)(void *,int))dump_create_mapping_request,
613 (void(*)())dump_create_mapping_reply },
614 { (int(*)(void *,int))dump_get_mapping_info_request,
615 (void(*)())dump_get_mapping_info_reply },
616 { (int(*)(void *,int))dump_create_device_request,
617 (void(*)())dump_create_device_reply },
620 static const char * const req_names[REQ_NB_REQUESTS] =
664 "create_change_notification",
670 void trace_request( enum request req, void *data, int len, int fd )
673 current->last_req = req;
674 fprintf( stderr, "%08x: %s(", (unsigned int)current, req_names[req] );
675 size = dumpers[req].dump_req( data, len );
676 if ((len -= size) > 0)
678 unsigned char *ptr = (unsigned char *)data + size;
679 while (len--) fprintf( stderr, ", %02x", *ptr++ );
681 if (fd != -1) fprintf( stderr, " ) fd=%d\n", fd );
682 else fprintf( stderr, " )\n" );
685 void trace_timeout(void)
687 fprintf( stderr, "%08x: *timeout*\n", (unsigned int)current );
690 void trace_kill( int exit_code )
692 fprintf( stderr,"%08x: *killed* exit_code=%d\n",
693 (unsigned int)current, exit_code );
696 void trace_reply( struct thread *thread, int type, int pass_fd,
697 struct iovec *vec, int veclen )
700 fprintf( stderr, "%08x: %s() = %d",
701 (unsigned int)thread, req_names[thread->last_req], type );
704 fprintf( stderr, " {" );
705 if (dumpers[thread->last_req].dump_reply)
707 dumpers[thread->last_req].dump_reply( vec->iov_base );
711 for (; veclen; veclen--, vec++)
713 unsigned char *ptr = vec->iov_base;
714 int len = vec->iov_len;
715 while (len--) fprintf( stderr, ", %02x", *ptr++ );
717 fprintf( stderr, " }" );
719 if (pass_fd != -1) fprintf( stderr, " fd=%d\n", pass_fd );
720 else fprintf( stderr, "\n" );