trace.c 168 KB
Newer Older
1 2 3 4
/*
 * Server request tracing
 *
 * Copyright (C) 1999 Alexandre Julliard
5 6 7 8 9 10 11 12 13 14 15 16 17
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19
 */
Alexandre Julliard's avatar
Alexandre Julliard committed
20

21
#include "config.h"
22
#include "wine/port.h"
23

24
#include <ctype.h>
25
#include <stdarg.h>
Alexandre Julliard's avatar
Alexandre Julliard committed
26
#include <stdio.h>
Alexandre Julliard's avatar
Alexandre Julliard committed
27
#include <sys/types.h>
Steven Edwards's avatar
Steven Edwards committed
28 29

#ifdef HAVE_SYS_UIO_H
Alexandre Julliard's avatar
Alexandre Julliard committed
30
#include <sys/uio.h>
Steven Edwards's avatar
Steven Edwards committed
31 32
#endif

33 34
#include "ntstatus.h"
#define WIN32_NO_STATUS
35
#include "windef.h"
36 37
#include "winbase.h"
#include "wincon.h"
38
#include "winternl.h"
39
#include "winioctl.h"
40
#include "file.h"
41
#include "request.h"
42
#include "unicode.h"
Alexandre Julliard's avatar
Alexandre Julliard committed
43

44
static const void *cur_data;
45
static data_size_t cur_size;
46

47 48
static const char *get_status_name( unsigned int status );

49 50
/* utility functions */

51
static inline void remove_data( data_size_t size )
52
{
53 54
    cur_data = (const char *)cur_data + size;
    cur_size -= size;
55 56
}

57 58 59
static void dump_uints( const int *ptr, int len )
{
    fputc( '{', stderr );
60
    while (len > 0)
61 62 63 64 65 66 67
    {
        fprintf( stderr, "%08x", *ptr++ );
        if (--len) fputc( ',', stderr );
    }
    fputc( '}', stderr );
}

68
static void dump_timeout( const char *prefix, const timeout_t *time )
69
{
70
    fprintf( stderr, "%s%s", prefix, get_timeout_str(*time) );
71 72
}

73
static void dump_uint64( const char *prefix, const unsigned __int64 *val )
74
{
75
    if ((unsigned int)*val != *val)
76
        fprintf( stderr, "%s%x%08x", prefix, (unsigned int)(*val >> 32), (unsigned int)*val );
77
    else
78
        fprintf( stderr, "%s%08x", prefix, (unsigned int)*val );
79 80
}

81
static void dump_rectangle( const char *prefix, const rectangle_t *rect )
82
{
83
    fprintf( stderr, "%s{%d,%d;%d,%d}", prefix,
84 85 86
             rect->left, rect->top, rect->right, rect->bottom );
}

87
static void dump_char_info( const char *prefix, const char_info_t *info )
88
{
89
    fprintf( stderr, "%s{'", prefix );
90 91 92 93
    dump_strW( &info->ch, 1, stderr, "\'\'" );
    fprintf( stderr, "',%04x}", info->attr );
}

94
static void dump_ioctl_code( const char *prefix, const ioctl_code_t *code )
95 96 97
{
    switch(*code)
    {
98
#define CASE(c) case c: fprintf( stderr, "%s%s", prefix, #c ); break
99 100
        CASE(FSCTL_DISMOUNT_VOLUME);
        CASE(FSCTL_PIPE_DISCONNECT);
101
        CASE(FSCTL_PIPE_LISTEN);
102
        CASE(FSCTL_PIPE_WAIT);
103
        default: fprintf( stderr, "%s%08x", prefix, *code ); break;
104 105 106 107
#undef CASE
    }
}

108
static void dump_cpu_type( const char *prefix, const cpu_type_t *code )
109 110 111
{
    switch (*code)
    {
112
#define CASE(c) case CPU_##c: fprintf( stderr, "%s%s", prefix, #c ); break
113 114 115 116 117
        CASE(x86);
        CASE(x86_64);
        CASE(ALPHA);
        CASE(POWERPC);
        CASE(SPARC);
118
        default: fprintf( stderr, "%s%u", prefix, *code ); break;
119 120 121 122
#undef CASE
    }
}

123
static void dump_apc_call( const char *prefix, const apc_call_t *call )
124
{
125
    fprintf( stderr, "%s{", prefix );
126 127 128 129 130 131
    switch(call->type)
    {
    case APC_NONE:
        fprintf( stderr, "APC_NONE" );
        break;
    case APC_USER:
132 133 134 135
        dump_uint64( "APC_USER,func=", &call->user.func );
        dump_uint64( ",args={", &call->user.args[0] );
        dump_uint64( ",", &call->user.args[1] );
        dump_uint64( ",", &call->user.args[2] );
136
        fputc( '}', stderr );
137 138
        break;
    case APC_TIMER:
139 140
        dump_timeout( "APC_TIMER,time=", &call->timer.time );
        dump_uint64( ",arg=", &call->timer.arg );
141 142
        break;
    case APC_ASYNC_IO:
143 144 145
        dump_uint64( "APC_ASYNC_IO,func=", &call->async_io.func );
        dump_uint64( ",user=", &call->async_io.user );
        dump_uint64( ",sb=", &call->async_io.sb );
146
        fprintf( stderr, ",status=%s", get_status_name(call->async_io.status) );
147
        break;
148
    case APC_VIRTUAL_ALLOC:
149 150
        dump_uint64( "APC_VIRTUAL_ALLOC,addr==", &call->virtual_alloc.addr );
        dump_uint64( ",size=", &call->virtual_alloc.size );
151
        fprintf( stderr, ",zero_bits=%u,op_type=%x,prot=%x",
152 153 154 155
                 call->virtual_alloc.zero_bits, call->virtual_alloc.op_type,
                 call->virtual_alloc.prot );
        break;
    case APC_VIRTUAL_FREE:
156 157
        dump_uint64( "APC_VIRTUAL_FREE,addr=", &call->virtual_free.addr );
        dump_uint64( ",size=", &call->virtual_free.size );
158
        fprintf( stderr, ",op_type=%x", call->virtual_free.op_type );
159
        break;
160
    case APC_VIRTUAL_QUERY:
161
        dump_uint64( "APC_VIRTUAL_QUERY,addr=", &call->virtual_query.addr );
162
        break;
163
    case APC_VIRTUAL_PROTECT:
164 165
        dump_uint64( "APC_VIRTUAL_PROTECT,addr=", &call->virtual_protect.addr );
        dump_uint64( ",size=", &call->virtual_protect.size );
166
        fprintf( stderr, ",prot=%x", call->virtual_protect.prot );
167
        break;
168
    case APC_VIRTUAL_FLUSH:
169 170
        dump_uint64( "APC_VIRTUAL_FLUSH,addr=", &call->virtual_flush.addr );
        dump_uint64( ",size=", &call->virtual_flush.size );
171
        break;
172
    case APC_VIRTUAL_LOCK:
173 174
        dump_uint64( "APC_VIRTUAL_LOCK,addr=", &call->virtual_lock.addr );
        dump_uint64( ",size=", &call->virtual_lock.size );
175 176
        break;
    case APC_VIRTUAL_UNLOCK:
177 178
        dump_uint64( "APC_VIRTUAL_UNLOCK,addr=", &call->virtual_unlock.addr );
        dump_uint64( ",size=", &call->virtual_unlock.size );
179
        break;
180
    case APC_MAP_VIEW:
181 182 183 184
        fprintf( stderr, "APC_MAP_VIEW,handle=%04x", call->map_view.handle );
        dump_uint64( ",addr=", &call->map_view.addr );
        dump_uint64( ",size=", &call->map_view.size );
        dump_uint64( ",offset=", &call->map_view.offset );
185
        fprintf( stderr, ",zero_bits=%u,alloc_type=%x,prot=%x",
186
                 call->map_view.zero_bits, call->map_view.alloc_type, call->map_view.prot );
187 188
        break;
    case APC_UNMAP_VIEW:
189
        dump_uint64( "APC_UNMAP_VIEW,addr=", &call->unmap_view.addr );
190
        break;
191
    case APC_CREATE_THREAD:
192 193 194 195
        dump_uint64( "APC_CREATE_THREAD,func=", &call->create_thread.func );
        dump_uint64( ",arg=", &call->create_thread.arg );
        dump_uint64( ",reserve=", &call->create_thread.reserve );
        dump_uint64( ",commit=", &call->create_thread.commit );
196
        fprintf( stderr, ",suspend=%u", call->create_thread.suspend );
197
        break;
198 199 200 201 202 203 204
    default:
        fprintf( stderr, "type=%u", call->type );
        break;
    }
    fputc( '}', stderr );
}

205
static void dump_apc_result( const char *prefix, const apc_result_t *result )
206
{
207
    fprintf( stderr, "%s{", prefix );
208 209 210 211
    switch(result->type)
    {
    case APC_NONE:
        break;
212
    case APC_ASYNC_IO:
213
        fprintf( stderr, "APC_ASYNC_IO,status=%s,total=%u",
214
                 get_status_name( result->async_io.status ), result->async_io.total );
215
        dump_uint64( ",apc=", &result->async_io.apc );
216
        break;
217
    case APC_VIRTUAL_ALLOC:
218
        fprintf( stderr, "APC_VIRTUAL_ALLOC,status=%s",
219
                 get_status_name( result->virtual_alloc.status ));
220 221
        dump_uint64( ",addr=", &result->virtual_alloc.addr );
        dump_uint64( ",size=", &result->virtual_alloc.size );
222 223
        break;
    case APC_VIRTUAL_FREE:
224
        fprintf( stderr, "APC_VIRTUAL_FREE,status=%s",
225
                 get_status_name( result->virtual_free.status ));
226 227
        dump_uint64( ",addr=", &result->virtual_free.addr );
        dump_uint64( ",size=", &result->virtual_free.size );
228
        break;
229
    case APC_VIRTUAL_QUERY:
230
        fprintf( stderr, "APC_VIRTUAL_QUERY,status=%s",
231
                 get_status_name( result->virtual_query.status ));
232 233 234
        dump_uint64( ",base=", &result->virtual_query.base );
        dump_uint64( ",alloc_base=", &result->virtual_query.alloc_base );
        dump_uint64( ",size=", &result->virtual_query.size );
235 236 237
        fprintf( stderr, ",state=%x,prot=%x,alloc_prot=%x,alloc_type=%x",
                 result->virtual_query.state, result->virtual_query.prot,
                 result->virtual_query.alloc_prot, result->virtual_query.alloc_type );
238
        break;
239
    case APC_VIRTUAL_PROTECT:
240
        fprintf( stderr, "APC_VIRTUAL_PROTECT,status=%s",
241
                 get_status_name( result->virtual_protect.status ));
242 243
        dump_uint64( ",addr=", &result->virtual_protect.addr );
        dump_uint64( ",size=", &result->virtual_protect.size );
244
        fprintf( stderr, ",prot=%x", result->virtual_protect.prot );
245
        break;
246
    case APC_VIRTUAL_FLUSH:
247
        fprintf( stderr, "APC_VIRTUAL_FLUSH,status=%s",
248
                 get_status_name( result->virtual_flush.status ));
249 250
        dump_uint64( ",addr=", &result->virtual_flush.addr );
        dump_uint64( ",size=", &result->virtual_flush.size );
251
        break;
252
    case APC_VIRTUAL_LOCK:
253
        fprintf( stderr, "APC_VIRTUAL_LOCK,status=%s",
254
                 get_status_name( result->virtual_lock.status ));
255 256
        dump_uint64( ",addr=", &result->virtual_lock.addr );
        dump_uint64( ",size=", &result->virtual_lock.size );
257 258
        break;
    case APC_VIRTUAL_UNLOCK:
259
        fprintf( stderr, "APC_VIRTUAL_UNLOCK,status=%s",
260
                 get_status_name( result->virtual_unlock.status ));
261 262
        dump_uint64( ",addr=", &result->virtual_unlock.addr );
        dump_uint64( ",size=", &result->virtual_unlock.size );
263
        break;
264
    case APC_MAP_VIEW:
265
        fprintf( stderr, "APC_MAP_VIEW,status=%s",
266
                 get_status_name( result->map_view.status ));
267 268
        dump_uint64( ",addr=", &result->map_view.addr );
        dump_uint64( ",size=", &result->map_view.size );
269 270 271 272 273
        break;
    case APC_UNMAP_VIEW:
        fprintf( stderr, "APC_UNMAP_VIEW,status=%s",
                 get_status_name( result->unmap_view.status ) );
        break;
274
    case APC_CREATE_THREAD:
275
        fprintf( stderr, "APC_CREATE_THREAD,status=%s,tid=%04x,handle=%04x",
276 277 278
                 get_status_name( result->create_thread.status ),
                 result->create_thread.tid, result->create_thread.handle );
        break;
279 280 281 282 283 284 285
    default:
        fprintf( stderr, "type=%u", result->type );
        break;
    }
    fputc( '}', stderr );
}

286
static void dump_async_data( const char *prefix, const async_data_t *data )
287
{
288 289 290 291 292
    fprintf( stderr, "%s{handle=%04x,event=%04x", prefix, data->handle, data->event );
    dump_uint64( ",callback=", &data->callback );
    dump_uint64( ",iosb=", &data->iosb );
    dump_uint64( ",arg=", &data->arg );
    dump_uint64( ",cvalue=", &data->cvalue );
293
    fputc( '}', stderr );
294 295
}

296
static void dump_luid( const char *prefix, const luid_t *luid )
297
{
298
    fprintf( stderr, "%s%d.%u", prefix, luid->high_part, luid->low_part );
299 300
}

301
static void dump_varargs_ints( const char *prefix, data_size_t size )
302
{
303 304 305
    const int *data = cur_data;
    data_size_t len = size / sizeof(*data);

306
    fprintf( stderr,"%s{", prefix );
307
    while (len > 0)
308
    {
309 310
        fprintf( stderr, "%d", *data++ );
        if (--len) fputc( ',', stderr );
311 312
    }
    fputc( '}', stderr );
313
    remove_data( size );
314 315
}

316
static void dump_varargs_uints64( const char *prefix, data_size_t size )
317
{
318
    const unsigned __int64 *data = cur_data;
319
    data_size_t len = size / sizeof(*data);
320

321
    fprintf( stderr,"%s{", prefix );
322 323
    while (len > 0)
    {
324
        dump_uint64( "", data++ );
325 326 327
        if (--len) fputc( ',', stderr );
    }
    fputc( '}', stderr );
328
    remove_data( size );
329 330
}

331
static void dump_varargs_apc_result( const char *prefix, data_size_t size )
332 333 334 335 336
{
    const apc_result_t *result = cur_data;

    if (size >= sizeof(*result))
    {
337
        dump_apc_result( prefix, result );
338 339 340 341 342
        size = sizeof(*result);
    }
    remove_data( size );
}

343
static void dump_varargs_handles( const char *prefix, data_size_t size )
344
{
345
    const obj_handle_t *data = cur_data;
346
    data_size_t len = size / sizeof(*data);
347

348
    fprintf( stderr,"%s{", prefix );
349 350
    while (len > 0)
    {
351
        fprintf( stderr, "%04x", *data++ );
352 353 354
        if (--len) fputc( ',', stderr );
    }
    fputc( '}', stderr );
355
    remove_data( size );
356 357
}

358
static void dump_varargs_user_handles( const char *prefix, data_size_t size )
359
{
360
    const user_handle_t *data = cur_data;
361
    data_size_t len = size / sizeof(*data);
362

363
    fprintf( stderr,"%s{", prefix );
364 365
    while (len > 0)
    {
366
        fprintf( stderr, "%08x", *data++ );
367 368 369
        if (--len) fputc( ',', stderr );
    }
    fputc( '}', stderr );
370
    remove_data( size );
371 372
}

373
static void dump_varargs_bytes( const char *prefix, data_size_t size )
374
{
375
    const unsigned char *data = cur_data;
376
    data_size_t len = min( 1024, size );
377

378
    fprintf( stderr,"%s{", prefix );
379 380 381 382 383
    while (len > 0)
    {
        fprintf( stderr, "%02x", *data++ );
        if (--len) fputc( ',', stderr );
    }
384
    if (size > 1024) fprintf( stderr, "...(total %u)", size );
385
    fputc( '}', stderr );
386
    remove_data( size );
387 388
}

389
static void dump_varargs_string( const char *prefix, data_size_t size )
390
{
391
    fprintf( stderr, "%s\"%.*s\"", prefix, (int)size, (const char *)cur_data );
392
    remove_data( size );
393 394
}

395
static void dump_varargs_unicode_str( const char *prefix, data_size_t size )
396
{
397
    fprintf( stderr, "%sL\"", prefix );
398
    dump_strW( cur_data, size / sizeof(WCHAR), stderr, "\"\"" );
399
    fputc( '\"', stderr );
400
    remove_data( size );
401 402
}

403
static void dump_varargs_context( const char *prefix, data_size_t size )
404
{
405 406 407 408
    const context_t *context = cur_data;
    context_t ctx;
    unsigned int i;

409 410
    if (!size)
    {
411
        fprintf( stderr, "%s{}", prefix );
412 413
        return;
    }
414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440
    size = min( size, sizeof(ctx) );
    memset( &ctx, 0, sizeof(ctx) );
    memcpy( &ctx, context, size );

    fprintf( stderr,"%s{", prefix );
    dump_cpu_type( "cpu=", &ctx.cpu );
    switch (ctx.cpu)
    {
    case CPU_x86:
        if (ctx.flags & SERVER_CTX_CONTROL)
            fprintf( stderr, ",eip=%08x,esp=%08x,ebp=%08x,eflags=%08x,cs=%04x,ss=%04x",
                     ctx.ctl.i386_regs.eip, ctx.ctl.i386_regs.esp, ctx.ctl.i386_regs.ebp,
                     ctx.ctl.i386_regs.eflags, ctx.ctl.i386_regs.cs, ctx.ctl.i386_regs.ss );
        if (ctx.flags & SERVER_CTX_SEGMENTS)
            fprintf( stderr, ",ds=%04x,es=%04x,fs=%04x,gs=%04x",
                     ctx.seg.i386_regs.ds, ctx.seg.i386_regs.es,
                     ctx.seg.i386_regs.fs, ctx.seg.i386_regs.gs );
        if (ctx.flags & SERVER_CTX_INTEGER)
            fprintf( stderr, ",eax=%08x,ebx=%08x,ecx=%08x,edx=%08x,esi=%08x,edi=%08x",
                     ctx.integer.i386_regs.eax, ctx.integer.i386_regs.ebx, ctx.integer.i386_regs.ecx,
                     ctx.integer.i386_regs.edx, ctx.integer.i386_regs.esi, ctx.integer.i386_regs.edi );
        if (ctx.flags & SERVER_CTX_DEBUG_REGISTERS)
            fprintf( stderr, ",dr0=%08x,dr1=%08x,dr2=%08x,dr3=%08x,dr6=%08x,dr7=%08x",
                     ctx.debug.i386_regs.dr0, ctx.debug.i386_regs.dr1, ctx.debug.i386_regs.dr2,
                     ctx.debug.i386_regs.dr3, ctx.debug.i386_regs.dr6, ctx.debug.i386_regs.dr7 );
        if (ctx.flags & SERVER_CTX_FLOATING_POINT)
        {
441
            fprintf( stderr, ",fp.ctrl=%08x,fp.status=%08x,fp.tag=%08x,fp.err_off=%08x,fp.err_sel=%08x",
442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460
                     ctx.fp.i386_regs.ctrl, ctx.fp.i386_regs.status, ctx.fp.i386_regs.tag,
                     ctx.fp.i386_regs.err_off, ctx.fp.i386_regs.err_sel );
            fprintf( stderr, ",fp.data_off=%08x,fp.data_sel=%08x,fp.cr0npx=%08x",
                     ctx.fp.i386_regs.data_off, ctx.fp.i386_regs.data_sel, ctx.fp.i386_regs.cr0npx );
            for (i = 0; i < 8; i++)
                fprintf( stderr, ",fp.reg%u=%Lg", i, *(long double *)&ctx.fp.i386_regs.regs[10*i] );
        }
        if (ctx.flags & SERVER_CTX_EXTENDED_REGISTERS)
        {
            fprintf( stderr, ",extended=" );
            dump_uints( (const int *)ctx.ext.i386_regs, sizeof(ctx.ext.i386_regs) / sizeof(int) );
        }
        break;
    case CPU_x86_64:
        if (ctx.flags & SERVER_CTX_CONTROL)
        {
            dump_uint64( ",rip=", &ctx.ctl.x86_64_regs.rip );
            dump_uint64( ",rbp=", &ctx.ctl.x86_64_regs.rbp );
            dump_uint64( ",rsp=", &ctx.ctl.x86_64_regs.rsp );
461 462
            fprintf( stderr, ",cs=%04x,ss=%04x,flags=%08x",
                     ctx.ctl.x86_64_regs.cs, ctx.ctl.x86_64_regs.ss, ctx.ctl.x86_64_regs.flags );
463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587
        }
        if (ctx.flags & SERVER_CTX_INTEGER)
        {
            dump_uint64( ",rax=", &ctx.integer.x86_64_regs.rax );
            dump_uint64( ",rbx=", &ctx.integer.x86_64_regs.rbx );
            dump_uint64( ",rcx=", &ctx.integer.x86_64_regs.rcx );
            dump_uint64( ",rdx=", &ctx.integer.x86_64_regs.rdx );
            dump_uint64( ",rsi=", &ctx.integer.x86_64_regs.rsi );
            dump_uint64( ",rdi=", &ctx.integer.x86_64_regs.rdi );
            dump_uint64( ",r8=",  &ctx.integer.x86_64_regs.r8 );
            dump_uint64( ",r9=",  &ctx.integer.x86_64_regs.r9 );
            dump_uint64( ",r10=", &ctx.integer.x86_64_regs.r10 );
            dump_uint64( ",r11=", &ctx.integer.x86_64_regs.r11 );
            dump_uint64( ",r12=", &ctx.integer.x86_64_regs.r12 );
            dump_uint64( ",r13=", &ctx.integer.x86_64_regs.r13 );
            dump_uint64( ",r14=", &ctx.integer.x86_64_regs.r14 );
            dump_uint64( ",r15=", &ctx.integer.x86_64_regs.r15 );
        }
        if (ctx.flags & SERVER_CTX_SEGMENTS)
            fprintf( stderr, ",ds=%04x,es=%04x,fs=%04x,gs=%04x",
                     ctx.seg.x86_64_regs.ds, ctx.seg.x86_64_regs.es,
                     ctx.seg.x86_64_regs.fs, ctx.seg.x86_64_regs.gs );
        if (ctx.flags & SERVER_CTX_DEBUG_REGISTERS)
        {
            dump_uint64( ",dr0=", &ctx.debug.x86_64_regs.dr0 );
            dump_uint64( ",dr1=", &ctx.debug.x86_64_regs.dr1 );
            dump_uint64( ",dr2=", &ctx.debug.x86_64_regs.dr2 );
            dump_uint64( ",dr3=", &ctx.debug.x86_64_regs.dr3 );
            dump_uint64( ",dr6=", &ctx.debug.x86_64_regs.dr6 );
            dump_uint64( ",dr7=", &ctx.debug.x86_64_regs.dr7 );
        }
        if (ctx.flags & SERVER_CTX_FLOATING_POINT)
        {
            for (i = 0; i < 32; i++)
                fprintf( stderr, ",fp%u=%08x%08x%08x%08x", i,
                         (unsigned int)(ctx.fp.x86_64_regs.fpregs[i].high >> 32),
                         (unsigned int)ctx.fp.x86_64_regs.fpregs[i].high,
                         (unsigned int)(ctx.fp.x86_64_regs.fpregs[i].low >> 32),
                         (unsigned int)ctx.fp.x86_64_regs.fpregs[i].low );
        }
        break;
    case CPU_ALPHA:
        if (ctx.flags & SERVER_CTX_CONTROL)
        {
            dump_uint64( ",fir=", &ctx.ctl.alpha_regs.fir );
            fprintf( stderr, ",psr=%08x", ctx.ctl.alpha_regs.psr );
        }
        if (ctx.flags & SERVER_CTX_INTEGER)
        {
            dump_uint64( ",v0=",  &ctx.integer.alpha_regs.v0 );
            dump_uint64( ",t0=",  &ctx.integer.alpha_regs.t0 );
            dump_uint64( ",t1=",  &ctx.integer.alpha_regs.t1 );
            dump_uint64( ",t2=",  &ctx.integer.alpha_regs.t2 );
            dump_uint64( ",t3=",  &ctx.integer.alpha_regs.t3 );
            dump_uint64( ",t4=",  &ctx.integer.alpha_regs.t4 );
            dump_uint64( ",t5=",  &ctx.integer.alpha_regs.t5 );
            dump_uint64( ",t6=",  &ctx.integer.alpha_regs.t6 );
            dump_uint64( ",t7=",  &ctx.integer.alpha_regs.t7 );
            dump_uint64( ",t8=",  &ctx.integer.alpha_regs.t8 );
            dump_uint64( ",t9=",  &ctx.integer.alpha_regs.t9 );
            dump_uint64( ",t10=", &ctx.integer.alpha_regs.t10 );
            dump_uint64( ",t11=", &ctx.integer.alpha_regs.t11 );
            dump_uint64( ",t12=", &ctx.integer.alpha_regs.t12 );
            dump_uint64( ",s0=",  &ctx.integer.alpha_regs.s0 );
            dump_uint64( ",s1=",  &ctx.integer.alpha_regs.s1 );
            dump_uint64( ",s2=",  &ctx.integer.alpha_regs.s2 );
            dump_uint64( ",s3=",  &ctx.integer.alpha_regs.s3 );
            dump_uint64( ",s4=",  &ctx.integer.alpha_regs.s4 );
            dump_uint64( ",s5=",  &ctx.integer.alpha_regs.s5 );
            dump_uint64( ",s6=",  &ctx.integer.alpha_regs.s6 );
            dump_uint64( ",a0=",  &ctx.integer.alpha_regs.a0 );
            dump_uint64( ",a1=",  &ctx.integer.alpha_regs.a1 );
            dump_uint64( ",a2=",  &ctx.integer.alpha_regs.a2 );
            dump_uint64( ",a3=",  &ctx.integer.alpha_regs.a3 );
            dump_uint64( ",a4=",  &ctx.integer.alpha_regs.a4 );
            dump_uint64( ",a5=",  &ctx.integer.alpha_regs.a5 );
            dump_uint64( ",at=",  &ctx.integer.alpha_regs.at );
        }
        if (ctx.flags & SERVER_CTX_FLOATING_POINT)
        {
            for (i = 0; i < 32; i++)
            {
                fprintf( stderr, ",f%u", i );
                dump_uint64( "=", &ctx.fp.alpha_regs.f[i] );
            }
            dump_uint64( ",fpcr=", &ctx.fp.alpha_regs.fpcr );
            dump_uint64( ",softfpcr=", &ctx.fp.alpha_regs.softfpcr );
        }
        break;
    case CPU_POWERPC:
        if (ctx.flags & SERVER_CTX_CONTROL)
            fprintf( stderr, ",iar=%08x,msr=%08x,ctr=%08x,lr=%08x,dar=%08x,dsisr=%08x,trap=%08x",
                     ctx.ctl.powerpc_regs.iar, ctx.ctl.powerpc_regs.msr, ctx.ctl.powerpc_regs.ctr,
                     ctx.ctl.powerpc_regs.lr, ctx.ctl.powerpc_regs.dar, ctx.ctl.powerpc_regs.dsisr,
                     ctx.ctl.powerpc_regs.trap );
        if (ctx.flags & SERVER_CTX_INTEGER)
        {
            for (i = 0; i < 32; i++) fprintf( stderr, ",gpr%u=%08x", i, ctx.integer.powerpc_regs.gpr[i] );
            fprintf( stderr, ",cr=%08x,xer=%08x",
                     ctx.integer.powerpc_regs.cr, ctx.integer.powerpc_regs.xer );
        }
        if (ctx.flags & SERVER_CTX_DEBUG_REGISTERS)
            for (i = 0; i < 8; i++) fprintf( stderr, ",dr%u=%08x", i, ctx.debug.powerpc_regs.dr[i] );
        if (ctx.flags & SERVER_CTX_FLOATING_POINT)
        {
            for (i = 0; i < 32; i++) fprintf( stderr, ",fpr%u=%g", i, ctx.fp.powerpc_regs.fpr[i] );
            fprintf( stderr, ",fpscr=%g", ctx.fp.powerpc_regs.fpscr );
        }
        break;
    case CPU_SPARC:
        if (ctx.flags & SERVER_CTX_CONTROL)
            fprintf( stderr, ",psr=%08x,pc=%08x,npc=%08x,y=%08x,wim=%08x,tbr=%08x",
                     ctx.ctl.sparc_regs.psr, ctx.ctl.sparc_regs.pc, ctx.ctl.sparc_regs.npc,
                     ctx.ctl.sparc_regs.y, ctx.ctl.sparc_regs.wim, ctx.ctl.sparc_regs.tbr );
        if (ctx.flags & SERVER_CTX_INTEGER)
        {
            for (i = 0; i < 8; i++) fprintf( stderr, ",g%u=%08x", i, ctx.integer.sparc_regs.g[i] );
            for (i = 0; i < 8; i++) fprintf( stderr, ",o%u=%08x", i, ctx.integer.sparc_regs.o[i] );
            for (i = 0; i < 8; i++) fprintf( stderr, ",l%u=%08x", i, ctx.integer.sparc_regs.l[i] );
            for (i = 0; i < 8; i++) fprintf( stderr, ",i%u=%08x", i, ctx.integer.sparc_regs.i[i] );
        }
        break;
    }
    fputc( '}', stderr );
    remove_data( size );
588 589
}

590
static void dump_varargs_debug_event( const char *prefix, data_size_t size )
591
{
592 593
    debug_event_t event;
    unsigned int i;
594

595
    if (!size)
596
    {
597
        fprintf( stderr, "%s{}", prefix );
598
        return;
599
    }
600 601 602 603 604
    size = min( size, sizeof(event) );
    memset( &event, 0, sizeof(event) );
    memcpy( &event, cur_data, size );

    switch(event.code)
605 606
    {
    case EXCEPTION_DEBUG_EVENT:
607
        fprintf( stderr, "%s{exception,first=%d,exc_code=%08x,flags=%08x", prefix,
608
                 event.exception.first, event.exception.exc_code, event.exception.flags );
609 610
        dump_uint64( ",record=", &event.exception.record );
        dump_uint64( ",address=", &event.exception.address );
611 612 613 614
        fprintf( stderr, ",params={" );
        event.exception.nb_params = min( event.exception.nb_params, EXCEPTION_MAXIMUM_PARAMETERS );
        for (i = 0; i < event.exception.nb_params; i++)
        {
615
            dump_uint64( "", &event.exception.params[i] );
616 617 618
            if (i < event.exception.nb_params) fputc( ',', stderr );
        }
        fprintf( stderr, "}}" );
619 620
        break;
    case CREATE_THREAD_DEBUG_EVENT:
621 622 623
        fprintf( stderr, "%s{create_thread,thread=%04x", prefix, event.create_thread.handle );
        dump_uint64( ",teb=", &event.create_thread.teb );
        dump_uint64( ",start=", &event.create_thread.start );
624
        fputc( '}', stderr );
625 626
        break;
    case CREATE_PROCESS_DEBUG_EVENT:
627
        fprintf( stderr, "%s{create_process,file=%04x,process=%04x,thread=%04x", prefix,
628 629
                 event.create_process.file, event.create_process.process,
                 event.create_process.thread );
630 631
        dump_uint64( ",base=", &event.create_process.base );
        fprintf( stderr, ",offset=%d,size=%d",
632
                 event.create_process.dbg_offset, event.create_process.dbg_size );
633 634 635
        dump_uint64( ",teb=", &event.create_process.teb );
        dump_uint64( ",start=", &event.create_process.start );
        dump_uint64( ",name=", &event.create_process.name );
636
        fprintf( stderr, ",unicode=%d}", event.create_process.unicode );
637 638
        break;
    case EXIT_THREAD_DEBUG_EVENT:
639
        fprintf( stderr, "%s{exit_thread,code=%d}", prefix, event.exit.exit_code );
640 641
        break;
    case EXIT_PROCESS_DEBUG_EVENT:
642
        fprintf( stderr, "%s{exit_process,code=%d}", prefix, event.exit.exit_code );
643 644
        break;
    case LOAD_DLL_DEBUG_EVENT:
645 646 647
        fprintf( stderr, "%s{load_dll,file=%04x", prefix, event.load_dll.handle );
        dump_uint64( ",base=", &event.load_dll.base );
        fprintf( stderr, ",offset=%d,size=%d",
648
                 event.load_dll.dbg_offset, event.load_dll.dbg_size );
649
        dump_uint64( ",name=", &event.load_dll.name );
650
        fprintf( stderr, ",unicode=%d}", event.load_dll.unicode );
651 652
        break;
    case UNLOAD_DLL_DEBUG_EVENT:
653 654
        fprintf( stderr, "%s{unload_dll", prefix );
        dump_uint64( ",base=", &event.unload_dll.base );
655
        fputc( '}', stderr );
656 657
        break;
    case OUTPUT_DEBUG_STRING_EVENT:
658 659
        fprintf( stderr, "%s{output_string", prefix );
        dump_uint64( ",string=", &event.output_string.string );
660
        fprintf( stderr, ",len=%u}", event.output_string.length );
661 662
        break;
    case RIP_EVENT:
663
        fprintf( stderr, "%s{rip,err=%d,type=%d}", prefix,
664
                 event.rip_info.error, event.rip_info.type );
665 666
        break;
    case 0:  /* zero is the code returned on timeouts */
667
        fprintf( stderr, "%s{}", prefix );
668 669
        break;
    default:
670
        fprintf( stderr, "%s{code=??? (%d)}", prefix, event.code );
671 672
        break;
    }
673
    remove_data( size );
674 675
}

676
/* dump a unicode string contained in a buffer; helper for dump_varargs_startup_info */
677
static data_size_t dump_inline_unicode_string( const char *prefix, data_size_t pos, data_size_t len, data_size_t total_size )
678
{
679 680 681 682 683 684
    fputs( prefix, stderr );
    if (pos >= total_size) return pos;
    if (len > total_size - pos) len = total_size - pos;
    len /= sizeof(WCHAR);
    dump_strW( (const WCHAR *)cur_data + pos/sizeof(WCHAR), len, stderr, "\"\"" );
    return pos + len * sizeof(WCHAR);
685 686
}

687
static void dump_varargs_startup_info( const char *prefix, data_size_t size )
688
{
689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708
    startup_info_t info;
    data_size_t pos = sizeof(info);

    memset( &info, 0, sizeof(info) );
    memcpy( &info, cur_data, min( size, sizeof(info) ));

    fprintf( stderr,
             "%s{debug_flags=%x,console_flags=%x,console=%04x,hstdin=%04x,hstdout=%04x,hstderr=%04x,"
             "x=%u,y=%u,xsize=%u,ysize=%u,xchars=%u,ychars=%u,attribute=%02x,flags=%x,show=%u",
             prefix, info.debug_flags, info.console_flags, info.console,
             info.hstdin, info.hstdout, info.hstderr, info.x, info.y, info.xsize, info.ysize,
             info.xchars, info.ychars, info.attribute, info.flags, info.show );
    pos = dump_inline_unicode_string( ",curdir=L\"", pos, info.curdir_len, size );
    pos = dump_inline_unicode_string( "\",dllpath=L\"", pos, info.dllpath_len, size );
    pos = dump_inline_unicode_string( "\",imagepath=L\"", pos, info.imagepath_len, size );
    pos = dump_inline_unicode_string( "\",cmdline=L\"", pos, info.cmdline_len, size );
    pos = dump_inline_unicode_string( "\",title=L\"", pos, info.title_len, size );
    pos = dump_inline_unicode_string( "\",desktop=L\"", pos, info.desktop_len, size );
    pos = dump_inline_unicode_string( "\",shellinfo=L\"", pos, info.shellinfo_len, size );
    pos = dump_inline_unicode_string( "\",runtime=L\"", pos, info.runtime_len, size );
709
    fprintf( stderr, "\"}" );
710 711 712
    remove_data( size );
}

713
static void dump_varargs_input_records( const char *prefix, data_size_t size )
714
{
715
    const INPUT_RECORD *rec = cur_data;
716
    data_size_t len = size / sizeof(*rec);
717

718
    fprintf( stderr,"%s{", prefix );
719 720 721 722 723 724 725
    while (len > 0)
    {
        fprintf( stderr, "{%04x,...}", rec->EventType );
        rec++;
        if (--len) fputc( ',', stderr );
    }
    fputc( '}', stderr );
726
    remove_data( size );
727 728
}

729
static void dump_varargs_rectangles( const char *prefix, data_size_t size )
730 731
{
    const rectangle_t *rect = cur_data;
732
    data_size_t len = size / sizeof(*rect);
733

734
    fprintf( stderr,"%s{", prefix );
735 736
    while (len > 0)
    {
737
        dump_rectangle( "", rect++ );
738 739 740 741 742 743
        if (--len) fputc( ',', stderr );
    }
    fputc( '}', stderr );
    remove_data( size );
}

744
static void dump_varargs_message_data( const char *prefix, data_size_t size )
745 746
{
    /* FIXME: dump the structured data */
747
    dump_varargs_bytes( prefix, size );
748 749
}

750
static void dump_varargs_properties( const char *prefix, data_size_t size )
751
{
752
    const property_data_t *prop = cur_data;
753
    data_size_t len = size / sizeof(*prop);
754

755
    fprintf( stderr,"%s{", prefix );
756 757
    while (len > 0)
    {
758 759
        fprintf( stderr, "{atom=%04x,str=%d", prop->atom, prop->string );
        dump_uint64( ",data=", &prop->data );
760
        fputc( '}', stderr );
761 762 763 764
        prop++;
        if (--len) fputc( ',', stderr );
    }
    fputc( '}', stderr );
765
    remove_data( size );
766 767
}

768
static void dump_varargs_LUID_AND_ATTRIBUTES( const char *prefix, data_size_t size )
769 770
{
    const LUID_AND_ATTRIBUTES *lat = cur_data;
771
    data_size_t len = size / sizeof(*lat);
772

773
    fprintf( stderr,"%s{", prefix );
774 775
    while (len > 0)
    {
776
        fprintf( stderr, "{luid=%08x%08x,attr=%x}",
777 778 779 780 781 782 783 784
                 lat->Luid.HighPart, lat->Luid.LowPart, lat->Attributes );
        lat++;
        if (--len) fputc( ',', stderr );
    }
    fputc( '}', stderr );
    remove_data( size );
}

785
static void dump_inline_sid( const char *prefix, const SID *sid, data_size_t size )
786 787 788 789
{
    DWORD i;

    /* security check */
790 791 792 793
    if ((FIELD_OFFSET(SID, SubAuthority[0]) > size) ||
        (FIELD_OFFSET(SID, SubAuthority[sid->SubAuthorityCount]) > size))
    {
        fprintf( stderr, "<invalid sid>" );
794
        return;
795
    }
796

797
    fprintf( stderr,"%s{", prefix );
798
    fprintf( stderr, "S-%u-%u", sid->Revision, MAKELONG(
799 800 801 802 803
        MAKEWORD( sid->IdentifierAuthority.Value[5],
                  sid->IdentifierAuthority.Value[4] ),
        MAKEWORD( sid->IdentifierAuthority.Value[3],
                  sid->IdentifierAuthority.Value[2] ) ) );
    for (i = 0; i < sid->SubAuthorityCount; i++)
804
        fprintf( stderr, "-%u", sid->SubAuthority[i] );
805 806 807
    fputc( '}', stderr );
}

808
static void dump_varargs_SID( const char *prefix, data_size_t size )
809 810
{
    const SID *sid = cur_data;
811
    dump_inline_sid( prefix, sid, size );
812 813 814
    remove_data( size );
}

815
static void dump_inline_acl( const char *prefix, const ACL *acl, data_size_t size )
816 817 818 819
{
    const ACE_HEADER *ace;
    ULONG i;

820
    fprintf( stderr,"%s{", prefix );
821 822 823
    if (size)
    {
        if (size < sizeof(ACL))
824
        {
825
            fprintf( stderr, "<invalid acl>}" );
826
            return;
827
        }
828 829 830 831 832
        size -= sizeof(ACL);
        ace = (const ACE_HEADER *)(acl + 1);
        for (i = 0; i < acl->AceCount; i++)
        {
            const SID *sid = NULL;
833
            data_size_t sid_size = 0;
834

835
            if (size < sizeof(ACE_HEADER) || size < ace->AceSize) break;
836
            size -= ace->AceSize;
837
            if (i != 0) fputc( ',', stderr );
838 839 840 841 842
            fprintf( stderr, "{AceType=" );
            switch (ace->AceType)
            {
            case ACCESS_DENIED_ACE_TYPE:
                sid = (const SID *)&((const ACCESS_DENIED_ACE *)ace)->SidStart;
843
                sid_size = ace->AceSize - FIELD_OFFSET(ACCESS_DENIED_ACE, SidStart);
844
                fprintf( stderr, "ACCESS_DENIED_ACE_TYPE,Mask=%x",
845
                         ((const ACCESS_DENIED_ACE *)ace)->Mask );
846 847 848
                break;
            case ACCESS_ALLOWED_ACE_TYPE:
                sid = (const SID *)&((const ACCESS_ALLOWED_ACE *)ace)->SidStart;
849
                sid_size = ace->AceSize - FIELD_OFFSET(ACCESS_ALLOWED_ACE, SidStart);
850
                fprintf( stderr, "ACCESS_ALLOWED_ACE_TYPE,Mask=%x",
851
                         ((const ACCESS_ALLOWED_ACE *)ace)->Mask );
852 853 854
                break;
            case SYSTEM_AUDIT_ACE_TYPE:
                sid = (const SID *)&((const SYSTEM_AUDIT_ACE *)ace)->SidStart;
855
                sid_size = ace->AceSize - FIELD_OFFSET(SYSTEM_AUDIT_ACE, SidStart);
856
                fprintf( stderr, "SYSTEM_AUDIT_ACE_TYPE,Mask=%x",
857
                         ((const SYSTEM_AUDIT_ACE *)ace)->Mask );
858 859 860
                break;
            case SYSTEM_ALARM_ACE_TYPE:
                sid = (const SID *)&((const SYSTEM_ALARM_ACE *)ace)->SidStart;
861
                sid_size = ace->AceSize - FIELD_OFFSET(SYSTEM_ALARM_ACE, SidStart);
862
                fprintf( stderr, "SYSTEM_ALARM_ACE_TYPE,Mask=%x",
863
                         ((const SYSTEM_ALARM_ACE *)ace)->Mask );
864 865 866 867 868
                break;
            default:
                fprintf( stderr, "unknown<%d>", ace->AceType );
                break;
            }
869
            fprintf( stderr, ",AceFlags=%x", ace->AceFlags );
870
            if (sid)
871
                dump_inline_sid( ",Sid=", sid, sid_size );
872 873 874 875 876 877 878
            ace = (const ACE_HEADER *)((const char *)ace + ace->AceSize);
            fputc( '}', stderr );
        }
    }
    fputc( '}', stderr );
}

879 880 881 882 883 884 885
static void dump_varargs_ACL( const char *prefix, data_size_t size )
{
    const ACL *acl = cur_data;
    dump_inline_acl( prefix, acl, size );
    remove_data( size );
}

886
static void dump_inline_security_descriptor( const char *prefix, const struct security_descriptor *sd, data_size_t size )
887
{
888
    fprintf( stderr,"%s{", prefix );
889 890 891 892 893 894
    if (size >= sizeof(struct security_descriptor))
    {
        size_t offset = sizeof(struct security_descriptor);
        fprintf( stderr, "control=%08x", sd->control );
        if ((sd->owner_len > FIELD_OFFSET(SID, SubAuthority[255])) || (offset + sd->owner_len > size))
            return;
895
        if (sd->owner_len)
896
            dump_inline_sid( ",owner=", (const SID *)((const char *)sd + offset), sd->owner_len );
897
        else
898
            fprintf( stderr, ",owner=<not present>" );
899 900 901
        offset += sd->owner_len;
        if ((sd->group_len > FIELD_OFFSET(SID, SubAuthority[255])) || (offset + sd->group_len > size))
            return;
902
        if (sd->group_len)
903
            dump_inline_sid( ",group=", (const SID *)((const char *)sd + offset), sd->group_len );
904
        else
905
            fprintf( stderr, ",group=<not present>" );
906 907 908
        offset += sd->group_len;
        if ((sd->sacl_len >= MAX_ACL_LEN) || (offset + sd->sacl_len > size))
            return;
909
        dump_inline_acl( ",sacl=", (const ACL *)((const char *)sd + offset), sd->sacl_len );
910 911 912
        offset += sd->sacl_len;
        if ((sd->dacl_len >= MAX_ACL_LEN) || (offset + sd->dacl_len > size))
            return;
913
        dump_inline_acl( ",dacl=", (const ACL *)((const char *)sd + offset), sd->dacl_len );
914 915 916 917 918
        offset += sd->dacl_len;
    }
    fputc( '}', stderr );
}

919
static void dump_varargs_security_descriptor( const char *prefix, data_size_t size )
920 921
{
    const struct security_descriptor *sd = cur_data;
922
    dump_inline_security_descriptor( prefix, sd, size );
923 924 925
    remove_data( size );
}

926
static void dump_varargs_token_groups( const char *prefix, data_size_t size )
927 928
{
    const struct token_groups *tg = cur_data;
929 930

    fprintf( stderr,"%s{", prefix );
931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949
    if (size >= sizeof(struct token_groups))
    {
        size_t offset = sizeof(*tg);
        fprintf( stderr, "count=%08x,", tg->count );
        if (tg->count * sizeof(unsigned int) <= size)
        {
            unsigned int i;
            const unsigned int *attr = (const unsigned int *)(tg + 1);

            offset += tg->count * sizeof(unsigned int);

            fputc( '[', stderr );
            for (i = 0; i < tg->count; i++)
            {
                const SID *sid = (const SID *)((const char *)cur_data + offset);
                if (i != 0)
                    fputc( ',', stderr );
                fputc( '{', stderr );
                fprintf( stderr, "attributes=%08x", attr[i] );
950
                dump_inline_sid( ",sid=", sid, size - offset );
951 952 953 954 955 956 957 958 959 960 961 962
                if ((offset + FIELD_OFFSET(SID, SubAuthority[0]) > size) ||
                    (offset + FIELD_OFFSET(SID, SubAuthority[sid->SubAuthorityCount]) > size))
                    break;
                offset += FIELD_OFFSET(SID, SubAuthority[sid->SubAuthorityCount]);
                fputc( '}', stderr );
            }
            fputc( ']', stderr );
        }
    }
    fputc( '}', stderr );
}

963
static void dump_varargs_object_attributes( const char *prefix, data_size_t size )
964 965
{
    const struct object_attributes *objattr = cur_data;
966 967

    fprintf( stderr,"%s{", prefix );
968 969 970
    if (size >= sizeof(struct object_attributes))
    {
        const WCHAR *str;
971
        fprintf( stderr, "rootdir=%04x", objattr->rootdir );
972 973 974
        if (objattr->sd_len > size - sizeof(*objattr) ||
            objattr->name_len > size - sizeof(*objattr) - objattr->sd_len)
            return;
975
        dump_inline_security_descriptor( ",sd=", (const struct security_descriptor *)(objattr + 1), objattr->sd_len );
976
        str = (const WCHAR *)objattr + (sizeof(*objattr) + objattr->sd_len) / sizeof(WCHAR);
977
        fprintf( stderr, ",name=L\"" );
978
        dump_strW( str, objattr->name_len / sizeof(WCHAR), stderr, "\"\"" );
979
        fputc( '\"', stderr );
980 981
        remove_data( ((sizeof(*objattr) + objattr->sd_len) / sizeof(WCHAR)) * sizeof(WCHAR) +
                     objattr->name_len );
982 983 984 985
    }
    fputc( '}', stderr );
}

986
typedef void (*dump_func)( const void *req );
987 988 989 990

/* Everything below this line is generated automatically by tools/make_requests */
/* ### make_requests begin ### */

991
static void dump_new_process_request( const struct new_process_request *req )
992
{
993 994 995 996 997 998 999 1000
    fprintf( stderr, " inherit_all=%d", req->inherit_all );
    fprintf( stderr, ", create_flags=%08x", req->create_flags );
    fprintf( stderr, ", socket_fd=%d", req->socket_fd );
    fprintf( stderr, ", exe_file=%04x", req->exe_file );
    fprintf( stderr, ", process_access=%08x", req->process_access );
    fprintf( stderr, ", process_attr=%08x", req->process_attr );
    fprintf( stderr, ", thread_access=%08x", req->thread_access );
    fprintf( stderr, ", thread_attr=%08x", req->thread_attr );
1001 1002
    fprintf( stderr, ", info_size=%u", req->info_size );
    dump_varargs_startup_info( ", info=", min(cur_size,req->info_size) );
1003
    dump_varargs_unicode_str( ", env=", cur_size );
1004 1005
}

1006
static void dump_new_process_reply( const struct new_process_reply *req )
1007
{
1008 1009 1010 1011 1012
    fprintf( stderr, " info=%04x", req->info );
    fprintf( stderr, ", pid=%04x", req->pid );
    fprintf( stderr, ", phandle=%04x", req->phandle );
    fprintf( stderr, ", tid=%04x", req->tid );
    fprintf( stderr, ", thandle=%04x", req->thandle );
1013 1014 1015 1016
}

static void dump_get_new_process_info_request( const struct get_new_process_info_request *req )
{
1017
    fprintf( stderr, " info=%04x", req->info );
1018 1019
}

1020
static void dump_get_new_process_info_reply( const struct get_new_process_info_reply *req )
1021
{
1022 1023
    fprintf( stderr, " success=%d", req->success );
    fprintf( stderr, ", exit_code=%d", req->exit_code );
1024 1025
}

1026
static void dump_new_thread_request( const struct new_thread_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1027
{
1028 1029 1030 1031
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", suspend=%d", req->suspend );
    fprintf( stderr, ", request_fd=%d", req->request_fd );
Alexandre Julliard's avatar
Alexandre Julliard committed
1032 1033
}

1034
static void dump_new_thread_reply( const struct new_thread_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1035
{
1036 1037
    fprintf( stderr, " tid=%04x", req->tid );
    fprintf( stderr, ", handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1038 1039
}

1040 1041 1042 1043 1044 1045
static void dump_get_startup_info_request( const struct get_startup_info_request *req )
{
}

static void dump_get_startup_info_reply( const struct get_startup_info_reply *req )
{
1046
    fprintf( stderr, " exe_file=%04x", req->exe_file );
1047 1048
    fprintf( stderr, ", info_size=%u", req->info_size );
    dump_varargs_startup_info( ", info=", min(cur_size,req->info_size) );
1049
    dump_varargs_unicode_str( ", env=", cur_size );
1050 1051
}

1052
static void dump_init_process_done_request( const struct init_process_done_request *req )
1053
{
1054 1055 1056 1057
    fprintf( stderr, " gui=%d", req->gui );
    dump_uint64( ", module=", &req->module );
    dump_uint64( ", ldt_copy=", &req->ldt_copy );
    dump_uint64( ", entry=", &req->entry );
1058 1059
}

1060
static void dump_init_thread_request( const struct init_thread_request *req )
1061
{
1062 1063 1064 1065 1066 1067 1068 1069
    fprintf( stderr, " unix_pid=%d", req->unix_pid );
    fprintf( stderr, ", unix_tid=%d", req->unix_tid );
    fprintf( stderr, ", debug_level=%d", req->debug_level );
    dump_uint64( ", teb=", &req->teb );
    dump_uint64( ", entry=", &req->entry );
    fprintf( stderr, ", reply_fd=%d", req->reply_fd );
    fprintf( stderr, ", wait_fd=%d", req->wait_fd );
    dump_cpu_type( ", cpu=", &req->cpu );
1070 1071
}

1072
static void dump_init_thread_reply( const struct init_thread_reply *req )
1073
{
1074 1075 1076 1077 1078 1079
    fprintf( stderr, " pid=%04x", req->pid );
    fprintf( stderr, ", tid=%04x", req->tid );
    dump_timeout( ", server_start=", &req->server_start );
    fprintf( stderr, ", info_size=%u", req->info_size );
    fprintf( stderr, ", version=%d", req->version );
    fprintf( stderr, ", all_cpus=%08x", req->all_cpus );
1080 1081
}

1082
static void dump_terminate_process_request( const struct terminate_process_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1083
{
1084 1085
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", exit_code=%d", req->exit_code );
Alexandre Julliard's avatar
Alexandre Julliard committed
1086 1087
}

1088
static void dump_terminate_process_reply( const struct terminate_process_reply *req )
1089 1090 1091 1092
{
    fprintf( stderr, " self=%d", req->self );
}

1093
static void dump_terminate_thread_request( const struct terminate_thread_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1094
{
1095 1096
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", exit_code=%d", req->exit_code );
Alexandre Julliard's avatar
Alexandre Julliard committed
1097 1098
}

1099
static void dump_terminate_thread_reply( const struct terminate_thread_reply *req )
1100
{
1101 1102
    fprintf( stderr, " self=%d", req->self );
    fprintf( stderr, ", last=%d", req->last );
1103 1104
}

1105
static void dump_get_process_info_request( const struct get_process_info_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1106
{
1107
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1108 1109
}

1110
static void dump_get_process_info_reply( const struct get_process_info_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1111
{
1112 1113 1114 1115 1116 1117 1118 1119
    fprintf( stderr, " pid=%04x", req->pid );
    fprintf( stderr, ", ppid=%04x", req->ppid );
    dump_uint64( ", affinity=", &req->affinity );
    dump_uint64( ", peb=", &req->peb );
    dump_timeout( ", start_time=", &req->start_time );
    dump_timeout( ", end_time=", &req->end_time );
    fprintf( stderr, ", exit_code=%d", req->exit_code );
    fprintf( stderr, ", priority=%d", req->priority );
1120
    dump_cpu_type( ", cpu=", &req->cpu );
1121
    fprintf( stderr, ", debugger_present=%d", req->debugger_present );
1122 1123
}

1124
static void dump_set_process_info_request( const struct set_process_info_request *req )
1125
{
1126 1127 1128 1129
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", mask=%d", req->mask );
    fprintf( stderr, ", priority=%d", req->priority );
    dump_uint64( ", affinity=", &req->affinity );
Alexandre Julliard's avatar
Alexandre Julliard committed
1130 1131
}

1132
static void dump_get_thread_info_request( const struct get_thread_info_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1133
{
1134 1135
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", tid_in=%04x", req->tid_in );
Alexandre Julliard's avatar
Alexandre Julliard committed
1136 1137
}

1138
static void dump_get_thread_info_reply( const struct get_thread_info_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1139
{
1140 1141 1142 1143 1144 1145 1146 1147 1148
    fprintf( stderr, " pid=%04x", req->pid );
    fprintf( stderr, ", tid=%04x", req->tid );
    dump_uint64( ", teb=", &req->teb );
    dump_uint64( ", affinity=", &req->affinity );
    dump_timeout( ", creation_time=", &req->creation_time );
    dump_timeout( ", exit_time=", &req->exit_time );
    fprintf( stderr, ", exit_code=%d", req->exit_code );
    fprintf( stderr, ", priority=%d", req->priority );
    fprintf( stderr, ", last=%d", req->last );
1149 1150
}

1151
static void dump_set_thread_info_request( const struct set_thread_info_request *req )
1152
{
1153 1154 1155 1156 1157
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", mask=%d", req->mask );
    fprintf( stderr, ", priority=%d", req->priority );
    dump_uint64( ", affinity=", &req->affinity );
    fprintf( stderr, ", token=%04x", req->token );
1158 1159
}

1160 1161
static void dump_get_dll_info_request( const struct get_dll_info_request *req )
{
1162 1163
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", base_address=", &req->base_address );
1164 1165 1166 1167
}

static void dump_get_dll_info_reply( const struct get_dll_info_reply *req )
{
1168 1169 1170 1171
    dump_uint64( " entry_point=", &req->entry_point );
    fprintf( stderr, ", size=%u", req->size );
    fprintf( stderr, ", filename_len=%u", req->filename_len );
    dump_varargs_unicode_str( ", filename=", cur_size );
1172 1173
}

1174
static void dump_suspend_thread_request( const struct suspend_thread_request *req )
1175
{
1176
    fprintf( stderr, " handle=%04x", req->handle );
1177 1178
}

1179
static void dump_suspend_thread_reply( const struct suspend_thread_reply *req )
1180 1181 1182 1183
{
    fprintf( stderr, " count=%d", req->count );
}

1184
static void dump_resume_thread_request( const struct resume_thread_request *req )
1185
{
1186
    fprintf( stderr, " handle=%04x", req->handle );
1187 1188
}

1189
static void dump_resume_thread_reply( const struct resume_thread_reply *req )
1190 1191 1192 1193
{
    fprintf( stderr, " count=%d", req->count );
}

1194
static void dump_load_dll_request( const struct load_dll_request *req )
1195
{
1196 1197 1198 1199 1200 1201 1202
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", base=", &req->base );
    dump_uint64( ", name=", &req->name );
    fprintf( stderr, ", size=%u", req->size );
    fprintf( stderr, ", dbg_offset=%d", req->dbg_offset );
    fprintf( stderr, ", dbg_size=%d", req->dbg_size );
    dump_varargs_unicode_str( ", filename=", cur_size );
1203 1204 1205 1206
}

static void dump_unload_dll_request( const struct unload_dll_request *req )
{
1207
    dump_uint64( " base=", &req->base );
1208 1209
}

1210
static void dump_queue_apc_request( const struct queue_apc_request *req )
1211
{
1212 1213
    fprintf( stderr, " handle=%04x", req->handle );
    dump_apc_call( ", call=", &req->call );
Alexandre Julliard's avatar
Alexandre Julliard committed
1214 1215
}

1216 1217
static void dump_queue_apc_reply( const struct queue_apc_reply *req )
{
1218 1219
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", self=%d", req->self );
1220 1221
}

1222 1223
static void dump_get_apc_result_request( const struct get_apc_result_request *req )
{
1224
    fprintf( stderr, " handle=%04x", req->handle );
1225 1226 1227 1228
}

static void dump_get_apc_result_reply( const struct get_apc_result_reply *req )
{
1229
    dump_apc_result( " result=", &req->result );
1230 1231
}

1232
static void dump_close_handle_request( const struct close_handle_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1233
{
1234
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1235 1236
}

1237
static void dump_set_handle_info_request( const struct set_handle_info_request *req )
1238
{
1239 1240 1241
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", flags=%d", req->flags );
    fprintf( stderr, ", mask=%d", req->mask );
1242 1243
}

1244
static void dump_set_handle_info_reply( const struct set_handle_info_reply *req )
1245
{
1246 1247 1248
    fprintf( stderr, " old_flags=%d", req->old_flags );
}

1249
static void dump_dup_handle_request( const struct dup_handle_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1250
{
1251 1252 1253 1254 1255 1256
    fprintf( stderr, " src_process=%04x", req->src_process );
    fprintf( stderr, ", src_handle=%04x", req->src_handle );
    fprintf( stderr, ", dst_process=%04x", req->dst_process );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", options=%08x", req->options );
Alexandre Julliard's avatar
Alexandre Julliard committed
1257 1258
}

1259
static void dump_dup_handle_reply( const struct dup_handle_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1260
{
1261 1262 1263
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", self=%d", req->self );
    fprintf( stderr, ", closed=%d", req->closed );
Alexandre Julliard's avatar
Alexandre Julliard committed
1264 1265
}

1266
static void dump_open_process_request( const struct open_process_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1267
{
1268 1269 1270
    fprintf( stderr, " pid=%04x", req->pid );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
Alexandre Julliard's avatar
Alexandre Julliard committed
1271 1272
}

1273
static void dump_open_process_reply( const struct open_process_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1274
{
1275
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1276 1277
}

1278 1279
static void dump_open_thread_request( const struct open_thread_request *req )
{
1280 1281 1282
    fprintf( stderr, " tid=%04x", req->tid );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
1283 1284 1285 1286
}

static void dump_open_thread_reply( const struct open_thread_reply *req )
{
1287
    fprintf( stderr, " handle=%04x", req->handle );
1288 1289
}

1290
static void dump_select_request( const struct select_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1291
{
1292 1293 1294 1295 1296 1297 1298
    fprintf( stderr, " flags=%d", req->flags );
    dump_uint64( ", cookie=", &req->cookie );
    fprintf( stderr, ", signal=%04x", req->signal );
    fprintf( stderr, ", prev_apc=%04x", req->prev_apc );
    dump_timeout( ", timeout=", &req->timeout );
    dump_varargs_apc_result( ", result=", cur_size );
    dump_varargs_handles( ", handles=", cur_size );
Alexandre Julliard's avatar
Alexandre Julliard committed
1299 1300
}

1301 1302
static void dump_select_reply( const struct select_reply *req )
{
1303 1304 1305
    dump_timeout( " timeout=", &req->timeout );
    dump_apc_call( ", call=", &req->call );
    fprintf( stderr, ", apc_handle=%04x", req->apc_handle );
1306 1307
}

1308
static void dump_create_event_request( const struct create_event_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1309
{
1310 1311 1312 1313 1314
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", manual_reset=%d", req->manual_reset );
    fprintf( stderr, ", initial_state=%d", req->initial_state );
    dump_varargs_object_attributes( ", objattr=", cur_size );
Alexandre Julliard's avatar
Alexandre Julliard committed
1315 1316
}

1317
static void dump_create_event_reply( const struct create_event_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1318
{
1319
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1320 1321
}

1322
static void dump_event_op_request( const struct event_op_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1323
{
1324 1325
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", op=%d", req->op );
Alexandre Julliard's avatar
Alexandre Julliard committed
1326 1327
}

1328
static void dump_open_event_request( const struct open_event_request *req )
1329
{
1330 1331 1332 1333
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", rootdir=%04x", req->rootdir );
    dump_varargs_unicode_str( ", name=", cur_size );
1334 1335
}

1336
static void dump_open_event_reply( const struct open_event_reply *req )
1337
{
1338
    fprintf( stderr, " handle=%04x", req->handle );
1339 1340
}

1341
static void dump_create_mutex_request( const struct create_mutex_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1342
{
1343 1344 1345 1346
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", owned=%d", req->owned );
    dump_varargs_object_attributes( ", objattr=", cur_size );
Alexandre Julliard's avatar
Alexandre Julliard committed
1347 1348
}

1349
static void dump_create_mutex_reply( const struct create_mutex_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1350
{
1351
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1352 1353
}

1354
static void dump_release_mutex_request( const struct release_mutex_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1355
{
1356
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1357 1358
}

1359 1360 1361 1362 1363
static void dump_release_mutex_reply( const struct release_mutex_reply *req )
{
    fprintf( stderr, " prev_count=%08x", req->prev_count );
}

1364
static void dump_open_mutex_request( const struct open_mutex_request *req )
1365
{
1366 1367 1368 1369
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", rootdir=%04x", req->rootdir );
    dump_varargs_unicode_str( ", name=", cur_size );
1370 1371
}

1372
static void dump_open_mutex_reply( const struct open_mutex_reply *req )
1373
{
1374
    fprintf( stderr, " handle=%04x", req->handle );
1375 1376
}

1377
static void dump_create_semaphore_request( const struct create_semaphore_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1378
{
1379 1380 1381 1382 1383
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", initial=%08x", req->initial );
    fprintf( stderr, ", max=%08x", req->max );
    dump_varargs_object_attributes( ", objattr=", cur_size );
Alexandre Julliard's avatar
Alexandre Julliard committed
1384 1385
}

1386
static void dump_create_semaphore_reply( const struct create_semaphore_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1387
{
1388
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1389 1390
}

1391
static void dump_release_semaphore_request( const struct release_semaphore_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1392
{
1393 1394
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", count=%08x", req->count );
Alexandre Julliard's avatar
Alexandre Julliard committed
1395 1396
}

1397
static void dump_release_semaphore_reply( const struct release_semaphore_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1398
{
1399
    fprintf( stderr, " prev_count=%08x", req->prev_count );
Alexandre Julliard's avatar
Alexandre Julliard committed
1400 1401
}

1402
static void dump_open_semaphore_request( const struct open_semaphore_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1403
{
1404 1405 1406 1407
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", rootdir=%04x", req->rootdir );
    dump_varargs_unicode_str( ", name=", cur_size );
1408 1409
}

1410
static void dump_open_semaphore_reply( const struct open_semaphore_reply *req )
1411
{
1412
    fprintf( stderr, " handle=%04x", req->handle );
1413 1414
}

1415
static void dump_create_file_request( const struct create_file_request *req )
1416
{
1417 1418 1419 1420 1421 1422 1423 1424
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", sharing=%08x", req->sharing );
    fprintf( stderr, ", create=%d", req->create );
    fprintf( stderr, ", options=%08x", req->options );
    fprintf( stderr, ", attrs=%08x", req->attrs );
    dump_varargs_object_attributes( ", objattr=", cur_size );
    dump_varargs_string( ", filename=", cur_size );
1425 1426
}

1427
static void dump_create_file_reply( const struct create_file_reply *req )
1428
{
1429
    fprintf( stderr, " handle=%04x", req->handle );
1430 1431
}

1432 1433
static void dump_open_file_object_request( const struct open_file_object_request *req )
{
1434 1435 1436 1437 1438 1439
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", rootdir=%04x", req->rootdir );
    fprintf( stderr, ", sharing=%08x", req->sharing );
    fprintf( stderr, ", options=%08x", req->options );
    dump_varargs_unicode_str( ", filename=", cur_size );
1440 1441 1442 1443
}

static void dump_open_file_object_reply( const struct open_file_object_reply *req )
{
1444
    fprintf( stderr, " handle=%04x", req->handle );
1445 1446
}

1447
static void dump_alloc_file_handle_request( const struct alloc_file_handle_request *req )
1448
{
1449 1450 1451
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", fd=%d", req->fd );
Alexandre Julliard's avatar
Alexandre Julliard committed
1452 1453
}

1454
static void dump_alloc_file_handle_reply( const struct alloc_file_handle_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1455
{
1456
    fprintf( stderr, " handle=%04x", req->handle );
1457 1458
}

1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469
static void dump_get_handle_unix_name_request( const struct get_handle_unix_name_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
}

static void dump_get_handle_unix_name_reply( const struct get_handle_unix_name_reply *req )
{
    fprintf( stderr, " name_len=%u", req->name_len );
    dump_varargs_string( ", name=", cur_size );
}

1470
static void dump_get_handle_fd_request( const struct get_handle_fd_request *req )
1471
{
1472
    fprintf( stderr, " handle=%04x", req->handle );
1473 1474
}

1475
static void dump_get_handle_fd_reply( const struct get_handle_fd_reply *req )
1476
{
1477 1478 1479 1480
    fprintf( stderr, " type=%d", req->type );
    fprintf( stderr, ", removable=%d", req->removable );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", options=%08x", req->options );
1481 1482
}

1483
static void dump_flush_file_request( const struct flush_file_request *req )
1484
{
1485
    fprintf( stderr, " handle=%04x", req->handle );
1486 1487
}

1488 1489
static void dump_flush_file_reply( const struct flush_file_reply *req )
{
1490
    fprintf( stderr, " event=%04x", req->event );
1491 1492
}

1493
static void dump_lock_file_request( const struct lock_file_request *req )
1494
{
1495 1496 1497 1498 1499
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", offset=", &req->offset );
    dump_uint64( ", count=", &req->count );
    fprintf( stderr, ", shared=%d", req->shared );
    fprintf( stderr, ", wait=%d", req->wait );
1500 1501 1502 1503
}

static void dump_lock_file_reply( const struct lock_file_reply *req )
{
1504 1505
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", overlapped=%d", req->overlapped );
1506 1507
}

1508
static void dump_unlock_file_request( const struct unlock_file_request *req )
1509
{
1510 1511 1512
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", offset=", &req->offset );
    dump_uint64( ", count=", &req->count );
1513 1514
}

1515
static void dump_create_socket_request( const struct create_socket_request *req )
1516
{
1517 1518 1519 1520 1521 1522
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", family=%d", req->family );
    fprintf( stderr, ", type=%d", req->type );
    fprintf( stderr, ", protocol=%d", req->protocol );
    fprintf( stderr, ", flags=%08x", req->flags );
1523 1524
}

1525
static void dump_create_socket_reply( const struct create_socket_reply *req )
1526
{
1527
    fprintf( stderr, " handle=%04x", req->handle );
1528 1529
}

1530
static void dump_accept_socket_request( const struct accept_socket_request *req )
1531
{
1532 1533 1534
    fprintf( stderr, " lhandle=%04x", req->lhandle );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
1535 1536
}

1537
static void dump_accept_socket_reply( const struct accept_socket_reply *req )
1538
{
1539
    fprintf( stderr, " handle=%04x", req->handle );
1540 1541
}

1542
static void dump_set_socket_event_request( const struct set_socket_event_request *req )
1543
{
1544 1545 1546 1547 1548
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", mask=%08x", req->mask );
    fprintf( stderr, ", event=%04x", req->event );
    fprintf( stderr, ", window=%08x", req->window );
    fprintf( stderr, ", msg=%08x", req->msg );
1549 1550
}

1551
static void dump_get_socket_event_request( const struct get_socket_event_request *req )
1552
{
1553 1554 1555
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", service=%d", req->service );
    fprintf( stderr, ", c_event=%04x", req->c_event );
1556 1557
}

1558
static void dump_get_socket_event_reply( const struct get_socket_event_reply *req )
1559
{
1560 1561 1562 1563
    fprintf( stderr, " mask=%08x", req->mask );
    fprintf( stderr, ", pmask=%08x", req->pmask );
    fprintf( stderr, ", state=%08x", req->state );
    dump_varargs_ints( ", errors=", cur_size );
1564 1565
}

1566
static void dump_enable_socket_event_request( const struct enable_socket_event_request *req )
1567
{
1568 1569 1570 1571
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", mask=%08x", req->mask );
    fprintf( stderr, ", sstate=%08x", req->sstate );
    fprintf( stderr, ", cstate=%08x", req->cstate );
1572 1573
}

1574 1575
static void dump_set_socket_deferred_request( const struct set_socket_deferred_request *req )
{
1576 1577
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", deferred=%04x", req->deferred );
1578 1579
}

1580
static void dump_alloc_console_request( const struct alloc_console_request *req )
1581
{
1582 1583 1584
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", pid=%04x", req->pid );
1585 1586
}

1587
static void dump_alloc_console_reply( const struct alloc_console_reply *req )
1588
{
1589 1590
    fprintf( stderr, " handle_in=%04x", req->handle_in );
    fprintf( stderr, ", event=%04x", req->event );
1591 1592
}

1593
static void dump_free_console_request( const struct free_console_request *req )
1594 1595 1596
{
}

1597 1598
static void dump_get_console_renderer_events_request( const struct get_console_renderer_events_request *req )
{
1599
    fprintf( stderr, " handle=%04x", req->handle );
1600 1601
}

1602
static void dump_get_console_renderer_events_reply( const struct get_console_renderer_events_reply *req )
1603
{
1604
    dump_varargs_bytes( " data=", cur_size );
1605 1606
}

1607
static void dump_open_console_request( const struct open_console_request *req )
1608
{
1609 1610 1611 1612
    fprintf( stderr, " from=%04x", req->from );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", share=%d", req->share );
1613 1614
}

1615
static void dump_open_console_reply( const struct open_console_reply *req )
1616
{
1617
    fprintf( stderr, " handle=%04x", req->handle );
1618 1619
}

1620 1621 1622 1623 1624 1625
static void dump_get_console_wait_event_request( const struct get_console_wait_event_request *req )
{
}

static void dump_get_console_wait_event_reply( const struct get_console_wait_event_reply *req )
{
1626
    fprintf( stderr, " handle=%04x", req->handle );
1627 1628
}

1629
static void dump_get_console_mode_request( const struct get_console_mode_request *req )
1630
{
1631
    fprintf( stderr, " handle=%04x", req->handle );
1632 1633
}

1634
static void dump_get_console_mode_reply( const struct get_console_mode_reply *req )
1635 1636 1637 1638
{
    fprintf( stderr, " mode=%d", req->mode );
}

1639
static void dump_set_console_mode_request( const struct set_console_mode_request *req )
1640
{
1641 1642
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", mode=%d", req->mode );
1643 1644
}

1645 1646
static void dump_set_console_input_info_request( const struct set_console_input_info_request *req )
{
1647 1648 1649 1650 1651 1652 1653 1654 1655 1656
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", mask=%d", req->mask );
    fprintf( stderr, ", active_sb=%04x", req->active_sb );
    fprintf( stderr, ", history_mode=%d", req->history_mode );
    fprintf( stderr, ", history_size=%d", req->history_size );
    fprintf( stderr, ", edition_mode=%d", req->edition_mode );
    fprintf( stderr, ", input_cp=%d", req->input_cp );
    fprintf( stderr, ", output_cp=%d", req->output_cp );
    fprintf( stderr, ", win=%08x", req->win );
    dump_varargs_unicode_str( ", title=", cur_size );
1657 1658 1659 1660
}

static void dump_get_console_input_info_request( const struct get_console_input_info_request *req )
{
1661
    fprintf( stderr, " handle=%04x", req->handle );
1662 1663
}

1664
static void dump_get_console_input_info_reply( const struct get_console_input_info_reply *req )
1665
{
1666 1667 1668 1669 1670 1671 1672 1673
    fprintf( stderr, " history_mode=%d", req->history_mode );
    fprintf( stderr, ", history_size=%d", req->history_size );
    fprintf( stderr, ", history_index=%d", req->history_index );
    fprintf( stderr, ", edition_mode=%d", req->edition_mode );
    fprintf( stderr, ", input_cp=%d", req->input_cp );
    fprintf( stderr, ", output_cp=%d", req->output_cp );
    fprintf( stderr, ", win=%08x", req->win );
    dump_varargs_unicode_str( ", title=", cur_size );
1674 1675 1676 1677
}

static void dump_append_console_input_history_request( const struct append_console_input_history_request *req )
{
1678 1679
    fprintf( stderr, " handle=%04x", req->handle );
    dump_varargs_unicode_str( ", line=", cur_size );
1680 1681 1682 1683
}

static void dump_get_console_input_history_request( const struct get_console_input_history_request *req )
{
1684 1685
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", index=%d", req->index );
1686 1687
}

1688
static void dump_get_console_input_history_reply( const struct get_console_input_history_reply *req )
1689
{
1690 1691
    fprintf( stderr, " total=%d", req->total );
    dump_varargs_unicode_str( ", line=", cur_size );
1692 1693 1694 1695
}

static void dump_create_console_output_request( const struct create_console_output_request *req )
{
1696 1697 1698 1699
    fprintf( stderr, " handle_in=%04x", req->handle_in );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", share=%08x", req->share );
1700 1701
}

1702
static void dump_create_console_output_reply( const struct create_console_output_reply *req )
1703
{
1704
    fprintf( stderr, " handle_out=%04x", req->handle_out );
1705 1706 1707
}

static void dump_set_console_output_info_request( const struct set_console_output_info_request *req )
1708
{
1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", mask=%d", req->mask );
    fprintf( stderr, ", cursor_size=%d", req->cursor_size );
    fprintf( stderr, ", cursor_visible=%d", req->cursor_visible );
    fprintf( stderr, ", cursor_x=%d", req->cursor_x );
    fprintf( stderr, ", cursor_y=%d", req->cursor_y );
    fprintf( stderr, ", width=%d", req->width );
    fprintf( stderr, ", height=%d", req->height );
    fprintf( stderr, ", attr=%d", req->attr );
    fprintf( stderr, ", win_left=%d", req->win_left );
    fprintf( stderr, ", win_top=%d", req->win_top );
    fprintf( stderr, ", win_right=%d", req->win_right );
    fprintf( stderr, ", win_bottom=%d", req->win_bottom );
    fprintf( stderr, ", max_width=%d", req->max_width );
    fprintf( stderr, ", max_height=%d", req->max_height );
1724 1725
}

1726
static void dump_get_console_output_info_request( const struct get_console_output_info_request *req )
1727
{
1728
    fprintf( stderr, " handle=%04x", req->handle );
1729 1730
}

1731
static void dump_get_console_output_info_reply( const struct get_console_output_info_reply *req )
1732
{
1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745
    fprintf( stderr, " cursor_size=%d", req->cursor_size );
    fprintf( stderr, ", cursor_visible=%d", req->cursor_visible );
    fprintf( stderr, ", cursor_x=%d", req->cursor_x );
    fprintf( stderr, ", cursor_y=%d", req->cursor_y );
    fprintf( stderr, ", width=%d", req->width );
    fprintf( stderr, ", height=%d", req->height );
    fprintf( stderr, ", attr=%d", req->attr );
    fprintf( stderr, ", win_left=%d", req->win_left );
    fprintf( stderr, ", win_top=%d", req->win_top );
    fprintf( stderr, ", win_right=%d", req->win_right );
    fprintf( stderr, ", win_bottom=%d", req->win_bottom );
    fprintf( stderr, ", max_width=%d", req->max_width );
    fprintf( stderr, ", max_height=%d", req->max_height );
1746 1747
}

1748
static void dump_write_console_input_request( const struct write_console_input_request *req )
1749
{
1750 1751
    fprintf( stderr, " handle=%04x", req->handle );
    dump_varargs_input_records( ", rec=", cur_size );
1752 1753
}

1754
static void dump_write_console_input_reply( const struct write_console_input_reply *req )
1755 1756 1757 1758
{
    fprintf( stderr, " written=%d", req->written );
}

1759
static void dump_read_console_input_request( const struct read_console_input_request *req )
1760
{
1761 1762
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", flush=%d", req->flush );
1763 1764
}

1765
static void dump_read_console_input_reply( const struct read_console_input_reply *req )
1766
{
1767 1768
    fprintf( stderr, " read=%d", req->read );
    dump_varargs_input_records( ", rec=", cur_size );
1769 1770
}

1771 1772
static void dump_write_console_output_request( const struct write_console_output_request *req )
{
1773 1774 1775 1776 1777 1778
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", x=%d", req->x );
    fprintf( stderr, ", y=%d", req->y );
    fprintf( stderr, ", mode=%d", req->mode );
    fprintf( stderr, ", wrap=%d", req->wrap );
    dump_varargs_bytes( ", data=", cur_size );
1779 1780 1781 1782
}

static void dump_write_console_output_reply( const struct write_console_output_reply *req )
{
1783 1784 1785
    fprintf( stderr, " written=%d", req->written );
    fprintf( stderr, ", width=%d", req->width );
    fprintf( stderr, ", height=%d", req->height );
1786 1787 1788 1789
}

static void dump_fill_console_output_request( const struct fill_console_output_request *req )
{
1790 1791 1792 1793 1794 1795 1796
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", x=%d", req->x );
    fprintf( stderr, ", y=%d", req->y );
    fprintf( stderr, ", mode=%d", req->mode );
    fprintf( stderr, ", count=%d", req->count );
    fprintf( stderr, ", wrap=%d", req->wrap );
    dump_char_info( ", data=", &req->data );
1797 1798
}

1799
static void dump_fill_console_output_reply( const struct fill_console_output_reply *req )
1800 1801 1802 1803 1804 1805
{
    fprintf( stderr, " written=%d", req->written );
}

static void dump_read_console_output_request( const struct read_console_output_request *req )
{
1806 1807 1808 1809 1810
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", x=%d", req->x );
    fprintf( stderr, ", y=%d", req->y );
    fprintf( stderr, ", mode=%d", req->mode );
    fprintf( stderr, ", wrap=%d", req->wrap );
1811 1812
}

1813
static void dump_read_console_output_reply( const struct read_console_output_reply *req )
1814
{
1815 1816 1817
    fprintf( stderr, " width=%d", req->width );
    fprintf( stderr, ", height=%d", req->height );
    dump_varargs_bytes( ", data=", cur_size );
1818 1819 1820 1821
}

static void dump_move_console_output_request( const struct move_console_output_request *req )
{
1822 1823 1824 1825 1826 1827 1828
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", x_src=%d", req->x_src );
    fprintf( stderr, ", y_src=%d", req->y_src );
    fprintf( stderr, ", x_dst=%d", req->x_dst );
    fprintf( stderr, ", y_dst=%d", req->y_dst );
    fprintf( stderr, ", w=%d", req->w );
    fprintf( stderr, ", h=%d", req->h );
1829 1830
}

1831 1832
static void dump_send_console_signal_request( const struct send_console_signal_request *req )
{
1833 1834
    fprintf( stderr, " signal=%d", req->signal );
    fprintf( stderr, ", group_id=%04x", req->group_id );
1835 1836
}

1837
static void dump_read_directory_changes_request( const struct read_directory_changes_request *req )
1838
{
1839 1840 1841 1842
    fprintf( stderr, " filter=%08x", req->filter );
    fprintf( stderr, ", subtree=%d", req->subtree );
    fprintf( stderr, ", want_data=%d", req->want_data );
    dump_async_data( ", async=", &req->async );
1843 1844 1845 1846
}

static void dump_read_change_request( const struct read_change_request *req )
{
1847
    fprintf( stderr, " handle=%04x", req->handle );
1848 1849 1850 1851
}

static void dump_read_change_reply( const struct read_change_reply *req )
{
1852 1853
    fprintf( stderr, " action=%d", req->action );
    dump_varargs_string( ", name=", cur_size );
1854 1855
}

1856
static void dump_create_mapping_request( const struct create_mapping_request *req )
1857
{
1858 1859 1860 1861 1862 1863
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", protect=%08x", req->protect );
    dump_uint64( ", size=", &req->size );
    fprintf( stderr, ", file_handle=%04x", req->file_handle );
    dump_varargs_object_attributes( ", objattr=", cur_size );
1864 1865
}

1866
static void dump_create_mapping_reply( const struct create_mapping_reply *req )
1867
{
1868
    fprintf( stderr, " handle=%04x", req->handle );
1869 1870
}

1871
static void dump_open_mapping_request( const struct open_mapping_request *req )
1872
{
1873 1874 1875 1876
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", rootdir=%04x", req->rootdir );
    dump_varargs_unicode_str( ", name=", cur_size );
1877 1878
}

1879
static void dump_open_mapping_reply( const struct open_mapping_reply *req )
1880
{
1881
    fprintf( stderr, " handle=%04x", req->handle );
1882 1883
}

1884
static void dump_get_mapping_info_request( const struct get_mapping_info_request *req )
1885
{
1886 1887
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", access=%08x", req->access );
1888 1889
}

1890
static void dump_get_mapping_info_reply( const struct get_mapping_info_reply *req )
1891
{
1892 1893 1894 1895 1896 1897
    dump_uint64( " size=", &req->size );
    fprintf( stderr, ", protect=%d", req->protect );
    fprintf( stderr, ", header_size=%d", req->header_size );
    dump_uint64( ", base=", &req->base );
    fprintf( stderr, ", mapping=%04x", req->mapping );
    fprintf( stderr, ", shared_file=%04x", req->shared_file );
1898 1899
}

1900 1901
static void dump_get_mapping_committed_range_request( const struct get_mapping_committed_range_request *req )
{
1902 1903
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", offset=", &req->offset );
1904 1905 1906 1907
}

static void dump_get_mapping_committed_range_reply( const struct get_mapping_committed_range_reply *req )
{
1908 1909
    dump_uint64( " size=", &req->size );
    fprintf( stderr, ", committed=%d", req->committed );
1910 1911 1912 1913
}

static void dump_add_mapping_committed_range_request( const struct add_mapping_committed_range_request *req )
{
1914 1915 1916
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", offset=", &req->offset );
    dump_uint64( ", size=", &req->size );
1917 1918
}

1919
static void dump_create_snapshot_request( const struct create_snapshot_request *req )
1920
{
1921 1922
    fprintf( stderr, " attributes=%08x", req->attributes );
    fprintf( stderr, ", flags=%08x", req->flags );
1923 1924
}

1925
static void dump_create_snapshot_reply( const struct create_snapshot_reply *req )
1926
{
1927
    fprintf( stderr, " handle=%04x", req->handle );
1928 1929
}

1930
static void dump_next_process_request( const struct next_process_request *req )
1931
{
1932 1933
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", reset=%d", req->reset );
1934 1935
}

1936
static void dump_next_process_reply( const struct next_process_reply *req )
1937
{
1938 1939 1940 1941 1942 1943 1944
    fprintf( stderr, " count=%d", req->count );
    fprintf( stderr, ", pid=%04x", req->pid );
    fprintf( stderr, ", ppid=%04x", req->ppid );
    fprintf( stderr, ", threads=%d", req->threads );
    fprintf( stderr, ", priority=%d", req->priority );
    fprintf( stderr, ", handles=%d", req->handles );
    dump_varargs_unicode_str( ", filename=", cur_size );
1945 1946
}

1947 1948
static void dump_next_thread_request( const struct next_thread_request *req )
{
1949 1950
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", reset=%d", req->reset );
1951 1952
}

1953
static void dump_next_thread_reply( const struct next_thread_reply *req )
1954
{
1955 1956 1957 1958 1959
    fprintf( stderr, " count=%d", req->count );
    fprintf( stderr, ", pid=%04x", req->pid );
    fprintf( stderr, ", tid=%04x", req->tid );
    fprintf( stderr, ", base_pri=%d", req->base_pri );
    fprintf( stderr, ", delta_pri=%d", req->delta_pri );
1960 1961
}

1962
static void dump_wait_debug_event_request( const struct wait_debug_event_request *req )
1963
{
1964
    fprintf( stderr, " get_handle=%d", req->get_handle );
1965 1966
}

1967
static void dump_wait_debug_event_reply( const struct wait_debug_event_reply *req )
1968
{
1969 1970 1971 1972
    fprintf( stderr, " pid=%04x", req->pid );
    fprintf( stderr, ", tid=%04x", req->tid );
    fprintf( stderr, ", wait=%04x", req->wait );
    dump_varargs_debug_event( ", event=", cur_size );
1973 1974
}

1975
static void dump_queue_exception_event_request( const struct queue_exception_event_request *req )
1976
{
1977 1978 1979 1980 1981 1982 1983 1984
    fprintf( stderr, " first=%d", req->first );
    fprintf( stderr, ", code=%08x", req->code );
    fprintf( stderr, ", flags=%08x", req->flags );
    dump_uint64( ", record=", &req->record );
    dump_uint64( ", address=", &req->address );
    fprintf( stderr, ", len=%u", req->len );
    dump_varargs_uints64( ", params=", min(cur_size,req->len) );
    dump_varargs_context( ", context=", cur_size );
1985 1986
}

1987
static void dump_queue_exception_event_reply( const struct queue_exception_event_reply *req )
1988
{
1989
    fprintf( stderr, " handle=%04x", req->handle );
1990 1991 1992 1993
}

static void dump_get_exception_status_request( const struct get_exception_status_request *req )
{
1994
    fprintf( stderr, " handle=%04x", req->handle );
1995 1996
}

1997
static void dump_get_exception_status_reply( const struct get_exception_status_reply *req )
1998
{
1999
    dump_varargs_context( " context=", cur_size );
2000 2001
}

2002 2003
static void dump_output_debug_string_request( const struct output_debug_string_request *req )
{
2004 2005
    fprintf( stderr, " length=%u", req->length );
    dump_uint64( ", string=", &req->string );
2006 2007
}

2008
static void dump_continue_debug_event_request( const struct continue_debug_event_request *req )
2009
{
2010 2011 2012
    fprintf( stderr, " pid=%04x", req->pid );
    fprintf( stderr, ", tid=%04x", req->tid );
    fprintf( stderr, ", status=%d", req->status );
2013 2014
}

2015
static void dump_debug_process_request( const struct debug_process_request *req )
2016
{
2017 2018
    fprintf( stderr, " pid=%04x", req->pid );
    fprintf( stderr, ", attach=%d", req->attach );
2019 2020
}

2021 2022
static void dump_debug_break_request( const struct debug_break_request *req )
{
2023
    fprintf( stderr, " handle=%04x", req->handle );
2024 2025 2026 2027 2028 2029 2030
}

static void dump_debug_break_reply( const struct debug_break_reply *req )
{
    fprintf( stderr, " self=%d", req->self );
}

2031 2032 2033
static void dump_set_debugger_kill_on_exit_request( const struct set_debugger_kill_on_exit_request *req )
{
    fprintf( stderr, " kill_on_exit=%d", req->kill_on_exit );
2034
}
2035

2036
static void dump_read_process_memory_request( const struct read_process_memory_request *req )
2037
{
2038 2039
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", addr=", &req->addr );
2040 2041
}

2042
static void dump_read_process_memory_reply( const struct read_process_memory_reply *req )
2043
{
2044
    dump_varargs_bytes( " data=", cur_size );
2045 2046
}

2047
static void dump_write_process_memory_request( const struct write_process_memory_request *req )
2048
{
2049 2050 2051
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", addr=", &req->addr );
    dump_varargs_bytes( ", data=", cur_size );
2052 2053
}

2054
static void dump_create_key_request( const struct create_key_request *req )
2055
{
2056 2057 2058 2059 2060 2061 2062
    fprintf( stderr, " parent=%04x", req->parent );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", options=%08x", req->options );
    fprintf( stderr, ", namelen=%u", req->namelen );
    dump_varargs_unicode_str( ", name=", min(cur_size,req->namelen) );
    dump_varargs_unicode_str( ", class=", cur_size );
2063 2064
}

2065
static void dump_create_key_reply( const struct create_key_reply *req )
2066
{
2067 2068
    fprintf( stderr, " hkey=%04x", req->hkey );
    fprintf( stderr, ", created=%d", req->created );
2069 2070
}

2071
static void dump_open_key_request( const struct open_key_request *req )
2072
{
2073 2074 2075 2076
    fprintf( stderr, " parent=%04x", req->parent );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    dump_varargs_unicode_str( ", name=", cur_size );
2077 2078
}

2079
static void dump_open_key_reply( const struct open_key_reply *req )
2080
{
2081
    fprintf( stderr, " hkey=%04x", req->hkey );
2082 2083
}

2084
static void dump_delete_key_request( const struct delete_key_request *req )
2085
{
2086
    fprintf( stderr, " hkey=%04x", req->hkey );
2087 2088
}

2089 2090
static void dump_flush_key_request( const struct flush_key_request *req )
{
2091
    fprintf( stderr, " hkey=%04x", req->hkey );
2092 2093
}

2094
static void dump_enum_key_request( const struct enum_key_request *req )
2095
{
2096 2097 2098
    fprintf( stderr, " hkey=%04x", req->hkey );
    fprintf( stderr, ", index=%d", req->index );
    fprintf( stderr, ", info_class=%d", req->info_class );
2099 2100
}

2101
static void dump_enum_key_reply( const struct enum_key_reply *req )
2102
{
2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113
    fprintf( stderr, " subkeys=%d", req->subkeys );
    fprintf( stderr, ", max_subkey=%d", req->max_subkey );
    fprintf( stderr, ", max_class=%d", req->max_class );
    fprintf( stderr, ", values=%d", req->values );
    fprintf( stderr, ", max_value=%d", req->max_value );
    fprintf( stderr, ", max_data=%d", req->max_data );
    dump_timeout( ", modif=", &req->modif );
    fprintf( stderr, ", total=%u", req->total );
    fprintf( stderr, ", namelen=%u", req->namelen );
    dump_varargs_unicode_str( ", name=", min(cur_size,req->namelen) );
    dump_varargs_unicode_str( ", class=", cur_size );
2114 2115
}

2116
static void dump_set_key_value_request( const struct set_key_value_request *req )
2117
{
2118 2119 2120 2121 2122
    fprintf( stderr, " hkey=%04x", req->hkey );
    fprintf( stderr, ", type=%d", req->type );
    fprintf( stderr, ", namelen=%u", req->namelen );
    dump_varargs_unicode_str( ", name=", min(cur_size,req->namelen) );
    dump_varargs_bytes( ", data=", cur_size );
2123 2124
}

2125
static void dump_get_key_value_request( const struct get_key_value_request *req )
2126
{
2127 2128
    fprintf( stderr, " hkey=%04x", req->hkey );
    dump_varargs_unicode_str( ", name=", cur_size );
2129 2130
}

2131
static void dump_get_key_value_reply( const struct get_key_value_reply *req )
2132
{
2133 2134 2135
    fprintf( stderr, " type=%d", req->type );
    fprintf( stderr, ", total=%u", req->total );
    dump_varargs_bytes( ", data=", cur_size );
2136 2137
}

2138
static void dump_enum_key_value_request( const struct enum_key_value_request *req )
2139
{
2140 2141 2142
    fprintf( stderr, " hkey=%04x", req->hkey );
    fprintf( stderr, ", index=%d", req->index );
    fprintf( stderr, ", info_class=%d", req->info_class );
2143 2144
}

2145
static void dump_enum_key_value_reply( const struct enum_key_value_reply *req )
2146
{
2147 2148 2149 2150 2151
    fprintf( stderr, " type=%d", req->type );
    fprintf( stderr, ", total=%u", req->total );
    fprintf( stderr, ", namelen=%u", req->namelen );
    dump_varargs_unicode_str( ", name=", min(cur_size,req->namelen) );
    dump_varargs_bytes( ", data=", cur_size );
2152 2153
}

2154
static void dump_delete_key_value_request( const struct delete_key_value_request *req )
2155
{
2156 2157
    fprintf( stderr, " hkey=%04x", req->hkey );
    dump_varargs_unicode_str( ", name=", cur_size );
2158 2159
}

2160
static void dump_load_registry_request( const struct load_registry_request *req )
2161
{
2162 2163 2164
    fprintf( stderr, " hkey=%04x", req->hkey );
    fprintf( stderr, ", file=%04x", req->file );
    dump_varargs_unicode_str( ", name=", cur_size );
2165 2166
}

2167 2168
static void dump_unload_registry_request( const struct unload_registry_request *req )
{
2169
    fprintf( stderr, " hkey=%04x", req->hkey );
2170 2171
}

2172
static void dump_save_registry_request( const struct save_registry_request *req )
2173
{
2174 2175
    fprintf( stderr, " hkey=%04x", req->hkey );
    fprintf( stderr, ", file=%04x", req->file );
2176 2177
}

2178 2179
static void dump_set_registry_notification_request( const struct set_registry_notification_request *req )
{
2180 2181 2182 2183
    fprintf( stderr, " hkey=%04x", req->hkey );
    fprintf( stderr, ", event=%04x", req->event );
    fprintf( stderr, ", subtree=%d", req->subtree );
    fprintf( stderr, ", filter=%08x", req->filter );
2184 2185
}

2186
static void dump_create_timer_request( const struct create_timer_request *req )
2187
{
2188 2189 2190 2191 2192
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", rootdir=%04x", req->rootdir );
    fprintf( stderr, ", manual=%d", req->manual );
    dump_varargs_unicode_str( ", name=", cur_size );
2193 2194
}

2195
static void dump_create_timer_reply( const struct create_timer_reply *req )
2196
{
2197
    fprintf( stderr, " handle=%04x", req->handle );
2198 2199
}

2200
static void dump_open_timer_request( const struct open_timer_request *req )
2201
{
2202 2203 2204 2205
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", rootdir=%04x", req->rootdir );
    dump_varargs_unicode_str( ", name=", cur_size );
2206 2207
}

2208
static void dump_open_timer_reply( const struct open_timer_reply *req )
2209
{
2210
    fprintf( stderr, " handle=%04x", req->handle );
2211 2212
}

2213
static void dump_set_timer_request( const struct set_timer_request *req )
2214
{
2215 2216 2217 2218 2219
    fprintf( stderr, " handle=%04x", req->handle );
    dump_timeout( ", expire=", &req->expire );
    dump_uint64( ", callback=", &req->callback );
    dump_uint64( ", arg=", &req->arg );
    fprintf( stderr, ", period=%d", req->period );
2220 2221
}

2222 2223 2224 2225 2226
static void dump_set_timer_reply( const struct set_timer_reply *req )
{
    fprintf( stderr, " signaled=%d", req->signaled );
}

2227
static void dump_cancel_timer_request( const struct cancel_timer_request *req )
2228
{
2229
    fprintf( stderr, " handle=%04x", req->handle );
2230 2231
}

2232 2233 2234 2235 2236
static void dump_cancel_timer_reply( const struct cancel_timer_reply *req )
{
    fprintf( stderr, " signaled=%d", req->signaled );
}

2237 2238
static void dump_get_timer_info_request( const struct get_timer_info_request *req )
{
2239
    fprintf( stderr, " handle=%04x", req->handle );
2240 2241 2242 2243
}

static void dump_get_timer_info_reply( const struct get_timer_info_reply *req )
{
2244 2245
    dump_timeout( " when=", &req->when );
    fprintf( stderr, ", signaled=%d", req->signaled );
2246 2247
}

2248 2249
static void dump_get_thread_context_request( const struct get_thread_context_request *req )
{
2250 2251 2252
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", flags=%08x", req->flags );
    fprintf( stderr, ", suspend=%d", req->suspend );
2253 2254
}

2255
static void dump_get_thread_context_reply( const struct get_thread_context_reply *req )
2256
{
2257 2258
    fprintf( stderr, " self=%d", req->self );
    dump_varargs_context( ", context=", cur_size );
2259 2260 2261 2262
}

static void dump_set_thread_context_request( const struct set_thread_context_request *req )
{
2263 2264 2265
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", suspend=%d", req->suspend );
    dump_varargs_context( ", context=", cur_size );
2266 2267
}

2268 2269 2270 2271 2272
static void dump_set_thread_context_reply( const struct set_thread_context_reply *req )
{
    fprintf( stderr, " self=%d", req->self );
}

2273 2274
static void dump_get_selector_entry_request( const struct get_selector_entry_request *req )
{
2275 2276
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", entry=%d", req->entry );
2277 2278
}

2279
static void dump_get_selector_entry_reply( const struct get_selector_entry_reply *req )
2280
{
2281 2282 2283
    fprintf( stderr, " base=%08x", req->base );
    fprintf( stderr, ", limit=%08x", req->limit );
    fprintf( stderr, ", flags=%02x", req->flags );
2284 2285
}

2286 2287
static void dump_add_atom_request( const struct add_atom_request *req )
{
2288 2289
    fprintf( stderr, " table=%04x", req->table );
    dump_varargs_unicode_str( ", name=", cur_size );
2290 2291
}

2292
static void dump_add_atom_reply( const struct add_atom_reply *req )
2293
{
2294
    fprintf( stderr, " atom=%04x", req->atom );
2295 2296 2297 2298
}

static void dump_delete_atom_request( const struct delete_atom_request *req )
{
2299 2300
    fprintf( stderr, " table=%04x", req->table );
    fprintf( stderr, ", atom=%04x", req->atom );
2301 2302 2303 2304
}

static void dump_find_atom_request( const struct find_atom_request *req )
{
2305 2306
    fprintf( stderr, " table=%04x", req->table );
    dump_varargs_unicode_str( ", name=", cur_size );
2307 2308
}

2309
static void dump_find_atom_reply( const struct find_atom_reply *req )
2310
{
2311
    fprintf( stderr, " atom=%04x", req->atom );
2312 2313
}

2314
static void dump_get_atom_information_request( const struct get_atom_information_request *req )
2315
{
2316 2317
    fprintf( stderr, " table=%04x", req->table );
    fprintf( stderr, ", atom=%04x", req->atom );
2318 2319
}

2320
static void dump_get_atom_information_reply( const struct get_atom_information_reply *req )
2321
{
2322 2323 2324 2325
    fprintf( stderr, " count=%d", req->count );
    fprintf( stderr, ", pinned=%d", req->pinned );
    fprintf( stderr, ", total=%u", req->total );
    dump_varargs_unicode_str( ", name=", cur_size );
2326 2327
}

2328 2329
static void dump_set_atom_information_request( const struct set_atom_information_request *req )
{
2330 2331 2332
    fprintf( stderr, " table=%04x", req->table );
    fprintf( stderr, ", atom=%04x", req->atom );
    fprintf( stderr, ", pinned=%d", req->pinned );
2333 2334 2335 2336
}

static void dump_empty_atom_table_request( const struct empty_atom_table_request *req )
{
2337 2338
    fprintf( stderr, " table=%04x", req->table );
    fprintf( stderr, ", if_pinned=%d", req->if_pinned );
2339 2340
}

2341 2342 2343 2344 2345
static void dump_init_atom_table_request( const struct init_atom_table_request *req )
{
    fprintf( stderr, " entries=%d", req->entries );
}

2346 2347
static void dump_init_atom_table_reply( const struct init_atom_table_reply *req )
{
2348
    fprintf( stderr, " table=%04x", req->table );
2349 2350
}

2351 2352 2353 2354
static void dump_get_msg_queue_request( const struct get_msg_queue_request *req )
{
}

2355
static void dump_get_msg_queue_reply( const struct get_msg_queue_reply *req )
2356
{
2357
    fprintf( stderr, " handle=%04x", req->handle );
2358 2359
}

2360 2361
static void dump_set_queue_fd_request( const struct set_queue_fd_request *req )
{
2362
    fprintf( stderr, " handle=%04x", req->handle );
2363 2364
}

2365 2366
static void dump_set_queue_mask_request( const struct set_queue_mask_request *req )
{
2367 2368 2369
    fprintf( stderr, " wake_mask=%08x", req->wake_mask );
    fprintf( stderr, ", changed_mask=%08x", req->changed_mask );
    fprintf( stderr, ", skip_wait=%d", req->skip_wait );
2370 2371
}

2372
static void dump_set_queue_mask_reply( const struct set_queue_mask_reply *req )
2373
{
2374 2375
    fprintf( stderr, " wake_bits=%08x", req->wake_bits );
    fprintf( stderr, ", changed_bits=%08x", req->changed_bits );
2376 2377 2378 2379 2380 2381 2382
}

static void dump_get_queue_status_request( const struct get_queue_status_request *req )
{
    fprintf( stderr, " clear=%d", req->clear );
}

2383
static void dump_get_queue_status_reply( const struct get_queue_status_reply *req )
2384
{
2385 2386
    fprintf( stderr, " wake_bits=%08x", req->wake_bits );
    fprintf( stderr, ", changed_bits=%08x", req->changed_bits );
2387 2388
}

2389
static void dump_get_process_idle_event_request( const struct get_process_idle_event_request *req )
2390
{
2391
    fprintf( stderr, " handle=%04x", req->handle );
2392 2393
}

2394
static void dump_get_process_idle_event_reply( const struct get_process_idle_event_reply *req )
2395
{
2396
    fprintf( stderr, " event=%04x", req->event );
2397 2398
}

2399 2400
static void dump_send_message_request( const struct send_message_request *req )
{
2401 2402 2403 2404 2405 2406 2407 2408 2409
    fprintf( stderr, " id=%04x", req->id );
    fprintf( stderr, ", type=%d", req->type );
    fprintf( stderr, ", flags=%d", req->flags );
    fprintf( stderr, ", win=%08x", req->win );
    fprintf( stderr, ", msg=%08x", req->msg );
    dump_uint64( ", wparam=", &req->wparam );
    dump_uint64( ", lparam=", &req->lparam );
    dump_timeout( ", timeout=", &req->timeout );
    dump_varargs_message_data( ", data=", cur_size );
2410 2411
}

2412 2413 2414 2415 2416
static void dump_post_quit_message_request( const struct post_quit_message_request *req )
{
    fprintf( stderr, " exit_code=%d", req->exit_code );
}

2417 2418
static void dump_send_hardware_message_request( const struct send_hardware_message_request *req )
{
2419 2420 2421 2422 2423 2424 2425 2426 2427
    fprintf( stderr, " id=%04x", req->id );
    fprintf( stderr, ", win=%08x", req->win );
    fprintf( stderr, ", msg=%08x", req->msg );
    dump_uint64( ", wparam=", &req->wparam );
    dump_uint64( ", lparam=", &req->lparam );
    dump_uint64( ", info=", &req->info );
    fprintf( stderr, ", x=%d", req->x );
    fprintf( stderr, ", y=%d", req->y );
    fprintf( stderr, ", time=%08x", req->time );
2428 2429
}

2430 2431 2432 2433 2434 2435
static void dump_send_hardware_message_reply( const struct send_hardware_message_reply *req )
{
    fprintf( stderr, " cursor=%08x", req->cursor );
    fprintf( stderr, ", count=%d", req->count );
}

2436 2437
static void dump_get_message_request( const struct get_message_request *req )
{
2438 2439 2440 2441 2442 2443 2444
    fprintf( stderr, " flags=%08x", req->flags );
    fprintf( stderr, ", get_win=%08x", req->get_win );
    fprintf( stderr, ", get_first=%08x", req->get_first );
    fprintf( stderr, ", get_last=%08x", req->get_last );
    fprintf( stderr, ", hw_id=%08x", req->hw_id );
    fprintf( stderr, ", wake_mask=%08x", req->wake_mask );
    fprintf( stderr, ", changed_mask=%08x", req->changed_mask );
2445 2446
}

2447
static void dump_get_message_reply( const struct get_message_reply *req )
2448
{
2449 2450 2451 2452 2453 2454 2455 2456 2457
    fprintf( stderr, " win=%08x", req->win );
    fprintf( stderr, ", msg=%08x", req->msg );
    dump_uint64( ", wparam=", &req->wparam );
    dump_uint64( ", lparam=", &req->lparam );
    fprintf( stderr, ", type=%d", req->type );
    fprintf( stderr, ", time=%08x", req->time );
    fprintf( stderr, ", active_hooks=%08x", req->active_hooks );
    fprintf( stderr, ", total=%u", req->total );
    dump_varargs_message_data( ", data=", cur_size );
2458 2459 2460 2461
}

static void dump_reply_message_request( const struct reply_message_request *req )
{
2462 2463 2464
    fprintf( stderr, " remove=%d", req->remove );
    dump_uint64( ", result=", &req->result );
    dump_varargs_bytes( ", data=", cur_size );
2465 2466
}

2467 2468
static void dump_accept_hardware_message_request( const struct accept_hardware_message_request *req )
{
2469 2470 2471
    fprintf( stderr, " hw_id=%08x", req->hw_id );
    fprintf( stderr, ", remove=%d", req->remove );
    fprintf( stderr, ", new_win=%08x", req->new_win );
2472 2473
}

2474 2475 2476 2477 2478
static void dump_get_message_reply_request( const struct get_message_reply_request *req )
{
    fprintf( stderr, " cancel=%d", req->cancel );
}

2479
static void dump_get_message_reply_reply( const struct get_message_reply_reply *req )
2480
{
2481 2482
    dump_uint64( " result=", &req->result );
    dump_varargs_bytes( ", data=", cur_size );
2483 2484 2485 2486
}

static void dump_set_win_timer_request( const struct set_win_timer_request *req )
{
2487 2488 2489 2490 2491
    fprintf( stderr, " win=%08x", req->win );
    fprintf( stderr, ", msg=%08x", req->msg );
    fprintf( stderr, ", rate=%08x", req->rate );
    dump_uint64( ", id=", &req->id );
    dump_uint64( ", lparam=", &req->lparam );
2492 2493
}

2494 2495
static void dump_set_win_timer_reply( const struct set_win_timer_reply *req )
{
2496
    dump_uint64( " id=", &req->id );
2497 2498
}

2499 2500
static void dump_kill_win_timer_request( const struct kill_win_timer_request *req )
{
2501 2502 2503
    fprintf( stderr, " win=%08x", req->win );
    dump_uint64( ", id=", &req->id );
    fprintf( stderr, ", msg=%08x", req->msg );
2504 2505
}

2506 2507
static void dump_is_window_hung_request( const struct is_window_hung_request *req )
{
2508
    fprintf( stderr, " win=%08x", req->win );
2509 2510 2511 2512 2513 2514 2515
}

static void dump_is_window_hung_reply( const struct is_window_hung_reply *req )
{
    fprintf( stderr, " is_hung=%d", req->is_hung );
}

2516 2517
static void dump_get_serial_info_request( const struct get_serial_info_request *req )
{
2518
    fprintf( stderr, " handle=%04x", req->handle );
2519 2520
}

2521
static void dump_get_serial_info_reply( const struct get_serial_info_reply *req )
2522
{
2523 2524 2525 2526 2527 2528
    fprintf( stderr, " readinterval=%08x", req->readinterval );
    fprintf( stderr, ", readconst=%08x", req->readconst );
    fprintf( stderr, ", readmult=%08x", req->readmult );
    fprintf( stderr, ", writeconst=%08x", req->writeconst );
    fprintf( stderr, ", writemult=%08x", req->writemult );
    fprintf( stderr, ", eventmask=%08x", req->eventmask );
2529 2530 2531 2532
}

static void dump_set_serial_info_request( const struct set_serial_info_request *req )
{
2533 2534 2535 2536 2537 2538 2539 2540
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", flags=%d", req->flags );
    fprintf( stderr, ", readinterval=%08x", req->readinterval );
    fprintf( stderr, ", readconst=%08x", req->readconst );
    fprintf( stderr, ", readmult=%08x", req->readmult );
    fprintf( stderr, ", writeconst=%08x", req->writeconst );
    fprintf( stderr, ", writemult=%08x", req->writemult );
    fprintf( stderr, ", eventmask=%08x", req->eventmask );
2541 2542
}

2543
static void dump_register_async_request( const struct register_async_request *req )
2544
{
2545 2546 2547
    fprintf( stderr, " type=%d", req->type );
    dump_async_data( ", async=", &req->async );
    fprintf( stderr, ", count=%d", req->count );
2548 2549 2550 2551
}

static void dump_cancel_async_request( const struct cancel_async_request *req )
{
2552
    fprintf( stderr, " handle=%04x", req->handle );
2553 2554
    dump_uint64( ", iosb=", &req->iosb );
    fprintf( stderr, ", only_thread=%d", req->only_thread );
2555 2556
}

2557 2558
static void dump_ioctl_request( const struct ioctl_request *req )
{
2559 2560 2561 2562
    dump_ioctl_code( " code=", &req->code );
    dump_async_data( ", async=", &req->async );
    fprintf( stderr, ", blocking=%d", req->blocking );
    dump_varargs_bytes( ", in_data=", cur_size );
2563 2564 2565 2566
}

static void dump_ioctl_reply( const struct ioctl_reply *req )
{
2567 2568 2569
    fprintf( stderr, " wait=%04x", req->wait );
    fprintf( stderr, ", options=%08x", req->options );
    dump_varargs_bytes( ", out_data=", cur_size );
2570 2571
}

2572 2573
static void dump_get_ioctl_result_request( const struct get_ioctl_result_request *req )
{
2574 2575
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", user_arg=", &req->user_arg );
2576 2577 2578 2579
}

static void dump_get_ioctl_result_reply( const struct get_ioctl_result_reply *req )
{
2580
    dump_varargs_bytes( " out_data=", cur_size );
2581 2582
}

2583 2584
static void dump_create_named_pipe_request( const struct create_named_pipe_request *req )
{
2585 2586 2587 2588 2589 2590 2591 2592 2593 2594
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", rootdir=%04x", req->rootdir );
    fprintf( stderr, ", options=%08x", req->options );
    fprintf( stderr, ", maxinstances=%08x", req->maxinstances );
    fprintf( stderr, ", outsize=%08x", req->outsize );
    fprintf( stderr, ", insize=%08x", req->insize );
    dump_timeout( ", timeout=", &req->timeout );
    fprintf( stderr, ", flags=%08x", req->flags );
    dump_varargs_unicode_str( ", name=", cur_size );
2595 2596
}

2597
static void dump_create_named_pipe_reply( const struct create_named_pipe_reply *req )
2598
{
2599
    fprintf( stderr, " handle=%04x", req->handle );
2600 2601
}

2602 2603
static void dump_get_named_pipe_info_request( const struct get_named_pipe_info_request *req )
{
2604
    fprintf( stderr, " handle=%04x", req->handle );
2605 2606
}

2607
static void dump_get_named_pipe_info_reply( const struct get_named_pipe_info_reply *req )
2608
{
2609 2610 2611 2612 2613
    fprintf( stderr, " flags=%08x", req->flags );
    fprintf( stderr, ", maxinstances=%08x", req->maxinstances );
    fprintf( stderr, ", instances=%08x", req->instances );
    fprintf( stderr, ", outsize=%08x", req->outsize );
    fprintf( stderr, ", insize=%08x", req->insize );
2614 2615
}

2616 2617
static void dump_create_window_request( const struct create_window_request *req )
{
2618 2619 2620 2621 2622
    fprintf( stderr, " parent=%08x", req->parent );
    fprintf( stderr, ", owner=%08x", req->owner );
    fprintf( stderr, ", atom=%04x", req->atom );
    dump_uint64( ", instance=", &req->instance );
    dump_varargs_unicode_str( ", class=", cur_size );
2623 2624
}

2625
static void dump_create_window_reply( const struct create_window_reply *req )
2626
{
2627 2628 2629 2630 2631
    fprintf( stderr, " handle=%08x", req->handle );
    fprintf( stderr, ", parent=%08x", req->parent );
    fprintf( stderr, ", owner=%08x", req->owner );
    fprintf( stderr, ", extra=%d", req->extra );
    dump_uint64( ", class_ptr=", &req->class_ptr );
2632 2633 2634 2635
}

static void dump_destroy_window_request( const struct destroy_window_request *req )
{
2636
    fprintf( stderr, " handle=%08x", req->handle );
2637 2638
}

2639 2640
static void dump_get_desktop_window_request( const struct get_desktop_window_request *req )
{
2641
    fprintf( stderr, " force=%d", req->force );
2642 2643 2644 2645
}

static void dump_get_desktop_window_reply( const struct get_desktop_window_reply *req )
{
2646 2647
    fprintf( stderr, " top_window=%08x", req->top_window );
    fprintf( stderr, ", msg_window=%08x", req->msg_window );
2648 2649
}

2650 2651
static void dump_set_window_owner_request( const struct set_window_owner_request *req )
{
2652 2653
    fprintf( stderr, " handle=%08x", req->handle );
    fprintf( stderr, ", owner=%08x", req->owner );
2654 2655
}

2656
static void dump_set_window_owner_reply( const struct set_window_owner_reply *req )
2657
{
2658 2659
    fprintf( stderr, " full_owner=%08x", req->full_owner );
    fprintf( stderr, ", prev_owner=%08x", req->prev_owner );
2660 2661
}

2662 2663
static void dump_get_window_info_request( const struct get_window_info_request *req )
{
2664
    fprintf( stderr, " handle=%08x", req->handle );
2665 2666
}

2667
static void dump_get_window_info_reply( const struct get_window_info_reply *req )
2668
{
2669 2670 2671 2672 2673 2674
    fprintf( stderr, " full_handle=%08x", req->full_handle );
    fprintf( stderr, ", last_active=%08x", req->last_active );
    fprintf( stderr, ", pid=%04x", req->pid );
    fprintf( stderr, ", tid=%04x", req->tid );
    fprintf( stderr, ", atom=%04x", req->atom );
    fprintf( stderr, ", is_unicode=%d", req->is_unicode );
2675 2676 2677 2678
}

static void dump_set_window_info_request( const struct set_window_info_request *req )
{
2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689
    fprintf( stderr, " flags=%04x", req->flags );
    fprintf( stderr, ", is_unicode=%d", req->is_unicode );
    fprintf( stderr, ", handle=%08x", req->handle );
    fprintf( stderr, ", style=%08x", req->style );
    fprintf( stderr, ", ex_style=%08x", req->ex_style );
    fprintf( stderr, ", id=%08x", req->id );
    dump_uint64( ", instance=", &req->instance );
    dump_uint64( ", user_data=", &req->user_data );
    fprintf( stderr, ", extra_offset=%d", req->extra_offset );
    fprintf( stderr, ", extra_size=%u", req->extra_size );
    dump_uint64( ", extra_value=", &req->extra_value );
2690 2691
}

2692
static void dump_set_window_info_reply( const struct set_window_info_reply *req )
2693
{
2694 2695 2696 2697 2698 2699
    fprintf( stderr, " old_style=%08x", req->old_style );
    fprintf( stderr, ", old_ex_style=%08x", req->old_ex_style );
    dump_uint64( ", old_instance=", &req->old_instance );
    dump_uint64( ", old_user_data=", &req->old_user_data );
    dump_uint64( ", old_extra_value=", &req->old_extra_value );
    fprintf( stderr, ", old_id=%08x", req->old_id );
2700 2701
}

2702 2703
static void dump_set_parent_request( const struct set_parent_request *req )
{
2704 2705
    fprintf( stderr, " handle=%08x", req->handle );
    fprintf( stderr, ", parent=%08x", req->parent );
2706 2707 2708 2709
}

static void dump_set_parent_reply( const struct set_parent_reply *req )
{
2710 2711
    fprintf( stderr, " old_parent=%08x", req->old_parent );
    fprintf( stderr, ", full_parent=%08x", req->full_parent );
2712 2713
}

2714 2715
static void dump_get_window_parents_request( const struct get_window_parents_request *req )
{
2716
    fprintf( stderr, " handle=%08x", req->handle );
2717 2718
}

2719
static void dump_get_window_parents_reply( const struct get_window_parents_reply *req )
2720
{
2721 2722
    fprintf( stderr, " count=%d", req->count );
    dump_varargs_user_handles( ", parents=", cur_size );
2723 2724 2725 2726
}

static void dump_get_window_children_request( const struct get_window_children_request *req )
{
2727 2728 2729 2730 2731
    fprintf( stderr, " desktop=%04x", req->desktop );
    fprintf( stderr, ", parent=%08x", req->parent );
    fprintf( stderr, ", atom=%04x", req->atom );
    fprintf( stderr, ", tid=%04x", req->tid );
    dump_varargs_unicode_str( ", class=", cur_size );
2732 2733
}

2734
static void dump_get_window_children_reply( const struct get_window_children_reply *req )
2735
{
2736 2737
    fprintf( stderr, " count=%d", req->count );
    dump_varargs_user_handles( ", children=", cur_size );
2738 2739
}

2740 2741
static void dump_get_window_children_from_point_request( const struct get_window_children_from_point_request *req )
{
2742 2743 2744
    fprintf( stderr, " parent=%08x", req->parent );
    fprintf( stderr, ", x=%d", req->x );
    fprintf( stderr, ", y=%d", req->y );
2745 2746 2747 2748
}

static void dump_get_window_children_from_point_reply( const struct get_window_children_from_point_reply *req )
{
2749 2750
    fprintf( stderr, " count=%d", req->count );
    dump_varargs_user_handles( ", children=", cur_size );
2751 2752
}

2753 2754
static void dump_get_window_tree_request( const struct get_window_tree_request *req )
{
2755
    fprintf( stderr, " handle=%08x", req->handle );
2756 2757
}

2758
static void dump_get_window_tree_reply( const struct get_window_tree_reply *req )
2759
{
2760 2761 2762 2763 2764 2765 2766 2767
    fprintf( stderr, " parent=%08x", req->parent );
    fprintf( stderr, ", owner=%08x", req->owner );
    fprintf( stderr, ", next_sibling=%08x", req->next_sibling );
    fprintf( stderr, ", prev_sibling=%08x", req->prev_sibling );
    fprintf( stderr, ", first_sibling=%08x", req->first_sibling );
    fprintf( stderr, ", last_sibling=%08x", req->last_sibling );
    fprintf( stderr, ", first_child=%08x", req->first_child );
    fprintf( stderr, ", last_child=%08x", req->last_child );
2768 2769
}

2770
static void dump_set_window_pos_request( const struct set_window_pos_request *req )
2771
{
2772 2773 2774 2775 2776 2777
    fprintf( stderr, " flags=%08x", req->flags );
    fprintf( stderr, ", handle=%08x", req->handle );
    fprintf( stderr, ", previous=%08x", req->previous );
    dump_rectangle( ", window=", &req->window );
    dump_rectangle( ", client=", &req->client );
    dump_varargs_rectangles( ", valid=", cur_size );
2778 2779
}

2780 2781
static void dump_set_window_pos_reply( const struct set_window_pos_reply *req )
{
2782 2783
    fprintf( stderr, " new_style=%08x", req->new_style );
    fprintf( stderr, ", new_ex_style=%08x", req->new_ex_style );
2784 2785
}

2786 2787
static void dump_get_window_rectangles_request( const struct get_window_rectangles_request *req )
{
2788
    fprintf( stderr, " handle=%08x", req->handle );
2789 2790
}

2791
static void dump_get_window_rectangles_reply( const struct get_window_rectangles_reply *req )
2792
{
2793 2794 2795
    dump_rectangle( " window=", &req->window );
    dump_rectangle( ", visible=", &req->visible );
    dump_rectangle( ", client=", &req->client );
2796 2797
}

2798 2799
static void dump_get_window_text_request( const struct get_window_text_request *req )
{
2800
    fprintf( stderr, " handle=%08x", req->handle );
2801 2802
}

2803
static void dump_get_window_text_reply( const struct get_window_text_reply *req )
2804
{
2805
    dump_varargs_unicode_str( " text=", cur_size );
2806 2807 2808 2809
}

static void dump_set_window_text_request( const struct set_window_text_request *req )
{
2810 2811
    fprintf( stderr, " handle=%08x", req->handle );
    dump_varargs_unicode_str( ", text=", cur_size );
2812 2813
}

2814 2815
static void dump_get_windows_offset_request( const struct get_windows_offset_request *req )
{
2816 2817
    fprintf( stderr, " from=%08x", req->from );
    fprintf( stderr, ", to=%08x", req->to );
2818 2819
}

2820
static void dump_get_windows_offset_reply( const struct get_windows_offset_reply *req )
2821
{
2822 2823
    fprintf( stderr, " x=%d", req->x );
    fprintf( stderr, ", y=%d", req->y );
2824 2825
}

2826 2827
static void dump_get_visible_region_request( const struct get_visible_region_request *req )
{
2828 2829
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", flags=%08x", req->flags );
2830 2831 2832 2833
}

static void dump_get_visible_region_reply( const struct get_visible_region_reply *req )
{
2834 2835 2836 2837 2838
    fprintf( stderr, " top_win=%08x", req->top_win );
    dump_rectangle( ", top_rect=", &req->top_rect );
    dump_rectangle( ", win_rect=", &req->win_rect );
    fprintf( stderr, ", total_size=%u", req->total_size );
    dump_varargs_rectangles( ", region=", cur_size );
2839 2840
}

2841 2842
static void dump_get_window_region_request( const struct get_window_region_request *req )
{
2843
    fprintf( stderr, " window=%08x", req->window );
2844 2845 2846 2847
}

static void dump_get_window_region_reply( const struct get_window_region_reply *req )
{
2848 2849
    fprintf( stderr, " total_size=%u", req->total_size );
    dump_varargs_rectangles( ", region=", cur_size );
2850 2851 2852 2853
}

static void dump_set_window_region_request( const struct set_window_region_request *req )
{
2854 2855 2856
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", redraw=%d", req->redraw );
    dump_varargs_rectangles( ", region=", cur_size );
2857 2858
}

2859 2860
static void dump_get_update_region_request( const struct get_update_region_request *req )
{
2861 2862 2863
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", from_child=%08x", req->from_child );
    fprintf( stderr, ", flags=%08x", req->flags );
2864 2865 2866 2867
}

static void dump_get_update_region_reply( const struct get_update_region_reply *req )
{
2868 2869 2870 2871
    fprintf( stderr, " child=%08x", req->child );
    fprintf( stderr, ", flags=%08x", req->flags );
    fprintf( stderr, ", total_size=%u", req->total_size );
    dump_varargs_rectangles( ", region=", cur_size );
2872 2873
}

2874 2875
static void dump_update_window_zorder_request( const struct update_window_zorder_request *req )
{
2876 2877
    fprintf( stderr, " window=%08x", req->window );
    dump_rectangle( ", rect=", &req->rect );
2878 2879
}

2880 2881
static void dump_redraw_window_request( const struct redraw_window_request *req )
{
2882 2883 2884
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", flags=%08x", req->flags );
    dump_varargs_rectangles( ", region=", cur_size );
2885 2886
}

2887 2888
static void dump_set_window_property_request( const struct set_window_property_request *req )
{
2889 2890 2891 2892
    fprintf( stderr, " window=%08x", req->window );
    dump_uint64( ", data=", &req->data );
    fprintf( stderr, ", atom=%04x", req->atom );
    dump_varargs_unicode_str( ", name=", cur_size );
2893 2894 2895 2896
}

static void dump_remove_window_property_request( const struct remove_window_property_request *req )
{
2897 2898 2899
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", atom=%04x", req->atom );
    dump_varargs_unicode_str( ", name=", cur_size );
2900 2901
}

2902
static void dump_remove_window_property_reply( const struct remove_window_property_reply *req )
2903
{
2904
    dump_uint64( " data=", &req->data );
2905 2906 2907 2908
}

static void dump_get_window_property_request( const struct get_window_property_request *req )
{
2909 2910 2911
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", atom=%04x", req->atom );
    dump_varargs_unicode_str( ", name=", cur_size );
2912 2913
}

2914
static void dump_get_window_property_reply( const struct get_window_property_reply *req )
2915
{
2916
    dump_uint64( " data=", &req->data );
2917 2918 2919 2920
}

static void dump_get_window_properties_request( const struct get_window_properties_request *req )
{
2921
    fprintf( stderr, " window=%08x", req->window );
2922 2923
}

2924
static void dump_get_window_properties_reply( const struct get_window_properties_reply *req )
2925
{
2926 2927
    fprintf( stderr, " total=%d", req->total );
    dump_varargs_properties( ", props=", cur_size );
2928 2929
}

2930 2931
static void dump_create_winstation_request( const struct create_winstation_request *req )
{
2932 2933 2934 2935
    fprintf( stderr, " flags=%08x", req->flags );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    dump_varargs_unicode_str( ", name=", cur_size );
2936 2937 2938 2939
}

static void dump_create_winstation_reply( const struct create_winstation_reply *req )
{
2940
    fprintf( stderr, " handle=%04x", req->handle );
2941 2942 2943 2944
}

static void dump_open_winstation_request( const struct open_winstation_request *req )
{
2945 2946 2947
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    dump_varargs_unicode_str( ", name=", cur_size );
2948 2949 2950 2951
}

static void dump_open_winstation_reply( const struct open_winstation_reply *req )
{
2952
    fprintf( stderr, " handle=%04x", req->handle );
2953 2954 2955 2956
}

static void dump_close_winstation_request( const struct close_winstation_request *req )
{
2957
    fprintf( stderr, " handle=%04x", req->handle );
2958 2959 2960 2961 2962 2963 2964 2965
}

static void dump_get_process_winstation_request( const struct get_process_winstation_request *req )
{
}

static void dump_get_process_winstation_reply( const struct get_process_winstation_reply *req )
{
2966
    fprintf( stderr, " handle=%04x", req->handle );
2967 2968 2969 2970
}

static void dump_set_process_winstation_request( const struct set_process_winstation_request *req )
{
2971
    fprintf( stderr, " handle=%04x", req->handle );
2972 2973
}

2974 2975 2976 2977 2978 2979 2980
static void dump_enum_winstation_request( const struct enum_winstation_request *req )
{
    fprintf( stderr, " index=%08x", req->index );
}

static void dump_enum_winstation_reply( const struct enum_winstation_reply *req )
{
2981 2982
    fprintf( stderr, " next=%08x", req->next );
    dump_varargs_unicode_str( ", name=", cur_size );
2983 2984
}

2985 2986
static void dump_create_desktop_request( const struct create_desktop_request *req )
{
2987 2988 2989 2990
    fprintf( stderr, " flags=%08x", req->flags );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    dump_varargs_unicode_str( ", name=", cur_size );
2991 2992 2993 2994
}

static void dump_create_desktop_reply( const struct create_desktop_reply *req )
{
2995
    fprintf( stderr, " handle=%04x", req->handle );
2996 2997 2998 2999
}

static void dump_open_desktop_request( const struct open_desktop_request *req )
{
3000 3001 3002 3003 3004
    fprintf( stderr, " winsta=%04x", req->winsta );
    fprintf( stderr, ", flags=%08x", req->flags );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    dump_varargs_unicode_str( ", name=", cur_size );
3005 3006 3007 3008
}

static void dump_open_desktop_reply( const struct open_desktop_reply *req )
{
3009
    fprintf( stderr, " handle=%04x", req->handle );
3010 3011 3012 3013
}

static void dump_close_desktop_request( const struct close_desktop_request *req )
{
3014
    fprintf( stderr, " handle=%04x", req->handle );
3015 3016 3017 3018 3019 3020 3021 3022 3023
}

static void dump_get_thread_desktop_request( const struct get_thread_desktop_request *req )
{
    fprintf( stderr, " tid=%04x", req->tid );
}

static void dump_get_thread_desktop_reply( const struct get_thread_desktop_reply *req )
{
3024
    fprintf( stderr, " handle=%04x", req->handle );
3025 3026 3027 3028
}

static void dump_set_thread_desktop_request( const struct set_thread_desktop_request *req )
{
3029
    fprintf( stderr, " handle=%04x", req->handle );
3030 3031
}

3032 3033
static void dump_enum_desktop_request( const struct enum_desktop_request *req )
{
3034 3035
    fprintf( stderr, " winstation=%04x", req->winstation );
    fprintf( stderr, ", index=%08x", req->index );
3036 3037 3038 3039
}

static void dump_enum_desktop_reply( const struct enum_desktop_reply *req )
{
3040 3041
    fprintf( stderr, " next=%08x", req->next );
    dump_varargs_unicode_str( ", name=", cur_size );
3042 3043
}

3044 3045
static void dump_set_user_object_info_request( const struct set_user_object_info_request *req )
{
3046 3047 3048
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", flags=%08x", req->flags );
    fprintf( stderr, ", obj_flags=%08x", req->obj_flags );
3049 3050 3051 3052
}

static void dump_set_user_object_info_reply( const struct set_user_object_info_reply *req )
{
3053 3054 3055
    fprintf( stderr, " is_desktop=%d", req->is_desktop );
    fprintf( stderr, ", old_obj_flags=%08x", req->old_obj_flags );
    dump_varargs_unicode_str( ", name=", cur_size );
3056 3057
}

3058 3059
static void dump_attach_thread_input_request( const struct attach_thread_input_request *req )
{
3060 3061 3062
    fprintf( stderr, " tid_from=%04x", req->tid_from );
    fprintf( stderr, ", tid_to=%04x", req->tid_to );
    fprintf( stderr, ", attach=%d", req->attach );
3063 3064 3065 3066
}

static void dump_get_thread_input_request( const struct get_thread_input_request *req )
{
3067
    fprintf( stderr, " tid=%04x", req->tid );
3068 3069 3070 3071
}

static void dump_get_thread_input_reply( const struct get_thread_input_reply *req )
{
3072 3073 3074 3075 3076 3077 3078
    fprintf( stderr, " focus=%08x", req->focus );
    fprintf( stderr, ", capture=%08x", req->capture );
    fprintf( stderr, ", active=%08x", req->active );
    fprintf( stderr, ", foreground=%08x", req->foreground );
    fprintf( stderr, ", menu_owner=%08x", req->menu_owner );
    fprintf( stderr, ", move_size=%08x", req->move_size );
    fprintf( stderr, ", caret=%08x", req->caret );
3079 3080
    fprintf( stderr, ", cursor=%08x", req->cursor );
    fprintf( stderr, ", show_count=%d", req->show_count );
3081
    dump_rectangle( ", rect=", &req->rect );
3082 3083
}

3084 3085 3086 3087 3088 3089 3090 3091 3092
static void dump_get_last_input_time_request( const struct get_last_input_time_request *req )
{
}

static void dump_get_last_input_time_reply( const struct get_last_input_time_reply *req )
{
    fprintf( stderr, " time=%08x", req->time );
}

3093 3094
static void dump_get_key_state_request( const struct get_key_state_request *req )
{
3095 3096
    fprintf( stderr, " tid=%04x", req->tid );
    fprintf( stderr, ", key=%d", req->key );
3097 3098 3099 3100
}

static void dump_get_key_state_reply( const struct get_key_state_reply *req )
{
3101 3102
    fprintf( stderr, " state=%02x", req->state );
    dump_varargs_bytes( ", keystate=", cur_size );
3103 3104 3105 3106
}

static void dump_set_key_state_request( const struct set_key_state_request *req )
{
3107 3108
    fprintf( stderr, " tid=%04x", req->tid );
    dump_varargs_bytes( ", keystate=", cur_size );
3109 3110
}

3111 3112
static void dump_set_foreground_window_request( const struct set_foreground_window_request *req )
{
3113
    fprintf( stderr, " handle=%08x", req->handle );
3114 3115 3116 3117
}

static void dump_set_foreground_window_reply( const struct set_foreground_window_reply *req )
{
3118 3119 3120
    fprintf( stderr, " previous=%08x", req->previous );
    fprintf( stderr, ", send_msg_old=%d", req->send_msg_old );
    fprintf( stderr, ", send_msg_new=%d", req->send_msg_new );
3121 3122 3123 3124
}

static void dump_set_focus_window_request( const struct set_focus_window_request *req )
{
3125
    fprintf( stderr, " handle=%08x", req->handle );
3126 3127 3128 3129
}

static void dump_set_focus_window_reply( const struct set_focus_window_reply *req )
{
3130
    fprintf( stderr, " previous=%08x", req->previous );
3131 3132 3133 3134
}

static void dump_set_active_window_request( const struct set_active_window_request *req )
{
3135
    fprintf( stderr, " handle=%08x", req->handle );
3136 3137 3138 3139
}

static void dump_set_active_window_reply( const struct set_active_window_reply *req )
{
3140
    fprintf( stderr, " previous=%08x", req->previous );
3141 3142
}

3143 3144
static void dump_set_capture_window_request( const struct set_capture_window_request *req )
{
3145 3146
    fprintf( stderr, " handle=%08x", req->handle );
    fprintf( stderr, ", flags=%08x", req->flags );
3147 3148 3149 3150
}

static void dump_set_capture_window_reply( const struct set_capture_window_reply *req )
{
3151 3152
    fprintf( stderr, " previous=%08x", req->previous );
    fprintf( stderr, ", full_handle=%08x", req->full_handle );
3153 3154
}

3155 3156
static void dump_set_caret_window_request( const struct set_caret_window_request *req )
{
3157 3158 3159
    fprintf( stderr, " handle=%08x", req->handle );
    fprintf( stderr, ", width=%d", req->width );
    fprintf( stderr, ", height=%d", req->height );
3160 3161 3162 3163
}

static void dump_set_caret_window_reply( const struct set_caret_window_reply *req )
{
3164 3165 3166 3167
    fprintf( stderr, " previous=%08x", req->previous );
    dump_rectangle( ", old_rect=", &req->old_rect );
    fprintf( stderr, ", old_hide=%d", req->old_hide );
    fprintf( stderr, ", old_state=%d", req->old_state );
3168 3169 3170 3171
}

static void dump_set_caret_info_request( const struct set_caret_info_request *req )
{
3172 3173 3174 3175 3176 3177
    fprintf( stderr, " flags=%08x", req->flags );
    fprintf( stderr, ", handle=%08x", req->handle );
    fprintf( stderr, ", x=%d", req->x );
    fprintf( stderr, ", y=%d", req->y );
    fprintf( stderr, ", hide=%d", req->hide );
    fprintf( stderr, ", state=%d", req->state );
3178 3179 3180 3181
}

static void dump_set_caret_info_reply( const struct set_caret_info_reply *req )
{
3182 3183 3184 3185
    fprintf( stderr, " full_handle=%08x", req->full_handle );
    dump_rectangle( ", old_rect=", &req->old_rect );
    fprintf( stderr, ", old_hide=%d", req->old_hide );
    fprintf( stderr, ", old_state=%d", req->old_state );
3186 3187
}

3188 3189
static void dump_set_hook_request( const struct set_hook_request *req )
{
3190 3191 3192 3193 3194 3195 3196 3197 3198
    fprintf( stderr, " id=%d", req->id );
    fprintf( stderr, ", pid=%04x", req->pid );
    fprintf( stderr, ", tid=%04x", req->tid );
    fprintf( stderr, ", event_min=%d", req->event_min );
    fprintf( stderr, ", event_max=%d", req->event_max );
    dump_uint64( ", proc=", &req->proc );
    fprintf( stderr, ", flags=%d", req->flags );
    fprintf( stderr, ", unicode=%d", req->unicode );
    dump_varargs_unicode_str( ", module=", cur_size );
3199 3200 3201 3202
}

static void dump_set_hook_reply( const struct set_hook_reply *req )
{
3203 3204
    fprintf( stderr, " handle=%08x", req->handle );
    fprintf( stderr, ", active_hooks=%08x", req->active_hooks );
3205 3206 3207 3208
}

static void dump_remove_hook_request( const struct remove_hook_request *req )
{
3209 3210 3211
    fprintf( stderr, " handle=%08x", req->handle );
    dump_uint64( ", proc=", &req->proc );
    fprintf( stderr, ", id=%d", req->id );
3212 3213
}

3214 3215 3216 3217 3218
static void dump_remove_hook_reply( const struct remove_hook_reply *req )
{
    fprintf( stderr, " active_hooks=%08x", req->active_hooks );
}

3219 3220
static void dump_start_hook_chain_request( const struct start_hook_chain_request *req )
{
3221 3222 3223 3224 3225
    fprintf( stderr, " id=%d", req->id );
    fprintf( stderr, ", event=%d", req->event );
    fprintf( stderr, ", window=%08x", req->window );
    fprintf( stderr, ", object_id=%d", req->object_id );
    fprintf( stderr, ", child_id=%d", req->child_id );
3226 3227 3228 3229
}

static void dump_start_hook_chain_reply( const struct start_hook_chain_reply *req )
{
3230 3231 3232 3233 3234 3235 3236
    fprintf( stderr, " handle=%08x", req->handle );
    fprintf( stderr, ", pid=%04x", req->pid );
    fprintf( stderr, ", tid=%04x", req->tid );
    fprintf( stderr, ", unicode=%d", req->unicode );
    dump_uint64( ", proc=", &req->proc );
    fprintf( stderr, ", active_hooks=%08x", req->active_hooks );
    dump_varargs_unicode_str( ", module=", cur_size );
3237 3238 3239 3240 3241 3242 3243
}

static void dump_finish_hook_chain_request( const struct finish_hook_chain_request *req )
{
    fprintf( stderr, " id=%d", req->id );
}

3244
static void dump_get_hook_info_request( const struct get_hook_info_request *req )
3245
{
3246 3247 3248 3249 3250 3251
    fprintf( stderr, " handle=%08x", req->handle );
    fprintf( stderr, ", get_next=%d", req->get_next );
    fprintf( stderr, ", event=%d", req->event );
    fprintf( stderr, ", window=%08x", req->window );
    fprintf( stderr, ", object_id=%d", req->object_id );
    fprintf( stderr, ", child_id=%d", req->child_id );
3252 3253
}

3254
static void dump_get_hook_info_reply( const struct get_hook_info_reply *req )
3255
{
3256 3257 3258 3259 3260 3261 3262
    fprintf( stderr, " handle=%08x", req->handle );
    fprintf( stderr, ", id=%d", req->id );
    fprintf( stderr, ", pid=%04x", req->pid );
    fprintf( stderr, ", tid=%04x", req->tid );
    dump_uint64( ", proc=", &req->proc );
    fprintf( stderr, ", unicode=%d", req->unicode );
    dump_varargs_unicode_str( ", module=", cur_size );
3263 3264
}

3265 3266
static void dump_create_class_request( const struct create_class_request *req )
{
3267 3268 3269 3270 3271 3272 3273 3274
    fprintf( stderr, " local=%d", req->local );
    fprintf( stderr, ", atom=%04x", req->atom );
    fprintf( stderr, ", style=%08x", req->style );
    dump_uint64( ", instance=", &req->instance );
    fprintf( stderr, ", extra=%d", req->extra );
    fprintf( stderr, ", win_extra=%d", req->win_extra );
    dump_uint64( ", client_ptr=", &req->client_ptr );
    dump_varargs_unicode_str( ", name=", cur_size );
3275 3276 3277 3278 3279
}

static void dump_create_class_reply( const struct create_class_reply *req )
{
    fprintf( stderr, " atom=%04x", req->atom );
3280 3281 3282 3283
}

static void dump_destroy_class_request( const struct destroy_class_request *req )
{
3284 3285 3286
    fprintf( stderr, " atom=%04x", req->atom );
    dump_uint64( ", instance=", &req->instance );
    dump_varargs_unicode_str( ", name=", cur_size );
3287 3288
}

3289 3290
static void dump_destroy_class_reply( const struct destroy_class_reply *req )
{
3291
    dump_uint64( " client_ptr=", &req->client_ptr );
3292 3293
}

3294 3295
static void dump_set_class_info_request( const struct set_class_info_request *req )
{
3296 3297 3298 3299 3300 3301 3302 3303 3304
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", flags=%08x", req->flags );
    fprintf( stderr, ", atom=%04x", req->atom );
    fprintf( stderr, ", style=%08x", req->style );
    fprintf( stderr, ", win_extra=%d", req->win_extra );
    dump_uint64( ", instance=", &req->instance );
    fprintf( stderr, ", extra_offset=%d", req->extra_offset );
    fprintf( stderr, ", extra_size=%u", req->extra_size );
    dump_uint64( ", extra_value=", &req->extra_value );
3305 3306 3307 3308
}

static void dump_set_class_info_reply( const struct set_class_info_reply *req )
{
3309 3310 3311 3312 3313 3314
    fprintf( stderr, " old_atom=%04x", req->old_atom );
    fprintf( stderr, ", old_style=%08x", req->old_style );
    fprintf( stderr, ", old_extra=%d", req->old_extra );
    fprintf( stderr, ", old_win_extra=%d", req->old_win_extra );
    dump_uint64( ", old_instance=", &req->old_instance );
    dump_uint64( ", old_extra_value=", &req->old_extra_value );
3315 3316
}

3317 3318
static void dump_set_clipboard_info_request( const struct set_clipboard_info_request *req )
{
3319 3320 3321 3322 3323
    fprintf( stderr, " flags=%08x", req->flags );
    fprintf( stderr, ", clipboard=%08x", req->clipboard );
    fprintf( stderr, ", owner=%08x", req->owner );
    fprintf( stderr, ", viewer=%08x", req->viewer );
    fprintf( stderr, ", seqno=%08x", req->seqno );
3324 3325 3326 3327
}

static void dump_set_clipboard_info_reply( const struct set_clipboard_info_reply *req )
{
3328 3329 3330 3331 3332
    fprintf( stderr, " flags=%08x", req->flags );
    fprintf( stderr, ", old_clipboard=%08x", req->old_clipboard );
    fprintf( stderr, ", old_owner=%08x", req->old_owner );
    fprintf( stderr, ", old_viewer=%08x", req->old_viewer );
    fprintf( stderr, ", seqno=%08x", req->seqno );
3333 3334
}

3335 3336
static void dump_open_token_request( const struct open_token_request *req )
{
3337 3338 3339 3340
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", flags=%08x", req->flags );
3341 3342 3343 3344
}

static void dump_open_token_reply( const struct open_token_reply *req )
{
3345
    fprintf( stderr, " token=%04x", req->token );
3346 3347
}

3348 3349
static void dump_set_global_windows_request( const struct set_global_windows_request *req )
{
3350 3351 3352 3353 3354
    fprintf( stderr, " flags=%08x", req->flags );
    fprintf( stderr, ", shell_window=%08x", req->shell_window );
    fprintf( stderr, ", shell_listview=%08x", req->shell_listview );
    fprintf( stderr, ", progman_window=%08x", req->progman_window );
    fprintf( stderr, ", taskman_window=%08x", req->taskman_window );
3355 3356 3357 3358
}

static void dump_set_global_windows_reply( const struct set_global_windows_reply *req )
{
3359 3360 3361 3362
    fprintf( stderr, " old_shell_window=%08x", req->old_shell_window );
    fprintf( stderr, ", old_shell_listview=%08x", req->old_shell_listview );
    fprintf( stderr, ", old_progman_window=%08x", req->old_progman_window );
    fprintf( stderr, ", old_taskman_window=%08x", req->old_taskman_window );
3363 3364
}

3365 3366
static void dump_adjust_token_privileges_request( const struct adjust_token_privileges_request *req )
{
3367 3368 3369 3370
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", disable_all=%d", req->disable_all );
    fprintf( stderr, ", get_modified_state=%d", req->get_modified_state );
    dump_varargs_LUID_AND_ATTRIBUTES( ", privileges=", cur_size );
3371 3372 3373 3374
}

static void dump_adjust_token_privileges_reply( const struct adjust_token_privileges_reply *req )
{
3375 3376
    fprintf( stderr, " len=%08x", req->len );
    dump_varargs_LUID_AND_ATTRIBUTES( ", privileges=", cur_size );
3377 3378 3379 3380
}

static void dump_get_token_privileges_request( const struct get_token_privileges_request *req )
{
3381
    fprintf( stderr, " handle=%04x", req->handle );
3382 3383 3384 3385
}

static void dump_get_token_privileges_reply( const struct get_token_privileges_reply *req )
{
3386 3387
    fprintf( stderr, " len=%08x", req->len );
    dump_varargs_LUID_AND_ATTRIBUTES( ", privileges=", cur_size );
3388 3389
}

3390 3391
static void dump_check_token_privileges_request( const struct check_token_privileges_request *req )
{
3392 3393 3394
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", all_required=%d", req->all_required );
    dump_varargs_LUID_AND_ATTRIBUTES( ", privileges=", cur_size );
3395 3396 3397 3398
}

static void dump_check_token_privileges_reply( const struct check_token_privileges_reply *req )
{
3399 3400
    fprintf( stderr, " has_privileges=%d", req->has_privileges );
    dump_varargs_LUID_AND_ATTRIBUTES( ", privileges=", cur_size );
3401 3402
}

3403 3404
static void dump_duplicate_token_request( const struct duplicate_token_request *req )
{
3405 3406 3407 3408 3409
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", primary=%d", req->primary );
    fprintf( stderr, ", impersonation_level=%d", req->impersonation_level );
3410 3411 3412 3413
}

static void dump_duplicate_token_reply( const struct duplicate_token_reply *req )
{
3414
    fprintf( stderr, " new_handle=%04x", req->new_handle );
3415 3416
}

3417 3418
static void dump_access_check_request( const struct access_check_request *req )
{
3419 3420 3421 3422 3423 3424 3425
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", desired_access=%08x", req->desired_access );
    fprintf( stderr, ", mapping_read=%08x", req->mapping_read );
    fprintf( stderr, ", mapping_write=%08x", req->mapping_write );
    fprintf( stderr, ", mapping_execute=%08x", req->mapping_execute );
    fprintf( stderr, ", mapping_all=%08x", req->mapping_all );
    dump_varargs_security_descriptor( ", sd=", cur_size );
3426 3427 3428 3429
}

static void dump_access_check_reply( const struct access_check_reply *req )
{
3430 3431 3432 3433
    fprintf( stderr, " access_granted=%08x", req->access_granted );
    fprintf( stderr, ", access_status=%08x", req->access_status );
    fprintf( stderr, ", privileges_len=%08x", req->privileges_len );
    dump_varargs_LUID_AND_ATTRIBUTES( ", privileges=", cur_size );
3434 3435
}

3436
static void dump_get_token_sid_request( const struct get_token_sid_request *req )
3437
{
3438
    fprintf( stderr, " handle=%04x", req->handle );
3439
    fprintf( stderr, ", which_sid=%08x", req->which_sid );
3440 3441
}

3442
static void dump_get_token_sid_reply( const struct get_token_sid_reply *req )
3443
{
3444 3445
    fprintf( stderr, " sid_len=%u", req->sid_len );
    dump_varargs_SID( ", sid=", cur_size );
3446 3447
}

3448 3449
static void dump_get_token_groups_request( const struct get_token_groups_request *req )
{
3450
    fprintf( stderr, " handle=%04x", req->handle );
3451 3452 3453 3454
}

static void dump_get_token_groups_reply( const struct get_token_groups_reply *req )
{
3455 3456
    fprintf( stderr, " user_len=%u", req->user_len );
    dump_varargs_token_groups( ", user=", cur_size );
3457 3458
}

3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475
static void dump_get_token_default_dacl_request( const struct get_token_default_dacl_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
}

static void dump_get_token_default_dacl_reply( const struct get_token_default_dacl_reply *req )
{
    fprintf( stderr, " acl_len=%u", req->acl_len );
    dump_varargs_ACL( ", acl=", cur_size );
}

static void dump_set_token_default_dacl_request( const struct set_token_default_dacl_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
    dump_varargs_ACL( ", acl=", cur_size );
}

3476 3477
static void dump_set_security_object_request( const struct set_security_object_request *req )
{
3478 3479 3480
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", security_info=%08x", req->security_info );
    dump_varargs_security_descriptor( ", sd=", cur_size );
3481 3482
}

3483 3484
static void dump_get_security_object_request( const struct get_security_object_request *req )
{
3485 3486
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", security_info=%08x", req->security_info );
3487 3488 3489 3490
}

static void dump_get_security_object_reply( const struct get_security_object_reply *req )
{
3491 3492
    fprintf( stderr, " sd_len=%08x", req->sd_len );
    dump_varargs_security_descriptor( ", sd=", cur_size );
3493 3494
}

Mike McCormack's avatar
Mike McCormack committed
3495 3496
static void dump_create_mailslot_request( const struct create_mailslot_request *req )
{
3497 3498 3499 3500 3501 3502
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", rootdir=%04x", req->rootdir );
    dump_timeout( ", read_timeout=", &req->read_timeout );
    fprintf( stderr, ", max_msgsize=%08x", req->max_msgsize );
    dump_varargs_unicode_str( ", name=", cur_size );
Mike McCormack's avatar
Mike McCormack committed
3503 3504 3505 3506
}

static void dump_create_mailslot_reply( const struct create_mailslot_reply *req )
{
3507
    fprintf( stderr, " handle=%04x", req->handle );
Mike McCormack's avatar
Mike McCormack committed
3508 3509 3510 3511
}

static void dump_set_mailslot_info_request( const struct set_mailslot_info_request *req )
{
3512 3513 3514
    fprintf( stderr, " handle=%04x", req->handle );
    dump_timeout( ", read_timeout=", &req->read_timeout );
    fprintf( stderr, ", flags=%08x", req->flags );
Mike McCormack's avatar
Mike McCormack committed
3515 3516 3517 3518
}

static void dump_set_mailslot_info_reply( const struct set_mailslot_info_reply *req )
{
3519 3520
    dump_timeout( " read_timeout=", &req->read_timeout );
    fprintf( stderr, ", max_msgsize=%08x", req->max_msgsize );
Mike McCormack's avatar
Mike McCormack committed
3521 3522
}

3523 3524
static void dump_create_directory_request( const struct create_directory_request *req )
{
3525 3526 3527 3528
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", rootdir=%04x", req->rootdir );
    dump_varargs_unicode_str( ", directory_name=", cur_size );
3529 3530 3531 3532
}

static void dump_create_directory_reply( const struct create_directory_reply *req )
{
3533
    fprintf( stderr, " handle=%04x", req->handle );
3534 3535 3536 3537
}

static void dump_open_directory_request( const struct open_directory_request *req )
{
3538 3539 3540 3541
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", rootdir=%04x", req->rootdir );
    dump_varargs_unicode_str( ", directory_name=", cur_size );
3542 3543 3544 3545
}

static void dump_open_directory_reply( const struct open_directory_reply *req )
{
3546
    fprintf( stderr, " handle=%04x", req->handle );
3547 3548
}

3549 3550
static void dump_get_directory_entry_request( const struct get_directory_entry_request *req )
{
3551 3552
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", index=%08x", req->index );
3553 3554 3555 3556
}

static void dump_get_directory_entry_reply( const struct get_directory_entry_reply *req )
{
3557 3558 3559
    fprintf( stderr, " name_len=%u", req->name_len );
    dump_varargs_unicode_str( ", name=", min(cur_size,req->name_len) );
    dump_varargs_unicode_str( ", type=", cur_size );
3560 3561
}

3562 3563
static void dump_create_symlink_request( const struct create_symlink_request *req )
{
3564 3565 3566 3567 3568 3569
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", rootdir=%04x", req->rootdir );
    fprintf( stderr, ", name_len=%u", req->name_len );
    dump_varargs_unicode_str( ", name=", min(cur_size,req->name_len) );
    dump_varargs_unicode_str( ", target_name=", cur_size );
3570 3571 3572 3573
}

static void dump_create_symlink_reply( const struct create_symlink_reply *req )
{
3574
    fprintf( stderr, " handle=%04x", req->handle );
3575 3576 3577 3578
}

static void dump_open_symlink_request( const struct open_symlink_request *req )
{
3579 3580 3581 3582
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", rootdir=%04x", req->rootdir );
    dump_varargs_unicode_str( ", name=", cur_size );
3583 3584 3585 3586
}

static void dump_open_symlink_reply( const struct open_symlink_reply *req )
{
3587
    fprintf( stderr, " handle=%04x", req->handle );
3588 3589 3590 3591
}

static void dump_query_symlink_request( const struct query_symlink_request *req )
{
3592
    fprintf( stderr, " handle=%04x", req->handle );
3593 3594 3595 3596
}

static void dump_query_symlink_reply( const struct query_symlink_reply *req )
{
3597
    dump_varargs_unicode_str( " target_name=", cur_size );
3598 3599
}

3600 3601
static void dump_get_object_info_request( const struct get_object_info_request *req )
{
3602
    fprintf( stderr, " handle=%04x", req->handle );
3603 3604 3605 3606
}

static void dump_get_object_info_reply( const struct get_object_info_reply *req )
{
3607 3608
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", ref_count=%08x", req->ref_count );
3609 3610
    fprintf( stderr, ", total=%u", req->total );
    dump_varargs_unicode_str( ", name=", cur_size );
3611 3612
}

3613 3614
static void dump_unlink_object_request( const struct unlink_object_request *req )
{
3615
    fprintf( stderr, " handle=%04x", req->handle );
3616 3617
}

3618 3619
static void dump_get_token_impersonation_level_request( const struct get_token_impersonation_level_request *req )
{
3620
    fprintf( stderr, " handle=%04x", req->handle );
3621 3622 3623 3624 3625 3626 3627
}

static void dump_get_token_impersonation_level_reply( const struct get_token_impersonation_level_reply *req )
{
    fprintf( stderr, " impersonation_level=%d", req->impersonation_level );
}

3628 3629 3630 3631 3632 3633
static void dump_allocate_locally_unique_id_request( const struct allocate_locally_unique_id_request *req )
{
}

static void dump_allocate_locally_unique_id_reply( const struct allocate_locally_unique_id_reply *req )
{
3634
    dump_luid( " luid=", &req->luid );
3635 3636
}

3637 3638
static void dump_create_device_manager_request( const struct create_device_manager_request *req )
{
3639 3640
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
3641 3642 3643 3644
}

static void dump_create_device_manager_reply( const struct create_device_manager_reply *req )
{
3645
    fprintf( stderr, " handle=%04x", req->handle );
3646 3647 3648 3649
}

static void dump_create_device_request( const struct create_device_request *req )
{
3650 3651 3652 3653 3654 3655
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", rootdir=%04x", req->rootdir );
    dump_uint64( ", user_ptr=", &req->user_ptr );
    fprintf( stderr, ", manager=%04x", req->manager );
    dump_varargs_unicode_str( ", name=", cur_size );
3656 3657 3658 3659
}

static void dump_create_device_reply( const struct create_device_reply *req )
{
3660
    fprintf( stderr, " handle=%04x", req->handle );
3661 3662 3663 3664
}

static void dump_delete_device_request( const struct delete_device_request *req )
{
3665
    fprintf( stderr, " handle=%04x", req->handle );
3666 3667
}

3668 3669
static void dump_get_next_device_request_request( const struct get_next_device_request_request *req )
{
3670 3671 3672 3673
    fprintf( stderr, " manager=%04x", req->manager );
    fprintf( stderr, ", prev=%04x", req->prev );
    fprintf( stderr, ", status=%08x", req->status );
    dump_varargs_bytes( ", prev_data=", cur_size );
3674 3675 3676 3677
}

static void dump_get_next_device_request_reply( const struct get_next_device_request_reply *req )
{
3678 3679 3680 3681 3682 3683
    fprintf( stderr, " next=%04x", req->next );
    dump_ioctl_code( ", code=", &req->code );
    dump_uint64( ", user_ptr=", &req->user_ptr );
    fprintf( stderr, ", in_size=%u", req->in_size );
    fprintf( stderr, ", out_size=%u", req->out_size );
    dump_varargs_bytes( ", next_data=", cur_size );
3684 3685
}

3686 3687 3688 3689 3690 3691
static void dump_make_process_system_request( const struct make_process_system_request *req )
{
}

static void dump_make_process_system_reply( const struct make_process_system_reply *req )
{
3692
    fprintf( stderr, " event=%04x", req->event );
3693 3694
}

3695 3696
static void dump_get_token_statistics_request( const struct get_token_statistics_request *req )
{
3697
    fprintf( stderr, " handle=%04x", req->handle );
3698 3699 3700 3701
}

static void dump_get_token_statistics_reply( const struct get_token_statistics_reply *req )
{
3702 3703 3704 3705 3706 3707
    dump_luid( " token_id=", &req->token_id );
    dump_luid( ", modified_id=", &req->modified_id );
    fprintf( stderr, ", primary=%d", req->primary );
    fprintf( stderr, ", impersonation_level=%d", req->impersonation_level );
    fprintf( stderr, ", group_count=%d", req->group_count );
    fprintf( stderr, ", privilege_count=%d", req->privilege_count );
3708 3709
}

3710 3711
static void dump_create_completion_request( const struct create_completion_request *req )
{
3712 3713 3714 3715 3716
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", concurrent=%08x", req->concurrent );
    fprintf( stderr, ", rootdir=%04x", req->rootdir );
    dump_varargs_string( ", filename=", cur_size );
3717 3718 3719 3720
}

static void dump_create_completion_reply( const struct create_completion_reply *req )
{
3721
    fprintf( stderr, " handle=%04x", req->handle );
3722 3723 3724 3725
}

static void dump_open_completion_request( const struct open_completion_request *req )
{
3726 3727 3728 3729
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", rootdir=%04x", req->rootdir );
    dump_varargs_string( ", filename=", cur_size );
3730 3731 3732 3733
}

static void dump_open_completion_reply( const struct open_completion_reply *req )
{
3734
    fprintf( stderr, " handle=%04x", req->handle );
3735 3736 3737 3738
}

static void dump_add_completion_request( const struct add_completion_request *req )
{
3739 3740 3741 3742 3743
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", ckey=", &req->ckey );
    dump_uint64( ", cvalue=", &req->cvalue );
    fprintf( stderr, ", information=%08x", req->information );
    fprintf( stderr, ", status=%08x", req->status );
3744 3745 3746 3747
}

static void dump_remove_completion_request( const struct remove_completion_request *req )
{
3748
    fprintf( stderr, " handle=%04x", req->handle );
3749 3750 3751 3752
}

static void dump_remove_completion_reply( const struct remove_completion_reply *req )
{
3753 3754 3755 3756
    dump_uint64( " ckey=", &req->ckey );
    dump_uint64( ", cvalue=", &req->cvalue );
    fprintf( stderr, ", information=%08x", req->information );
    fprintf( stderr, ", status=%08x", req->status );
3757 3758 3759 3760
}

static void dump_query_completion_request( const struct query_completion_request *req )
{
3761
    fprintf( stderr, " handle=%04x", req->handle );
3762 3763 3764 3765 3766 3767 3768
}

static void dump_query_completion_reply( const struct query_completion_reply *req )
{
    fprintf( stderr, " depth=%08x", req->depth );
}

3769 3770
static void dump_set_completion_info_request( const struct set_completion_info_request *req )
{
3771 3772 3773
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", ckey=", &req->ckey );
    fprintf( stderr, ", chandle=%04x", req->chandle );
3774 3775
}

3776 3777
static void dump_add_fd_completion_request( const struct add_fd_completion_request *req )
{
3778 3779 3780 3781
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", cvalue=", &req->cvalue );
    fprintf( stderr, ", status=%08x", req->status );
    fprintf( stderr, ", information=%08x", req->information );
3782 3783
}

3784 3785
static void dump_get_window_layered_info_request( const struct get_window_layered_info_request *req )
{
3786
    fprintf( stderr, " handle=%08x", req->handle );
3787 3788 3789 3790
}

static void dump_get_window_layered_info_reply( const struct get_window_layered_info_reply *req )
{
3791 3792 3793
    fprintf( stderr, " color_key=%08x", req->color_key );
    fprintf( stderr, ", alpha=%08x", req->alpha );
    fprintf( stderr, ", flags=%08x", req->flags );
3794 3795 3796 3797
}

static void dump_set_window_layered_info_request( const struct set_window_layered_info_request *req )
{
3798 3799 3800 3801
    fprintf( stderr, " handle=%08x", req->handle );
    fprintf( stderr, ", color_key=%08x", req->color_key );
    fprintf( stderr, ", alpha=%08x", req->alpha );
    fprintf( stderr, ", flags=%08x", req->flags );
3802 3803
}

3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817
static void dump_alloc_user_handle_request( const struct alloc_user_handle_request *req )
{
}

static void dump_alloc_user_handle_reply( const struct alloc_user_handle_reply *req )
{
    fprintf( stderr, " handle=%08x", req->handle );
}

static void dump_free_user_handle_request( const struct free_user_handle_request *req )
{
    fprintf( stderr, " handle=%08x", req->handle );
}

3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830
static void dump_set_cursor_request( const struct set_cursor_request *req )
{
    fprintf( stderr, " flags=%08x", req->flags );
    fprintf( stderr, ", handle=%08x", req->handle );
    fprintf( stderr, ", show_count=%d", req->show_count );
}

static void dump_set_cursor_reply( const struct set_cursor_reply *req )
{
    fprintf( stderr, " prev_handle=%08x", req->prev_handle );
    fprintf( stderr, ", prev_count=%d", req->prev_count );
}

3831 3832
static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
    (dump_func)dump_new_process_request,
3833
    (dump_func)dump_get_new_process_info_request,
3834
    (dump_func)dump_new_thread_request,
3835
    (dump_func)dump_get_startup_info_request,
3836
    (dump_func)dump_init_process_done_request,
3837 3838 3839 3840 3841 3842 3843
    (dump_func)dump_init_thread_request,
    (dump_func)dump_terminate_process_request,
    (dump_func)dump_terminate_thread_request,
    (dump_func)dump_get_process_info_request,
    (dump_func)dump_set_process_info_request,
    (dump_func)dump_get_thread_info_request,
    (dump_func)dump_set_thread_info_request,
3844
    (dump_func)dump_get_dll_info_request,
3845 3846
    (dump_func)dump_suspend_thread_request,
    (dump_func)dump_resume_thread_request,
3847 3848
    (dump_func)dump_load_dll_request,
    (dump_func)dump_unload_dll_request,
3849
    (dump_func)dump_queue_apc_request,
3850
    (dump_func)dump_get_apc_result_request,
3851 3852 3853 3854
    (dump_func)dump_close_handle_request,
    (dump_func)dump_set_handle_info_request,
    (dump_func)dump_dup_handle_request,
    (dump_func)dump_open_process_request,
3855
    (dump_func)dump_open_thread_request,
3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866
    (dump_func)dump_select_request,
    (dump_func)dump_create_event_request,
    (dump_func)dump_event_op_request,
    (dump_func)dump_open_event_request,
    (dump_func)dump_create_mutex_request,
    (dump_func)dump_release_mutex_request,
    (dump_func)dump_open_mutex_request,
    (dump_func)dump_create_semaphore_request,
    (dump_func)dump_release_semaphore_request,
    (dump_func)dump_open_semaphore_request,
    (dump_func)dump_create_file_request,
3867
    (dump_func)dump_open_file_object_request,
3868
    (dump_func)dump_alloc_file_handle_request,
3869
    (dump_func)dump_get_handle_unix_name_request,
3870
    (dump_func)dump_get_handle_fd_request,
3871 3872 3873
    (dump_func)dump_flush_file_request,
    (dump_func)dump_lock_file_request,
    (dump_func)dump_unlock_file_request,
3874 3875 3876 3877 3878
    (dump_func)dump_create_socket_request,
    (dump_func)dump_accept_socket_request,
    (dump_func)dump_set_socket_event_request,
    (dump_func)dump_get_socket_event_request,
    (dump_func)dump_enable_socket_event_request,
3879
    (dump_func)dump_set_socket_deferred_request,
3880 3881
    (dump_func)dump_alloc_console_request,
    (dump_func)dump_free_console_request,
3882
    (dump_func)dump_get_console_renderer_events_request,
3883
    (dump_func)dump_open_console_request,
3884
    (dump_func)dump_get_console_wait_event_request,
3885 3886
    (dump_func)dump_get_console_mode_request,
    (dump_func)dump_set_console_mode_request,
3887 3888 3889 3890 3891 3892 3893
    (dump_func)dump_set_console_input_info_request,
    (dump_func)dump_get_console_input_info_request,
    (dump_func)dump_append_console_input_history_request,
    (dump_func)dump_get_console_input_history_request,
    (dump_func)dump_create_console_output_request,
    (dump_func)dump_set_console_output_info_request,
    (dump_func)dump_get_console_output_info_request,
3894 3895
    (dump_func)dump_write_console_input_request,
    (dump_func)dump_read_console_input_request,
3896
    (dump_func)dump_write_console_output_request,
3897
    (dump_func)dump_fill_console_output_request,
3898 3899
    (dump_func)dump_read_console_output_request,
    (dump_func)dump_move_console_output_request,
3900
    (dump_func)dump_send_console_signal_request,
3901
    (dump_func)dump_read_directory_changes_request,
3902
    (dump_func)dump_read_change_request,
3903 3904 3905
    (dump_func)dump_create_mapping_request,
    (dump_func)dump_open_mapping_request,
    (dump_func)dump_get_mapping_info_request,
3906 3907
    (dump_func)dump_get_mapping_committed_range_request,
    (dump_func)dump_add_mapping_committed_range_request,
3908 3909
    (dump_func)dump_create_snapshot_request,
    (dump_func)dump_next_process_request,
3910
    (dump_func)dump_next_thread_request,
3911
    (dump_func)dump_wait_debug_event_request,
3912 3913
    (dump_func)dump_queue_exception_event_request,
    (dump_func)dump_get_exception_status_request,
3914
    (dump_func)dump_output_debug_string_request,
3915 3916
    (dump_func)dump_continue_debug_event_request,
    (dump_func)dump_debug_process_request,
3917
    (dump_func)dump_debug_break_request,
3918
    (dump_func)dump_set_debugger_kill_on_exit_request,
3919
    (dump_func)dump_read_process_memory_request,
3920
    (dump_func)dump_write_process_memory_request,
3921 3922 3923
    (dump_func)dump_create_key_request,
    (dump_func)dump_open_key_request,
    (dump_func)dump_delete_key_request,
3924
    (dump_func)dump_flush_key_request,
3925 3926 3927 3928 3929 3930
    (dump_func)dump_enum_key_request,
    (dump_func)dump_set_key_value_request,
    (dump_func)dump_get_key_value_request,
    (dump_func)dump_enum_key_value_request,
    (dump_func)dump_delete_key_value_request,
    (dump_func)dump_load_registry_request,
3931
    (dump_func)dump_unload_registry_request,
3932
    (dump_func)dump_save_registry_request,
3933
    (dump_func)dump_set_registry_notification_request,
3934 3935 3936 3937
    (dump_func)dump_create_timer_request,
    (dump_func)dump_open_timer_request,
    (dump_func)dump_set_timer_request,
    (dump_func)dump_cancel_timer_request,
3938
    (dump_func)dump_get_timer_info_request,
3939 3940
    (dump_func)dump_get_thread_context_request,
    (dump_func)dump_set_thread_context_request,
3941
    (dump_func)dump_get_selector_entry_request,
3942 3943 3944
    (dump_func)dump_add_atom_request,
    (dump_func)dump_delete_atom_request,
    (dump_func)dump_find_atom_request,
3945 3946 3947
    (dump_func)dump_get_atom_information_request,
    (dump_func)dump_set_atom_information_request,
    (dump_func)dump_empty_atom_table_request,
3948
    (dump_func)dump_init_atom_table_request,
3949
    (dump_func)dump_get_msg_queue_request,
3950
    (dump_func)dump_set_queue_fd_request,
3951 3952
    (dump_func)dump_set_queue_mask_request,
    (dump_func)dump_get_queue_status_request,
3953
    (dump_func)dump_get_process_idle_event_request,
3954
    (dump_func)dump_send_message_request,
3955
    (dump_func)dump_post_quit_message_request,
3956
    (dump_func)dump_send_hardware_message_request,
3957 3958
    (dump_func)dump_get_message_request,
    (dump_func)dump_reply_message_request,
3959
    (dump_func)dump_accept_hardware_message_request,
3960 3961 3962
    (dump_func)dump_get_message_reply_request,
    (dump_func)dump_set_win_timer_request,
    (dump_func)dump_kill_win_timer_request,
3963
    (dump_func)dump_is_window_hung_request,
3964 3965
    (dump_func)dump_get_serial_info_request,
    (dump_func)dump_set_serial_info_request,
3966
    (dump_func)dump_register_async_request,
3967
    (dump_func)dump_cancel_async_request,
3968
    (dump_func)dump_ioctl_request,
3969
    (dump_func)dump_get_ioctl_result_request,
3970
    (dump_func)dump_create_named_pipe_request,
3971
    (dump_func)dump_get_named_pipe_info_request,
3972 3973
    (dump_func)dump_create_window_request,
    (dump_func)dump_destroy_window_request,
3974
    (dump_func)dump_get_desktop_window_request,
3975
    (dump_func)dump_set_window_owner_request,
3976
    (dump_func)dump_get_window_info_request,
3977
    (dump_func)dump_set_window_info_request,
3978
    (dump_func)dump_set_parent_request,
3979 3980
    (dump_func)dump_get_window_parents_request,
    (dump_func)dump_get_window_children_request,
3981
    (dump_func)dump_get_window_children_from_point_request,
3982
    (dump_func)dump_get_window_tree_request,
3983
    (dump_func)dump_set_window_pos_request,
3984
    (dump_func)dump_get_window_rectangles_request,
3985 3986
    (dump_func)dump_get_window_text_request,
    (dump_func)dump_set_window_text_request,
3987
    (dump_func)dump_get_windows_offset_request,
3988
    (dump_func)dump_get_visible_region_request,
3989 3990
    (dump_func)dump_get_window_region_request,
    (dump_func)dump_set_window_region_request,
3991
    (dump_func)dump_get_update_region_request,
3992
    (dump_func)dump_update_window_zorder_request,
3993
    (dump_func)dump_redraw_window_request,
3994 3995 3996 3997
    (dump_func)dump_set_window_property_request,
    (dump_func)dump_remove_window_property_request,
    (dump_func)dump_get_window_property_request,
    (dump_func)dump_get_window_properties_request,
3998 3999 4000 4001 4002
    (dump_func)dump_create_winstation_request,
    (dump_func)dump_open_winstation_request,
    (dump_func)dump_close_winstation_request,
    (dump_func)dump_get_process_winstation_request,
    (dump_func)dump_set_process_winstation_request,
4003
    (dump_func)dump_enum_winstation_request,
4004 4005 4006 4007 4008
    (dump_func)dump_create_desktop_request,
    (dump_func)dump_open_desktop_request,
    (dump_func)dump_close_desktop_request,
    (dump_func)dump_get_thread_desktop_request,
    (dump_func)dump_set_thread_desktop_request,
4009
    (dump_func)dump_enum_desktop_request,
4010
    (dump_func)dump_set_user_object_info_request,
4011 4012
    (dump_func)dump_attach_thread_input_request,
    (dump_func)dump_get_thread_input_request,
4013
    (dump_func)dump_get_last_input_time_request,
4014 4015
    (dump_func)dump_get_key_state_request,
    (dump_func)dump_set_key_state_request,
4016 4017 4018
    (dump_func)dump_set_foreground_window_request,
    (dump_func)dump_set_focus_window_request,
    (dump_func)dump_set_active_window_request,
4019
    (dump_func)dump_set_capture_window_request,
4020 4021
    (dump_func)dump_set_caret_window_request,
    (dump_func)dump_set_caret_info_request,
4022 4023 4024 4025
    (dump_func)dump_set_hook_request,
    (dump_func)dump_remove_hook_request,
    (dump_func)dump_start_hook_chain_request,
    (dump_func)dump_finish_hook_chain_request,
4026
    (dump_func)dump_get_hook_info_request,
4027 4028 4029
    (dump_func)dump_create_class_request,
    (dump_func)dump_destroy_class_request,
    (dump_func)dump_set_class_info_request,
4030
    (dump_func)dump_set_clipboard_info_request,
4031
    (dump_func)dump_open_token_request,
4032
    (dump_func)dump_set_global_windows_request,
4033 4034
    (dump_func)dump_adjust_token_privileges_request,
    (dump_func)dump_get_token_privileges_request,
4035
    (dump_func)dump_check_token_privileges_request,
4036
    (dump_func)dump_duplicate_token_request,
4037
    (dump_func)dump_access_check_request,
4038
    (dump_func)dump_get_token_sid_request,
4039
    (dump_func)dump_get_token_groups_request,
4040 4041
    (dump_func)dump_get_token_default_dacl_request,
    (dump_func)dump_set_token_default_dacl_request,
4042
    (dump_func)dump_set_security_object_request,
4043
    (dump_func)dump_get_security_object_request,
Mike McCormack's avatar
Mike McCormack committed
4044 4045
    (dump_func)dump_create_mailslot_request,
    (dump_func)dump_set_mailslot_info_request,
4046 4047
    (dump_func)dump_create_directory_request,
    (dump_func)dump_open_directory_request,
4048
    (dump_func)dump_get_directory_entry_request,
4049 4050 4051
    (dump_func)dump_create_symlink_request,
    (dump_func)dump_open_symlink_request,
    (dump_func)dump_query_symlink_request,
4052
    (dump_func)dump_get_object_info_request,
4053
    (dump_func)dump_unlink_object_request,
4054
    (dump_func)dump_get_token_impersonation_level_request,
4055
    (dump_func)dump_allocate_locally_unique_id_request,
4056 4057 4058
    (dump_func)dump_create_device_manager_request,
    (dump_func)dump_create_device_request,
    (dump_func)dump_delete_device_request,
4059
    (dump_func)dump_get_next_device_request_request,
4060
    (dump_func)dump_make_process_system_request,
4061
    (dump_func)dump_get_token_statistics_request,
4062 4063 4064 4065 4066
    (dump_func)dump_create_completion_request,
    (dump_func)dump_open_completion_request,
    (dump_func)dump_add_completion_request,
    (dump_func)dump_remove_completion_request,
    (dump_func)dump_query_completion_request,
4067
    (dump_func)dump_set_completion_info_request,
4068
    (dump_func)dump_add_fd_completion_request,
4069 4070
    (dump_func)dump_get_window_layered_info_request,
    (dump_func)dump_set_window_layered_info_request,
4071 4072
    (dump_func)dump_alloc_user_handle_request,
    (dump_func)dump_free_user_handle_request,
4073
    (dump_func)dump_set_cursor_request,
Alexandre Julliard's avatar
Alexandre Julliard committed
4074 4075
};

4076
static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
4077 4078
    (dump_func)dump_new_process_reply,
    (dump_func)dump_get_new_process_info_reply,
4079
    (dump_func)dump_new_thread_reply,
4080
    (dump_func)dump_get_startup_info_reply,
4081
    NULL,
4082
    (dump_func)dump_init_thread_reply,
4083 4084
    (dump_func)dump_terminate_process_reply,
    (dump_func)dump_terminate_thread_reply,
4085
    (dump_func)dump_get_process_info_reply,
4086
    NULL,
4087
    (dump_func)dump_get_thread_info_reply,
4088
    NULL,
4089
    (dump_func)dump_get_dll_info_reply,
4090 4091
    (dump_func)dump_suspend_thread_reply,
    (dump_func)dump_resume_thread_reply,
4092 4093
    NULL,
    NULL,
4094
    (dump_func)dump_queue_apc_reply,
4095
    (dump_func)dump_get_apc_result_reply,
4096
    NULL,
4097
    (dump_func)dump_set_handle_info_reply,
4098 4099
    (dump_func)dump_dup_handle_reply,
    (dump_func)dump_open_process_reply,
4100
    (dump_func)dump_open_thread_reply,
4101
    (dump_func)dump_select_reply,
4102
    (dump_func)dump_create_event_reply,
4103
    NULL,
4104 4105
    (dump_func)dump_open_event_reply,
    (dump_func)dump_create_mutex_reply,
4106
    (dump_func)dump_release_mutex_reply,
4107 4108 4109 4110 4111
    (dump_func)dump_open_mutex_reply,
    (dump_func)dump_create_semaphore_reply,
    (dump_func)dump_release_semaphore_reply,
    (dump_func)dump_open_semaphore_reply,
    (dump_func)dump_create_file_reply,
4112
    (dump_func)dump_open_file_object_reply,
4113
    (dump_func)dump_alloc_file_handle_reply,
4114
    (dump_func)dump_get_handle_unix_name_reply,
4115
    (dump_func)dump_get_handle_fd_reply,
4116
    (dump_func)dump_flush_file_reply,
4117
    (dump_func)dump_lock_file_reply,
4118
    NULL,
4119 4120
    (dump_func)dump_create_socket_reply,
    (dump_func)dump_accept_socket_reply,
4121
    NULL,
4122
    (dump_func)dump_get_socket_event_reply,
4123 4124
    NULL,
    NULL,
4125
    (dump_func)dump_alloc_console_reply,
4126
    NULL,
4127
    (dump_func)dump_get_console_renderer_events_reply,
4128
    (dump_func)dump_open_console_reply,
4129
    (dump_func)dump_get_console_wait_event_reply,
4130
    (dump_func)dump_get_console_mode_reply,
4131 4132
    NULL,
    NULL,
4133
    (dump_func)dump_get_console_input_info_reply,
4134
    NULL,
4135 4136
    (dump_func)dump_get_console_input_history_reply,
    (dump_func)dump_create_console_output_reply,
4137
    NULL,
4138
    (dump_func)dump_get_console_output_info_reply,
4139 4140
    (dump_func)dump_write_console_input_reply,
    (dump_func)dump_read_console_input_reply,
4141
    (dump_func)dump_write_console_output_reply,
4142
    (dump_func)dump_fill_console_output_reply,
4143
    (dump_func)dump_read_console_output_reply,
4144 4145 4146
    NULL,
    NULL,
    NULL,
4147
    (dump_func)dump_read_change_reply,
4148 4149 4150
    (dump_func)dump_create_mapping_reply,
    (dump_func)dump_open_mapping_reply,
    (dump_func)dump_get_mapping_info_reply,
4151 4152
    (dump_func)dump_get_mapping_committed_range_reply,
    NULL,
4153 4154
    (dump_func)dump_create_snapshot_reply,
    (dump_func)dump_next_process_reply,
4155
    (dump_func)dump_next_thread_reply,
4156
    (dump_func)dump_wait_debug_event_reply,
4157 4158
    (dump_func)dump_queue_exception_event_reply,
    (dump_func)dump_get_exception_status_reply,
4159 4160 4161
    NULL,
    NULL,
    NULL,
4162
    (dump_func)dump_debug_break_reply,
4163
    NULL,
4164
    (dump_func)dump_read_process_memory_reply,
4165
    NULL,
4166 4167
    (dump_func)dump_create_key_reply,
    (dump_func)dump_open_key_reply,
4168 4169
    NULL,
    NULL,
4170
    (dump_func)dump_enum_key_reply,
4171
    NULL,
4172 4173
    (dump_func)dump_get_key_value_reply,
    (dump_func)dump_enum_key_value_reply,
4174 4175 4176 4177 4178
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
4179 4180
    (dump_func)dump_create_timer_reply,
    (dump_func)dump_open_timer_reply,
4181 4182
    (dump_func)dump_set_timer_reply,
    (dump_func)dump_cancel_timer_reply,
4183
    (dump_func)dump_get_timer_info_reply,
4184
    (dump_func)dump_get_thread_context_reply,
4185
    (dump_func)dump_set_thread_context_reply,
4186
    (dump_func)dump_get_selector_entry_reply,
4187
    (dump_func)dump_add_atom_reply,
4188
    NULL,
4189
    (dump_func)dump_find_atom_reply,
4190
    (dump_func)dump_get_atom_information_reply,
4191 4192
    NULL,
    NULL,
4193
    (dump_func)dump_init_atom_table_reply,
4194
    (dump_func)dump_get_msg_queue_reply,
4195
    NULL,
4196 4197
    (dump_func)dump_set_queue_mask_reply,
    (dump_func)dump_get_queue_status_reply,
4198
    (dump_func)dump_get_process_idle_event_reply,
4199 4200
    NULL,
    NULL,
4201
    (dump_func)dump_send_hardware_message_reply,
4202
    (dump_func)dump_get_message_reply,
4203 4204
    NULL,
    NULL,
4205
    (dump_func)dump_get_message_reply_reply,
4206
    (dump_func)dump_set_win_timer_reply,
4207
    NULL,
4208
    (dump_func)dump_is_window_hung_reply,
4209
    (dump_func)dump_get_serial_info_reply,
4210 4211 4212
    NULL,
    NULL,
    NULL,
4213
    (dump_func)dump_ioctl_reply,
4214
    (dump_func)dump_get_ioctl_result_reply,
4215
    (dump_func)dump_create_named_pipe_reply,
4216
    (dump_func)dump_get_named_pipe_info_reply,
4217
    (dump_func)dump_create_window_reply,
4218
    NULL,
4219
    (dump_func)dump_get_desktop_window_reply,
4220
    (dump_func)dump_set_window_owner_reply,
4221
    (dump_func)dump_get_window_info_reply,
4222
    (dump_func)dump_set_window_info_reply,
4223
    (dump_func)dump_set_parent_reply,
4224 4225
    (dump_func)dump_get_window_parents_reply,
    (dump_func)dump_get_window_children_reply,
4226
    (dump_func)dump_get_window_children_from_point_reply,
4227
    (dump_func)dump_get_window_tree_reply,
4228
    (dump_func)dump_set_window_pos_reply,
4229
    (dump_func)dump_get_window_rectangles_reply,
4230
    (dump_func)dump_get_window_text_reply,
4231
    NULL,
4232
    (dump_func)dump_get_windows_offset_reply,
4233
    (dump_func)dump_get_visible_region_reply,
4234
    (dump_func)dump_get_window_region_reply,
4235
    NULL,
4236
    (dump_func)dump_get_update_region_reply,
4237 4238 4239
    NULL,
    NULL,
    NULL,
4240 4241 4242
    (dump_func)dump_remove_window_property_reply,
    (dump_func)dump_get_window_property_reply,
    (dump_func)dump_get_window_properties_reply,
4243 4244
    (dump_func)dump_create_winstation_reply,
    (dump_func)dump_open_winstation_reply,
4245
    NULL,
4246
    (dump_func)dump_get_process_winstation_reply,
4247
    NULL,
4248
    (dump_func)dump_enum_winstation_reply,
4249 4250
    (dump_func)dump_create_desktop_reply,
    (dump_func)dump_open_desktop_reply,
4251
    NULL,
4252
    (dump_func)dump_get_thread_desktop_reply,
4253
    NULL,
4254
    (dump_func)dump_enum_desktop_reply,
4255
    (dump_func)dump_set_user_object_info_reply,
4256
    NULL,
4257
    (dump_func)dump_get_thread_input_reply,
4258
    (dump_func)dump_get_last_input_time_reply,
4259
    (dump_func)dump_get_key_state_reply,
4260
    NULL,
4261 4262 4263
    (dump_func)dump_set_foreground_window_reply,
    (dump_func)dump_set_focus_window_reply,
    (dump_func)dump_set_active_window_reply,
4264
    (dump_func)dump_set_capture_window_reply,
4265 4266
    (dump_func)dump_set_caret_window_reply,
    (dump_func)dump_set_caret_info_reply,
4267
    (dump_func)dump_set_hook_reply,
4268
    (dump_func)dump_remove_hook_reply,
4269
    (dump_func)dump_start_hook_chain_reply,
4270
    NULL,
4271
    (dump_func)dump_get_hook_info_reply,
4272
    (dump_func)dump_create_class_reply,
4273
    (dump_func)dump_destroy_class_reply,
4274
    (dump_func)dump_set_class_info_reply,
4275
    (dump_func)dump_set_clipboard_info_reply,
4276
    (dump_func)dump_open_token_reply,
4277
    (dump_func)dump_set_global_windows_reply,
4278 4279
    (dump_func)dump_adjust_token_privileges_reply,
    (dump_func)dump_get_token_privileges_reply,
4280
    (dump_func)dump_check_token_privileges_reply,
4281
    (dump_func)dump_duplicate_token_reply,
4282
    (dump_func)dump_access_check_reply,
4283
    (dump_func)dump_get_token_sid_reply,
4284
    (dump_func)dump_get_token_groups_reply,
4285 4286
    (dump_func)dump_get_token_default_dacl_reply,
    NULL,
4287
    NULL,
4288
    (dump_func)dump_get_security_object_reply,
Mike McCormack's avatar
Mike McCormack committed
4289 4290
    (dump_func)dump_create_mailslot_reply,
    (dump_func)dump_set_mailslot_info_reply,
4291 4292
    (dump_func)dump_create_directory_reply,
    (dump_func)dump_open_directory_reply,
4293
    (dump_func)dump_get_directory_entry_reply,
4294 4295 4296
    (dump_func)dump_create_symlink_reply,
    (dump_func)dump_open_symlink_reply,
    (dump_func)dump_query_symlink_reply,
4297
    (dump_func)dump_get_object_info_reply,
4298
    NULL,
4299
    (dump_func)dump_get_token_impersonation_level_reply,
4300
    (dump_func)dump_allocate_locally_unique_id_reply,
4301 4302
    (dump_func)dump_create_device_manager_reply,
    (dump_func)dump_create_device_reply,
4303
    NULL,
4304
    (dump_func)dump_get_next_device_request_reply,
4305
    (dump_func)dump_make_process_system_reply,
4306
    (dump_func)dump_get_token_statistics_reply,
4307 4308
    (dump_func)dump_create_completion_reply,
    (dump_func)dump_open_completion_reply,
4309
    NULL,
4310 4311
    (dump_func)dump_remove_completion_reply,
    (dump_func)dump_query_completion_reply,
4312 4313
    NULL,
    NULL,
4314
    (dump_func)dump_get_window_layered_info_reply,
4315
    NULL,
4316 4317
    (dump_func)dump_alloc_user_handle_reply,
    NULL,
4318
    (dump_func)dump_set_cursor_reply,
Alexandre Julliard's avatar
Alexandre Julliard committed
4319 4320
};

4321
static const char * const req_names[REQ_NB_REQUESTS] = {
4322
    "new_process",
4323
    "get_new_process_info",
Alexandre Julliard's avatar
Alexandre Julliard committed
4324
    "new_thread",
4325
    "get_startup_info",
4326
    "init_process_done",
Alexandre Julliard's avatar
Alexandre Julliard committed
4327 4328 4329 4330
    "init_thread",
    "terminate_process",
    "terminate_thread",
    "get_process_info",
4331
    "set_process_info",
Alexandre Julliard's avatar
Alexandre Julliard committed
4332
    "get_thread_info",
4333
    "set_thread_info",
4334
    "get_dll_info",
4335 4336
    "suspend_thread",
    "resume_thread",
4337 4338
    "load_dll",
    "unload_dll",
4339
    "queue_apc",
4340
    "get_apc_result",
Alexandre Julliard's avatar
Alexandre Julliard committed
4341
    "close_handle",
4342
    "set_handle_info",
Alexandre Julliard's avatar
Alexandre Julliard committed
4343 4344
    "dup_handle",
    "open_process",
4345
    "open_thread",
Alexandre Julliard's avatar
Alexandre Julliard committed
4346
    "select",
Alexandre Julliard's avatar
Alexandre Julliard committed
4347 4348
    "create_event",
    "event_op",
4349
    "open_event",
Alexandre Julliard's avatar
Alexandre Julliard committed
4350 4351
    "create_mutex",
    "release_mutex",
4352
    "open_mutex",
Alexandre Julliard's avatar
Alexandre Julliard committed
4353 4354
    "create_semaphore",
    "release_semaphore",
4355
    "open_semaphore",
4356
    "create_file",
4357
    "open_file_object",
4358
    "alloc_file_handle",
4359
    "get_handle_unix_name",
4360
    "get_handle_fd",
4361
    "flush_file",
4362 4363
    "lock_file",
    "unlock_file",
4364 4365 4366 4367 4368
    "create_socket",
    "accept_socket",
    "set_socket_event",
    "get_socket_event",
    "enable_socket_event",
4369
    "set_socket_deferred",
4370 4371
    "alloc_console",
    "free_console",
4372
    "get_console_renderer_events",
4373
    "open_console",
4374
    "get_console_wait_event",
4375 4376
    "get_console_mode",
    "set_console_mode",
4377 4378 4379 4380 4381 4382 4383
    "set_console_input_info",
    "get_console_input_info",
    "append_console_input_history",
    "get_console_input_history",
    "create_console_output",
    "set_console_output_info",
    "get_console_output_info",
4384 4385
    "write_console_input",
    "read_console_input",
4386
    "write_console_output",
4387
    "fill_console_output",
4388 4389
    "read_console_output",
    "move_console_output",
4390
    "send_console_signal",
4391
    "read_directory_changes",
4392
    "read_change",
4393
    "create_mapping",
4394
    "open_mapping",
4395
    "get_mapping_info",
4396 4397
    "get_mapping_committed_range",
    "add_mapping_committed_range",
4398 4399
    "create_snapshot",
    "next_process",
4400
    "next_thread",
4401
    "wait_debug_event",
4402 4403
    "queue_exception_event",
    "get_exception_status",
4404
    "output_debug_string",
4405 4406
    "continue_debug_event",
    "debug_process",
4407
    "debug_break",
4408
    "set_debugger_kill_on_exit",
4409
    "read_process_memory",
4410
    "write_process_memory",
4411 4412 4413
    "create_key",
    "open_key",
    "delete_key",
4414
    "flush_key",
4415 4416 4417 4418 4419 4420
    "enum_key",
    "set_key_value",
    "get_key_value",
    "enum_key_value",
    "delete_key_value",
    "load_registry",
4421
    "unload_registry",
4422
    "save_registry",
4423
    "set_registry_notification",
4424 4425 4426 4427
    "create_timer",
    "open_timer",
    "set_timer",
    "cancel_timer",
4428
    "get_timer_info",
4429 4430
    "get_thread_context",
    "set_thread_context",
4431
    "get_selector_entry",
4432 4433 4434
    "add_atom",
    "delete_atom",
    "find_atom",
4435 4436 4437
    "get_atom_information",
    "set_atom_information",
    "empty_atom_table",
4438
    "init_atom_table",
4439
    "get_msg_queue",
4440
    "set_queue_fd",
4441 4442
    "set_queue_mask",
    "get_queue_status",
4443
    "get_process_idle_event",
4444
    "send_message",
4445
    "post_quit_message",
4446
    "send_hardware_message",
4447 4448
    "get_message",
    "reply_message",
4449
    "accept_hardware_message",
4450 4451 4452
    "get_message_reply",
    "set_win_timer",
    "kill_win_timer",
4453
    "is_window_hung",
4454 4455
    "get_serial_info",
    "set_serial_info",
4456
    "register_async",
4457
    "cancel_async",
4458
    "ioctl",
4459
    "get_ioctl_result",
4460
    "create_named_pipe",
4461
    "get_named_pipe_info",
4462 4463
    "create_window",
    "destroy_window",
4464
    "get_desktop_window",
4465
    "set_window_owner",
4466
    "get_window_info",
4467
    "set_window_info",
4468
    "set_parent",
4469 4470
    "get_window_parents",
    "get_window_children",
4471
    "get_window_children_from_point",
4472
    "get_window_tree",
4473
    "set_window_pos",
4474
    "get_window_rectangles",
4475 4476
    "get_window_text",
    "set_window_text",
4477
    "get_windows_offset",
4478
    "get_visible_region",
4479 4480
    "get_window_region",
    "set_window_region",
4481
    "get_update_region",
4482
    "update_window_zorder",
4483
    "redraw_window",
4484 4485 4486 4487
    "set_window_property",
    "remove_window_property",
    "get_window_property",
    "get_window_properties",
4488 4489 4490 4491 4492
    "create_winstation",
    "open_winstation",
    "close_winstation",
    "get_process_winstation",
    "set_process_winstation",
4493
    "enum_winstation",
4494 4495 4496 4497 4498
    "create_desktop",
    "open_desktop",
    "close_desktop",
    "get_thread_desktop",
    "set_thread_desktop",
4499
    "enum_desktop",
4500
    "set_user_object_info",
4501 4502
    "attach_thread_input",
    "get_thread_input",
4503
    "get_last_input_time",
4504 4505
    "get_key_state",
    "set_key_state",
4506 4507 4508
    "set_foreground_window",
    "set_focus_window",
    "set_active_window",
4509
    "set_capture_window",
4510 4511
    "set_caret_window",
    "set_caret_info",
4512 4513 4514 4515
    "set_hook",
    "remove_hook",
    "start_hook_chain",
    "finish_hook_chain",
4516
    "get_hook_info",
4517 4518 4519
    "create_class",
    "destroy_class",
    "set_class_info",
4520
    "set_clipboard_info",
4521
    "open_token",
4522
    "set_global_windows",
4523 4524
    "adjust_token_privileges",
    "get_token_privileges",
4525
    "check_token_privileges",
4526
    "duplicate_token",
4527
    "access_check",
4528
    "get_token_sid",
4529
    "get_token_groups",
4530 4531
    "get_token_default_dacl",
    "set_token_default_dacl",
4532
    "set_security_object",
4533
    "get_security_object",
Mike McCormack's avatar
Mike McCormack committed
4534 4535
    "create_mailslot",
    "set_mailslot_info",
4536 4537
    "create_directory",
    "open_directory",
4538
    "get_directory_entry",
4539 4540 4541
    "create_symlink",
    "open_symlink",
    "query_symlink",
4542
    "get_object_info",
4543
    "unlink_object",
4544
    "get_token_impersonation_level",
4545
    "allocate_locally_unique_id",
4546 4547 4548
    "create_device_manager",
    "create_device",
    "delete_device",
4549
    "get_next_device_request",
4550
    "make_process_system",
4551
    "get_token_statistics",
4552 4553 4554 4555 4556
    "create_completion",
    "open_completion",
    "add_completion",
    "remove_completion",
    "query_completion",
4557
    "set_completion_info",
4558
    "add_fd_completion",
4559 4560
    "get_window_layered_info",
    "set_window_layered_info",
4561 4562
    "alloc_user_handle",
    "free_user_handle",
4563
    "set_cursor",
Alexandre Julliard's avatar
Alexandre Julliard committed
4564 4565
};

4566 4567 4568 4569 4570 4571
static const struct
{
    const char  *name;
    unsigned int value;
} status_names[] =
{
4572
    { "ABANDONED_WAIT_0",            STATUS_ABANDONED_WAIT_0 },
4573 4574
    { "ACCESS_DENIED",               STATUS_ACCESS_DENIED },
    { "ACCESS_VIOLATION",            STATUS_ACCESS_VIOLATION },
4575
    { "ADDRESS_ALREADY_ASSOCIATED",  STATUS_ADDRESS_ALREADY_ASSOCIATED },
4576
    { "ALERTED",                     STATUS_ALERTED },
4577
    { "ALIAS_EXISTS",                STATUS_ALIAS_EXISTS },
4578
    { "BAD_DEVICE_TYPE",             STATUS_BAD_DEVICE_TYPE },
4579
    { "BAD_IMPERSONATION_LEVEL",     STATUS_BAD_IMPERSONATION_LEVEL },
4580
    { "BREAKPOINT",                  STATUS_BREAKPOINT },
4581 4582
    { "BUFFER_OVERFLOW",             STATUS_BUFFER_OVERFLOW },
    { "BUFFER_TOO_SMALL",            STATUS_BUFFER_TOO_SMALL },
4583
    { "CANCELLED",                   STATUS_CANCELLED },
4584
    { "CANNOT_DELETE",               STATUS_CANNOT_DELETE },
4585
    { "CANT_OPEN_ANONYMOUS",         STATUS_CANT_OPEN_ANONYMOUS },
4586
    { "CANT_WAIT",                   STATUS_CANT_WAIT },
4587
    { "CHILD_MUST_BE_VOLATILE",      STATUS_CHILD_MUST_BE_VOLATILE },
4588 4589 4590 4591
    { "CONNECTION_ABORTED",          STATUS_CONNECTION_ABORTED },
    { "CONNECTION_DISCONNECTED",     STATUS_CONNECTION_DISCONNECTED },
    { "CONNECTION_REFUSED",          STATUS_CONNECTION_REFUSED },
    { "CONNECTION_RESET",            STATUS_CONNECTION_RESET },
4592
    { "DEBUGGER_INACTIVE",           STATUS_DEBUGGER_INACTIVE },
4593 4594 4595 4596 4597 4598 4599 4600
    { "DEVICE_BUSY",                 STATUS_DEVICE_BUSY },
    { "DIRECTORY_NOT_EMPTY",         STATUS_DIRECTORY_NOT_EMPTY },
    { "DISK_FULL",                   STATUS_DISK_FULL },
    { "DLL_NOT_FOUND",               STATUS_DLL_NOT_FOUND },
    { "ERROR_CLASS_ALREADY_EXISTS",  0xc0010000 | ERROR_CLASS_ALREADY_EXISTS },
    { "ERROR_CLASS_DOES_NOT_EXIST",  0xc0010000 | ERROR_CLASS_DOES_NOT_EXIST },
    { "ERROR_CLASS_HAS_WINDOWS",     0xc0010000 | ERROR_CLASS_HAS_WINDOWS },
    { "ERROR_CLIPBOARD_NOT_OPEN",    0xc0010000 | ERROR_CLIPBOARD_NOT_OPEN },
4601
    { "ERROR_INVALID_CURSOR_HANDLE", 0xc0010000 | ERROR_INVALID_CURSOR_HANDLE },
4602
    { "ERROR_INVALID_INDEX",         0xc0010000 | ERROR_INVALID_INDEX },
4603
    { "ERROR_INVALID_WINDOW_HANDLE", 0xc0010000 | ERROR_INVALID_WINDOW_HANDLE },
4604
    { "FILE_DELETED",                STATUS_FILE_DELETED },
4605 4606
    { "FILE_IS_A_DIRECTORY",         STATUS_FILE_IS_A_DIRECTORY },
    { "FILE_LOCK_CONFLICT",          STATUS_FILE_LOCK_CONFLICT },
4607
    { "GENERIC_NOT_MAPPED",          STATUS_GENERIC_NOT_MAPPED },
4608
    { "HANDLES_CLOSED",              STATUS_HANDLES_CLOSED },
4609
    { "HANDLE_NOT_CLOSABLE",         STATUS_HANDLE_NOT_CLOSABLE },
4610
    { "ILLEGAL_FUNCTION",            STATUS_ILLEGAL_FUNCTION },
4611
    { "INSTANCE_NOT_AVAILABLE",      STATUS_INSTANCE_NOT_AVAILABLE },
4612
    { "INSUFFICIENT_RESOURCES",      STATUS_INSUFFICIENT_RESOURCES },
4613
    { "INVALID_CID",                 STATUS_INVALID_CID },
4614
    { "INVALID_DEVICE_REQUEST",      STATUS_INVALID_DEVICE_REQUEST },
4615 4616 4617
    { "INVALID_FILE_FOR_SECTION",    STATUS_INVALID_FILE_FOR_SECTION },
    { "INVALID_HANDLE",              STATUS_INVALID_HANDLE },
    { "INVALID_PARAMETER",           STATUS_INVALID_PARAMETER },
4618
    { "INVALID_SECURITY_DESCR",      STATUS_INVALID_SECURITY_DESCR },
4619 4620
    { "IO_TIMEOUT",                  STATUS_IO_TIMEOUT },
    { "KEY_DELETED",                 STATUS_KEY_DELETED },
4621
    { "MAPPED_FILE_SIZE_ZERO",       STATUS_MAPPED_FILE_SIZE_ZERO },
4622
    { "MUTANT_NOT_OWNED",            STATUS_MUTANT_NOT_OWNED },
4623
    { "NAME_TOO_LONG",               STATUS_NAME_TOO_LONG },
4624 4625
    { "NETWORK_BUSY",                STATUS_NETWORK_BUSY },
    { "NETWORK_UNREACHABLE",         STATUS_NETWORK_UNREACHABLE },
4626
    { "NOTIFY_ENUM_DIR",             STATUS_NOTIFY_ENUM_DIR },
4627 4628
    { "NOT_ALL_ASSIGNED",            STATUS_NOT_ALL_ASSIGNED },
    { "NOT_A_DIRECTORY",             STATUS_NOT_A_DIRECTORY },
4629
    { "NOT_FOUND",                   STATUS_NOT_FOUND },
4630 4631
    { "NOT_IMPLEMENTED",             STATUS_NOT_IMPLEMENTED },
    { "NOT_REGISTRY_FILE",           STATUS_NOT_REGISTRY_FILE },
4632
    { "NOT_SUPPORTED",               STATUS_NOT_SUPPORTED },
4633 4634 4635 4636 4637 4638 4639 4640 4641
    { "NO_DATA_DETECTED",            STATUS_NO_DATA_DETECTED },
    { "NO_IMPERSONATION_TOKEN",      STATUS_NO_IMPERSONATION_TOKEN },
    { "NO_MEMORY",                   STATUS_NO_MEMORY },
    { "NO_MORE_ENTRIES",             STATUS_NO_MORE_ENTRIES },
    { "NO_MORE_FILES",               STATUS_NO_MORE_FILES },
    { "NO_SUCH_DEVICE",              STATUS_NO_SUCH_DEVICE },
    { "NO_SUCH_FILE",                STATUS_NO_SUCH_FILE },
    { "NO_TOKEN",                    STATUS_NO_TOKEN },
    { "OBJECT_NAME_COLLISION",       STATUS_OBJECT_NAME_COLLISION },
4642
    { "OBJECT_NAME_EXISTS",          STATUS_OBJECT_NAME_EXISTS },
4643 4644 4645
    { "OBJECT_NAME_INVALID",         STATUS_OBJECT_NAME_INVALID },
    { "OBJECT_NAME_NOT_FOUND",       STATUS_OBJECT_NAME_NOT_FOUND },
    { "OBJECT_PATH_INVALID",         STATUS_OBJECT_PATH_INVALID },
4646 4647
    { "OBJECT_PATH_NOT_FOUND",       STATUS_OBJECT_PATH_NOT_FOUND },
    { "OBJECT_PATH_SYNTAX_BAD",      STATUS_OBJECT_PATH_SYNTAX_BAD },
4648 4649 4650 4651 4652 4653 4654 4655
    { "OBJECT_TYPE_MISMATCH",        STATUS_OBJECT_TYPE_MISMATCH },
    { "PENDING",                     STATUS_PENDING },
    { "PIPE_BUSY",                   STATUS_PIPE_BUSY },
    { "PIPE_CONNECTED",              STATUS_PIPE_CONNECTED },
    { "PIPE_DISCONNECTED",           STATUS_PIPE_DISCONNECTED },
    { "PIPE_LISTENING",              STATUS_PIPE_LISTENING },
    { "PIPE_NOT_AVAILABLE",          STATUS_PIPE_NOT_AVAILABLE },
    { "PRIVILEGE_NOT_HELD",          STATUS_PRIVILEGE_NOT_HELD },
4656
    { "PROCESS_IS_TERMINATING",      STATUS_PROCESS_IS_TERMINATING },
4657 4658 4659
    { "SECTION_TOO_BIG",             STATUS_SECTION_TOO_BIG },
    { "SEMAPHORE_LIMIT_EXCEEDED",    STATUS_SEMAPHORE_LIMIT_EXCEEDED },
    { "SHARING_VIOLATION",           STATUS_SHARING_VIOLATION },
4660
    { "SHUTDOWN_IN_PROGRESS",        STATUS_SHUTDOWN_IN_PROGRESS },
4661
    { "SUSPEND_COUNT_EXCEEDED",      STATUS_SUSPEND_COUNT_EXCEEDED },
4662
    { "THREAD_IS_TERMINATING",       STATUS_THREAD_IS_TERMINATING },
4663
    { "TIMEOUT",                     STATUS_TIMEOUT },
4664
    { "TOO_MANY_OPENED_FILES",       STATUS_TOO_MANY_OPENED_FILES },
4665
    { "UNSUCCESSFUL",                STATUS_UNSUCCESSFUL },
4666
    { "USER_APC",                    STATUS_USER_APC },
4667
    { "USER_MAPPED_FILE",            STATUS_USER_MAPPED_FILE },
4668
    { "VOLUME_DISMOUNTED",           STATUS_VOLUME_DISMOUNTED },
4669 4670 4671 4672
    { "WAS_LOCKED",                  STATUS_WAS_LOCKED },
    { NULL, 0 }
};

4673 4674 4675
/* ### make_requests end ### */
/* Everything above this line is generated automatically by tools/make_requests */

4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689
static const char *get_status_name( unsigned int status )
{
    int i;
    static char buffer[10];

    if (status)
    {
        for (i = 0; status_names[i].name; i++)
            if (status_names[i].value == status) return status_names[i].name;
    }
    sprintf( buffer, "%x", status );
    return buffer;
}

4690
void trace_request(void)
Alexandre Julliard's avatar
Alexandre Julliard committed
4691
{
4692
    enum request req = current->req.request_header.req;
4693
    if (req < REQ_NB_REQUESTS)
Alexandre Julliard's avatar
Alexandre Julliard committed
4694
    {
4695
        fprintf( stderr, "%04x: %s(", current->id, req_names[req] );
4696 4697 4698 4699 4700 4701
        if (req_dumpers[req])
        {
            cur_data = get_req_data();
            cur_size = get_req_data_size();
            req_dumpers[req]( &current->req );
        }
4702
        fprintf( stderr, " )\n" );
Alexandre Julliard's avatar
Alexandre Julliard committed
4703
    }
4704
    else fprintf( stderr, "%04x: %d(?)\n", current->id, req );
Alexandre Julliard's avatar
Alexandre Julliard committed
4705 4706
}

4707
void trace_reply( enum request req, const union generic_reply *reply )
Alexandre Julliard's avatar
Alexandre Julliard committed
4708
{
4709
    if (req < REQ_NB_REQUESTS)
Alexandre Julliard's avatar
Alexandre Julliard committed
4710
    {
4711 4712
        fprintf( stderr, "%04x: %s() = %s",
                 current->id, req_names[req], get_status_name(current->error) );
4713 4714 4715
        if (reply_dumpers[req])
        {
            fprintf( stderr, " {" );
4716 4717 4718
            cur_data = current->reply_data;
            cur_size = reply->reply_header.reply_size;
            reply_dumpers[req]( reply );
4719 4720 4721
            fprintf( stderr, " }" );
        }
        fputc( '\n', stderr );
Alexandre Julliard's avatar
Alexandre Julliard committed
4722
    }
4723 4724
    else fprintf( stderr, "%04x: %d() = %s\n",
                  current->id, req, get_status_name(current->error) );
Alexandre Julliard's avatar
Alexandre Julliard committed
4725
}