server: Use attributes instead of inherit flag in console requests.
[wine] / server / trace.c
1 /*
2  * Server request tracing
3  *
4  * Copyright (C) 1999 Alexandre Julliard
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #include "config.h"
22 #include "wine/port.h"
23
24 #include <ctype.h>
25 #include <stdarg.h>
26 #include <stdio.h>
27 #include <sys/types.h>
28
29 #ifdef HAVE_SYS_UIO_H
30 #include <sys/uio.h>
31 #endif
32
33 #include "ntstatus.h"
34 #define WIN32_NO_STATUS
35 #include "windef.h"
36 #include "winbase.h"
37 #include "wincon.h"
38 #include "winternl.h"
39 #include "request.h"
40 #include "unicode.h"
41
42 static int cur_pos;
43 static const void *cur_data;
44 static int cur_size;
45
46 /* utility functions */
47
48 inline static void remove_data( size_t size )
49 {
50     cur_data = (const char *)cur_data + size;
51     cur_size -= size;
52 }
53
54 static void dump_uints( const int *ptr, int len )
55 {
56     fputc( '{', stderr );
57     while (len > 0)
58     {
59         fprintf( stderr, "%08x", *ptr++ );
60         if (--len) fputc( ',', stderr );
61     }
62     fputc( '}', stderr );
63 }
64
65 static void dump_abs_time( const abs_time_t *time )
66 {
67     struct timeval tv;
68     int secs, usecs;
69
70     if (!time->sec && !time->usec)
71     {
72         fprintf( stderr, "0" );
73         return;
74     }
75     gettimeofday( &tv, NULL );
76     secs = time->sec - tv.tv_sec;
77     if ((usecs = time->usec - tv.tv_usec) < 0)
78     {
79         usecs += 1000000;
80         secs--;
81     }
82     if (secs > 0 || (secs == 0 && usecs >= 0))
83         fprintf( stderr, "%d.%06d (+%d.%06d)", time->sec, time->usec, secs, usecs );
84     else
85         fprintf( stderr, "%d.%06d (-%d.%06d)", time->sec, time->usec, abs(secs+1), 1000000-usecs );
86 }
87
88 static void dump_rectangle( const rectangle_t *rect )
89 {
90     fprintf( stderr, "{%d,%d;%d,%d}",
91              rect->left, rect->top, rect->right, rect->bottom );
92 }
93
94 static void dump_char_info( const char_info_t *info )
95 {
96     fprintf( stderr, "{'" );
97     dump_strW( &info->ch, 1, stderr, "\'\'" );
98     fprintf( stderr, "',%04x}", info->attr );
99 }
100
101 static void dump_context( const CONTEXT *context )
102 {
103 #ifdef __i386__
104     fprintf( stderr, "{flags=%08lx,eax=%08lx,ebx=%08lx,ecx=%08lx,edx=%08lx,esi=%08lx,edi=%08lx,"
105              "ebp=%08lx,eip=%08lx,esp=%08lx,eflags=%08lx,cs=%04lx,ds=%04lx,es=%04lx,"
106              "fs=%04lx,gs=%04lx,dr0=%08lx,dr1=%08lx,dr2=%08lx,dr3=%08lx,dr6=%08lx,dr7=%08lx,",
107              context->ContextFlags, context->Eax, context->Ebx, context->Ecx, context->Edx,
108              context->Esi, context->Edi, context->Ebp, context->Eip, context->Esp, context->EFlags,
109              context->SegCs, context->SegDs, context->SegEs, context->SegFs, context->SegGs,
110              context->Dr0, context->Dr1, context->Dr2, context->Dr3, context->Dr6, context->Dr7 );
111     fprintf( stderr, "float=" );
112     dump_uints( (const int *)&context->FloatSave, sizeof(context->FloatSave) / sizeof(int) );
113     fprintf( stderr, "}" );
114 #else
115     dump_uints( (const int *)context, sizeof(*context) / sizeof(int) );
116 #endif
117 }
118
119 static void dump_exc_record( const EXCEPTION_RECORD *rec )
120 {
121     unsigned int i;
122     fprintf( stderr, "{code=%lx,flags=%lx,rec=%p,addr=%p,params={",
123              rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionRecord,
124              rec->ExceptionAddress );
125     for (i = 0; i < min(rec->NumberParameters,EXCEPTION_MAXIMUM_PARAMETERS); i++)
126     {
127         if (i) fputc( ',', stderr );
128         fprintf( stderr, "%lx", rec->ExceptionInformation[i] );
129     }
130     fputc( '}', stderr );
131 }
132
133 static void dump_varargs_ints( size_t size )
134 {
135     const int *data = cur_data;
136     size_t len = size / sizeof(*data);
137
138     fputc( '{', stderr );
139     while (len > 0)
140     {
141         fprintf( stderr, "%d", *data++ );
142         if (--len) fputc( ',', stderr );
143     }
144     fputc( '}', stderr );
145     remove_data( size );
146 }
147
148 static void dump_varargs_handles( size_t size )
149 {
150     const obj_handle_t *data = cur_data;
151     size_t len = size / sizeof(*data);
152
153     fputc( '{', stderr );
154     while (len > 0)
155     {
156         fprintf( stderr, "%p", *data++ );
157         if (--len) fputc( ',', stderr );
158     }
159     fputc( '}', stderr );
160     remove_data( size );
161 }
162
163 static void dump_varargs_user_handles( size_t size )
164 {
165     const user_handle_t *data = cur_data;
166     size_t len = size / sizeof(*data);
167
168     fputc( '{', stderr );
169     while (len > 0)
170     {
171         fprintf( stderr, "%p", *data++ );
172         if (--len) fputc( ',', stderr );
173     }
174     fputc( '}', stderr );
175     remove_data( size );
176 }
177
178 static void dump_varargs_bytes( size_t size )
179 {
180     const unsigned char *data = cur_data;
181     size_t len = size;
182
183     fputc( '{', stderr );
184     while (len > 0)
185     {
186         fprintf( stderr, "%02x", *data++ );
187         if (--len) fputc( ',', stderr );
188     }
189     fputc( '}', stderr );
190     remove_data( size );
191 }
192
193 static void dump_varargs_string( size_t size )
194 {
195     fprintf( stderr, "\"%.*s\"", (int)size, (const char *)cur_data );
196     remove_data( size );
197 }
198
199 static void dump_varargs_unicode_str( size_t size )
200 {
201     fprintf( stderr, "L\"" );
202     dump_strW( cur_data, size / sizeof(WCHAR), stderr, "\"\"" );
203     fputc( '\"', stderr );
204     remove_data( size );
205 }
206
207 static void dump_varargs_context( size_t size )
208 {
209     if (!size)
210     {
211         fprintf( stderr, "{}" );
212         return;
213     }
214     dump_context( cur_data );
215     remove_data( size );
216 }
217
218 static void dump_varargs_exc_event( size_t size )
219 {
220     const CONTEXT *ptr = cur_data;
221
222     if (!size)
223     {
224         fprintf( stderr, "{}" );
225         return;
226     }
227     fprintf( stderr, "{context=" );
228     dump_context( ptr );
229     fprintf( stderr, ",rec=" );
230     dump_exc_record( (const EXCEPTION_RECORD *)(ptr + 1) );
231     fputc( '}', stderr );
232     remove_data( size );
233 }
234
235 static void dump_varargs_debug_event( size_t size )
236 {
237     const debug_event_t *event = cur_data;
238
239     if (!size)
240     {
241         fprintf( stderr, "{}" );
242         return;
243     }
244     switch(event->code)
245     {
246     case EXCEPTION_DEBUG_EVENT:
247         fprintf( stderr, "{exception," );
248         dump_exc_record( &event->info.exception.record );
249         fprintf( stderr, ",first=%d}", event->info.exception.first );
250         break;
251     case CREATE_THREAD_DEBUG_EVENT:
252         fprintf( stderr, "{create_thread,thread=%p,teb=%p,start=%p}",
253                  event->info.create_thread.handle, event->info.create_thread.teb,
254                  event->info.create_thread.start );
255         break;
256     case CREATE_PROCESS_DEBUG_EVENT:
257         fprintf( stderr, "{create_process,file=%p,process=%p,thread=%p,base=%p,offset=%d,"
258                          "size=%d,teb=%p,start=%p,name=%p,unicode=%d}",
259                  event->info.create_process.file, event->info.create_process.process,
260                  event->info.create_process.thread, event->info.create_process.base,
261                  event->info.create_process.dbg_offset, event->info.create_process.dbg_size,
262                  event->info.create_process.teb, event->info.create_process.start,
263                  event->info.create_process.name, event->info.create_process.unicode );
264         break;
265     case EXIT_THREAD_DEBUG_EVENT:
266         fprintf( stderr, "{exit_thread,code=%d}", event->info.exit.exit_code );
267         break;
268     case EXIT_PROCESS_DEBUG_EVENT:
269         fprintf( stderr, "{exit_process,code=%d}", event->info.exit.exit_code );
270         break;
271     case LOAD_DLL_DEBUG_EVENT:
272         fprintf( stderr, "{load_dll,file=%p,base=%p,offset=%d,size=%d,name=%p,unicode=%d}",
273                  event->info.load_dll.handle, event->info.load_dll.base,
274                  event->info.load_dll.dbg_offset, event->info.load_dll.dbg_size,
275                  event->info.load_dll.name, event->info.load_dll.unicode );
276         break;
277     case UNLOAD_DLL_DEBUG_EVENT:
278         fprintf( stderr, "{unload_dll,base=%p}", event->info.unload_dll.base );
279         break;
280     case OUTPUT_DEBUG_STRING_EVENT:
281         fprintf( stderr, "{output_string,data=%p,unicode=%d,len=%d}",
282                  event->info.output_string.string, event->info.output_string.unicode,
283                  event->info.output_string.length );
284         break;
285     case RIP_EVENT:
286         fprintf( stderr, "{rip,err=%d,type=%d}",
287                  event->info.rip_info.error, event->info.rip_info.type );
288         break;
289     case 0:  /* zero is the code returned on timeouts */
290         fprintf( stderr, "{}" );
291         break;
292     default:
293         fprintf( stderr, "{code=??? (%d)}", event->code );
294         break;
295     }
296     remove_data( size );
297 }
298
299 /* dump a unicode string contained in a buffer; helper for dump_varargs_startup_info */
300 static void dump_inline_unicode_string( const UNICODE_STRING *str, const void *data, size_t size )
301 {
302     size_t length = str->Length / sizeof(WCHAR);
303     size_t offset = (size_t)str->Buffer;
304
305     if (offset >= size) return;
306     if (offset + length > size) length = size - offset;
307     dump_strW( (const WCHAR *)data + offset/sizeof(WCHAR), length, stderr, "\"\"" );
308 }
309
310 static void dump_varargs_startup_info( size_t size )
311 {
312     const RTL_USER_PROCESS_PARAMETERS *ptr = cur_data;
313     RTL_USER_PROCESS_PARAMETERS params;
314
315     if (size < sizeof(params.Size))
316     {
317         fprintf( stderr, "{}" );
318         return;
319     }
320     if (size > ptr->Size) size = ptr->Size;
321     memset( &params, 0, sizeof(params) );
322     memcpy( &params, ptr, min( size, sizeof(params) ));
323
324     fprintf( stderr, "{AllocationSize=%lx,", params.AllocationSize );
325     fprintf( stderr, "Size=%lx,", params.Size );
326     fprintf( stderr, "Flags=%lx,", params.Flags );
327     fprintf( stderr, "DebugFlags=%lx,", params.DebugFlags );
328     fprintf( stderr, "ConsoleHandle=%p,", params.ConsoleHandle );
329     fprintf( stderr, "ConsoleFlags=%lx,", params.ConsoleFlags );
330     fprintf( stderr, "hStdInput=%p,", params.hStdInput );
331     fprintf( stderr, "hStdOutput=%p,", params.hStdOutput );
332     fprintf( stderr, "hStdError=%p,", params.hStdError );
333     fprintf( stderr, "CurrentDirectory.Handle=%p,", params.CurrentDirectory.Handle );
334     fprintf( stderr, "dwX=%ld,", params.dwX );
335     fprintf( stderr, "dwY=%ld,", params.dwY );
336     fprintf( stderr, "dwXSize=%ld,", params.dwXSize );
337     fprintf( stderr, "dwYSize=%ld,", params.dwYSize );
338     fprintf( stderr, "dwXCountChars=%ld,", params.dwXCountChars );
339     fprintf( stderr, "dwYCountChars=%ld,", params.dwYCountChars );
340     fprintf( stderr, "dwFillAttribute=%lx,", params.dwFillAttribute );
341     fprintf( stderr, "dwFlags=%lx,", params.dwFlags );
342     fprintf( stderr, "wShowWindow=%lx,", params.wShowWindow );
343     fprintf( stderr, "CurrentDirectory.DosPath=L\"" );
344     dump_inline_unicode_string( &params.CurrentDirectory.DosPath, cur_data, size );
345     fprintf( stderr, "\",DllPath=L\"" );
346     dump_inline_unicode_string( &params.DllPath, cur_data, size );
347     fprintf( stderr, "\",ImagePathName=L\"" );
348     dump_inline_unicode_string( &params.ImagePathName, cur_data, size );
349     fprintf( stderr, "\",CommandLine=L\"" );
350     dump_inline_unicode_string( &params.CommandLine, cur_data, size );
351     fprintf( stderr, "\",WindowTitle=L\"" );
352     dump_inline_unicode_string( &params.WindowTitle, cur_data, size );
353     fprintf( stderr, "\",Desktop=L\"" );
354     dump_inline_unicode_string( &params.Desktop, cur_data, size );
355     fprintf( stderr, "\",ShellInfo=L\"" );
356     dump_inline_unicode_string( &params.ShellInfo, cur_data, size );
357     fprintf( stderr, "\",RuntimeInfo=L\"" );
358     dump_inline_unicode_string( &params.RuntimeInfo, cur_data, size );
359     fprintf( stderr, "\"}" );
360     remove_data( size );
361 }
362
363 static void dump_varargs_input_records( size_t size )
364 {
365     const INPUT_RECORD *rec = cur_data;
366     size_t len = size / sizeof(*rec);
367
368     fputc( '{', stderr );
369     while (len > 0)
370     {
371         fprintf( stderr, "{%04x,...}", rec->EventType );
372         rec++;
373         if (--len) fputc( ',', stderr );
374     }
375     fputc( '}', stderr );
376     remove_data( size );
377 }
378
379 static void dump_varargs_rectangles( size_t size )
380 {
381     const rectangle_t *rect = cur_data;
382     size_t len = size / sizeof(*rect);
383
384     fputc( '{', stderr );
385     while (len > 0)
386     {
387         dump_rectangle( rect++ );
388         if (--len) fputc( ',', stderr );
389     }
390     fputc( '}', stderr );
391     remove_data( size );
392 }
393
394 static void dump_varargs_properties( size_t size )
395 {
396     const property_data_t *prop = cur_data;
397     size_t len = size / sizeof(*prop);
398
399     fputc( '{', stderr );
400     while (len > 0)
401     {
402         fprintf( stderr, "{atom=%04x,str=%d,handle=%p}",
403                  prop->atom, prop->string, prop->handle );
404         prop++;
405         if (--len) fputc( ',', stderr );
406     }
407     fputc( '}', stderr );
408     remove_data( size );
409 }
410
411 static void dump_varargs_LUID_AND_ATTRIBUTES( size_t size )
412 {
413     const LUID_AND_ATTRIBUTES *lat = cur_data;
414     size_t len = size / sizeof(*lat);
415
416     fputc( '{', stderr );
417     while (len > 0)
418     {
419         fprintf( stderr, "{luid=%08lx%08lx,attr=%lx}",
420                  lat->Luid.HighPart, lat->Luid.LowPart, lat->Attributes );
421         lat++;
422         if (--len) fputc( ',', stderr );
423     }
424     fputc( '}', stderr );
425     remove_data( size );
426 }
427
428 static void dump_inline_sid( const SID *sid, size_t size )
429 {
430     DWORD i;
431
432     /* security check */
433     if ((FIELD_OFFSET(SID, SubAuthority[0]) > size) ||
434         (FIELD_OFFSET(SID, SubAuthority[sid->SubAuthorityCount]) > size))
435     {
436         fprintf( stderr, "<invalid sid>" );
437         return;
438     }
439
440     fputc( '{', stderr );
441     fprintf( stderr, "S-%u-%lu", sid->Revision, MAKELONG(
442         MAKEWORD( sid->IdentifierAuthority.Value[5],
443                   sid->IdentifierAuthority.Value[4] ),
444         MAKEWORD( sid->IdentifierAuthority.Value[3],
445                   sid->IdentifierAuthority.Value[2] ) ) );
446     for (i = 0; i < sid->SubAuthorityCount; i++)
447         fprintf( stderr, "-%lu", sid->SubAuthority[i] );
448     fputc( '}', stderr );
449 }
450
451 static void dump_varargs_SID( size_t size )
452 {
453     const SID *sid = cur_data;
454     dump_inline_sid( sid, size );
455     remove_data( size );
456 }
457
458 static void dump_inline_acl( const ACL *acl, size_t size )
459 {
460     const ACE_HEADER *ace;
461     ULONG i;
462     fputc( '{', stderr );
463
464     if (size)
465     {
466         if (size < sizeof(ACL))
467         {
468             fprintf( stderr, "<invalid acl>}\n" );
469             return;
470         }
471         size -= sizeof(ACL);
472         ace = (const ACE_HEADER *)(acl + 1);
473         for (i = 0; i < acl->AceCount; i++)
474         {
475             const SID *sid = NULL;
476             size_t sid_size = 0;
477
478             if (size < sizeof(ACE_HEADER))
479                 return;
480             if (size < ace->AceSize)
481                 return;
482             size -= ace->AceSize;
483             if (i != 0) fputc( ',', stderr );
484             fprintf( stderr, "{AceType=" );
485             switch (ace->AceType)
486             {
487             case ACCESS_DENIED_ACE_TYPE:
488                 sid = (const SID *)&((const ACCESS_DENIED_ACE *)ace)->SidStart;
489                 sid_size = ace->AceSize - FIELD_OFFSET(ACCESS_DENIED_ACE, SidStart);
490                 fprintf( stderr, "ACCESS_DENIED_ACE_TYPE,Mask=%lx",
491                          ((const ACCESS_DENIED_ACE *)ace)->Mask );
492                 break;
493             case ACCESS_ALLOWED_ACE_TYPE:
494                 sid = (const SID *)&((const ACCESS_ALLOWED_ACE *)ace)->SidStart;
495                 sid_size = ace->AceSize - FIELD_OFFSET(ACCESS_ALLOWED_ACE, SidStart);
496                 fprintf( stderr, "ACCESS_ALLOWED_ACE_TYPE,Mask=%lx",
497                          ((const ACCESS_ALLOWED_ACE *)ace)->Mask );
498                 break;
499             case SYSTEM_AUDIT_ACE_TYPE:
500                 sid = (const SID *)&((const SYSTEM_AUDIT_ACE *)ace)->SidStart;
501                 sid_size = ace->AceSize - FIELD_OFFSET(SYSTEM_AUDIT_ACE, SidStart);
502                 fprintf( stderr, "SYSTEM_AUDIT_ACE_TYPE,Mask=%lx",
503                          ((const SYSTEM_AUDIT_ACE *)ace)->Mask );
504                 break;
505             case SYSTEM_ALARM_ACE_TYPE:
506                 sid = (const SID *)&((const SYSTEM_ALARM_ACE *)ace)->SidStart;
507                 sid_size = ace->AceSize - FIELD_OFFSET(SYSTEM_ALARM_ACE, SidStart);
508                 fprintf( stderr, "SYSTEM_ALARM_ACE_TYPE,Mask=%lx",
509                          ((const SYSTEM_ALARM_ACE *)ace)->Mask );
510                 break;
511             default:
512                 fprintf( stderr, "unknown<%d>", ace->AceType );
513                 break;
514             }
515             fprintf( stderr, ",AceFlags=%x,Sid=", ace->AceFlags );
516             if (sid)
517                 dump_inline_sid( sid, sid_size );
518             ace = (const ACE_HEADER *)((const char *)ace + ace->AceSize);
519             fputc( '}', stderr );
520         }
521     }
522     fputc( '}', stderr );
523 }
524
525 static void dump_inline_security_descriptor( const struct security_descriptor *sd, size_t size )
526 {
527     fputc( '{', stderr );
528     if (size >= sizeof(struct security_descriptor))
529     {
530         size_t offset = sizeof(struct security_descriptor);
531         fprintf( stderr, "control=%08x", sd->control );
532         fprintf( stderr, ",owner=" );
533         if ((sd->owner_len > FIELD_OFFSET(SID, SubAuthority[255])) || (offset + sd->owner_len > size))
534             return;
535         dump_inline_sid( (const SID *)((const char *)sd + offset), sd->owner_len );
536         offset += sd->owner_len;
537         fprintf( stderr, ",group=" );
538         if ((sd->group_len > FIELD_OFFSET(SID, SubAuthority[255])) || (offset + sd->group_len > size))
539             return;
540         dump_inline_sid( (const SID *)((const char *)sd + offset), sd->group_len );
541         offset += sd->group_len;
542         fprintf( stderr, ",sacl=" );
543         if ((sd->sacl_len >= MAX_ACL_LEN) || (offset + sd->sacl_len > size))
544             return;
545         dump_inline_acl( (const ACL *)((const char *)sd + offset), sd->sacl_len );
546         offset += sd->sacl_len;
547         fprintf( stderr, ",dacl=" );
548         if ((sd->dacl_len >= MAX_ACL_LEN) || (offset + sd->dacl_len > size))
549             return;
550         dump_inline_acl( (const ACL *)((const char *)sd + offset), sd->dacl_len );
551         offset += sd->dacl_len;
552     }
553     fputc( '}', stderr );
554 }
555
556 static void dump_varargs_security_descriptor( size_t size )
557 {
558     const struct security_descriptor *sd = cur_data;
559     dump_inline_security_descriptor( sd, size );
560     remove_data( size );
561 }
562
563 typedef void (*dump_func)( const void *req );
564
565 /* Everything below this line is generated automatically by tools/make_requests */
566 /* ### make_requests begin ### */
567
568 static void dump_new_process_request( const struct new_process_request *req )
569 {
570     fprintf( stderr, " inherit_all=%d,", req->inherit_all );
571     fprintf( stderr, " create_flags=%08x,", req->create_flags );
572     fprintf( stderr, " unix_pid=%d,", req->unix_pid );
573     fprintf( stderr, " exe_file=%p,", req->exe_file );
574     fprintf( stderr, " hstdin=%p,", req->hstdin );
575     fprintf( stderr, " hstdout=%p,", req->hstdout );
576     fprintf( stderr, " hstderr=%p,", req->hstderr );
577     fprintf( stderr, " info=" );
578     dump_varargs_startup_info( cur_size );
579     fputc( ',', stderr );
580     fprintf( stderr, " env=" );
581     dump_varargs_unicode_str( cur_size );
582 }
583
584 static void dump_new_process_reply( const struct new_process_reply *req )
585 {
586     fprintf( stderr, " info=%p", req->info );
587 }
588
589 static void dump_get_new_process_info_request( const struct get_new_process_info_request *req )
590 {
591     fprintf( stderr, " info=%p,", req->info );
592     fprintf( stderr, " pinherit=%d,", req->pinherit );
593     fprintf( stderr, " tinherit=%d", req->tinherit );
594 }
595
596 static void dump_get_new_process_info_reply( const struct get_new_process_info_reply *req )
597 {
598     fprintf( stderr, " pid=%04x,", req->pid );
599     fprintf( stderr, " phandle=%p,", req->phandle );
600     fprintf( stderr, " tid=%04x,", req->tid );
601     fprintf( stderr, " thandle=%p,", req->thandle );
602     fprintf( stderr, " success=%d", req->success );
603 }
604
605 static void dump_new_thread_request( const struct new_thread_request *req )
606 {
607     fprintf( stderr, " suspend=%d,", req->suspend );
608     fprintf( stderr, " inherit=%d,", req->inherit );
609     fprintf( stderr, " request_fd=%d", req->request_fd );
610 }
611
612 static void dump_new_thread_reply( const struct new_thread_reply *req )
613 {
614     fprintf( stderr, " tid=%04x,", req->tid );
615     fprintf( stderr, " handle=%p", req->handle );
616 }
617
618 static void dump_get_startup_info_request( const struct get_startup_info_request *req )
619 {
620 }
621
622 static void dump_get_startup_info_reply( const struct get_startup_info_reply *req )
623 {
624     fprintf( stderr, " create_flags=%08x,", req->create_flags );
625     fprintf( stderr, " exe_file=%p,", req->exe_file );
626     fprintf( stderr, " hstdin=%p,", req->hstdin );
627     fprintf( stderr, " hstdout=%p,", req->hstdout );
628     fprintf( stderr, " hstderr=%p,", req->hstderr );
629     fprintf( stderr, " info=" );
630     dump_varargs_startup_info( cur_size );
631     fputc( ',', stderr );
632     fprintf( stderr, " env=" );
633     dump_varargs_unicode_str( cur_size );
634 }
635
636 static void dump_init_process_done_request( const struct init_process_done_request *req )
637 {
638     fprintf( stderr, " module=%p,", req->module );
639     fprintf( stderr, " module_size=%d,", req->module_size );
640     fprintf( stderr, " entry=%p,", req->entry );
641     fprintf( stderr, " name=%p,", req->name );
642     fprintf( stderr, " exe_file=%p,", req->exe_file );
643     fprintf( stderr, " gui=%d,", req->gui );
644     fprintf( stderr, " filename=" );
645     dump_varargs_unicode_str( cur_size );
646 }
647
648 static void dump_init_thread_request( const struct init_thread_request *req )
649 {
650     fprintf( stderr, " unix_pid=%d,", req->unix_pid );
651     fprintf( stderr, " unix_tid=%d,", req->unix_tid );
652     fprintf( stderr, " teb=%p,", req->teb );
653     fprintf( stderr, " peb=%p,", req->peb );
654     fprintf( stderr, " entry=%p,", req->entry );
655     fprintf( stderr, " ldt_copy=%p,", req->ldt_copy );
656     fprintf( stderr, " reply_fd=%d,", req->reply_fd );
657     fprintf( stderr, " wait_fd=%d,", req->wait_fd );
658     fprintf( stderr, " debug_level=%d", req->debug_level );
659 }
660
661 static void dump_init_thread_reply( const struct init_thread_reply *req )
662 {
663     fprintf( stderr, " pid=%04x,", req->pid );
664     fprintf( stderr, " tid=%04x,", req->tid );
665     fprintf( stderr, " info_size=%d,", req->info_size );
666     fprintf( stderr, " server_start=%ld,", (long)req->server_start );
667     fprintf( stderr, " version=%d", req->version );
668 }
669
670 static void dump_terminate_process_request( const struct terminate_process_request *req )
671 {
672     fprintf( stderr, " handle=%p,", req->handle );
673     fprintf( stderr, " exit_code=%d", req->exit_code );
674 }
675
676 static void dump_terminate_process_reply( const struct terminate_process_reply *req )
677 {
678     fprintf( stderr, " self=%d", req->self );
679 }
680
681 static void dump_terminate_thread_request( const struct terminate_thread_request *req )
682 {
683     fprintf( stderr, " handle=%p,", req->handle );
684     fprintf( stderr, " exit_code=%d", req->exit_code );
685 }
686
687 static void dump_terminate_thread_reply( const struct terminate_thread_reply *req )
688 {
689     fprintf( stderr, " self=%d,", req->self );
690     fprintf( stderr, " last=%d", req->last );
691 }
692
693 static void dump_get_process_info_request( const struct get_process_info_request *req )
694 {
695     fprintf( stderr, " handle=%p", req->handle );
696 }
697
698 static void dump_get_process_info_reply( const struct get_process_info_reply *req )
699 {
700     fprintf( stderr, " pid=%04x,", req->pid );
701     fprintf( stderr, " ppid=%04x,", req->ppid );
702     fprintf( stderr, " exit_code=%d,", req->exit_code );
703     fprintf( stderr, " priority=%d,", req->priority );
704     fprintf( stderr, " affinity=%d,", req->affinity );
705     fprintf( stderr, " peb=%p", req->peb );
706 }
707
708 static void dump_set_process_info_request( const struct set_process_info_request *req )
709 {
710     fprintf( stderr, " handle=%p,", req->handle );
711     fprintf( stderr, " mask=%d,", req->mask );
712     fprintf( stderr, " priority=%d,", req->priority );
713     fprintf( stderr, " affinity=%d", req->affinity );
714 }
715
716 static void dump_get_thread_info_request( const struct get_thread_info_request *req )
717 {
718     fprintf( stderr, " handle=%p,", req->handle );
719     fprintf( stderr, " tid_in=%04x", req->tid_in );
720 }
721
722 static void dump_get_thread_info_reply( const struct get_thread_info_reply *req )
723 {
724     fprintf( stderr, " pid=%04x,", req->pid );
725     fprintf( stderr, " tid=%04x,", req->tid );
726     fprintf( stderr, " teb=%p,", req->teb );
727     fprintf( stderr, " exit_code=%d,", req->exit_code );
728     fprintf( stderr, " priority=%d,", req->priority );
729     fprintf( stderr, " affinity=%d,", req->affinity );
730     fprintf( stderr, " creation_time=%ld,", (long)req->creation_time );
731     fprintf( stderr, " exit_time=%ld", (long)req->exit_time );
732 }
733
734 static void dump_set_thread_info_request( const struct set_thread_info_request *req )
735 {
736     fprintf( stderr, " handle=%p,", req->handle );
737     fprintf( stderr, " mask=%d,", req->mask );
738     fprintf( stderr, " priority=%d,", req->priority );
739     fprintf( stderr, " affinity=%d,", req->affinity );
740     fprintf( stderr, " token=%p", req->token );
741 }
742
743 static void dump_get_dll_info_request( const struct get_dll_info_request *req )
744 {
745     fprintf( stderr, " handle=%p,", req->handle );
746     fprintf( stderr, " base_address=%p", req->base_address );
747 }
748
749 static void dump_get_dll_info_reply( const struct get_dll_info_reply *req )
750 {
751     fprintf( stderr, " size=%d,", req->size );
752     fprintf( stderr, " entry_point=%p,", req->entry_point );
753     fprintf( stderr, " filename=" );
754     dump_varargs_unicode_str( cur_size );
755 }
756
757 static void dump_suspend_thread_request( const struct suspend_thread_request *req )
758 {
759     fprintf( stderr, " handle=%p", req->handle );
760 }
761
762 static void dump_suspend_thread_reply( const struct suspend_thread_reply *req )
763 {
764     fprintf( stderr, " count=%d", req->count );
765 }
766
767 static void dump_resume_thread_request( const struct resume_thread_request *req )
768 {
769     fprintf( stderr, " handle=%p", req->handle );
770 }
771
772 static void dump_resume_thread_reply( const struct resume_thread_reply *req )
773 {
774     fprintf( stderr, " count=%d", req->count );
775 }
776
777 static void dump_load_dll_request( const struct load_dll_request *req )
778 {
779     fprintf( stderr, " handle=%p,", req->handle );
780     fprintf( stderr, " base=%p,", req->base );
781     fprintf( stderr, " size=%d,", req->size );
782     fprintf( stderr, " dbg_offset=%d,", req->dbg_offset );
783     fprintf( stderr, " dbg_size=%d,", req->dbg_size );
784     fprintf( stderr, " name=%p,", req->name );
785     fprintf( stderr, " filename=" );
786     dump_varargs_unicode_str( cur_size );
787 }
788
789 static void dump_unload_dll_request( const struct unload_dll_request *req )
790 {
791     fprintf( stderr, " base=%p", req->base );
792 }
793
794 static void dump_queue_apc_request( const struct queue_apc_request *req )
795 {
796     fprintf( stderr, " handle=%p,", req->handle );
797     fprintf( stderr, " user=%d,", req->user );
798     fprintf( stderr, " func=%p,", req->func );
799     fprintf( stderr, " arg1=%p,", req->arg1 );
800     fprintf( stderr, " arg2=%p,", req->arg2 );
801     fprintf( stderr, " arg3=%p", req->arg3 );
802 }
803
804 static void dump_get_apc_request( const struct get_apc_request *req )
805 {
806     fprintf( stderr, " alertable=%d", req->alertable );
807 }
808
809 static void dump_get_apc_reply( const struct get_apc_reply *req )
810 {
811     fprintf( stderr, " func=%p,", req->func );
812     fprintf( stderr, " type=%d,", req->type );
813     fprintf( stderr, " arg1=%p,", req->arg1 );
814     fprintf( stderr, " arg2=%p,", req->arg2 );
815     fprintf( stderr, " arg3=%p", req->arg3 );
816 }
817
818 static void dump_close_handle_request( const struct close_handle_request *req )
819 {
820     fprintf( stderr, " handle=%p", req->handle );
821 }
822
823 static void dump_close_handle_reply( const struct close_handle_reply *req )
824 {
825     fprintf( stderr, " fd=%d", req->fd );
826 }
827
828 static void dump_set_handle_info_request( const struct set_handle_info_request *req )
829 {
830     fprintf( stderr, " handle=%p,", req->handle );
831     fprintf( stderr, " flags=%d,", req->flags );
832     fprintf( stderr, " mask=%d", req->mask );
833 }
834
835 static void dump_set_handle_info_reply( const struct set_handle_info_reply *req )
836 {
837     fprintf( stderr, " old_flags=%d", req->old_flags );
838 }
839
840 static void dump_dup_handle_request( const struct dup_handle_request *req )
841 {
842     fprintf( stderr, " src_process=%p,", req->src_process );
843     fprintf( stderr, " src_handle=%p,", req->src_handle );
844     fprintf( stderr, " dst_process=%p,", req->dst_process );
845     fprintf( stderr, " access=%08x,", req->access );
846     fprintf( stderr, " inherit=%d,", req->inherit );
847     fprintf( stderr, " options=%d", req->options );
848 }
849
850 static void dump_dup_handle_reply( const struct dup_handle_reply *req )
851 {
852     fprintf( stderr, " handle=%p,", req->handle );
853     fprintf( stderr, " fd=%d", req->fd );
854 }
855
856 static void dump_open_process_request( const struct open_process_request *req )
857 {
858     fprintf( stderr, " pid=%04x,", req->pid );
859     fprintf( stderr, " access=%08x,", req->access );
860     fprintf( stderr, " inherit=%d", req->inherit );
861 }
862
863 static void dump_open_process_reply( const struct open_process_reply *req )
864 {
865     fprintf( stderr, " handle=%p", req->handle );
866 }
867
868 static void dump_open_thread_request( const struct open_thread_request *req )
869 {
870     fprintf( stderr, " tid=%04x,", req->tid );
871     fprintf( stderr, " access=%08x,", req->access );
872     fprintf( stderr, " inherit=%d", req->inherit );
873 }
874
875 static void dump_open_thread_reply( const struct open_thread_reply *req )
876 {
877     fprintf( stderr, " handle=%p", req->handle );
878 }
879
880 static void dump_select_request( const struct select_request *req )
881 {
882     fprintf( stderr, " flags=%d,", req->flags );
883     fprintf( stderr, " cookie=%p,", req->cookie );
884     fprintf( stderr, " signal=%p,", req->signal );
885     fprintf( stderr, " timeout=" );
886     dump_abs_time( &req->timeout );
887     fprintf( stderr, "," );
888     fprintf( stderr, " handles=" );
889     dump_varargs_handles( cur_size );
890 }
891
892 static void dump_create_event_request( const struct create_event_request *req )
893 {
894     fprintf( stderr, " access=%08x,", req->access );
895     fprintf( stderr, " attributes=%08x,", req->attributes );
896     fprintf( stderr, " rootdir=%p,", req->rootdir );
897     fprintf( stderr, " manual_reset=%d,", req->manual_reset );
898     fprintf( stderr, " initial_state=%d,", req->initial_state );
899     fprintf( stderr, " name=" );
900     dump_varargs_unicode_str( cur_size );
901 }
902
903 static void dump_create_event_reply( const struct create_event_reply *req )
904 {
905     fprintf( stderr, " handle=%p", req->handle );
906 }
907
908 static void dump_event_op_request( const struct event_op_request *req )
909 {
910     fprintf( stderr, " handle=%p,", req->handle );
911     fprintf( stderr, " op=%d", req->op );
912 }
913
914 static void dump_open_event_request( const struct open_event_request *req )
915 {
916     fprintf( stderr, " access=%08x,", req->access );
917     fprintf( stderr, " attributes=%08x,", req->attributes );
918     fprintf( stderr, " rootdir=%p,", req->rootdir );
919     fprintf( stderr, " name=" );
920     dump_varargs_unicode_str( cur_size );
921 }
922
923 static void dump_open_event_reply( const struct open_event_reply *req )
924 {
925     fprintf( stderr, " handle=%p", req->handle );
926 }
927
928 static void dump_create_mutex_request( const struct create_mutex_request *req )
929 {
930     fprintf( stderr, " access=%08x,", req->access );
931     fprintf( stderr, " attributes=%08x,", req->attributes );
932     fprintf( stderr, " rootdir=%p,", req->rootdir );
933     fprintf( stderr, " owned=%d,", req->owned );
934     fprintf( stderr, " name=" );
935     dump_varargs_unicode_str( cur_size );
936 }
937
938 static void dump_create_mutex_reply( const struct create_mutex_reply *req )
939 {
940     fprintf( stderr, " handle=%p", req->handle );
941 }
942
943 static void dump_release_mutex_request( const struct release_mutex_request *req )
944 {
945     fprintf( stderr, " handle=%p", req->handle );
946 }
947
948 static void dump_release_mutex_reply( const struct release_mutex_reply *req )
949 {
950     fprintf( stderr, " prev_count=%08x", req->prev_count );
951 }
952
953 static void dump_open_mutex_request( const struct open_mutex_request *req )
954 {
955     fprintf( stderr, " access=%08x,", req->access );
956     fprintf( stderr, " attributes=%08x,", req->attributes );
957     fprintf( stderr, " rootdir=%p,", req->rootdir );
958     fprintf( stderr, " name=" );
959     dump_varargs_unicode_str( cur_size );
960 }
961
962 static void dump_open_mutex_reply( const struct open_mutex_reply *req )
963 {
964     fprintf( stderr, " handle=%p", req->handle );
965 }
966
967 static void dump_create_semaphore_request( const struct create_semaphore_request *req )
968 {
969     fprintf( stderr, " access=%08x,", req->access );
970     fprintf( stderr, " attributes=%08x,", req->attributes );
971     fprintf( stderr, " rootdir=%p,", req->rootdir );
972     fprintf( stderr, " initial=%08x,", req->initial );
973     fprintf( stderr, " max=%08x,", req->max );
974     fprintf( stderr, " name=" );
975     dump_varargs_unicode_str( cur_size );
976 }
977
978 static void dump_create_semaphore_reply( const struct create_semaphore_reply *req )
979 {
980     fprintf( stderr, " handle=%p", req->handle );
981 }
982
983 static void dump_release_semaphore_request( const struct release_semaphore_request *req )
984 {
985     fprintf( stderr, " handle=%p,", req->handle );
986     fprintf( stderr, " count=%08x", req->count );
987 }
988
989 static void dump_release_semaphore_reply( const struct release_semaphore_reply *req )
990 {
991     fprintf( stderr, " prev_count=%08x", req->prev_count );
992 }
993
994 static void dump_open_semaphore_request( const struct open_semaphore_request *req )
995 {
996     fprintf( stderr, " access=%08x,", req->access );
997     fprintf( stderr, " attributes=%08x,", req->attributes );
998     fprintf( stderr, " rootdir=%p,", req->rootdir );
999     fprintf( stderr, " name=" );
1000     dump_varargs_unicode_str( cur_size );
1001 }
1002
1003 static void dump_open_semaphore_reply( const struct open_semaphore_reply *req )
1004 {
1005     fprintf( stderr, " handle=%p", req->handle );
1006 }
1007
1008 static void dump_create_file_request( const struct create_file_request *req )
1009 {
1010     fprintf( stderr, " access=%08x,", req->access );
1011     fprintf( stderr, " attributes=%08x,", req->attributes );
1012     fprintf( stderr, " sharing=%08x,", req->sharing );
1013     fprintf( stderr, " create=%d,", req->create );
1014     fprintf( stderr, " options=%08x,", req->options );
1015     fprintf( stderr, " attrs=%08x,", req->attrs );
1016     fprintf( stderr, " filename=" );
1017     dump_varargs_string( cur_size );
1018 }
1019
1020 static void dump_create_file_reply( const struct create_file_reply *req )
1021 {
1022     fprintf( stderr, " handle=%p", req->handle );
1023 }
1024
1025 static void dump_alloc_file_handle_request( const struct alloc_file_handle_request *req )
1026 {
1027     fprintf( stderr, " access=%08x,", req->access );
1028     fprintf( stderr, " attributes=%08x,", req->attributes );
1029     fprintf( stderr, " fd=%d", req->fd );
1030 }
1031
1032 static void dump_alloc_file_handle_reply( const struct alloc_file_handle_reply *req )
1033 {
1034     fprintf( stderr, " handle=%p", req->handle );
1035 }
1036
1037 static void dump_get_handle_fd_request( const struct get_handle_fd_request *req )
1038 {
1039     fprintf( stderr, " handle=%p,", req->handle );
1040     fprintf( stderr, " access=%08x", req->access );
1041 }
1042
1043 static void dump_get_handle_fd_reply( const struct get_handle_fd_reply *req )
1044 {
1045     fprintf( stderr, " fd=%d,", req->fd );
1046     fprintf( stderr, " removable=%d,", req->removable );
1047     fprintf( stderr, " flags=%d", req->flags );
1048 }
1049
1050 static void dump_set_handle_fd_request( const struct set_handle_fd_request *req )
1051 {
1052     fprintf( stderr, " handle=%p,", req->handle );
1053     fprintf( stderr, " fd=%d,", req->fd );
1054     fprintf( stderr, " removable=%d", req->removable );
1055 }
1056
1057 static void dump_set_handle_fd_reply( const struct set_handle_fd_reply *req )
1058 {
1059     fprintf( stderr, " cur_fd=%d", req->cur_fd );
1060 }
1061
1062 static void dump_flush_file_request( const struct flush_file_request *req )
1063 {
1064     fprintf( stderr, " handle=%p", req->handle );
1065 }
1066
1067 static void dump_flush_file_reply( const struct flush_file_reply *req )
1068 {
1069     fprintf( stderr, " event=%p", req->event );
1070 }
1071
1072 static void dump_lock_file_request( const struct lock_file_request *req )
1073 {
1074     fprintf( stderr, " handle=%p,", req->handle );
1075     fprintf( stderr, " offset_low=%08x,", req->offset_low );
1076     fprintf( stderr, " offset_high=%08x,", req->offset_high );
1077     fprintf( stderr, " count_low=%08x,", req->count_low );
1078     fprintf( stderr, " count_high=%08x,", req->count_high );
1079     fprintf( stderr, " shared=%d,", req->shared );
1080     fprintf( stderr, " wait=%d", req->wait );
1081 }
1082
1083 static void dump_lock_file_reply( const struct lock_file_reply *req )
1084 {
1085     fprintf( stderr, " handle=%p,", req->handle );
1086     fprintf( stderr, " overlapped=%d", req->overlapped );
1087 }
1088
1089 static void dump_unlock_file_request( const struct unlock_file_request *req )
1090 {
1091     fprintf( stderr, " handle=%p,", req->handle );
1092     fprintf( stderr, " offset_low=%08x,", req->offset_low );
1093     fprintf( stderr, " offset_high=%08x,", req->offset_high );
1094     fprintf( stderr, " count_low=%08x,", req->count_low );
1095     fprintf( stderr, " count_high=%08x", req->count_high );
1096 }
1097
1098 static void dump_unmount_device_request( const struct unmount_device_request *req )
1099 {
1100     fprintf( stderr, " handle=%p", req->handle );
1101 }
1102
1103 static void dump_create_socket_request( const struct create_socket_request *req )
1104 {
1105     fprintf( stderr, " access=%08x,", req->access );
1106     fprintf( stderr, " attributes=%08x,", req->attributes );
1107     fprintf( stderr, " family=%d,", req->family );
1108     fprintf( stderr, " type=%d,", req->type );
1109     fprintf( stderr, " protocol=%d,", req->protocol );
1110     fprintf( stderr, " flags=%08x", req->flags );
1111 }
1112
1113 static void dump_create_socket_reply( const struct create_socket_reply *req )
1114 {
1115     fprintf( stderr, " handle=%p", req->handle );
1116 }
1117
1118 static void dump_accept_socket_request( const struct accept_socket_request *req )
1119 {
1120     fprintf( stderr, " lhandle=%p,", req->lhandle );
1121     fprintf( stderr, " access=%08x,", req->access );
1122     fprintf( stderr, " attributes=%08x", req->attributes );
1123 }
1124
1125 static void dump_accept_socket_reply( const struct accept_socket_reply *req )
1126 {
1127     fprintf( stderr, " handle=%p", req->handle );
1128 }
1129
1130 static void dump_set_socket_event_request( const struct set_socket_event_request *req )
1131 {
1132     fprintf( stderr, " handle=%p,", req->handle );
1133     fprintf( stderr, " mask=%08x,", req->mask );
1134     fprintf( stderr, " event=%p,", req->event );
1135     fprintf( stderr, " window=%p,", req->window );
1136     fprintf( stderr, " msg=%08x", req->msg );
1137 }
1138
1139 static void dump_get_socket_event_request( const struct get_socket_event_request *req )
1140 {
1141     fprintf( stderr, " handle=%p,", req->handle );
1142     fprintf( stderr, " service=%d,", req->service );
1143     fprintf( stderr, " c_event=%p", req->c_event );
1144 }
1145
1146 static void dump_get_socket_event_reply( const struct get_socket_event_reply *req )
1147 {
1148     fprintf( stderr, " mask=%08x,", req->mask );
1149     fprintf( stderr, " pmask=%08x,", req->pmask );
1150     fprintf( stderr, " state=%08x,", req->state );
1151     fprintf( stderr, " errors=" );
1152     dump_varargs_ints( cur_size );
1153 }
1154
1155 static void dump_enable_socket_event_request( const struct enable_socket_event_request *req )
1156 {
1157     fprintf( stderr, " handle=%p,", req->handle );
1158     fprintf( stderr, " mask=%08x,", req->mask );
1159     fprintf( stderr, " sstate=%08x,", req->sstate );
1160     fprintf( stderr, " cstate=%08x", req->cstate );
1161 }
1162
1163 static void dump_set_socket_deferred_request( const struct set_socket_deferred_request *req )
1164 {
1165     fprintf( stderr, " handle=%p,", req->handle );
1166     fprintf( stderr, " deferred=%p", req->deferred );
1167 }
1168
1169 static void dump_alloc_console_request( const struct alloc_console_request *req )
1170 {
1171     fprintf( stderr, " access=%08x,", req->access );
1172     fprintf( stderr, " attributes=%08x,", req->attributes );
1173     fprintf( stderr, " pid=%04x", req->pid );
1174 }
1175
1176 static void dump_alloc_console_reply( const struct alloc_console_reply *req )
1177 {
1178     fprintf( stderr, " handle_in=%p,", req->handle_in );
1179     fprintf( stderr, " event=%p", req->event );
1180 }
1181
1182 static void dump_free_console_request( const struct free_console_request *req )
1183 {
1184 }
1185
1186 static void dump_get_console_renderer_events_request( const struct get_console_renderer_events_request *req )
1187 {
1188     fprintf( stderr, " handle=%p", req->handle );
1189 }
1190
1191 static void dump_get_console_renderer_events_reply( const struct get_console_renderer_events_reply *req )
1192 {
1193     fprintf( stderr, " data=" );
1194     dump_varargs_bytes( cur_size );
1195 }
1196
1197 static void dump_open_console_request( const struct open_console_request *req )
1198 {
1199     fprintf( stderr, " from=%d,", req->from );
1200     fprintf( stderr, " access=%08x,", req->access );
1201     fprintf( stderr, " attributes=%08x,", req->attributes );
1202     fprintf( stderr, " share=%d", req->share );
1203 }
1204
1205 static void dump_open_console_reply( const struct open_console_reply *req )
1206 {
1207     fprintf( stderr, " handle=%p", req->handle );
1208 }
1209
1210 static void dump_get_console_wait_event_request( const struct get_console_wait_event_request *req )
1211 {
1212 }
1213
1214 static void dump_get_console_wait_event_reply( const struct get_console_wait_event_reply *req )
1215 {
1216     fprintf( stderr, " handle=%p", req->handle );
1217 }
1218
1219 static void dump_get_console_mode_request( const struct get_console_mode_request *req )
1220 {
1221     fprintf( stderr, " handle=%p", req->handle );
1222 }
1223
1224 static void dump_get_console_mode_reply( const struct get_console_mode_reply *req )
1225 {
1226     fprintf( stderr, " mode=%d", req->mode );
1227 }
1228
1229 static void dump_set_console_mode_request( const struct set_console_mode_request *req )
1230 {
1231     fprintf( stderr, " handle=%p,", req->handle );
1232     fprintf( stderr, " mode=%d", req->mode );
1233 }
1234
1235 static void dump_set_console_input_info_request( const struct set_console_input_info_request *req )
1236 {
1237     fprintf( stderr, " handle=%p,", req->handle );
1238     fprintf( stderr, " mask=%d,", req->mask );
1239     fprintf( stderr, " active_sb=%p,", req->active_sb );
1240     fprintf( stderr, " history_mode=%d,", req->history_mode );
1241     fprintf( stderr, " history_size=%d,", req->history_size );
1242     fprintf( stderr, " edition_mode=%d,", req->edition_mode );
1243     fprintf( stderr, " title=" );
1244     dump_varargs_unicode_str( cur_size );
1245 }
1246
1247 static void dump_get_console_input_info_request( const struct get_console_input_info_request *req )
1248 {
1249     fprintf( stderr, " handle=%p", req->handle );
1250 }
1251
1252 static void dump_get_console_input_info_reply( const struct get_console_input_info_reply *req )
1253 {
1254     fprintf( stderr, " history_mode=%d,", req->history_mode );
1255     fprintf( stderr, " history_size=%d,", req->history_size );
1256     fprintf( stderr, " history_index=%d,", req->history_index );
1257     fprintf( stderr, " edition_mode=%d,", req->edition_mode );
1258     fprintf( stderr, " title=" );
1259     dump_varargs_unicode_str( cur_size );
1260 }
1261
1262 static void dump_append_console_input_history_request( const struct append_console_input_history_request *req )
1263 {
1264     fprintf( stderr, " handle=%p,", req->handle );
1265     fprintf( stderr, " line=" );
1266     dump_varargs_unicode_str( cur_size );
1267 }
1268
1269 static void dump_get_console_input_history_request( const struct get_console_input_history_request *req )
1270 {
1271     fprintf( stderr, " handle=%p,", req->handle );
1272     fprintf( stderr, " index=%d", req->index );
1273 }
1274
1275 static void dump_get_console_input_history_reply( const struct get_console_input_history_reply *req )
1276 {
1277     fprintf( stderr, " total=%d,", req->total );
1278     fprintf( stderr, " line=" );
1279     dump_varargs_unicode_str( cur_size );
1280 }
1281
1282 static void dump_create_console_output_request( const struct create_console_output_request *req )
1283 {
1284     fprintf( stderr, " handle_in=%p,", req->handle_in );
1285     fprintf( stderr, " access=%08x,", req->access );
1286     fprintf( stderr, " attributes=%08x,", req->attributes );
1287     fprintf( stderr, " share=%08x", req->share );
1288 }
1289
1290 static void dump_create_console_output_reply( const struct create_console_output_reply *req )
1291 {
1292     fprintf( stderr, " handle_out=%p", req->handle_out );
1293 }
1294
1295 static void dump_set_console_output_info_request( const struct set_console_output_info_request *req )
1296 {
1297     fprintf( stderr, " handle=%p,", req->handle );
1298     fprintf( stderr, " mask=%d,", req->mask );
1299     fprintf( stderr, " cursor_size=%d,", req->cursor_size );
1300     fprintf( stderr, " cursor_visible=%d,", req->cursor_visible );
1301     fprintf( stderr, " cursor_x=%d,", req->cursor_x );
1302     fprintf( stderr, " cursor_y=%d,", req->cursor_y );
1303     fprintf( stderr, " width=%d,", req->width );
1304     fprintf( stderr, " height=%d,", req->height );
1305     fprintf( stderr, " attr=%d,", req->attr );
1306     fprintf( stderr, " win_left=%d,", req->win_left );
1307     fprintf( stderr, " win_top=%d,", req->win_top );
1308     fprintf( stderr, " win_right=%d,", req->win_right );
1309     fprintf( stderr, " win_bottom=%d,", req->win_bottom );
1310     fprintf( stderr, " max_width=%d,", req->max_width );
1311     fprintf( stderr, " max_height=%d", req->max_height );
1312 }
1313
1314 static void dump_get_console_output_info_request( const struct get_console_output_info_request *req )
1315 {
1316     fprintf( stderr, " handle=%p", req->handle );
1317 }
1318
1319 static void dump_get_console_output_info_reply( const struct get_console_output_info_reply *req )
1320 {
1321     fprintf( stderr, " cursor_size=%d,", req->cursor_size );
1322     fprintf( stderr, " cursor_visible=%d,", req->cursor_visible );
1323     fprintf( stderr, " cursor_x=%d,", req->cursor_x );
1324     fprintf( stderr, " cursor_y=%d,", req->cursor_y );
1325     fprintf( stderr, " width=%d,", req->width );
1326     fprintf( stderr, " height=%d,", req->height );
1327     fprintf( stderr, " attr=%d,", req->attr );
1328     fprintf( stderr, " win_left=%d,", req->win_left );
1329     fprintf( stderr, " win_top=%d,", req->win_top );
1330     fprintf( stderr, " win_right=%d,", req->win_right );
1331     fprintf( stderr, " win_bottom=%d,", req->win_bottom );
1332     fprintf( stderr, " max_width=%d,", req->max_width );
1333     fprintf( stderr, " max_height=%d", req->max_height );
1334 }
1335
1336 static void dump_write_console_input_request( const struct write_console_input_request *req )
1337 {
1338     fprintf( stderr, " handle=%p,", req->handle );
1339     fprintf( stderr, " rec=" );
1340     dump_varargs_input_records( cur_size );
1341 }
1342
1343 static void dump_write_console_input_reply( const struct write_console_input_reply *req )
1344 {
1345     fprintf( stderr, " written=%d", req->written );
1346 }
1347
1348 static void dump_read_console_input_request( const struct read_console_input_request *req )
1349 {
1350     fprintf( stderr, " handle=%p,", req->handle );
1351     fprintf( stderr, " flush=%d", req->flush );
1352 }
1353
1354 static void dump_read_console_input_reply( const struct read_console_input_reply *req )
1355 {
1356     fprintf( stderr, " read=%d,", req->read );
1357     fprintf( stderr, " rec=" );
1358     dump_varargs_input_records( cur_size );
1359 }
1360
1361 static void dump_write_console_output_request( const struct write_console_output_request *req )
1362 {
1363     fprintf( stderr, " handle=%p,", req->handle );
1364     fprintf( stderr, " x=%d,", req->x );
1365     fprintf( stderr, " y=%d,", req->y );
1366     fprintf( stderr, " mode=%d,", req->mode );
1367     fprintf( stderr, " wrap=%d,", req->wrap );
1368     fprintf( stderr, " data=" );
1369     dump_varargs_bytes( cur_size );
1370 }
1371
1372 static void dump_write_console_output_reply( const struct write_console_output_reply *req )
1373 {
1374     fprintf( stderr, " written=%d,", req->written );
1375     fprintf( stderr, " width=%d,", req->width );
1376     fprintf( stderr, " height=%d", req->height );
1377 }
1378
1379 static void dump_fill_console_output_request( const struct fill_console_output_request *req )
1380 {
1381     fprintf( stderr, " handle=%p,", req->handle );
1382     fprintf( stderr, " x=%d,", req->x );
1383     fprintf( stderr, " y=%d,", req->y );
1384     fprintf( stderr, " mode=%d,", req->mode );
1385     fprintf( stderr, " count=%d,", req->count );
1386     fprintf( stderr, " wrap=%d,", req->wrap );
1387     fprintf( stderr, " data=" );
1388     dump_char_info( &req->data );
1389 }
1390
1391 static void dump_fill_console_output_reply( const struct fill_console_output_reply *req )
1392 {
1393     fprintf( stderr, " written=%d", req->written );
1394 }
1395
1396 static void dump_read_console_output_request( const struct read_console_output_request *req )
1397 {
1398     fprintf( stderr, " handle=%p,", req->handle );
1399     fprintf( stderr, " x=%d,", req->x );
1400     fprintf( stderr, " y=%d,", req->y );
1401     fprintf( stderr, " mode=%d,", req->mode );
1402     fprintf( stderr, " wrap=%d", req->wrap );
1403 }
1404
1405 static void dump_read_console_output_reply( const struct read_console_output_reply *req )
1406 {
1407     fprintf( stderr, " width=%d,", req->width );
1408     fprintf( stderr, " height=%d,", req->height );
1409     fprintf( stderr, " data=" );
1410     dump_varargs_bytes( cur_size );
1411 }
1412
1413 static void dump_move_console_output_request( const struct move_console_output_request *req )
1414 {
1415     fprintf( stderr, " handle=%p,", req->handle );
1416     fprintf( stderr, " x_src=%d,", req->x_src );
1417     fprintf( stderr, " y_src=%d,", req->y_src );
1418     fprintf( stderr, " x_dst=%d,", req->x_dst );
1419     fprintf( stderr, " y_dst=%d,", req->y_dst );
1420     fprintf( stderr, " w=%d,", req->w );
1421     fprintf( stderr, " h=%d", req->h );
1422 }
1423
1424 static void dump_send_console_signal_request( const struct send_console_signal_request *req )
1425 {
1426     fprintf( stderr, " signal=%d,", req->signal );
1427     fprintf( stderr, " group_id=%04x", req->group_id );
1428 }
1429
1430 static void dump_create_change_notification_request( const struct create_change_notification_request *req )
1431 {
1432     fprintf( stderr, " handle=%p,", req->handle );
1433     fprintf( stderr, " subtree=%d,", req->subtree );
1434     fprintf( stderr, " filter=%08x", req->filter );
1435 }
1436
1437 static void dump_create_change_notification_reply( const struct create_change_notification_reply *req )
1438 {
1439     fprintf( stderr, " handle=%p", req->handle );
1440 }
1441
1442 static void dump_next_change_notification_request( const struct next_change_notification_request *req )
1443 {
1444     fprintf( stderr, " handle=%p", req->handle );
1445 }
1446
1447 static void dump_create_mapping_request( const struct create_mapping_request *req )
1448 {
1449     fprintf( stderr, " access=%08x,", req->access );
1450     fprintf( stderr, " attributes=%08x,", req->attributes );
1451     fprintf( stderr, " rootdir=%p,", req->rootdir );
1452     fprintf( stderr, " size_high=%d,", req->size_high );
1453     fprintf( stderr, " size_low=%d,", req->size_low );
1454     fprintf( stderr, " protect=%d,", req->protect );
1455     fprintf( stderr, " file_handle=%p,", req->file_handle );
1456     fprintf( stderr, " name=" );
1457     dump_varargs_unicode_str( cur_size );
1458 }
1459
1460 static void dump_create_mapping_reply( const struct create_mapping_reply *req )
1461 {
1462     fprintf( stderr, " handle=%p", req->handle );
1463 }
1464
1465 static void dump_open_mapping_request( const struct open_mapping_request *req )
1466 {
1467     fprintf( stderr, " access=%08x,", req->access );
1468     fprintf( stderr, " attributes=%08x,", req->attributes );
1469     fprintf( stderr, " rootdir=%p,", req->rootdir );
1470     fprintf( stderr, " name=" );
1471     dump_varargs_unicode_str( cur_size );
1472 }
1473
1474 static void dump_open_mapping_reply( const struct open_mapping_reply *req )
1475 {
1476     fprintf( stderr, " handle=%p", req->handle );
1477 }
1478
1479 static void dump_get_mapping_info_request( const struct get_mapping_info_request *req )
1480 {
1481     fprintf( stderr, " handle=%p", req->handle );
1482 }
1483
1484 static void dump_get_mapping_info_reply( const struct get_mapping_info_reply *req )
1485 {
1486     fprintf( stderr, " size_high=%d,", req->size_high );
1487     fprintf( stderr, " size_low=%d,", req->size_low );
1488     fprintf( stderr, " protect=%d,", req->protect );
1489     fprintf( stderr, " header_size=%d,", req->header_size );
1490     fprintf( stderr, " base=%p,", req->base );
1491     fprintf( stderr, " shared_file=%p,", req->shared_file );
1492     fprintf( stderr, " shared_size=%d", req->shared_size );
1493 }
1494
1495 static void dump_create_snapshot_request( const struct create_snapshot_request *req )
1496 {
1497     fprintf( stderr, " inherit=%d,", req->inherit );
1498     fprintf( stderr, " flags=%d,", req->flags );
1499     fprintf( stderr, " pid=%04x", req->pid );
1500 }
1501
1502 static void dump_create_snapshot_reply( const struct create_snapshot_reply *req )
1503 {
1504     fprintf( stderr, " handle=%p", req->handle );
1505 }
1506
1507 static void dump_next_process_request( const struct next_process_request *req )
1508 {
1509     fprintf( stderr, " handle=%p,", req->handle );
1510     fprintf( stderr, " reset=%d", req->reset );
1511 }
1512
1513 static void dump_next_process_reply( const struct next_process_reply *req )
1514 {
1515     fprintf( stderr, " count=%d,", req->count );
1516     fprintf( stderr, " pid=%04x,", req->pid );
1517     fprintf( stderr, " ppid=%04x,", req->ppid );
1518     fprintf( stderr, " heap=%p,", req->heap );
1519     fprintf( stderr, " module=%p,", req->module );
1520     fprintf( stderr, " threads=%d,", req->threads );
1521     fprintf( stderr, " priority=%d,", req->priority );
1522     fprintf( stderr, " handles=%d,", req->handles );
1523     fprintf( stderr, " filename=" );
1524     dump_varargs_unicode_str( cur_size );
1525 }
1526
1527 static void dump_next_thread_request( const struct next_thread_request *req )
1528 {
1529     fprintf( stderr, " handle=%p,", req->handle );
1530     fprintf( stderr, " reset=%d", req->reset );
1531 }
1532
1533 static void dump_next_thread_reply( const struct next_thread_reply *req )
1534 {
1535     fprintf( stderr, " count=%d,", req->count );
1536     fprintf( stderr, " pid=%04x,", req->pid );
1537     fprintf( stderr, " tid=%04x,", req->tid );
1538     fprintf( stderr, " base_pri=%d,", req->base_pri );
1539     fprintf( stderr, " delta_pri=%d", req->delta_pri );
1540 }
1541
1542 static void dump_next_module_request( const struct next_module_request *req )
1543 {
1544     fprintf( stderr, " handle=%p,", req->handle );
1545     fprintf( stderr, " reset=%d", req->reset );
1546 }
1547
1548 static void dump_next_module_reply( const struct next_module_reply *req )
1549 {
1550     fprintf( stderr, " pid=%04x,", req->pid );
1551     fprintf( stderr, " base=%p,", req->base );
1552     fprintf( stderr, " size=%d,", req->size );
1553     fprintf( stderr, " filename=" );
1554     dump_varargs_unicode_str( cur_size );
1555 }
1556
1557 static void dump_wait_debug_event_request( const struct wait_debug_event_request *req )
1558 {
1559     fprintf( stderr, " get_handle=%d", req->get_handle );
1560 }
1561
1562 static void dump_wait_debug_event_reply( const struct wait_debug_event_reply *req )
1563 {
1564     fprintf( stderr, " pid=%04x,", req->pid );
1565     fprintf( stderr, " tid=%04x,", req->tid );
1566     fprintf( stderr, " wait=%p,", req->wait );
1567     fprintf( stderr, " event=" );
1568     dump_varargs_debug_event( cur_size );
1569 }
1570
1571 static void dump_queue_exception_event_request( const struct queue_exception_event_request *req )
1572 {
1573     fprintf( stderr, " first=%d,", req->first );
1574     fprintf( stderr, " record=" );
1575     dump_varargs_exc_event( cur_size );
1576 }
1577
1578 static void dump_queue_exception_event_reply( const struct queue_exception_event_reply *req )
1579 {
1580     fprintf( stderr, " handle=%p", req->handle );
1581 }
1582
1583 static void dump_get_exception_status_request( const struct get_exception_status_request *req )
1584 {
1585     fprintf( stderr, " handle=%p", req->handle );
1586 }
1587
1588 static void dump_get_exception_status_reply( const struct get_exception_status_reply *req )
1589 {
1590     fprintf( stderr, " context=" );
1591     dump_varargs_context( cur_size );
1592 }
1593
1594 static void dump_output_debug_string_request( const struct output_debug_string_request *req )
1595 {
1596     fprintf( stderr, " string=%p,", req->string );
1597     fprintf( stderr, " unicode=%d,", req->unicode );
1598     fprintf( stderr, " length=%d", req->length );
1599 }
1600
1601 static void dump_continue_debug_event_request( const struct continue_debug_event_request *req )
1602 {
1603     fprintf( stderr, " pid=%04x,", req->pid );
1604     fprintf( stderr, " tid=%04x,", req->tid );
1605     fprintf( stderr, " status=%d", req->status );
1606 }
1607
1608 static void dump_debug_process_request( const struct debug_process_request *req )
1609 {
1610     fprintf( stderr, " pid=%04x,", req->pid );
1611     fprintf( stderr, " attach=%d", req->attach );
1612 }
1613
1614 static void dump_debug_break_request( const struct debug_break_request *req )
1615 {
1616     fprintf( stderr, " handle=%p", req->handle );
1617 }
1618
1619 static void dump_debug_break_reply( const struct debug_break_reply *req )
1620 {
1621     fprintf( stderr, " self=%d", req->self );
1622 }
1623
1624 static void dump_set_debugger_kill_on_exit_request( const struct set_debugger_kill_on_exit_request *req )
1625 {
1626     fprintf( stderr, " kill_on_exit=%d", req->kill_on_exit );
1627 }
1628
1629 static void dump_read_process_memory_request( const struct read_process_memory_request *req )
1630 {
1631     fprintf( stderr, " handle=%p,", req->handle );
1632     fprintf( stderr, " addr=%p", req->addr );
1633 }
1634
1635 static void dump_read_process_memory_reply( const struct read_process_memory_reply *req )
1636 {
1637     fprintf( stderr, " data=" );
1638     dump_varargs_bytes( cur_size );
1639 }
1640
1641 static void dump_write_process_memory_request( const struct write_process_memory_request *req )
1642 {
1643     fprintf( stderr, " handle=%p,", req->handle );
1644     fprintf( stderr, " addr=%p,", req->addr );
1645     fprintf( stderr, " first_mask=%08x,", req->first_mask );
1646     fprintf( stderr, " last_mask=%08x,", req->last_mask );
1647     fprintf( stderr, " data=" );
1648     dump_varargs_bytes( cur_size );
1649 }
1650
1651 static void dump_create_key_request( const struct create_key_request *req )
1652 {
1653     fprintf( stderr, " parent=%p,", req->parent );
1654     fprintf( stderr, " access=%08x,", req->access );
1655     fprintf( stderr, " options=%08x,", req->options );
1656     fprintf( stderr, " modif=%ld,", (long)req->modif );
1657     fprintf( stderr, " namelen=%d,", req->namelen );
1658     fprintf( stderr, " name=" );
1659     dump_varargs_unicode_str( min(cur_size,req->namelen) );
1660     fputc( ',', stderr );
1661     fprintf( stderr, " class=" );
1662     dump_varargs_unicode_str( cur_size );
1663 }
1664
1665 static void dump_create_key_reply( const struct create_key_reply *req )
1666 {
1667     fprintf( stderr, " hkey=%p,", req->hkey );
1668     fprintf( stderr, " created=%d", req->created );
1669 }
1670
1671 static void dump_open_key_request( const struct open_key_request *req )
1672 {
1673     fprintf( stderr, " parent=%p,", req->parent );
1674     fprintf( stderr, " access=%08x,", req->access );
1675     fprintf( stderr, " name=" );
1676     dump_varargs_unicode_str( cur_size );
1677 }
1678
1679 static void dump_open_key_reply( const struct open_key_reply *req )
1680 {
1681     fprintf( stderr, " hkey=%p", req->hkey );
1682 }
1683
1684 static void dump_delete_key_request( const struct delete_key_request *req )
1685 {
1686     fprintf( stderr, " hkey=%p", req->hkey );
1687 }
1688
1689 static void dump_flush_key_request( const struct flush_key_request *req )
1690 {
1691     fprintf( stderr, " hkey=%p", req->hkey );
1692 }
1693
1694 static void dump_enum_key_request( const struct enum_key_request *req )
1695 {
1696     fprintf( stderr, " hkey=%p,", req->hkey );
1697     fprintf( stderr, " index=%d,", req->index );
1698     fprintf( stderr, " info_class=%d", req->info_class );
1699 }
1700
1701 static void dump_enum_key_reply( const struct enum_key_reply *req )
1702 {
1703     fprintf( stderr, " subkeys=%d,", req->subkeys );
1704     fprintf( stderr, " max_subkey=%d,", req->max_subkey );
1705     fprintf( stderr, " max_class=%d,", req->max_class );
1706     fprintf( stderr, " values=%d,", req->values );
1707     fprintf( stderr, " max_value=%d,", req->max_value );
1708     fprintf( stderr, " max_data=%d,", req->max_data );
1709     fprintf( stderr, " modif=%ld,", (long)req->modif );
1710     fprintf( stderr, " total=%d,", req->total );
1711     fprintf( stderr, " namelen=%d,", req->namelen );
1712     fprintf( stderr, " name=" );
1713     dump_varargs_unicode_str( min(cur_size,req->namelen) );
1714     fputc( ',', stderr );
1715     fprintf( stderr, " class=" );
1716     dump_varargs_unicode_str( cur_size );
1717 }
1718
1719 static void dump_set_key_value_request( const struct set_key_value_request *req )
1720 {
1721     fprintf( stderr, " hkey=%p,", req->hkey );
1722     fprintf( stderr, " type=%d,", req->type );
1723     fprintf( stderr, " namelen=%d,", req->namelen );
1724     fprintf( stderr, " name=" );
1725     dump_varargs_unicode_str( min(cur_size,req->namelen) );
1726     fputc( ',', stderr );
1727     fprintf( stderr, " data=" );
1728     dump_varargs_bytes( cur_size );
1729 }
1730
1731 static void dump_get_key_value_request( const struct get_key_value_request *req )
1732 {
1733     fprintf( stderr, " hkey=%p,", req->hkey );
1734     fprintf( stderr, " name=" );
1735     dump_varargs_unicode_str( cur_size );
1736 }
1737
1738 static void dump_get_key_value_reply( const struct get_key_value_reply *req )
1739 {
1740     fprintf( stderr, " type=%d,", req->type );
1741     fprintf( stderr, " total=%d,", req->total );
1742     fprintf( stderr, " data=" );
1743     dump_varargs_bytes( cur_size );
1744 }
1745
1746 static void dump_enum_key_value_request( const struct enum_key_value_request *req )
1747 {
1748     fprintf( stderr, " hkey=%p,", req->hkey );
1749     fprintf( stderr, " index=%d,", req->index );
1750     fprintf( stderr, " info_class=%d", req->info_class );
1751 }
1752
1753 static void dump_enum_key_value_reply( const struct enum_key_value_reply *req )
1754 {
1755     fprintf( stderr, " type=%d,", req->type );
1756     fprintf( stderr, " total=%d,", req->total );
1757     fprintf( stderr, " namelen=%d,", req->namelen );
1758     fprintf( stderr, " name=" );
1759     dump_varargs_unicode_str( min(cur_size,req->namelen) );
1760     fputc( ',', stderr );
1761     fprintf( stderr, " data=" );
1762     dump_varargs_bytes( cur_size );
1763 }
1764
1765 static void dump_delete_key_value_request( const struct delete_key_value_request *req )
1766 {
1767     fprintf( stderr, " hkey=%p,", req->hkey );
1768     fprintf( stderr, " name=" );
1769     dump_varargs_unicode_str( cur_size );
1770 }
1771
1772 static void dump_load_registry_request( const struct load_registry_request *req )
1773 {
1774     fprintf( stderr, " hkey=%p,", req->hkey );
1775     fprintf( stderr, " file=%p,", req->file );
1776     fprintf( stderr, " name=" );
1777     dump_varargs_unicode_str( cur_size );
1778 }
1779
1780 static void dump_unload_registry_request( const struct unload_registry_request *req )
1781 {
1782     fprintf( stderr, " hkey=%p", req->hkey );
1783 }
1784
1785 static void dump_save_registry_request( const struct save_registry_request *req )
1786 {
1787     fprintf( stderr, " hkey=%p,", req->hkey );
1788     fprintf( stderr, " file=%p", req->file );
1789 }
1790
1791 static void dump_set_registry_notification_request( const struct set_registry_notification_request *req )
1792 {
1793     fprintf( stderr, " hkey=%p,", req->hkey );
1794     fprintf( stderr, " event=%p,", req->event );
1795     fprintf( stderr, " subtree=%d,", req->subtree );
1796     fprintf( stderr, " filter=%08x", req->filter );
1797 }
1798
1799 static void dump_create_timer_request( const struct create_timer_request *req )
1800 {
1801     fprintf( stderr, " access=%08x,", req->access );
1802     fprintf( stderr, " attributes=%08x,", req->attributes );
1803     fprintf( stderr, " rootdir=%p,", req->rootdir );
1804     fprintf( stderr, " manual=%d,", req->manual );
1805     fprintf( stderr, " name=" );
1806     dump_varargs_unicode_str( cur_size );
1807 }
1808
1809 static void dump_create_timer_reply( const struct create_timer_reply *req )
1810 {
1811     fprintf( stderr, " handle=%p", req->handle );
1812 }
1813
1814 static void dump_open_timer_request( const struct open_timer_request *req )
1815 {
1816     fprintf( stderr, " access=%08x,", req->access );
1817     fprintf( stderr, " attributes=%08x,", req->attributes );
1818     fprintf( stderr, " rootdir=%p,", req->rootdir );
1819     fprintf( stderr, " name=" );
1820     dump_varargs_unicode_str( cur_size );
1821 }
1822
1823 static void dump_open_timer_reply( const struct open_timer_reply *req )
1824 {
1825     fprintf( stderr, " handle=%p", req->handle );
1826 }
1827
1828 static void dump_set_timer_request( const struct set_timer_request *req )
1829 {
1830     fprintf( stderr, " handle=%p,", req->handle );
1831     fprintf( stderr, " expire=" );
1832     dump_abs_time( &req->expire );
1833     fprintf( stderr, "," );
1834     fprintf( stderr, " period=%d,", req->period );
1835     fprintf( stderr, " callback=%p,", req->callback );
1836     fprintf( stderr, " arg=%p", req->arg );
1837 }
1838
1839 static void dump_set_timer_reply( const struct set_timer_reply *req )
1840 {
1841     fprintf( stderr, " signaled=%d", req->signaled );
1842 }
1843
1844 static void dump_cancel_timer_request( const struct cancel_timer_request *req )
1845 {
1846     fprintf( stderr, " handle=%p", req->handle );
1847 }
1848
1849 static void dump_cancel_timer_reply( const struct cancel_timer_reply *req )
1850 {
1851     fprintf( stderr, " signaled=%d", req->signaled );
1852 }
1853
1854 static void dump_get_timer_info_request( const struct get_timer_info_request *req )
1855 {
1856     fprintf( stderr, " handle=%p", req->handle );
1857 }
1858
1859 static void dump_get_timer_info_reply( const struct get_timer_info_reply *req )
1860 {
1861     fprintf( stderr, " when=" );
1862     dump_abs_time( &req->when );
1863     fprintf( stderr, "," );
1864     fprintf( stderr, " signaled=%d", req->signaled );
1865 }
1866
1867 static void dump_get_thread_context_request( const struct get_thread_context_request *req )
1868 {
1869     fprintf( stderr, " handle=%p,", req->handle );
1870     fprintf( stderr, " flags=%08x,", req->flags );
1871     fprintf( stderr, " suspend=%d", req->suspend );
1872 }
1873
1874 static void dump_get_thread_context_reply( const struct get_thread_context_reply *req )
1875 {
1876     fprintf( stderr, " context=" );
1877     dump_varargs_context( cur_size );
1878 }
1879
1880 static void dump_set_thread_context_request( const struct set_thread_context_request *req )
1881 {
1882     fprintf( stderr, " handle=%p,", req->handle );
1883     fprintf( stderr, " flags=%08x,", req->flags );
1884     fprintf( stderr, " suspend=%d,", req->suspend );
1885     fprintf( stderr, " context=" );
1886     dump_varargs_context( cur_size );
1887 }
1888
1889 static void dump_get_selector_entry_request( const struct get_selector_entry_request *req )
1890 {
1891     fprintf( stderr, " handle=%p,", req->handle );
1892     fprintf( stderr, " entry=%d", req->entry );
1893 }
1894
1895 static void dump_get_selector_entry_reply( const struct get_selector_entry_reply *req )
1896 {
1897     fprintf( stderr, " base=%08x,", req->base );
1898     fprintf( stderr, " limit=%08x,", req->limit );
1899     fprintf( stderr, " flags=%02x", req->flags );
1900 }
1901
1902 static void dump_add_atom_request( const struct add_atom_request *req )
1903 {
1904     fprintf( stderr, " table=%p,", req->table );
1905     fprintf( stderr, " name=" );
1906     dump_varargs_unicode_str( cur_size );
1907 }
1908
1909 static void dump_add_atom_reply( const struct add_atom_reply *req )
1910 {
1911     fprintf( stderr, " atom=%04x", req->atom );
1912 }
1913
1914 static void dump_delete_atom_request( const struct delete_atom_request *req )
1915 {
1916     fprintf( stderr, " table=%p,", req->table );
1917     fprintf( stderr, " atom=%04x", req->atom );
1918 }
1919
1920 static void dump_find_atom_request( const struct find_atom_request *req )
1921 {
1922     fprintf( stderr, " table=%p,", req->table );
1923     fprintf( stderr, " name=" );
1924     dump_varargs_unicode_str( cur_size );
1925 }
1926
1927 static void dump_find_atom_reply( const struct find_atom_reply *req )
1928 {
1929     fprintf( stderr, " atom=%04x", req->atom );
1930 }
1931
1932 static void dump_get_atom_information_request( const struct get_atom_information_request *req )
1933 {
1934     fprintf( stderr, " table=%p,", req->table );
1935     fprintf( stderr, " atom=%04x", req->atom );
1936 }
1937
1938 static void dump_get_atom_information_reply( const struct get_atom_information_reply *req )
1939 {
1940     fprintf( stderr, " count=%d,", req->count );
1941     fprintf( stderr, " pinned=%d,", req->pinned );
1942     fprintf( stderr, " name=" );
1943     dump_varargs_unicode_str( cur_size );
1944 }
1945
1946 static void dump_set_atom_information_request( const struct set_atom_information_request *req )
1947 {
1948     fprintf( stderr, " table=%p,", req->table );
1949     fprintf( stderr, " atom=%04x,", req->atom );
1950     fprintf( stderr, " pinned=%d", req->pinned );
1951 }
1952
1953 static void dump_empty_atom_table_request( const struct empty_atom_table_request *req )
1954 {
1955     fprintf( stderr, " table=%p,", req->table );
1956     fprintf( stderr, " if_pinned=%d", req->if_pinned );
1957 }
1958
1959 static void dump_init_atom_table_request( const struct init_atom_table_request *req )
1960 {
1961     fprintf( stderr, " entries=%d", req->entries );
1962 }
1963
1964 static void dump_init_atom_table_reply( const struct init_atom_table_reply *req )
1965 {
1966     fprintf( stderr, " table=%p", req->table );
1967 }
1968
1969 static void dump_get_msg_queue_request( const struct get_msg_queue_request *req )
1970 {
1971 }
1972
1973 static void dump_get_msg_queue_reply( const struct get_msg_queue_reply *req )
1974 {
1975     fprintf( stderr, " handle=%p", req->handle );
1976 }
1977
1978 static void dump_set_queue_mask_request( const struct set_queue_mask_request *req )
1979 {
1980     fprintf( stderr, " wake_mask=%08x,", req->wake_mask );
1981     fprintf( stderr, " changed_mask=%08x,", req->changed_mask );
1982     fprintf( stderr, " skip_wait=%d", req->skip_wait );
1983 }
1984
1985 static void dump_set_queue_mask_reply( const struct set_queue_mask_reply *req )
1986 {
1987     fprintf( stderr, " wake_bits=%08x,", req->wake_bits );
1988     fprintf( stderr, " changed_bits=%08x", req->changed_bits );
1989 }
1990
1991 static void dump_get_queue_status_request( const struct get_queue_status_request *req )
1992 {
1993     fprintf( stderr, " clear=%d", req->clear );
1994 }
1995
1996 static void dump_get_queue_status_reply( const struct get_queue_status_reply *req )
1997 {
1998     fprintf( stderr, " wake_bits=%08x,", req->wake_bits );
1999     fprintf( stderr, " changed_bits=%08x", req->changed_bits );
2000 }
2001
2002 static void dump_wait_input_idle_request( const struct wait_input_idle_request *req )
2003 {
2004     fprintf( stderr, " handle=%p,", req->handle );
2005     fprintf( stderr, " timeout=%d", req->timeout );
2006 }
2007
2008 static void dump_wait_input_idle_reply( const struct wait_input_idle_reply *req )
2009 {
2010     fprintf( stderr, " event=%p", req->event );
2011 }
2012
2013 static void dump_send_message_request( const struct send_message_request *req )
2014 {
2015     fprintf( stderr, " id=%04x,", req->id );
2016     fprintf( stderr, " type=%d,", req->type );
2017     fprintf( stderr, " flags=%d,", req->flags );
2018     fprintf( stderr, " win=%p,", req->win );
2019     fprintf( stderr, " msg=%08x,", req->msg );
2020     fprintf( stderr, " wparam=%08x,", req->wparam );
2021     fprintf( stderr, " lparam=%08x,", req->lparam );
2022     fprintf( stderr, " x=%d,", req->x );
2023     fprintf( stderr, " y=%d,", req->y );
2024     fprintf( stderr, " time=%08x,", req->time );
2025     fprintf( stderr, " info=%08x,", req->info );
2026     fprintf( stderr, " timeout=%d,", req->timeout );
2027     fprintf( stderr, " callback=%p,", req->callback );
2028     fprintf( stderr, " data=" );
2029     dump_varargs_bytes( cur_size );
2030 }
2031
2032 static void dump_get_message_request( const struct get_message_request *req )
2033 {
2034     fprintf( stderr, " flags=%d,", req->flags );
2035     fprintf( stderr, " get_win=%p,", req->get_win );
2036     fprintf( stderr, " get_first=%08x,", req->get_first );
2037     fprintf( stderr, " get_last=%08x,", req->get_last );
2038     fprintf( stderr, " hw_id=%08x", req->hw_id );
2039 }
2040
2041 static void dump_get_message_reply( const struct get_message_reply *req )
2042 {
2043     fprintf( stderr, " type=%d,", req->type );
2044     fprintf( stderr, " win=%p,", req->win );
2045     fprintf( stderr, " msg=%08x,", req->msg );
2046     fprintf( stderr, " wparam=%08x,", req->wparam );
2047     fprintf( stderr, " lparam=%08x,", req->lparam );
2048     fprintf( stderr, " x=%d,", req->x );
2049     fprintf( stderr, " y=%d,", req->y );
2050     fprintf( stderr, " hook=%p,", req->hook );
2051     fprintf( stderr, " hook_proc=%p,", req->hook_proc );
2052     fprintf( stderr, " time=%08x,", req->time );
2053     fprintf( stderr, " info=%08x,", req->info );
2054     fprintf( stderr, " hw_id=%08x,", req->hw_id );
2055     fprintf( stderr, " active_hooks=%08x,", req->active_hooks );
2056     fprintf( stderr, " total=%d,", req->total );
2057     fprintf( stderr, " data=" );
2058     dump_varargs_bytes( cur_size );
2059 }
2060
2061 static void dump_reply_message_request( const struct reply_message_request *req )
2062 {
2063     fprintf( stderr, " result=%08x,", req->result );
2064     fprintf( stderr, " remove=%d,", req->remove );
2065     fprintf( stderr, " data=" );
2066     dump_varargs_bytes( cur_size );
2067 }
2068
2069 static void dump_accept_hardware_message_request( const struct accept_hardware_message_request *req )
2070 {
2071     fprintf( stderr, " hw_id=%08x,", req->hw_id );
2072     fprintf( stderr, " remove=%d,", req->remove );
2073     fprintf( stderr, " new_win=%p", req->new_win );
2074 }
2075
2076 static void dump_get_message_reply_request( const struct get_message_reply_request *req )
2077 {
2078     fprintf( stderr, " cancel=%d", req->cancel );
2079 }
2080
2081 static void dump_get_message_reply_reply( const struct get_message_reply_reply *req )
2082 {
2083     fprintf( stderr, " result=%08x,", req->result );
2084     fprintf( stderr, " data=" );
2085     dump_varargs_bytes( cur_size );
2086 }
2087
2088 static void dump_set_win_timer_request( const struct set_win_timer_request *req )
2089 {
2090     fprintf( stderr, " win=%p,", req->win );
2091     fprintf( stderr, " msg=%08x,", req->msg );
2092     fprintf( stderr, " id=%08x,", req->id );
2093     fprintf( stderr, " rate=%08x,", req->rate );
2094     fprintf( stderr, " lparam=%08x", req->lparam );
2095 }
2096
2097 static void dump_set_win_timer_reply( const struct set_win_timer_reply *req )
2098 {
2099     fprintf( stderr, " id=%08x", req->id );
2100 }
2101
2102 static void dump_kill_win_timer_request( const struct kill_win_timer_request *req )
2103 {
2104     fprintf( stderr, " win=%p,", req->win );
2105     fprintf( stderr, " msg=%08x,", req->msg );
2106     fprintf( stderr, " id=%08x", req->id );
2107 }
2108
2109 static void dump_get_serial_info_request( const struct get_serial_info_request *req )
2110 {
2111     fprintf( stderr, " handle=%p", req->handle );
2112 }
2113
2114 static void dump_get_serial_info_reply( const struct get_serial_info_reply *req )
2115 {
2116     fprintf( stderr, " readinterval=%08x,", req->readinterval );
2117     fprintf( stderr, " readconst=%08x,", req->readconst );
2118     fprintf( stderr, " readmult=%08x,", req->readmult );
2119     fprintf( stderr, " writeconst=%08x,", req->writeconst );
2120     fprintf( stderr, " writemult=%08x,", req->writemult );
2121     fprintf( stderr, " eventmask=%08x,", req->eventmask );
2122     fprintf( stderr, " commerror=%08x", req->commerror );
2123 }
2124
2125 static void dump_set_serial_info_request( const struct set_serial_info_request *req )
2126 {
2127     fprintf( stderr, " handle=%p,", req->handle );
2128     fprintf( stderr, " flags=%d,", req->flags );
2129     fprintf( stderr, " readinterval=%08x,", req->readinterval );
2130     fprintf( stderr, " readconst=%08x,", req->readconst );
2131     fprintf( stderr, " readmult=%08x,", req->readmult );
2132     fprintf( stderr, " writeconst=%08x,", req->writeconst );
2133     fprintf( stderr, " writemult=%08x,", req->writemult );
2134     fprintf( stderr, " eventmask=%08x,", req->eventmask );
2135     fprintf( stderr, " commerror=%08x", req->commerror );
2136 }
2137
2138 static void dump_register_async_request( const struct register_async_request *req )
2139 {
2140     fprintf( stderr, " handle=%p,", req->handle );
2141     fprintf( stderr, " type=%d,", req->type );
2142     fprintf( stderr, " io_apc=%p,", req->io_apc );
2143     fprintf( stderr, " io_sb=%p,", req->io_sb );
2144     fprintf( stderr, " io_user=%p,", req->io_user );
2145     fprintf( stderr, " count=%d", req->count );
2146 }
2147
2148 static void dump_cancel_async_request( const struct cancel_async_request *req )
2149 {
2150     fprintf( stderr, " handle=%p", req->handle );
2151 }
2152
2153 static void dump_create_named_pipe_request( const struct create_named_pipe_request *req )
2154 {
2155     fprintf( stderr, " access=%08x,", req->access );
2156     fprintf( stderr, " attributes=%08x,", req->attributes );
2157     fprintf( stderr, " rootdir=%p,", req->rootdir );
2158     fprintf( stderr, " options=%08x,", req->options );
2159     fprintf( stderr, " flags=%08x,", req->flags );
2160     fprintf( stderr, " maxinstances=%08x,", req->maxinstances );
2161     fprintf( stderr, " outsize=%08x,", req->outsize );
2162     fprintf( stderr, " insize=%08x,", req->insize );
2163     fprintf( stderr, " timeout=%08x,", req->timeout );
2164     fprintf( stderr, " name=" );
2165     dump_varargs_unicode_str( cur_size );
2166 }
2167
2168 static void dump_create_named_pipe_reply( const struct create_named_pipe_reply *req )
2169 {
2170     fprintf( stderr, " handle=%p", req->handle );
2171 }
2172
2173 static void dump_open_named_pipe_request( const struct open_named_pipe_request *req )
2174 {
2175     fprintf( stderr, " access=%08x,", req->access );
2176     fprintf( stderr, " attributes=%08x,", req->attributes );
2177     fprintf( stderr, " rootdir=%p,", req->rootdir );
2178     fprintf( stderr, " flags=%08x,", req->flags );
2179     fprintf( stderr, " name=" );
2180     dump_varargs_unicode_str( cur_size );
2181 }
2182
2183 static void dump_open_named_pipe_reply( const struct open_named_pipe_reply *req )
2184 {
2185     fprintf( stderr, " handle=%p", req->handle );
2186 }
2187
2188 static void dump_connect_named_pipe_request( const struct connect_named_pipe_request *req )
2189 {
2190     fprintf( stderr, " handle=%p,", req->handle );
2191     fprintf( stderr, " event=%p,", req->event );
2192     fprintf( stderr, " func=%p", req->func );
2193 }
2194
2195 static void dump_wait_named_pipe_request( const struct wait_named_pipe_request *req )
2196 {
2197     fprintf( stderr, " timeout=%08x,", req->timeout );
2198     fprintf( stderr, " overlapped=%p,", req->overlapped );
2199     fprintf( stderr, " func=%p,", req->func );
2200     fprintf( stderr, " name=" );
2201     dump_varargs_unicode_str( cur_size );
2202 }
2203
2204 static void dump_disconnect_named_pipe_request( const struct disconnect_named_pipe_request *req )
2205 {
2206     fprintf( stderr, " handle=%p", req->handle );
2207 }
2208
2209 static void dump_disconnect_named_pipe_reply( const struct disconnect_named_pipe_reply *req )
2210 {
2211     fprintf( stderr, " fd=%d", req->fd );
2212 }
2213
2214 static void dump_get_named_pipe_info_request( const struct get_named_pipe_info_request *req )
2215 {
2216     fprintf( stderr, " handle=%p", req->handle );
2217 }
2218
2219 static void dump_get_named_pipe_info_reply( const struct get_named_pipe_info_reply *req )
2220 {
2221     fprintf( stderr, " flags=%08x,", req->flags );
2222     fprintf( stderr, " maxinstances=%08x,", req->maxinstances );
2223     fprintf( stderr, " outsize=%08x,", req->outsize );
2224     fprintf( stderr, " insize=%08x", req->insize );
2225 }
2226
2227 static void dump_create_window_request( const struct create_window_request *req )
2228 {
2229     fprintf( stderr, " parent=%p,", req->parent );
2230     fprintf( stderr, " owner=%p,", req->owner );
2231     fprintf( stderr, " atom=%04x,", req->atom );
2232     fprintf( stderr, " instance=%p", req->instance );
2233 }
2234
2235 static void dump_create_window_reply( const struct create_window_reply *req )
2236 {
2237     fprintf( stderr, " handle=%p,", req->handle );
2238     fprintf( stderr, " extra=%d,", req->extra );
2239     fprintf( stderr, " class_ptr=%p", req->class_ptr );
2240 }
2241
2242 static void dump_destroy_window_request( const struct destroy_window_request *req )
2243 {
2244     fprintf( stderr, " handle=%p", req->handle );
2245 }
2246
2247 static void dump_get_desktop_window_request( const struct get_desktop_window_request *req )
2248 {
2249 }
2250
2251 static void dump_get_desktop_window_reply( const struct get_desktop_window_reply *req )
2252 {
2253     fprintf( stderr, " handle=%p", req->handle );
2254 }
2255
2256 static void dump_set_window_owner_request( const struct set_window_owner_request *req )
2257 {
2258     fprintf( stderr, " handle=%p,", req->handle );
2259     fprintf( stderr, " owner=%p", req->owner );
2260 }
2261
2262 static void dump_set_window_owner_reply( const struct set_window_owner_reply *req )
2263 {
2264     fprintf( stderr, " full_owner=%p,", req->full_owner );
2265     fprintf( stderr, " prev_owner=%p", req->prev_owner );
2266 }
2267
2268 static void dump_get_window_info_request( const struct get_window_info_request *req )
2269 {
2270     fprintf( stderr, " handle=%p", req->handle );
2271 }
2272
2273 static void dump_get_window_info_reply( const struct get_window_info_reply *req )
2274 {
2275     fprintf( stderr, " full_handle=%p,", req->full_handle );
2276     fprintf( stderr, " last_active=%p,", req->last_active );
2277     fprintf( stderr, " pid=%04x,", req->pid );
2278     fprintf( stderr, " tid=%04x,", req->tid );
2279     fprintf( stderr, " atom=%04x,", req->atom );
2280     fprintf( stderr, " is_unicode=%d", req->is_unicode );
2281 }
2282
2283 static void dump_set_window_info_request( const struct set_window_info_request *req )
2284 {
2285     fprintf( stderr, " handle=%p,", req->handle );
2286     fprintf( stderr, " flags=%08x,", req->flags );
2287     fprintf( stderr, " style=%08x,", req->style );
2288     fprintf( stderr, " ex_style=%08x,", req->ex_style );
2289     fprintf( stderr, " id=%08x,", req->id );
2290     fprintf( stderr, " instance=%p,", req->instance );
2291     fprintf( stderr, " is_unicode=%d,", req->is_unicode );
2292     fprintf( stderr, " user_data=%p,", req->user_data );
2293     fprintf( stderr, " extra_offset=%d,", req->extra_offset );
2294     fprintf( stderr, " extra_size=%d,", req->extra_size );
2295     fprintf( stderr, " extra_value=%08x", req->extra_value );
2296 }
2297
2298 static void dump_set_window_info_reply( const struct set_window_info_reply *req )
2299 {
2300     fprintf( stderr, " old_style=%08x,", req->old_style );
2301     fprintf( stderr, " old_ex_style=%08x,", req->old_ex_style );
2302     fprintf( stderr, " old_id=%08x,", req->old_id );
2303     fprintf( stderr, " old_instance=%p,", req->old_instance );
2304     fprintf( stderr, " old_user_data=%p,", req->old_user_data );
2305     fprintf( stderr, " old_extra_value=%08x", req->old_extra_value );
2306 }
2307
2308 static void dump_set_parent_request( const struct set_parent_request *req )
2309 {
2310     fprintf( stderr, " handle=%p,", req->handle );
2311     fprintf( stderr, " parent=%p", req->parent );
2312 }
2313
2314 static void dump_set_parent_reply( const struct set_parent_reply *req )
2315 {
2316     fprintf( stderr, " old_parent=%p,", req->old_parent );
2317     fprintf( stderr, " full_parent=%p", req->full_parent );
2318 }
2319
2320 static void dump_get_window_parents_request( const struct get_window_parents_request *req )
2321 {
2322     fprintf( stderr, " handle=%p", req->handle );
2323 }
2324
2325 static void dump_get_window_parents_reply( const struct get_window_parents_reply *req )
2326 {
2327     fprintf( stderr, " count=%d,", req->count );
2328     fprintf( stderr, " parents=" );
2329     dump_varargs_user_handles( cur_size );
2330 }
2331
2332 static void dump_get_window_children_request( const struct get_window_children_request *req )
2333 {
2334     fprintf( stderr, " parent=%p,", req->parent );
2335     fprintf( stderr, " atom=%04x,", req->atom );
2336     fprintf( stderr, " tid=%04x", req->tid );
2337 }
2338
2339 static void dump_get_window_children_reply( const struct get_window_children_reply *req )
2340 {
2341     fprintf( stderr, " count=%d,", req->count );
2342     fprintf( stderr, " children=" );
2343     dump_varargs_user_handles( cur_size );
2344 }
2345
2346 static void dump_get_window_children_from_point_request( const struct get_window_children_from_point_request *req )
2347 {
2348     fprintf( stderr, " parent=%p,", req->parent );
2349     fprintf( stderr, " x=%d,", req->x );
2350     fprintf( stderr, " y=%d", req->y );
2351 }
2352
2353 static void dump_get_window_children_from_point_reply( const struct get_window_children_from_point_reply *req )
2354 {
2355     fprintf( stderr, " count=%d,", req->count );
2356     fprintf( stderr, " children=" );
2357     dump_varargs_user_handles( cur_size );
2358 }
2359
2360 static void dump_get_window_tree_request( const struct get_window_tree_request *req )
2361 {
2362     fprintf( stderr, " handle=%p", req->handle );
2363 }
2364
2365 static void dump_get_window_tree_reply( const struct get_window_tree_reply *req )
2366 {
2367     fprintf( stderr, " parent=%p,", req->parent );
2368     fprintf( stderr, " owner=%p,", req->owner );
2369     fprintf( stderr, " next_sibling=%p,", req->next_sibling );
2370     fprintf( stderr, " prev_sibling=%p,", req->prev_sibling );
2371     fprintf( stderr, " first_sibling=%p,", req->first_sibling );
2372     fprintf( stderr, " last_sibling=%p,", req->last_sibling );
2373     fprintf( stderr, " first_child=%p,", req->first_child );
2374     fprintf( stderr, " last_child=%p", req->last_child );
2375 }
2376
2377 static void dump_set_window_pos_request( const struct set_window_pos_request *req )
2378 {
2379     fprintf( stderr, " handle=%p,", req->handle );
2380     fprintf( stderr, " previous=%p,", req->previous );
2381     fprintf( stderr, " flags=%08x,", req->flags );
2382     fprintf( stderr, " window=" );
2383     dump_rectangle( &req->window );
2384     fprintf( stderr, "," );
2385     fprintf( stderr, " client=" );
2386     dump_rectangle( &req->client );
2387     fprintf( stderr, "," );
2388     fprintf( stderr, " valid=" );
2389     dump_varargs_rectangles( cur_size );
2390 }
2391
2392 static void dump_set_window_pos_reply( const struct set_window_pos_reply *req )
2393 {
2394     fprintf( stderr, " new_style=%08x", req->new_style );
2395 }
2396
2397 static void dump_get_window_rectangles_request( const struct get_window_rectangles_request *req )
2398 {
2399     fprintf( stderr, " handle=%p", req->handle );
2400 }
2401
2402 static void dump_get_window_rectangles_reply( const struct get_window_rectangles_reply *req )
2403 {
2404     fprintf( stderr, " window=" );
2405     dump_rectangle( &req->window );
2406     fprintf( stderr, "," );
2407     fprintf( stderr, " visible=" );
2408     dump_rectangle( &req->visible );
2409     fprintf( stderr, "," );
2410     fprintf( stderr, " client=" );
2411     dump_rectangle( &req->client );
2412 }
2413
2414 static void dump_get_window_text_request( const struct get_window_text_request *req )
2415 {
2416     fprintf( stderr, " handle=%p", req->handle );
2417 }
2418
2419 static void dump_get_window_text_reply( const struct get_window_text_reply *req )
2420 {
2421     fprintf( stderr, " text=" );
2422     dump_varargs_unicode_str( cur_size );
2423 }
2424
2425 static void dump_set_window_text_request( const struct set_window_text_request *req )
2426 {
2427     fprintf( stderr, " handle=%p,", req->handle );
2428     fprintf( stderr, " text=" );
2429     dump_varargs_unicode_str( cur_size );
2430 }
2431
2432 static void dump_get_windows_offset_request( const struct get_windows_offset_request *req )
2433 {
2434     fprintf( stderr, " from=%p,", req->from );
2435     fprintf( stderr, " to=%p", req->to );
2436 }
2437
2438 static void dump_get_windows_offset_reply( const struct get_windows_offset_reply *req )
2439 {
2440     fprintf( stderr, " x=%d,", req->x );
2441     fprintf( stderr, " y=%d", req->y );
2442 }
2443
2444 static void dump_get_visible_region_request( const struct get_visible_region_request *req )
2445 {
2446     fprintf( stderr, " window=%p,", req->window );
2447     fprintf( stderr, " flags=%08x", req->flags );
2448 }
2449
2450 static void dump_get_visible_region_reply( const struct get_visible_region_reply *req )
2451 {
2452     fprintf( stderr, " top_win=%p,", req->top_win );
2453     fprintf( stderr, " top_org_x=%d,", req->top_org_x );
2454     fprintf( stderr, " top_org_y=%d,", req->top_org_y );
2455     fprintf( stderr, " win_org_x=%d,", req->win_org_x );
2456     fprintf( stderr, " win_org_y=%d,", req->win_org_y );
2457     fprintf( stderr, " total_size=%d,", req->total_size );
2458     fprintf( stderr, " region=" );
2459     dump_varargs_rectangles( cur_size );
2460 }
2461
2462 static void dump_get_window_region_request( const struct get_window_region_request *req )
2463 {
2464     fprintf( stderr, " window=%p", req->window );
2465 }
2466
2467 static void dump_get_window_region_reply( const struct get_window_region_reply *req )
2468 {
2469     fprintf( stderr, " total_size=%d,", req->total_size );
2470     fprintf( stderr, " region=" );
2471     dump_varargs_rectangles( cur_size );
2472 }
2473
2474 static void dump_set_window_region_request( const struct set_window_region_request *req )
2475 {
2476     fprintf( stderr, " window=%p,", req->window );
2477     fprintf( stderr, " region=" );
2478     dump_varargs_rectangles( cur_size );
2479 }
2480
2481 static void dump_get_update_region_request( const struct get_update_region_request *req )
2482 {
2483     fprintf( stderr, " window=%p,", req->window );
2484     fprintf( stderr, " from_child=%p,", req->from_child );
2485     fprintf( stderr, " flags=%08x", req->flags );
2486 }
2487
2488 static void dump_get_update_region_reply( const struct get_update_region_reply *req )
2489 {
2490     fprintf( stderr, " child=%p,", req->child );
2491     fprintf( stderr, " flags=%08x,", req->flags );
2492     fprintf( stderr, " total_size=%d,", req->total_size );
2493     fprintf( stderr, " region=" );
2494     dump_varargs_rectangles( cur_size );
2495 }
2496
2497 static void dump_update_window_zorder_request( const struct update_window_zorder_request *req )
2498 {
2499     fprintf( stderr, " window=%p,", req->window );
2500     fprintf( stderr, " rect=" );
2501     dump_rectangle( &req->rect );
2502 }
2503
2504 static void dump_redraw_window_request( const struct redraw_window_request *req )
2505 {
2506     fprintf( stderr, " window=%p,", req->window );
2507     fprintf( stderr, " flags=%08x,", req->flags );
2508     fprintf( stderr, " region=" );
2509     dump_varargs_rectangles( cur_size );
2510 }
2511
2512 static void dump_set_window_property_request( const struct set_window_property_request *req )
2513 {
2514     fprintf( stderr, " window=%p,", req->window );
2515     fprintf( stderr, " atom=%04x,", req->atom );
2516     fprintf( stderr, " handle=%p,", req->handle );
2517     fprintf( stderr, " name=" );
2518     dump_varargs_unicode_str( cur_size );
2519 }
2520
2521 static void dump_remove_window_property_request( const struct remove_window_property_request *req )
2522 {
2523     fprintf( stderr, " window=%p,", req->window );
2524     fprintf( stderr, " atom=%04x,", req->atom );
2525     fprintf( stderr, " name=" );
2526     dump_varargs_unicode_str( cur_size );
2527 }
2528
2529 static void dump_remove_window_property_reply( const struct remove_window_property_reply *req )
2530 {
2531     fprintf( stderr, " handle=%p", req->handle );
2532 }
2533
2534 static void dump_get_window_property_request( const struct get_window_property_request *req )
2535 {
2536     fprintf( stderr, " window=%p,", req->window );
2537     fprintf( stderr, " atom=%04x,", req->atom );
2538     fprintf( stderr, " name=" );
2539     dump_varargs_unicode_str( cur_size );
2540 }
2541
2542 static void dump_get_window_property_reply( const struct get_window_property_reply *req )
2543 {
2544     fprintf( stderr, " handle=%p", req->handle );
2545 }
2546
2547 static void dump_get_window_properties_request( const struct get_window_properties_request *req )
2548 {
2549     fprintf( stderr, " window=%p", req->window );
2550 }
2551
2552 static void dump_get_window_properties_reply( const struct get_window_properties_reply *req )
2553 {
2554     fprintf( stderr, " total=%d,", req->total );
2555     fprintf( stderr, " props=" );
2556     dump_varargs_properties( cur_size );
2557 }
2558
2559 static void dump_create_winstation_request( const struct create_winstation_request *req )
2560 {
2561     fprintf( stderr, " flags=%08x,", req->flags );
2562     fprintf( stderr, " access=%08x,", req->access );
2563     fprintf( stderr, " attributes=%08x,", req->attributes );
2564     fprintf( stderr, " name=" );
2565     dump_varargs_unicode_str( cur_size );
2566 }
2567
2568 static void dump_create_winstation_reply( const struct create_winstation_reply *req )
2569 {
2570     fprintf( stderr, " handle=%p", req->handle );
2571 }
2572
2573 static void dump_open_winstation_request( const struct open_winstation_request *req )
2574 {
2575     fprintf( stderr, " access=%08x,", req->access );
2576     fprintf( stderr, " attributes=%08x,", req->attributes );
2577     fprintf( stderr, " name=" );
2578     dump_varargs_unicode_str( cur_size );
2579 }
2580
2581 static void dump_open_winstation_reply( const struct open_winstation_reply *req )
2582 {
2583     fprintf( stderr, " handle=%p", req->handle );
2584 }
2585
2586 static void dump_close_winstation_request( const struct close_winstation_request *req )
2587 {
2588     fprintf( stderr, " handle=%p", req->handle );
2589 }
2590
2591 static void dump_get_process_winstation_request( const struct get_process_winstation_request *req )
2592 {
2593 }
2594
2595 static void dump_get_process_winstation_reply( const struct get_process_winstation_reply *req )
2596 {
2597     fprintf( stderr, " handle=%p", req->handle );
2598 }
2599
2600 static void dump_set_process_winstation_request( const struct set_process_winstation_request *req )
2601 {
2602     fprintf( stderr, " handle=%p", req->handle );
2603 }
2604
2605 static void dump_create_desktop_request( const struct create_desktop_request *req )
2606 {
2607     fprintf( stderr, " flags=%08x,", req->flags );
2608     fprintf( stderr, " access=%08x,", req->access );
2609     fprintf( stderr, " attributes=%08x,", req->attributes );
2610     fprintf( stderr, " name=" );
2611     dump_varargs_unicode_str( cur_size );
2612 }
2613
2614 static void dump_create_desktop_reply( const struct create_desktop_reply *req )
2615 {
2616     fprintf( stderr, " handle=%p", req->handle );
2617 }
2618
2619 static void dump_open_desktop_request( const struct open_desktop_request *req )
2620 {
2621     fprintf( stderr, " flags=%08x,", req->flags );
2622     fprintf( stderr, " access=%08x,", req->access );
2623     fprintf( stderr, " attributes=%08x,", req->attributes );
2624     fprintf( stderr, " name=" );
2625     dump_varargs_unicode_str( cur_size );
2626 }
2627
2628 static void dump_open_desktop_reply( const struct open_desktop_reply *req )
2629 {
2630     fprintf( stderr, " handle=%p", req->handle );
2631 }
2632
2633 static void dump_close_desktop_request( const struct close_desktop_request *req )
2634 {
2635     fprintf( stderr, " handle=%p", req->handle );
2636 }
2637
2638 static void dump_get_thread_desktop_request( const struct get_thread_desktop_request *req )
2639 {
2640     fprintf( stderr, " tid=%04x", req->tid );
2641 }
2642
2643 static void dump_get_thread_desktop_reply( const struct get_thread_desktop_reply *req )
2644 {
2645     fprintf( stderr, " handle=%p", req->handle );
2646 }
2647
2648 static void dump_set_thread_desktop_request( const struct set_thread_desktop_request *req )
2649 {
2650     fprintf( stderr, " handle=%p", req->handle );
2651 }
2652
2653 static void dump_set_user_object_info_request( const struct set_user_object_info_request *req )
2654 {
2655     fprintf( stderr, " handle=%p,", req->handle );
2656     fprintf( stderr, " flags=%08x,", req->flags );
2657     fprintf( stderr, " obj_flags=%08x", req->obj_flags );
2658 }
2659
2660 static void dump_set_user_object_info_reply( const struct set_user_object_info_reply *req )
2661 {
2662     fprintf( stderr, " is_desktop=%d,", req->is_desktop );
2663     fprintf( stderr, " old_obj_flags=%08x,", req->old_obj_flags );
2664     fprintf( stderr, " name=" );
2665     dump_varargs_unicode_str( cur_size );
2666 }
2667
2668 static void dump_attach_thread_input_request( const struct attach_thread_input_request *req )
2669 {
2670     fprintf( stderr, " tid_from=%04x,", req->tid_from );
2671     fprintf( stderr, " tid_to=%04x,", req->tid_to );
2672     fprintf( stderr, " attach=%d", req->attach );
2673 }
2674
2675 static void dump_get_thread_input_request( const struct get_thread_input_request *req )
2676 {
2677     fprintf( stderr, " tid=%04x", req->tid );
2678 }
2679
2680 static void dump_get_thread_input_reply( const struct get_thread_input_reply *req )
2681 {
2682     fprintf( stderr, " focus=%p,", req->focus );
2683     fprintf( stderr, " capture=%p,", req->capture );
2684     fprintf( stderr, " active=%p,", req->active );
2685     fprintf( stderr, " foreground=%p,", req->foreground );
2686     fprintf( stderr, " menu_owner=%p,", req->menu_owner );
2687     fprintf( stderr, " move_size=%p,", req->move_size );
2688     fprintf( stderr, " caret=%p,", req->caret );
2689     fprintf( stderr, " rect=" );
2690     dump_rectangle( &req->rect );
2691 }
2692
2693 static void dump_get_last_input_time_request( const struct get_last_input_time_request *req )
2694 {
2695 }
2696
2697 static void dump_get_last_input_time_reply( const struct get_last_input_time_reply *req )
2698 {
2699     fprintf( stderr, " time=%08x", req->time );
2700 }
2701
2702 static void dump_get_key_state_request( const struct get_key_state_request *req )
2703 {
2704     fprintf( stderr, " tid=%04x,", req->tid );
2705     fprintf( stderr, " key=%d", req->key );
2706 }
2707
2708 static void dump_get_key_state_reply( const struct get_key_state_reply *req )
2709 {
2710     fprintf( stderr, " state=%02x,", req->state );
2711     fprintf( stderr, " keystate=" );
2712     dump_varargs_bytes( cur_size );
2713 }
2714
2715 static void dump_set_key_state_request( const struct set_key_state_request *req )
2716 {
2717     fprintf( stderr, " tid=%04x,", req->tid );
2718     fprintf( stderr, " keystate=" );
2719     dump_varargs_bytes( cur_size );
2720 }
2721
2722 static void dump_set_foreground_window_request( const struct set_foreground_window_request *req )
2723 {
2724     fprintf( stderr, " handle=%p", req->handle );
2725 }
2726
2727 static void dump_set_foreground_window_reply( const struct set_foreground_window_reply *req )
2728 {
2729     fprintf( stderr, " previous=%p,", req->previous );
2730     fprintf( stderr, " send_msg_old=%d,", req->send_msg_old );
2731     fprintf( stderr, " send_msg_new=%d", req->send_msg_new );
2732 }
2733
2734 static void dump_set_focus_window_request( const struct set_focus_window_request *req )
2735 {
2736     fprintf( stderr, " handle=%p", req->handle );
2737 }
2738
2739 static void dump_set_focus_window_reply( const struct set_focus_window_reply *req )
2740 {
2741     fprintf( stderr, " previous=%p", req->previous );
2742 }
2743
2744 static void dump_set_active_window_request( const struct set_active_window_request *req )
2745 {
2746     fprintf( stderr, " handle=%p", req->handle );
2747 }
2748
2749 static void dump_set_active_window_reply( const struct set_active_window_reply *req )
2750 {
2751     fprintf( stderr, " previous=%p", req->previous );
2752 }
2753
2754 static void dump_set_capture_window_request( const struct set_capture_window_request *req )
2755 {
2756     fprintf( stderr, " handle=%p,", req->handle );
2757     fprintf( stderr, " flags=%08x", req->flags );
2758 }
2759
2760 static void dump_set_capture_window_reply( const struct set_capture_window_reply *req )
2761 {
2762     fprintf( stderr, " previous=%p,", req->previous );
2763     fprintf( stderr, " full_handle=%p", req->full_handle );
2764 }
2765
2766 static void dump_set_caret_window_request( const struct set_caret_window_request *req )
2767 {
2768     fprintf( stderr, " handle=%p,", req->handle );
2769     fprintf( stderr, " width=%d,", req->width );
2770     fprintf( stderr, " height=%d", req->height );
2771 }
2772
2773 static void dump_set_caret_window_reply( const struct set_caret_window_reply *req )
2774 {
2775     fprintf( stderr, " previous=%p,", req->previous );
2776     fprintf( stderr, " old_rect=" );
2777     dump_rectangle( &req->old_rect );
2778     fprintf( stderr, "," );
2779     fprintf( stderr, " old_hide=%d,", req->old_hide );
2780     fprintf( stderr, " old_state=%d", req->old_state );
2781 }
2782
2783 static void dump_set_caret_info_request( const struct set_caret_info_request *req )
2784 {
2785     fprintf( stderr, " flags=%08x,", req->flags );
2786     fprintf( stderr, " handle=%p,", req->handle );
2787     fprintf( stderr, " x=%d,", req->x );
2788     fprintf( stderr, " y=%d,", req->y );
2789     fprintf( stderr, " hide=%d,", req->hide );
2790     fprintf( stderr, " state=%d", req->state );
2791 }
2792
2793 static void dump_set_caret_info_reply( const struct set_caret_info_reply *req )
2794 {
2795     fprintf( stderr, " full_handle=%p,", req->full_handle );
2796     fprintf( stderr, " old_rect=" );
2797     dump_rectangle( &req->old_rect );
2798     fprintf( stderr, "," );
2799     fprintf( stderr, " old_hide=%d,", req->old_hide );
2800     fprintf( stderr, " old_state=%d", req->old_state );
2801 }
2802
2803 static void dump_set_hook_request( const struct set_hook_request *req )
2804 {
2805     fprintf( stderr, " id=%d,", req->id );
2806     fprintf( stderr, " pid=%04x,", req->pid );
2807     fprintf( stderr, " tid=%04x,", req->tid );
2808     fprintf( stderr, " event_min=%d,", req->event_min );
2809     fprintf( stderr, " event_max=%d,", req->event_max );
2810     fprintf( stderr, " flags=%d,", req->flags );
2811     fprintf( stderr, " proc=%p,", req->proc );
2812     fprintf( stderr, " unicode=%d,", req->unicode );
2813     fprintf( stderr, " module=" );
2814     dump_varargs_unicode_str( cur_size );
2815 }
2816
2817 static void dump_set_hook_reply( const struct set_hook_reply *req )
2818 {
2819     fprintf( stderr, " handle=%p,", req->handle );
2820     fprintf( stderr, " active_hooks=%08x", req->active_hooks );
2821 }
2822
2823 static void dump_remove_hook_request( const struct remove_hook_request *req )
2824 {
2825     fprintf( stderr, " handle=%p,", req->handle );
2826     fprintf( stderr, " id=%d,", req->id );
2827     fprintf( stderr, " proc=%p", req->proc );
2828 }
2829
2830 static void dump_remove_hook_reply( const struct remove_hook_reply *req )
2831 {
2832     fprintf( stderr, " active_hooks=%08x", req->active_hooks );
2833 }
2834
2835 static void dump_start_hook_chain_request( const struct start_hook_chain_request *req )
2836 {
2837     fprintf( stderr, " id=%d,", req->id );
2838     fprintf( stderr, " event=%d,", req->event );
2839     fprintf( stderr, " window=%p,", req->window );
2840     fprintf( stderr, " object_id=%d,", req->object_id );
2841     fprintf( stderr, " child_id=%d", req->child_id );
2842 }
2843
2844 static void dump_start_hook_chain_reply( const struct start_hook_chain_reply *req )
2845 {
2846     fprintf( stderr, " handle=%p,", req->handle );
2847     fprintf( stderr, " pid=%04x,", req->pid );
2848     fprintf( stderr, " tid=%04x,", req->tid );
2849     fprintf( stderr, " proc=%p,", req->proc );
2850     fprintf( stderr, " unicode=%d,", req->unicode );
2851     fprintf( stderr, " active_hooks=%08x,", req->active_hooks );
2852     fprintf( stderr, " module=" );
2853     dump_varargs_unicode_str( cur_size );
2854 }
2855
2856 static void dump_finish_hook_chain_request( const struct finish_hook_chain_request *req )
2857 {
2858     fprintf( stderr, " id=%d", req->id );
2859 }
2860
2861 static void dump_get_next_hook_request( const struct get_next_hook_request *req )
2862 {
2863     fprintf( stderr, " handle=%p,", req->handle );
2864     fprintf( stderr, " event=%d,", req->event );
2865     fprintf( stderr, " window=%p,", req->window );
2866     fprintf( stderr, " object_id=%d,", req->object_id );
2867     fprintf( stderr, " child_id=%d", req->child_id );
2868 }
2869
2870 static void dump_get_next_hook_reply( const struct get_next_hook_reply *req )
2871 {
2872     fprintf( stderr, " next=%p,", req->next );
2873     fprintf( stderr, " id=%d,", req->id );
2874     fprintf( stderr, " pid=%04x,", req->pid );
2875     fprintf( stderr, " tid=%04x,", req->tid );
2876     fprintf( stderr, " proc=%p,", req->proc );
2877     fprintf( stderr, " prev_unicode=%d,", req->prev_unicode );
2878     fprintf( stderr, " next_unicode=%d,", req->next_unicode );
2879     fprintf( stderr, " module=" );
2880     dump_varargs_unicode_str( cur_size );
2881 }
2882
2883 static void dump_create_class_request( const struct create_class_request *req )
2884 {
2885     fprintf( stderr, " local=%d,", req->local );
2886     fprintf( stderr, " atom=%04x,", req->atom );
2887     fprintf( stderr, " style=%08x,", req->style );
2888     fprintf( stderr, " instance=%p,", req->instance );
2889     fprintf( stderr, " extra=%d,", req->extra );
2890     fprintf( stderr, " win_extra=%d,", req->win_extra );
2891     fprintf( stderr, " client_ptr=%p", req->client_ptr );
2892 }
2893
2894 static void dump_destroy_class_request( const struct destroy_class_request *req )
2895 {
2896     fprintf( stderr, " atom=%04x,", req->atom );
2897     fprintf( stderr, " instance=%p", req->instance );
2898 }
2899
2900 static void dump_destroy_class_reply( const struct destroy_class_reply *req )
2901 {
2902     fprintf( stderr, " client_ptr=%p", req->client_ptr );
2903 }
2904
2905 static void dump_set_class_info_request( const struct set_class_info_request *req )
2906 {
2907     fprintf( stderr, " window=%p,", req->window );
2908     fprintf( stderr, " flags=%08x,", req->flags );
2909     fprintf( stderr, " atom=%04x,", req->atom );
2910     fprintf( stderr, " style=%08x,", req->style );
2911     fprintf( stderr, " win_extra=%d,", req->win_extra );
2912     fprintf( stderr, " instance=%p,", req->instance );
2913     fprintf( stderr, " extra_offset=%d,", req->extra_offset );
2914     fprintf( stderr, " extra_size=%d,", req->extra_size );
2915     fprintf( stderr, " extra_value=%08x", req->extra_value );
2916 }
2917
2918 static void dump_set_class_info_reply( const struct set_class_info_reply *req )
2919 {
2920     fprintf( stderr, " old_atom=%04x,", req->old_atom );
2921     fprintf( stderr, " old_style=%08x,", req->old_style );
2922     fprintf( stderr, " old_extra=%d,", req->old_extra );
2923     fprintf( stderr, " old_win_extra=%d,", req->old_win_extra );
2924     fprintf( stderr, " old_instance=%p,", req->old_instance );
2925     fprintf( stderr, " old_extra_value=%08x", req->old_extra_value );
2926 }
2927
2928 static void dump_set_clipboard_info_request( const struct set_clipboard_info_request *req )
2929 {
2930     fprintf( stderr, " flags=%08x,", req->flags );
2931     fprintf( stderr, " clipboard=%p,", req->clipboard );
2932     fprintf( stderr, " owner=%p,", req->owner );
2933     fprintf( stderr, " viewer=%p,", req->viewer );
2934     fprintf( stderr, " seqno=%08x", req->seqno );
2935 }
2936
2937 static void dump_set_clipboard_info_reply( const struct set_clipboard_info_reply *req )
2938 {
2939     fprintf( stderr, " flags=%08x,", req->flags );
2940     fprintf( stderr, " old_clipboard=%p,", req->old_clipboard );
2941     fprintf( stderr, " old_owner=%p,", req->old_owner );
2942     fprintf( stderr, " old_viewer=%p,", req->old_viewer );
2943     fprintf( stderr, " seqno=%08x", req->seqno );
2944 }
2945
2946 static void dump_open_token_request( const struct open_token_request *req )
2947 {
2948     fprintf( stderr, " handle=%p,", req->handle );
2949     fprintf( stderr, " flags=%08x", req->flags );
2950 }
2951
2952 static void dump_open_token_reply( const struct open_token_reply *req )
2953 {
2954     fprintf( stderr, " token=%p", req->token );
2955 }
2956
2957 static void dump_set_global_windows_request( const struct set_global_windows_request *req )
2958 {
2959     fprintf( stderr, " flags=%08x,", req->flags );
2960     fprintf( stderr, " shell_window=%p,", req->shell_window );
2961     fprintf( stderr, " shell_listview=%p,", req->shell_listview );
2962     fprintf( stderr, " progman_window=%p,", req->progman_window );
2963     fprintf( stderr, " taskman_window=%p", req->taskman_window );
2964 }
2965
2966 static void dump_set_global_windows_reply( const struct set_global_windows_reply *req )
2967 {
2968     fprintf( stderr, " old_shell_window=%p,", req->old_shell_window );
2969     fprintf( stderr, " old_shell_listview=%p,", req->old_shell_listview );
2970     fprintf( stderr, " old_progman_window=%p,", req->old_progman_window );
2971     fprintf( stderr, " old_taskman_window=%p", req->old_taskman_window );
2972 }
2973
2974 static void dump_adjust_token_privileges_request( const struct adjust_token_privileges_request *req )
2975 {
2976     fprintf( stderr, " handle=%p,", req->handle );
2977     fprintf( stderr, " disable_all=%d,", req->disable_all );
2978     fprintf( stderr, " get_modified_state=%d,", req->get_modified_state );
2979     fprintf( stderr, " privileges=" );
2980     dump_varargs_LUID_AND_ATTRIBUTES( cur_size );
2981 }
2982
2983 static void dump_adjust_token_privileges_reply( const struct adjust_token_privileges_reply *req )
2984 {
2985     fprintf( stderr, " len=%08x,", req->len );
2986     fprintf( stderr, " privileges=" );
2987     dump_varargs_LUID_AND_ATTRIBUTES( cur_size );
2988 }
2989
2990 static void dump_get_token_privileges_request( const struct get_token_privileges_request *req )
2991 {
2992     fprintf( stderr, " handle=%p", req->handle );
2993 }
2994
2995 static void dump_get_token_privileges_reply( const struct get_token_privileges_reply *req )
2996 {
2997     fprintf( stderr, " len=%08x,", req->len );
2998     fprintf( stderr, " privileges=" );
2999     dump_varargs_LUID_AND_ATTRIBUTES( cur_size );
3000 }
3001
3002 static void dump_check_token_privileges_request( const struct check_token_privileges_request *req )
3003 {
3004     fprintf( stderr, " handle=%p,", req->handle );
3005     fprintf( stderr, " all_required=%d,", req->all_required );
3006     fprintf( stderr, " privileges=" );
3007     dump_varargs_LUID_AND_ATTRIBUTES( cur_size );
3008 }
3009
3010 static void dump_check_token_privileges_reply( const struct check_token_privileges_reply *req )
3011 {
3012     fprintf( stderr, " has_privileges=%d,", req->has_privileges );
3013     fprintf( stderr, " privileges=" );
3014     dump_varargs_LUID_AND_ATTRIBUTES( cur_size );
3015 }
3016
3017 static void dump_duplicate_token_request( const struct duplicate_token_request *req )
3018 {
3019     fprintf( stderr, " handle=%p,", req->handle );
3020     fprintf( stderr, " access=%08x,", req->access );
3021     fprintf( stderr, " inherit=%d,", req->inherit );
3022     fprintf( stderr, " primary=%d,", req->primary );
3023     fprintf( stderr, " impersonation_level=%d", req->impersonation_level );
3024 }
3025
3026 static void dump_duplicate_token_reply( const struct duplicate_token_reply *req )
3027 {
3028     fprintf( stderr, " new_handle=%p", req->new_handle );
3029 }
3030
3031 static void dump_access_check_request( const struct access_check_request *req )
3032 {
3033     fprintf( stderr, " handle=%p,", req->handle );
3034     fprintf( stderr, " desired_access=%08x,", req->desired_access );
3035     fprintf( stderr, " mapping_read=%08x,", req->mapping_read );
3036     fprintf( stderr, " mapping_write=%08x,", req->mapping_write );
3037     fprintf( stderr, " mapping_execute=%08x,", req->mapping_execute );
3038     fprintf( stderr, " mapping_all=%08x,", req->mapping_all );
3039     fprintf( stderr, " sd=" );
3040     dump_varargs_security_descriptor( cur_size );
3041 }
3042
3043 static void dump_access_check_reply( const struct access_check_reply *req )
3044 {
3045     fprintf( stderr, " access_granted=%08x,", req->access_granted );
3046     fprintf( stderr, " access_status=%08x,", req->access_status );
3047     fprintf( stderr, " privileges_len=%08x,", req->privileges_len );
3048     fprintf( stderr, " privileges=" );
3049     dump_varargs_LUID_AND_ATTRIBUTES( cur_size );
3050 }
3051
3052 static void dump_get_token_user_request( const struct get_token_user_request *req )
3053 {
3054     fprintf( stderr, " handle=%p", req->handle );
3055 }
3056
3057 static void dump_get_token_user_reply( const struct get_token_user_reply *req )
3058 {
3059     fprintf( stderr, " user_len=%d,", req->user_len );
3060     fprintf( stderr, " user=" );
3061     dump_varargs_SID( cur_size );
3062 }
3063
3064 static void dump_create_mailslot_request( const struct create_mailslot_request *req )
3065 {
3066     fprintf( stderr, " access=%08x,", req->access );
3067     fprintf( stderr, " attributes=%08x,", req->attributes );
3068     fprintf( stderr, " rootdir=%p,", req->rootdir );
3069     fprintf( stderr, " max_msgsize=%08x,", req->max_msgsize );
3070     fprintf( stderr, " read_timeout=%d,", req->read_timeout );
3071     fprintf( stderr, " name=" );
3072     dump_varargs_unicode_str( cur_size );
3073 }
3074
3075 static void dump_create_mailslot_reply( const struct create_mailslot_reply *req )
3076 {
3077     fprintf( stderr, " handle=%p", req->handle );
3078 }
3079
3080 static void dump_open_mailslot_request( const struct open_mailslot_request *req )
3081 {
3082     fprintf( stderr, " access=%08x,", req->access );
3083     fprintf( stderr, " attributes=%08x,", req->attributes );
3084     fprintf( stderr, " rootdir=%p,", req->rootdir );
3085     fprintf( stderr, " sharing=%08x,", req->sharing );
3086     fprintf( stderr, " name=" );
3087     dump_varargs_unicode_str( cur_size );
3088 }
3089
3090 static void dump_open_mailslot_reply( const struct open_mailslot_reply *req )
3091 {
3092     fprintf( stderr, " handle=%p", req->handle );
3093 }
3094
3095 static void dump_set_mailslot_info_request( const struct set_mailslot_info_request *req )
3096 {
3097     fprintf( stderr, " handle=%p,", req->handle );
3098     fprintf( stderr, " flags=%08x,", req->flags );
3099     fprintf( stderr, " read_timeout=%d", req->read_timeout );
3100 }
3101
3102 static void dump_set_mailslot_info_reply( const struct set_mailslot_info_reply *req )
3103 {
3104     fprintf( stderr, " max_msgsize=%08x,", req->max_msgsize );
3105     fprintf( stderr, " read_timeout=%d,", req->read_timeout );
3106     fprintf( stderr, " msg_count=%08x,", req->msg_count );
3107     fprintf( stderr, " next_msgsize=%08x", req->next_msgsize );
3108 }
3109
3110 static void dump_create_directory_request( const struct create_directory_request *req )
3111 {
3112     fprintf( stderr, " access=%08x,", req->access );
3113     fprintf( stderr, " attributes=%08x,", req->attributes );
3114     fprintf( stderr, " rootdir=%p,", req->rootdir );
3115     fprintf( stderr, " directory_name=" );
3116     dump_varargs_unicode_str( cur_size );
3117 }
3118
3119 static void dump_create_directory_reply( const struct create_directory_reply *req )
3120 {
3121     fprintf( stderr, " handle=%p", req->handle );
3122 }
3123
3124 static void dump_open_directory_request( const struct open_directory_request *req )
3125 {
3126     fprintf( stderr, " access=%08x,", req->access );
3127     fprintf( stderr, " attributes=%08x,", req->attributes );
3128     fprintf( stderr, " rootdir=%p,", req->rootdir );
3129     fprintf( stderr, " directory_name=" );
3130     dump_varargs_unicode_str( cur_size );
3131 }
3132
3133 static void dump_open_directory_reply( const struct open_directory_reply *req )
3134 {
3135     fprintf( stderr, " handle=%p", req->handle );
3136 }
3137
3138 static void dump_create_symlink_request( const struct create_symlink_request *req )
3139 {
3140     fprintf( stderr, " access=%08x,", req->access );
3141     fprintf( stderr, " attributes=%08x,", req->attributes );
3142     fprintf( stderr, " rootdir=%p,", req->rootdir );
3143     fprintf( stderr, " name_len=%d,", req->name_len );
3144     fprintf( stderr, " name=" );
3145     dump_varargs_unicode_str( min(cur_size,req->name_len) );
3146     fputc( ',', stderr );
3147     fprintf( stderr, " target_name=" );
3148     dump_varargs_unicode_str( cur_size );
3149 }
3150
3151 static void dump_create_symlink_reply( const struct create_symlink_reply *req )
3152 {
3153     fprintf( stderr, " handle=%p", req->handle );
3154 }
3155
3156 static void dump_open_symlink_request( const struct open_symlink_request *req )
3157 {
3158     fprintf( stderr, " access=%08x,", req->access );
3159     fprintf( stderr, " attributes=%08x,", req->attributes );
3160     fprintf( stderr, " rootdir=%p,", req->rootdir );
3161     fprintf( stderr, " name=" );
3162     dump_varargs_unicode_str( cur_size );
3163 }
3164
3165 static void dump_open_symlink_reply( const struct open_symlink_reply *req )
3166 {
3167     fprintf( stderr, " handle=%p", req->handle );
3168 }
3169
3170 static void dump_query_symlink_request( const struct query_symlink_request *req )
3171 {
3172     fprintf( stderr, " handle=%p", req->handle );
3173 }
3174
3175 static void dump_query_symlink_reply( const struct query_symlink_reply *req )
3176 {
3177     fprintf( stderr, " target_name=" );
3178     dump_varargs_unicode_str( cur_size );
3179 }
3180
3181 static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
3182     (dump_func)dump_new_process_request,
3183     (dump_func)dump_get_new_process_info_request,
3184     (dump_func)dump_new_thread_request,
3185     (dump_func)dump_get_startup_info_request,
3186     (dump_func)dump_init_process_done_request,
3187     (dump_func)dump_init_thread_request,
3188     (dump_func)dump_terminate_process_request,
3189     (dump_func)dump_terminate_thread_request,
3190     (dump_func)dump_get_process_info_request,
3191     (dump_func)dump_set_process_info_request,
3192     (dump_func)dump_get_thread_info_request,
3193     (dump_func)dump_set_thread_info_request,
3194     (dump_func)dump_get_dll_info_request,
3195     (dump_func)dump_suspend_thread_request,
3196     (dump_func)dump_resume_thread_request,
3197     (dump_func)dump_load_dll_request,
3198     (dump_func)dump_unload_dll_request,
3199     (dump_func)dump_queue_apc_request,
3200     (dump_func)dump_get_apc_request,
3201     (dump_func)dump_close_handle_request,
3202     (dump_func)dump_set_handle_info_request,
3203     (dump_func)dump_dup_handle_request,
3204     (dump_func)dump_open_process_request,
3205     (dump_func)dump_open_thread_request,
3206     (dump_func)dump_select_request,
3207     (dump_func)dump_create_event_request,
3208     (dump_func)dump_event_op_request,
3209     (dump_func)dump_open_event_request,
3210     (dump_func)dump_create_mutex_request,
3211     (dump_func)dump_release_mutex_request,
3212     (dump_func)dump_open_mutex_request,
3213     (dump_func)dump_create_semaphore_request,
3214     (dump_func)dump_release_semaphore_request,
3215     (dump_func)dump_open_semaphore_request,
3216     (dump_func)dump_create_file_request,
3217     (dump_func)dump_alloc_file_handle_request,
3218     (dump_func)dump_get_handle_fd_request,
3219     (dump_func)dump_set_handle_fd_request,
3220     (dump_func)dump_flush_file_request,
3221     (dump_func)dump_lock_file_request,
3222     (dump_func)dump_unlock_file_request,
3223     (dump_func)dump_unmount_device_request,
3224     (dump_func)dump_create_socket_request,
3225     (dump_func)dump_accept_socket_request,
3226     (dump_func)dump_set_socket_event_request,
3227     (dump_func)dump_get_socket_event_request,
3228     (dump_func)dump_enable_socket_event_request,
3229     (dump_func)dump_set_socket_deferred_request,
3230     (dump_func)dump_alloc_console_request,
3231     (dump_func)dump_free_console_request,
3232     (dump_func)dump_get_console_renderer_events_request,
3233     (dump_func)dump_open_console_request,
3234     (dump_func)dump_get_console_wait_event_request,
3235     (dump_func)dump_get_console_mode_request,
3236     (dump_func)dump_set_console_mode_request,
3237     (dump_func)dump_set_console_input_info_request,
3238     (dump_func)dump_get_console_input_info_request,
3239     (dump_func)dump_append_console_input_history_request,
3240     (dump_func)dump_get_console_input_history_request,
3241     (dump_func)dump_create_console_output_request,
3242     (dump_func)dump_set_console_output_info_request,
3243     (dump_func)dump_get_console_output_info_request,
3244     (dump_func)dump_write_console_input_request,
3245     (dump_func)dump_read_console_input_request,
3246     (dump_func)dump_write_console_output_request,
3247     (dump_func)dump_fill_console_output_request,
3248     (dump_func)dump_read_console_output_request,
3249     (dump_func)dump_move_console_output_request,
3250     (dump_func)dump_send_console_signal_request,
3251     (dump_func)dump_create_change_notification_request,
3252     (dump_func)dump_next_change_notification_request,
3253     (dump_func)dump_create_mapping_request,
3254     (dump_func)dump_open_mapping_request,
3255     (dump_func)dump_get_mapping_info_request,
3256     (dump_func)dump_create_snapshot_request,
3257     (dump_func)dump_next_process_request,
3258     (dump_func)dump_next_thread_request,
3259     (dump_func)dump_next_module_request,
3260     (dump_func)dump_wait_debug_event_request,
3261     (dump_func)dump_queue_exception_event_request,
3262     (dump_func)dump_get_exception_status_request,
3263     (dump_func)dump_output_debug_string_request,
3264     (dump_func)dump_continue_debug_event_request,
3265     (dump_func)dump_debug_process_request,
3266     (dump_func)dump_debug_break_request,
3267     (dump_func)dump_set_debugger_kill_on_exit_request,
3268     (dump_func)dump_read_process_memory_request,
3269     (dump_func)dump_write_process_memory_request,
3270     (dump_func)dump_create_key_request,
3271     (dump_func)dump_open_key_request,
3272     (dump_func)dump_delete_key_request,
3273     (dump_func)dump_flush_key_request,
3274     (dump_func)dump_enum_key_request,
3275     (dump_func)dump_set_key_value_request,
3276     (dump_func)dump_get_key_value_request,
3277     (dump_func)dump_enum_key_value_request,
3278     (dump_func)dump_delete_key_value_request,
3279     (dump_func)dump_load_registry_request,
3280     (dump_func)dump_unload_registry_request,
3281     (dump_func)dump_save_registry_request,
3282     (dump_func)dump_set_registry_notification_request,
3283     (dump_func)dump_create_timer_request,
3284     (dump_func)dump_open_timer_request,
3285     (dump_func)dump_set_timer_request,
3286     (dump_func)dump_cancel_timer_request,
3287     (dump_func)dump_get_timer_info_request,
3288     (dump_func)dump_get_thread_context_request,
3289     (dump_func)dump_set_thread_context_request,
3290     (dump_func)dump_get_selector_entry_request,
3291     (dump_func)dump_add_atom_request,
3292     (dump_func)dump_delete_atom_request,
3293     (dump_func)dump_find_atom_request,
3294     (dump_func)dump_get_atom_information_request,
3295     (dump_func)dump_set_atom_information_request,
3296     (dump_func)dump_empty_atom_table_request,
3297     (dump_func)dump_init_atom_table_request,
3298     (dump_func)dump_get_msg_queue_request,
3299     (dump_func)dump_set_queue_mask_request,
3300     (dump_func)dump_get_queue_status_request,
3301     (dump_func)dump_wait_input_idle_request,
3302     (dump_func)dump_send_message_request,
3303     (dump_func)dump_get_message_request,
3304     (dump_func)dump_reply_message_request,
3305     (dump_func)dump_accept_hardware_message_request,
3306     (dump_func)dump_get_message_reply_request,
3307     (dump_func)dump_set_win_timer_request,
3308     (dump_func)dump_kill_win_timer_request,
3309     (dump_func)dump_get_serial_info_request,
3310     (dump_func)dump_set_serial_info_request,
3311     (dump_func)dump_register_async_request,
3312     (dump_func)dump_cancel_async_request,
3313     (dump_func)dump_create_named_pipe_request,
3314     (dump_func)dump_open_named_pipe_request,
3315     (dump_func)dump_connect_named_pipe_request,
3316     (dump_func)dump_wait_named_pipe_request,
3317     (dump_func)dump_disconnect_named_pipe_request,
3318     (dump_func)dump_get_named_pipe_info_request,
3319     (dump_func)dump_create_window_request,
3320     (dump_func)dump_destroy_window_request,
3321     (dump_func)dump_get_desktop_window_request,
3322     (dump_func)dump_set_window_owner_request,
3323     (dump_func)dump_get_window_info_request,
3324     (dump_func)dump_set_window_info_request,
3325     (dump_func)dump_set_parent_request,
3326     (dump_func)dump_get_window_parents_request,
3327     (dump_func)dump_get_window_children_request,
3328     (dump_func)dump_get_window_children_from_point_request,
3329     (dump_func)dump_get_window_tree_request,
3330     (dump_func)dump_set_window_pos_request,
3331     (dump_func)dump_get_window_rectangles_request,
3332     (dump_func)dump_get_window_text_request,
3333     (dump_func)dump_set_window_text_request,
3334     (dump_func)dump_get_windows_offset_request,
3335     (dump_func)dump_get_visible_region_request,
3336     (dump_func)dump_get_window_region_request,
3337     (dump_func)dump_set_window_region_request,
3338     (dump_func)dump_get_update_region_request,
3339     (dump_func)dump_update_window_zorder_request,
3340     (dump_func)dump_redraw_window_request,
3341     (dump_func)dump_set_window_property_request,
3342     (dump_func)dump_remove_window_property_request,
3343     (dump_func)dump_get_window_property_request,
3344     (dump_func)dump_get_window_properties_request,
3345     (dump_func)dump_create_winstation_request,
3346     (dump_func)dump_open_winstation_request,
3347     (dump_func)dump_close_winstation_request,
3348     (dump_func)dump_get_process_winstation_request,
3349     (dump_func)dump_set_process_winstation_request,
3350     (dump_func)dump_create_desktop_request,
3351     (dump_func)dump_open_desktop_request,
3352     (dump_func)dump_close_desktop_request,
3353     (dump_func)dump_get_thread_desktop_request,
3354     (dump_func)dump_set_thread_desktop_request,
3355     (dump_func)dump_set_user_object_info_request,
3356     (dump_func)dump_attach_thread_input_request,
3357     (dump_func)dump_get_thread_input_request,
3358     (dump_func)dump_get_last_input_time_request,
3359     (dump_func)dump_get_key_state_request,
3360     (dump_func)dump_set_key_state_request,
3361     (dump_func)dump_set_foreground_window_request,
3362     (dump_func)dump_set_focus_window_request,
3363     (dump_func)dump_set_active_window_request,
3364     (dump_func)dump_set_capture_window_request,
3365     (dump_func)dump_set_caret_window_request,
3366     (dump_func)dump_set_caret_info_request,
3367     (dump_func)dump_set_hook_request,
3368     (dump_func)dump_remove_hook_request,
3369     (dump_func)dump_start_hook_chain_request,
3370     (dump_func)dump_finish_hook_chain_request,
3371     (dump_func)dump_get_next_hook_request,
3372     (dump_func)dump_create_class_request,
3373     (dump_func)dump_destroy_class_request,
3374     (dump_func)dump_set_class_info_request,
3375     (dump_func)dump_set_clipboard_info_request,
3376     (dump_func)dump_open_token_request,
3377     (dump_func)dump_set_global_windows_request,
3378     (dump_func)dump_adjust_token_privileges_request,
3379     (dump_func)dump_get_token_privileges_request,
3380     (dump_func)dump_check_token_privileges_request,
3381     (dump_func)dump_duplicate_token_request,
3382     (dump_func)dump_access_check_request,
3383     (dump_func)dump_get_token_user_request,
3384     (dump_func)dump_create_mailslot_request,
3385     (dump_func)dump_open_mailslot_request,
3386     (dump_func)dump_set_mailslot_info_request,
3387     (dump_func)dump_create_directory_request,
3388     (dump_func)dump_open_directory_request,
3389     (dump_func)dump_create_symlink_request,
3390     (dump_func)dump_open_symlink_request,
3391     (dump_func)dump_query_symlink_request,
3392 };
3393
3394 static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
3395     (dump_func)dump_new_process_reply,
3396     (dump_func)dump_get_new_process_info_reply,
3397     (dump_func)dump_new_thread_reply,
3398     (dump_func)dump_get_startup_info_reply,
3399     (dump_func)0,
3400     (dump_func)dump_init_thread_reply,
3401     (dump_func)dump_terminate_process_reply,
3402     (dump_func)dump_terminate_thread_reply,
3403     (dump_func)dump_get_process_info_reply,
3404     (dump_func)0,
3405     (dump_func)dump_get_thread_info_reply,
3406     (dump_func)0,
3407     (dump_func)dump_get_dll_info_reply,
3408     (dump_func)dump_suspend_thread_reply,
3409     (dump_func)dump_resume_thread_reply,
3410     (dump_func)0,
3411     (dump_func)0,
3412     (dump_func)0,
3413     (dump_func)dump_get_apc_reply,
3414     (dump_func)dump_close_handle_reply,
3415     (dump_func)dump_set_handle_info_reply,
3416     (dump_func)dump_dup_handle_reply,
3417     (dump_func)dump_open_process_reply,
3418     (dump_func)dump_open_thread_reply,
3419     (dump_func)0,
3420     (dump_func)dump_create_event_reply,
3421     (dump_func)0,
3422     (dump_func)dump_open_event_reply,
3423     (dump_func)dump_create_mutex_reply,
3424     (dump_func)dump_release_mutex_reply,
3425     (dump_func)dump_open_mutex_reply,
3426     (dump_func)dump_create_semaphore_reply,
3427     (dump_func)dump_release_semaphore_reply,
3428     (dump_func)dump_open_semaphore_reply,
3429     (dump_func)dump_create_file_reply,
3430     (dump_func)dump_alloc_file_handle_reply,
3431     (dump_func)dump_get_handle_fd_reply,
3432     (dump_func)dump_set_handle_fd_reply,
3433     (dump_func)dump_flush_file_reply,
3434     (dump_func)dump_lock_file_reply,
3435     (dump_func)0,
3436     (dump_func)0,
3437     (dump_func)dump_create_socket_reply,
3438     (dump_func)dump_accept_socket_reply,
3439     (dump_func)0,
3440     (dump_func)dump_get_socket_event_reply,
3441     (dump_func)0,
3442     (dump_func)0,
3443     (dump_func)dump_alloc_console_reply,
3444     (dump_func)0,
3445     (dump_func)dump_get_console_renderer_events_reply,
3446     (dump_func)dump_open_console_reply,
3447     (dump_func)dump_get_console_wait_event_reply,
3448     (dump_func)dump_get_console_mode_reply,
3449     (dump_func)0,
3450     (dump_func)0,
3451     (dump_func)dump_get_console_input_info_reply,
3452     (dump_func)0,
3453     (dump_func)dump_get_console_input_history_reply,
3454     (dump_func)dump_create_console_output_reply,
3455     (dump_func)0,
3456     (dump_func)dump_get_console_output_info_reply,
3457     (dump_func)dump_write_console_input_reply,
3458     (dump_func)dump_read_console_input_reply,
3459     (dump_func)dump_write_console_output_reply,
3460     (dump_func)dump_fill_console_output_reply,
3461     (dump_func)dump_read_console_output_reply,
3462     (dump_func)0,
3463     (dump_func)0,
3464     (dump_func)dump_create_change_notification_reply,
3465     (dump_func)0,
3466     (dump_func)dump_create_mapping_reply,
3467     (dump_func)dump_open_mapping_reply,
3468     (dump_func)dump_get_mapping_info_reply,
3469     (dump_func)dump_create_snapshot_reply,
3470     (dump_func)dump_next_process_reply,
3471     (dump_func)dump_next_thread_reply,
3472     (dump_func)dump_next_module_reply,
3473     (dump_func)dump_wait_debug_event_reply,
3474     (dump_func)dump_queue_exception_event_reply,
3475     (dump_func)dump_get_exception_status_reply,
3476     (dump_func)0,
3477     (dump_func)0,
3478     (dump_func)0,
3479     (dump_func)dump_debug_break_reply,
3480     (dump_func)0,
3481     (dump_func)dump_read_process_memory_reply,
3482     (dump_func)0,
3483     (dump_func)dump_create_key_reply,
3484     (dump_func)dump_open_key_reply,
3485     (dump_func)0,
3486     (dump_func)0,
3487     (dump_func)dump_enum_key_reply,
3488     (dump_func)0,
3489     (dump_func)dump_get_key_value_reply,
3490     (dump_func)dump_enum_key_value_reply,
3491     (dump_func)0,
3492     (dump_func)0,
3493     (dump_func)0,
3494     (dump_func)0,
3495     (dump_func)0,
3496     (dump_func)dump_create_timer_reply,
3497     (dump_func)dump_open_timer_reply,
3498     (dump_func)dump_set_timer_reply,
3499     (dump_func)dump_cancel_timer_reply,
3500     (dump_func)dump_get_timer_info_reply,
3501     (dump_func)dump_get_thread_context_reply,
3502     (dump_func)0,
3503     (dump_func)dump_get_selector_entry_reply,
3504     (dump_func)dump_add_atom_reply,
3505     (dump_func)0,
3506     (dump_func)dump_find_atom_reply,
3507     (dump_func)dump_get_atom_information_reply,
3508     (dump_func)0,
3509     (dump_func)0,
3510     (dump_func)dump_init_atom_table_reply,
3511     (dump_func)dump_get_msg_queue_reply,
3512     (dump_func)dump_set_queue_mask_reply,
3513     (dump_func)dump_get_queue_status_reply,
3514     (dump_func)dump_wait_input_idle_reply,
3515     (dump_func)0,
3516     (dump_func)dump_get_message_reply,
3517     (dump_func)0,
3518     (dump_func)0,
3519     (dump_func)dump_get_message_reply_reply,
3520     (dump_func)dump_set_win_timer_reply,
3521     (dump_func)0,
3522     (dump_func)dump_get_serial_info_reply,
3523     (dump_func)0,
3524     (dump_func)0,
3525     (dump_func)0,
3526     (dump_func)dump_create_named_pipe_reply,
3527     (dump_func)dump_open_named_pipe_reply,
3528     (dump_func)0,
3529     (dump_func)0,
3530     (dump_func)dump_disconnect_named_pipe_reply,
3531     (dump_func)dump_get_named_pipe_info_reply,
3532     (dump_func)dump_create_window_reply,
3533     (dump_func)0,
3534     (dump_func)dump_get_desktop_window_reply,
3535     (dump_func)dump_set_window_owner_reply,
3536     (dump_func)dump_get_window_info_reply,
3537     (dump_func)dump_set_window_info_reply,
3538     (dump_func)dump_set_parent_reply,
3539     (dump_func)dump_get_window_parents_reply,
3540     (dump_func)dump_get_window_children_reply,
3541     (dump_func)dump_get_window_children_from_point_reply,
3542     (dump_func)dump_get_window_tree_reply,
3543     (dump_func)dump_set_window_pos_reply,
3544     (dump_func)dump_get_window_rectangles_reply,
3545     (dump_func)dump_get_window_text_reply,
3546     (dump_func)0,
3547     (dump_func)dump_get_windows_offset_reply,
3548     (dump_func)dump_get_visible_region_reply,
3549     (dump_func)dump_get_window_region_reply,
3550     (dump_func)0,
3551     (dump_func)dump_get_update_region_reply,
3552     (dump_func)0,
3553     (dump_func)0,
3554     (dump_func)0,
3555     (dump_func)dump_remove_window_property_reply,
3556     (dump_func)dump_get_window_property_reply,
3557     (dump_func)dump_get_window_properties_reply,
3558     (dump_func)dump_create_winstation_reply,
3559     (dump_func)dump_open_winstation_reply,
3560     (dump_func)0,
3561     (dump_func)dump_get_process_winstation_reply,
3562     (dump_func)0,
3563     (dump_func)dump_create_desktop_reply,
3564     (dump_func)dump_open_desktop_reply,
3565     (dump_func)0,
3566     (dump_func)dump_get_thread_desktop_reply,
3567     (dump_func)0,
3568     (dump_func)dump_set_user_object_info_reply,
3569     (dump_func)0,
3570     (dump_func)dump_get_thread_input_reply,
3571     (dump_func)dump_get_last_input_time_reply,
3572     (dump_func)dump_get_key_state_reply,
3573     (dump_func)0,
3574     (dump_func)dump_set_foreground_window_reply,
3575     (dump_func)dump_set_focus_window_reply,
3576     (dump_func)dump_set_active_window_reply,
3577     (dump_func)dump_set_capture_window_reply,
3578     (dump_func)dump_set_caret_window_reply,
3579     (dump_func)dump_set_caret_info_reply,
3580     (dump_func)dump_set_hook_reply,
3581     (dump_func)dump_remove_hook_reply,
3582     (dump_func)dump_start_hook_chain_reply,
3583     (dump_func)0,
3584     (dump_func)dump_get_next_hook_reply,
3585     (dump_func)0,
3586     (dump_func)dump_destroy_class_reply,
3587     (dump_func)dump_set_class_info_reply,
3588     (dump_func)dump_set_clipboard_info_reply,
3589     (dump_func)dump_open_token_reply,
3590     (dump_func)dump_set_global_windows_reply,
3591     (dump_func)dump_adjust_token_privileges_reply,
3592     (dump_func)dump_get_token_privileges_reply,
3593     (dump_func)dump_check_token_privileges_reply,
3594     (dump_func)dump_duplicate_token_reply,
3595     (dump_func)dump_access_check_reply,
3596     (dump_func)dump_get_token_user_reply,
3597     (dump_func)dump_create_mailslot_reply,
3598     (dump_func)dump_open_mailslot_reply,
3599     (dump_func)dump_set_mailslot_info_reply,
3600     (dump_func)dump_create_directory_reply,
3601     (dump_func)dump_open_directory_reply,
3602     (dump_func)dump_create_symlink_reply,
3603     (dump_func)dump_open_symlink_reply,
3604     (dump_func)dump_query_symlink_reply,
3605 };
3606
3607 static const char * const req_names[REQ_NB_REQUESTS] = {
3608     "new_process",
3609     "get_new_process_info",
3610     "new_thread",
3611     "get_startup_info",
3612     "init_process_done",
3613     "init_thread",
3614     "terminate_process",
3615     "terminate_thread",
3616     "get_process_info",
3617     "set_process_info",
3618     "get_thread_info",
3619     "set_thread_info",
3620     "get_dll_info",
3621     "suspend_thread",
3622     "resume_thread",
3623     "load_dll",
3624     "unload_dll",
3625     "queue_apc",
3626     "get_apc",
3627     "close_handle",
3628     "set_handle_info",
3629     "dup_handle",
3630     "open_process",
3631     "open_thread",
3632     "select",
3633     "create_event",
3634     "event_op",
3635     "open_event",
3636     "create_mutex",
3637     "release_mutex",
3638     "open_mutex",
3639     "create_semaphore",
3640     "release_semaphore",
3641     "open_semaphore",
3642     "create_file",
3643     "alloc_file_handle",
3644     "get_handle_fd",
3645     "set_handle_fd",
3646     "flush_file",
3647     "lock_file",
3648     "unlock_file",
3649     "unmount_device",
3650     "create_socket",
3651     "accept_socket",
3652     "set_socket_event",
3653     "get_socket_event",
3654     "enable_socket_event",
3655     "set_socket_deferred",
3656     "alloc_console",
3657     "free_console",
3658     "get_console_renderer_events",
3659     "open_console",
3660     "get_console_wait_event",
3661     "get_console_mode",
3662     "set_console_mode",
3663     "set_console_input_info",
3664     "get_console_input_info",
3665     "append_console_input_history",
3666     "get_console_input_history",
3667     "create_console_output",
3668     "set_console_output_info",
3669     "get_console_output_info",
3670     "write_console_input",
3671     "read_console_input",
3672     "write_console_output",
3673     "fill_console_output",
3674     "read_console_output",
3675     "move_console_output",
3676     "send_console_signal",
3677     "create_change_notification",
3678     "next_change_notification",
3679     "create_mapping",
3680     "open_mapping",
3681     "get_mapping_info",
3682     "create_snapshot",
3683     "next_process",
3684     "next_thread",
3685     "next_module",
3686     "wait_debug_event",
3687     "queue_exception_event",
3688     "get_exception_status",
3689     "output_debug_string",
3690     "continue_debug_event",
3691     "debug_process",
3692     "debug_break",
3693     "set_debugger_kill_on_exit",
3694     "read_process_memory",
3695     "write_process_memory",
3696     "create_key",
3697     "open_key",
3698     "delete_key",
3699     "flush_key",
3700     "enum_key",
3701     "set_key_value",
3702     "get_key_value",
3703     "enum_key_value",
3704     "delete_key_value",
3705     "load_registry",
3706     "unload_registry",
3707     "save_registry",
3708     "set_registry_notification",
3709     "create_timer",
3710     "open_timer",
3711     "set_timer",
3712     "cancel_timer",
3713     "get_timer_info",
3714     "get_thread_context",
3715     "set_thread_context",
3716     "get_selector_entry",
3717     "add_atom",
3718     "delete_atom",
3719     "find_atom",
3720     "get_atom_information",
3721     "set_atom_information",
3722     "empty_atom_table",
3723     "init_atom_table",
3724     "get_msg_queue",
3725     "set_queue_mask",
3726     "get_queue_status",
3727     "wait_input_idle",
3728     "send_message",
3729     "get_message",
3730     "reply_message",
3731     "accept_hardware_message",
3732     "get_message_reply",
3733     "set_win_timer",
3734     "kill_win_timer",
3735     "get_serial_info",
3736     "set_serial_info",
3737     "register_async",
3738     "cancel_async",
3739     "create_named_pipe",
3740     "open_named_pipe",
3741     "connect_named_pipe",
3742     "wait_named_pipe",
3743     "disconnect_named_pipe",
3744     "get_named_pipe_info",
3745     "create_window",
3746     "destroy_window",
3747     "get_desktop_window",
3748     "set_window_owner",
3749     "get_window_info",
3750     "set_window_info",
3751     "set_parent",
3752     "get_window_parents",
3753     "get_window_children",
3754     "get_window_children_from_point",
3755     "get_window_tree",
3756     "set_window_pos",
3757     "get_window_rectangles",
3758     "get_window_text",
3759     "set_window_text",
3760     "get_windows_offset",
3761     "get_visible_region",
3762     "get_window_region",
3763     "set_window_region",
3764     "get_update_region",
3765     "update_window_zorder",
3766     "redraw_window",
3767     "set_window_property",
3768     "remove_window_property",
3769     "get_window_property",
3770     "get_window_properties",
3771     "create_winstation",
3772     "open_winstation",
3773     "close_winstation",
3774     "get_process_winstation",
3775     "set_process_winstation",
3776     "create_desktop",
3777     "open_desktop",
3778     "close_desktop",
3779     "get_thread_desktop",
3780     "set_thread_desktop",
3781     "set_user_object_info",
3782     "attach_thread_input",
3783     "get_thread_input",
3784     "get_last_input_time",
3785     "get_key_state",
3786     "set_key_state",
3787     "set_foreground_window",
3788     "set_focus_window",
3789     "set_active_window",
3790     "set_capture_window",
3791     "set_caret_window",
3792     "set_caret_info",
3793     "set_hook",
3794     "remove_hook",
3795     "start_hook_chain",
3796     "finish_hook_chain",
3797     "get_next_hook",
3798     "create_class",
3799     "destroy_class",
3800     "set_class_info",
3801     "set_clipboard_info",
3802     "open_token",
3803     "set_global_windows",
3804     "adjust_token_privileges",
3805     "get_token_privileges",
3806     "check_token_privileges",
3807     "duplicate_token",
3808     "access_check",
3809     "get_token_user",
3810     "create_mailslot",
3811     "open_mailslot",
3812     "set_mailslot_info",
3813     "create_directory",
3814     "open_directory",
3815     "create_symlink",
3816     "open_symlink",
3817     "query_symlink",
3818 };
3819
3820 static const struct
3821 {
3822     const char  *name;
3823     unsigned int value;
3824 } status_names[] =
3825 {
3826     { "ACCESS_DENIED",               STATUS_ACCESS_DENIED },
3827     { "ACCESS_VIOLATION",            STATUS_ACCESS_VIOLATION },
3828     { "ALIAS_EXISTS",                STATUS_ALIAS_EXISTS },
3829     { "BUFFER_OVERFLOW",             STATUS_BUFFER_OVERFLOW },
3830     { "BUFFER_TOO_SMALL",            STATUS_BUFFER_TOO_SMALL },
3831     { "CHILD_MUST_BE_VOLATILE",      STATUS_CHILD_MUST_BE_VOLATILE },
3832     { "DEVICE_BUSY",                 STATUS_DEVICE_BUSY },
3833     { "DIRECTORY_NOT_EMPTY",         STATUS_DIRECTORY_NOT_EMPTY },
3834     { "DISK_FULL",                   STATUS_DISK_FULL },
3835     { "DLL_NOT_FOUND",               STATUS_DLL_NOT_FOUND },
3836     { "ERROR_CLASS_ALREADY_EXISTS",  0xc0010000 | ERROR_CLASS_ALREADY_EXISTS },
3837     { "ERROR_CLASS_DOES_NOT_EXIST",  0xc0010000 | ERROR_CLASS_DOES_NOT_EXIST },
3838     { "ERROR_CLASS_HAS_WINDOWS",     0xc0010000 | ERROR_CLASS_HAS_WINDOWS },
3839     { "ERROR_CLIPBOARD_NOT_OPEN",    0xc0010000 | ERROR_CLIPBOARD_NOT_OPEN },
3840     { "ERROR_INVALID_INDEX",         0xc0010000 | ERROR_INVALID_INDEX },
3841     { "ERROR_SEEK",                  0xc0010000 | ERROR_SEEK },
3842     { "FILE_INVALID",                STATUS_FILE_INVALID },
3843     { "FILE_IS_A_DIRECTORY",         STATUS_FILE_IS_A_DIRECTORY },
3844     { "FILE_LOCK_CONFLICT",          STATUS_FILE_LOCK_CONFLICT },
3845     { "HANDLE_NOT_CLOSABLE",         STATUS_HANDLE_NOT_CLOSABLE },
3846     { "INSTANCE_NOT_AVAILABLE",      STATUS_INSTANCE_NOT_AVAILABLE },
3847     { "INVALID_CID",                 STATUS_INVALID_CID },
3848     { "INVALID_FILE_FOR_SECTION",    STATUS_INVALID_FILE_FOR_SECTION },
3849     { "INVALID_HANDLE",              STATUS_INVALID_HANDLE },
3850     { "INVALID_PARAMETER",           STATUS_INVALID_PARAMETER },
3851     { "IO_TIMEOUT",                  STATUS_IO_TIMEOUT },
3852     { "KEY_DELETED",                 STATUS_KEY_DELETED },
3853     { "MEDIA_WRITE_PROTECTED",       STATUS_MEDIA_WRITE_PROTECTED },
3854     { "MUTANT_NOT_OWNED",            STATUS_MUTANT_NOT_OWNED },
3855     { "NAME_TOO_LONG",               STATUS_NAME_TOO_LONG },
3856     { "NOT_ALL_ASSIGNED",            STATUS_NOT_ALL_ASSIGNED },
3857     { "NOT_A_DIRECTORY",             STATUS_NOT_A_DIRECTORY },
3858     { "NOT_IMPLEMENTED",             STATUS_NOT_IMPLEMENTED },
3859     { "NOT_REGISTRY_FILE",           STATUS_NOT_REGISTRY_FILE },
3860     { "NO_DATA_DETECTED",            STATUS_NO_DATA_DETECTED },
3861     { "NO_IMPERSONATION_TOKEN",      STATUS_NO_IMPERSONATION_TOKEN },
3862     { "NO_MEMORY",                   STATUS_NO_MEMORY },
3863     { "NO_MORE_ENTRIES",             STATUS_NO_MORE_ENTRIES },
3864     { "NO_MORE_FILES",               STATUS_NO_MORE_FILES },
3865     { "NO_SUCH_DEVICE",              STATUS_NO_SUCH_DEVICE },
3866     { "NO_SUCH_FILE",                STATUS_NO_SUCH_FILE },
3867     { "NO_TOKEN",                    STATUS_NO_TOKEN },
3868     { "OBJECT_NAME_COLLISION",       STATUS_OBJECT_NAME_COLLISION },
3869     { "OBJECT_NAME_EXISTS",          STATUS_OBJECT_NAME_EXISTS },
3870     { "OBJECT_NAME_INVALID",         STATUS_OBJECT_NAME_INVALID },
3871     { "OBJECT_NAME_NOT_FOUND",       STATUS_OBJECT_NAME_NOT_FOUND },
3872     { "OBJECT_PATH_INVALID",         STATUS_OBJECT_PATH_INVALID },
3873     { "OBJECT_PATH_NOT_FOUND",       STATUS_OBJECT_PATH_NOT_FOUND },
3874     { "OBJECT_PATH_SYNTAX_BAD",      STATUS_OBJECT_PATH_SYNTAX_BAD },
3875     { "OBJECT_TYPE_MISMATCH",        STATUS_OBJECT_TYPE_MISMATCH },
3876     { "PENDING",                     STATUS_PENDING },
3877     { "PIPE_BUSY",                   STATUS_PIPE_BUSY },
3878     { "PIPE_CONNECTED",              STATUS_PIPE_CONNECTED },
3879     { "PIPE_DISCONNECTED",           STATUS_PIPE_DISCONNECTED },
3880     { "PIPE_LISTENING",              STATUS_PIPE_LISTENING },
3881     { "PIPE_NOT_AVAILABLE",          STATUS_PIPE_NOT_AVAILABLE },
3882     { "PRIVILEGE_NOT_HELD",          STATUS_PRIVILEGE_NOT_HELD },
3883     { "SECTION_TOO_BIG",             STATUS_SECTION_TOO_BIG },
3884     { "SEMAPHORE_LIMIT_EXCEEDED",    STATUS_SEMAPHORE_LIMIT_EXCEEDED },
3885     { "SHARING_VIOLATION",           STATUS_SHARING_VIOLATION },
3886     { "SUSPEND_COUNT_EXCEEDED",      STATUS_SUSPEND_COUNT_EXCEEDED },
3887     { "TIMEOUT",                     STATUS_TIMEOUT },
3888     { "UNSUCCESSFUL",                STATUS_UNSUCCESSFUL },
3889     { "VOLUME_DISMOUNTED",           STATUS_VOLUME_DISMOUNTED },
3890     { "WAS_LOCKED",                  STATUS_WAS_LOCKED },
3891     { NULL, 0 }
3892 };
3893
3894 /* ### make_requests end ### */
3895 /* Everything above this line is generated automatically by tools/make_requests */
3896
3897 static const char *get_status_name( unsigned int status )
3898 {
3899     int i;
3900     static char buffer[10];
3901
3902     if (status)
3903     {
3904         for (i = 0; status_names[i].name; i++)
3905             if (status_names[i].value == status) return status_names[i].name;
3906     }
3907     sprintf( buffer, "%x", status );
3908     return buffer;
3909 }
3910
3911 void trace_request(void)
3912 {
3913     enum request req = current->req.request_header.req;
3914     if (req < REQ_NB_REQUESTS)
3915     {
3916         fprintf( stderr, "%04x: %s(", current->id, req_names[req] );
3917         if (req_dumpers[req])
3918         {
3919             cur_pos = 0;
3920             cur_data = get_req_data();
3921             cur_size = get_req_data_size();
3922             req_dumpers[req]( &current->req );
3923         }
3924         fprintf( stderr, " )\n" );
3925     }
3926     else fprintf( stderr, "%04x: %d(?)\n", current->id, req );
3927 }
3928
3929 void trace_reply( enum request req, const union generic_reply *reply )
3930 {
3931     if (req < REQ_NB_REQUESTS)
3932     {
3933         fprintf( stderr, "%04x: %s() = %s",
3934                  current->id, req_names[req], get_status_name(current->error) );
3935         if (reply_dumpers[req])
3936         {
3937             fprintf( stderr, " {" );
3938             cur_pos = 0;
3939             cur_data = current->reply_data;
3940             cur_size = reply->reply_header.reply_size;
3941             reply_dumpers[req]( reply );
3942             fprintf( stderr, " }" );
3943         }
3944         fputc( '\n', stderr );
3945     }
3946     else fprintf( stderr, "%04x: %d() = %s\n",
3947                   current->id, req, get_status_name(current->error) );
3948 }