trace.c 194 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 "winuser.h"
40
#include "winioctl.h"
41
#include "ddk/wdm.h"
42 43
#define USE_WS_PREFIX
#include "winsock2.h"
44
#include "file.h"
45
#include "request.h"
46
#include "unicode.h"
Alexandre Julliard's avatar
Alexandre Julliard committed
47

48
static const void *cur_data;
49
static data_size_t cur_size;
50

51 52
static const char *get_status_name( unsigned int status );

53 54
/* utility functions */

55
static inline void remove_data( data_size_t size )
56
{
57 58
    cur_data = (const char *)cur_data + size;
    cur_size -= size;
59 60
}

61
static void dump_uints( const char *prefix, const unsigned int *ptr, int len )
62
{
63
    fprintf( stderr, "%s{", prefix );
64
    while (len > 0)
65 66 67 68 69 70 71
    {
        fprintf( stderr, "%08x", *ptr++ );
        if (--len) fputc( ',', stderr );
    }
    fputc( '}', stderr );
}

72 73 74 75 76 77 78 79 80 81 82 83 84
static void dump_handles( const char *prefix, const obj_handle_t *data, data_size_t size )
{
    data_size_t len = size / sizeof(*data);

    fprintf( stderr,"%s{", prefix );
    while (len > 0)
    {
        fprintf( stderr, "%04x", *data++ );
        if (--len) fputc( ',', stderr );
    }
    fputc( '}', stderr );
}

85
static void dump_timeout( const char *prefix, const timeout_t *time )
86
{
87
    fprintf( stderr, "%s%s", prefix, get_timeout_str(*time) );
88 89
}

90
static void dump_uint64( const char *prefix, const unsigned __int64 *val )
91
{
92
    if ((unsigned int)*val != *val)
93
        fprintf( stderr, "%s%x%08x", prefix, (unsigned int)(*val >> 32), (unsigned int)*val );
94
    else
95
        fprintf( stderr, "%s%08x", prefix, (unsigned int)*val );
96 97
}

98
static void dump_rectangle( const char *prefix, const rectangle_t *rect )
99
{
100
    fprintf( stderr, "%s{%d,%d;%d,%d}", prefix,
101 102 103
             rect->left, rect->top, rect->right, rect->bottom );
}

104
static void dump_char_info( const char *prefix, const char_info_t *info )
105
{
106
    fprintf( stderr, "%s{'", prefix );
107 108 109 110
    dump_strW( &info->ch, 1, stderr, "\'\'" );
    fprintf( stderr, "',%04x}", info->attr );
}

111
static void dump_ioctl_code( const char *prefix, const ioctl_code_t *code )
112 113 114
{
    switch(*code)
    {
115
#define CASE(c) case c: fprintf( stderr, "%s%s", prefix, #c ); break
116 117
        CASE(FSCTL_DISMOUNT_VOLUME);
        CASE(FSCTL_PIPE_DISCONNECT);
118
        CASE(FSCTL_PIPE_LISTEN);
119
        CASE(FSCTL_PIPE_WAIT);
120
        CASE(WS_SIO_ADDRESS_LIST_CHANGE);
121
        default: fprintf( stderr, "%s%08x", prefix, *code ); break;
122 123 124 125
#undef CASE
    }
}

126
static void dump_cpu_type( const char *prefix, const cpu_type_t *code )
127 128 129
{
    switch (*code)
    {
130
#define CASE(c) case CPU_##c: fprintf( stderr, "%s%s", prefix, #c ); break
131 132 133
        CASE(x86);
        CASE(x86_64);
        CASE(POWERPC);
134 135
        CASE(ARM);
        CASE(ARM64);
136
        default: fprintf( stderr, "%s%u", prefix, *code ); break;
137 138 139 140
#undef CASE
    }
}

141
static void dump_apc_call( const char *prefix, const apc_call_t *call )
142
{
143
    fprintf( stderr, "%s{", prefix );
144 145 146 147 148 149
    switch(call->type)
    {
    case APC_NONE:
        fprintf( stderr, "APC_NONE" );
        break;
    case APC_USER:
150 151 152 153
        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] );
154
        fputc( '}', stderr );
155 156
        break;
    case APC_TIMER:
157 158
        dump_timeout( "APC_TIMER,time=", &call->timer.time );
        dump_uint64( ",arg=", &call->timer.arg );
159 160
        break;
    case APC_ASYNC_IO:
161 162 163
        dump_uint64( "APC_ASYNC_IO,func=", &call->async_io.func );
        dump_uint64( ",user=", &call->async_io.user );
        dump_uint64( ",sb=", &call->async_io.sb );
164
        fprintf( stderr, ",status=%s", get_status_name(call->async_io.status) );
165
        break;
166
    case APC_VIRTUAL_ALLOC:
167 168
        dump_uint64( "APC_VIRTUAL_ALLOC,addr==", &call->virtual_alloc.addr );
        dump_uint64( ",size=", &call->virtual_alloc.size );
169
        fprintf( stderr, ",zero_bits=%u,op_type=%x,prot=%x",
170 171 172 173
                 call->virtual_alloc.zero_bits, call->virtual_alloc.op_type,
                 call->virtual_alloc.prot );
        break;
    case APC_VIRTUAL_FREE:
174 175
        dump_uint64( "APC_VIRTUAL_FREE,addr=", &call->virtual_free.addr );
        dump_uint64( ",size=", &call->virtual_free.size );
176
        fprintf( stderr, ",op_type=%x", call->virtual_free.op_type );
177
        break;
178
    case APC_VIRTUAL_QUERY:
179
        dump_uint64( "APC_VIRTUAL_QUERY,addr=", &call->virtual_query.addr );
180
        break;
181
    case APC_VIRTUAL_PROTECT:
182 183
        dump_uint64( "APC_VIRTUAL_PROTECT,addr=", &call->virtual_protect.addr );
        dump_uint64( ",size=", &call->virtual_protect.size );
184
        fprintf( stderr, ",prot=%x", call->virtual_protect.prot );
185
        break;
186
    case APC_VIRTUAL_FLUSH:
187 188
        dump_uint64( "APC_VIRTUAL_FLUSH,addr=", &call->virtual_flush.addr );
        dump_uint64( ",size=", &call->virtual_flush.size );
189
        break;
190
    case APC_VIRTUAL_LOCK:
191 192
        dump_uint64( "APC_VIRTUAL_LOCK,addr=", &call->virtual_lock.addr );
        dump_uint64( ",size=", &call->virtual_lock.size );
193 194
        break;
    case APC_VIRTUAL_UNLOCK:
195 196
        dump_uint64( "APC_VIRTUAL_UNLOCK,addr=", &call->virtual_unlock.addr );
        dump_uint64( ",size=", &call->virtual_unlock.size );
197
        break;
198
    case APC_MAP_VIEW:
199 200 201 202
        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 );
203
        fprintf( stderr, ",zero_bits=%u,alloc_type=%x,prot=%x",
204
                 call->map_view.zero_bits, call->map_view.alloc_type, call->map_view.prot );
205 206
        break;
    case APC_UNMAP_VIEW:
207
        dump_uint64( "APC_UNMAP_VIEW,addr=", &call->unmap_view.addr );
208
        break;
209
    case APC_CREATE_THREAD:
210 211 212 213
        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 );
214
        fprintf( stderr, ",suspend=%u", call->create_thread.suspend );
215
        break;
216 217 218 219 220 221 222
    default:
        fprintf( stderr, "type=%u", call->type );
        break;
    }
    fputc( '}', stderr );
}

223
static void dump_apc_result( const char *prefix, const apc_result_t *result )
224
{
225
    fprintf( stderr, "%s{", prefix );
226 227 228 229
    switch(result->type)
    {
    case APC_NONE:
        break;
230
    case APC_ASYNC_IO:
231
        fprintf( stderr, "APC_ASYNC_IO,status=%s,total=%u",
232
                 get_status_name( result->async_io.status ), result->async_io.total );
233
        dump_uint64( ",apc=", &result->async_io.apc );
234
        dump_uint64( ",arg=", &result->async_io.arg );
235
        break;
236
    case APC_VIRTUAL_ALLOC:
237
        fprintf( stderr, "APC_VIRTUAL_ALLOC,status=%s",
238
                 get_status_name( result->virtual_alloc.status ));
239 240
        dump_uint64( ",addr=", &result->virtual_alloc.addr );
        dump_uint64( ",size=", &result->virtual_alloc.size );
241 242
        break;
    case APC_VIRTUAL_FREE:
243
        fprintf( stderr, "APC_VIRTUAL_FREE,status=%s",
244
                 get_status_name( result->virtual_free.status ));
245 246
        dump_uint64( ",addr=", &result->virtual_free.addr );
        dump_uint64( ",size=", &result->virtual_free.size );
247
        break;
248
    case APC_VIRTUAL_QUERY:
249
        fprintf( stderr, "APC_VIRTUAL_QUERY,status=%s",
250
                 get_status_name( result->virtual_query.status ));
251 252 253
        dump_uint64( ",base=", &result->virtual_query.base );
        dump_uint64( ",alloc_base=", &result->virtual_query.alloc_base );
        dump_uint64( ",size=", &result->virtual_query.size );
254 255 256
        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 );
257
        break;
258
    case APC_VIRTUAL_PROTECT:
259
        fprintf( stderr, "APC_VIRTUAL_PROTECT,status=%s",
260
                 get_status_name( result->virtual_protect.status ));
261 262
        dump_uint64( ",addr=", &result->virtual_protect.addr );
        dump_uint64( ",size=", &result->virtual_protect.size );
263
        fprintf( stderr, ",prot=%x", result->virtual_protect.prot );
264
        break;
265
    case APC_VIRTUAL_FLUSH:
266
        fprintf( stderr, "APC_VIRTUAL_FLUSH,status=%s",
267
                 get_status_name( result->virtual_flush.status ));
268 269
        dump_uint64( ",addr=", &result->virtual_flush.addr );
        dump_uint64( ",size=", &result->virtual_flush.size );
270
        break;
271
    case APC_VIRTUAL_LOCK:
272
        fprintf( stderr, "APC_VIRTUAL_LOCK,status=%s",
273
                 get_status_name( result->virtual_lock.status ));
274 275
        dump_uint64( ",addr=", &result->virtual_lock.addr );
        dump_uint64( ",size=", &result->virtual_lock.size );
276 277
        break;
    case APC_VIRTUAL_UNLOCK:
278
        fprintf( stderr, "APC_VIRTUAL_UNLOCK,status=%s",
279
                 get_status_name( result->virtual_unlock.status ));
280 281
        dump_uint64( ",addr=", &result->virtual_unlock.addr );
        dump_uint64( ",size=", &result->virtual_unlock.size );
282
        break;
283
    case APC_MAP_VIEW:
284
        fprintf( stderr, "APC_MAP_VIEW,status=%s",
285
                 get_status_name( result->map_view.status ));
286 287
        dump_uint64( ",addr=", &result->map_view.addr );
        dump_uint64( ",size=", &result->map_view.size );
288 289 290 291 292
        break;
    case APC_UNMAP_VIEW:
        fprintf( stderr, "APC_UNMAP_VIEW,status=%s",
                 get_status_name( result->unmap_view.status ) );
        break;
293
    case APC_CREATE_THREAD:
294
        fprintf( stderr, "APC_CREATE_THREAD,status=%s,tid=%04x,handle=%04x",
295 296 297
                 get_status_name( result->create_thread.status ),
                 result->create_thread.tid, result->create_thread.handle );
        break;
298 299 300 301 302 303 304
    default:
        fprintf( stderr, "type=%u", result->type );
        break;
    }
    fputc( '}', stderr );
}

305
static void dump_async_data( const char *prefix, const async_data_t *data )
306
{
307 308 309 310 311
    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 );
312
    fputc( '}', stderr );
313 314
}

315 316 317 318
static void dump_irp_params( const char *prefix, const irp_params_t *data )
{
    switch (data->major)
    {
319 320 321 322 323 324
    case IRP_MJ_CREATE:
        fprintf( stderr, "%s{major=CREATE,access=%08x,sharing=%08x,options=%08x",
                 prefix, data->create.access, data->create.sharing, data->create.options );
        dump_uint64( ",device=", &data->create.device );
        fputc( '}', stderr );
        break;
325 326
    case IRP_MJ_CLOSE:
        fprintf( stderr, "%s{major=CLOSE", prefix );
327
        dump_uint64( ",file=", &data->close.file );
328 329
        fputc( '}', stderr );
        break;
330 331 332
    case IRP_MJ_READ:
        fprintf( stderr, "%s{major=READ,key=%08x", prefix, data->read.key );
        dump_uint64( ",pos=", &data->read.pos );
333
        dump_uint64( ",file=", &data->read.file );
334 335 336 337 338
        fputc( '}', stderr );
        break;
    case IRP_MJ_WRITE:
        fprintf( stderr, "%s{major=WRITE,key=%08x", prefix, data->write.key );
        dump_uint64( ",pos=", &data->write.pos );
339
        dump_uint64( ",file=", &data->write.file );
340 341
        fputc( '}', stderr );
        break;
342
    case IRP_MJ_FLUSH_BUFFERS:
343
        fprintf( stderr, "%s{major=FLUSH_BUFFERS", prefix );
344
        dump_uint64( ",file=", &data->flush.file );
345
        fputc( '}', stderr );
346
        break;
347 348 349
    case IRP_MJ_DEVICE_CONTROL:
        fprintf( stderr, "%s{major=DEVICE_CONTROL", prefix );
        dump_ioctl_code( ",code=", &data->ioctl.code );
350
        dump_uint64( ",file=", &data->ioctl.file );
351 352
        fputc( '}', stderr );
        break;
353 354 355
    case IRP_MJ_MAXIMUM_FUNCTION + 1: /* invalid */
        fprintf( stderr, "%s{}", prefix );
        break;
356 357 358 359 360 361
    default:
        fprintf( stderr, "%s{major=%u}", prefix, data->major );
        break;
    }
}

362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389
static void dump_hw_input( const char *prefix, const hw_input_t *input )
{
    switch (input->type)
    {
    case INPUT_MOUSE:
        fprintf( stderr, "%s{type=MOUSE,x=%d,y=%d,data=%08x,flags=%08x,time=%u",
                 prefix, input->mouse.x, input->mouse.y, input->mouse.data, input->mouse.flags,
                 input->mouse.time );
        dump_uint64( ",info=", &input->mouse.info );
        fputc( '}', stderr );
        break;
    case INPUT_KEYBOARD:
        fprintf( stderr, "%s{type=KEYBOARD,vkey=%04hx,scan=%04hx,flags=%08x,time=%u",
                 prefix, input->kbd.vkey, input->kbd.scan, input->kbd.flags, input->kbd.time );
        dump_uint64( ",info=", &input->kbd.info );
        fputc( '}', stderr );
        break;
    case INPUT_HARDWARE:
        fprintf( stderr, "%s{type=HARDWARE,msg=%04x", prefix, input->hw.msg );
        dump_uint64( ",lparam=", &input->hw.lparam );
        fputc( '}', stderr );
        break;
    default:
        fprintf( stderr, "%s{type=%04x}", prefix, input->type );
        break;
    }
}

390
static void dump_luid( const char *prefix, const luid_t *luid )
391
{
392
    fprintf( stderr, "%s%d.%u", prefix, luid->high_part, luid->low_part );
393 394
}

395
static void dump_varargs_ints( const char *prefix, data_size_t size )
396
{
397 398 399
    const int *data = cur_data;
    data_size_t len = size / sizeof(*data);

400
    fprintf( stderr,"%s{", prefix );
401
    while (len > 0)
402
    {
403 404
        fprintf( stderr, "%d", *data++ );
        if (--len) fputc( ',', stderr );
405 406
    }
    fputc( '}', stderr );
407
    remove_data( size );
408 409
}

410 411 412 413 414 415 416 417
static void dump_varargs_uints( const char *prefix, data_size_t size )
{
    const unsigned int *data = cur_data;

    dump_uints( prefix, data, size / sizeof(*data) );
    remove_data( size );
}

418
static void dump_varargs_uints64( const char *prefix, data_size_t size )
419
{
420
    const unsigned __int64 *data = cur_data;
421
    data_size_t len = size / sizeof(*data);
422

423
    fprintf( stderr,"%s{", prefix );
424 425
    while (len > 0)
    {
426
        dump_uint64( "", data++ );
427 428 429
        if (--len) fputc( ',', stderr );
    }
    fputc( '}', stderr );
430
    remove_data( size );
431 432
}

433
static void dump_varargs_apc_result( const char *prefix, data_size_t size )
434 435 436 437 438
{
    const apc_result_t *result = cur_data;

    if (size >= sizeof(*result))
    {
439
        dump_apc_result( prefix, result );
440 441 442 443 444
        size = sizeof(*result);
    }
    remove_data( size );
}

445
static void dump_varargs_select_op( const char *prefix, data_size_t size )
446
{
447
    select_op_t data;
448

449
    if (!size)
450
    {
451 452 453 454 455 456 457 458 459 460 461 462 463
        fprintf( stderr, "%s{}", prefix );
        return;
    }
    memset( &data, 0, sizeof(data) );
    memcpy( &data, cur_data, min( size, sizeof(data) ));

    fprintf( stderr, "%s{", prefix );
    switch (data.op)
    {
    case SELECT_NONE:
        fprintf( stderr, "NONE" );
        break;
    case SELECT_WAIT:
464 465
    case SELECT_WAIT_ALL:
        fprintf( stderr, "%s", data.op == SELECT_WAIT ? "WAIT" : "WAIT_ALL" );
466 467 468 469
        if (size > offsetof( select_op_t, wait.handles ))
            dump_handles( ",handles=", data.wait.handles,
                          min( size, sizeof(data.wait) ) - offsetof( select_op_t, wait.handles ));
        break;
470 471 472 473
    case SELECT_SIGNAL_AND_WAIT:
        fprintf( stderr, "SIGNAL_AND_WAIT,signal=%04x,wait=%04x",
                 data.signal_and_wait.signal, data.signal_and_wait.wait );
        break;
474 475 476 477 478 479 480
    case SELECT_KEYED_EVENT_WAIT:
    case SELECT_KEYED_EVENT_RELEASE:
        fprintf( stderr, "KEYED_EVENT_%s,handle=%04x",
                 data.op == SELECT_KEYED_EVENT_WAIT ? "WAIT" : "RELEASE",
                 data.keyed_event.handle );
        dump_uint64( ",key=", &data.keyed_event.key );
        break;
481 482 483
    default:
        fprintf( stderr, "op=%u", data.op );
        break;
484 485
    }
    fputc( '}', stderr );
486
    remove_data( size );
487 488
}

489
static void dump_varargs_user_handles( const char *prefix, data_size_t size )
490
{
491
    const user_handle_t *data = cur_data;
492
    data_size_t len = size / sizeof(*data);
493

494
    fprintf( stderr,"%s{", prefix );
495 496
    while (len > 0)
    {
497
        fprintf( stderr, "%08x", *data++ );
498 499 500
        if (--len) fputc( ',', stderr );
    }
    fputc( '}', stderr );
501
    remove_data( size );
502 503
}

504
static void dump_varargs_bytes( const char *prefix, data_size_t size )
505
{
506
    const unsigned char *data = cur_data;
507
    data_size_t len = min( 1024, size );
508

509
    fprintf( stderr,"%s{", prefix );
510 511 512 513 514
    while (len > 0)
    {
        fprintf( stderr, "%02x", *data++ );
        if (--len) fputc( ',', stderr );
    }
515
    if (size > 1024) fprintf( stderr, "...(total %u)", size );
516
    fputc( '}', stderr );
517
    remove_data( size );
518 519
}

520
static void dump_varargs_string( const char *prefix, data_size_t size )
521
{
522
    fprintf( stderr, "%s\"%.*s\"", prefix, (int)size, (const char *)cur_data );
523
    remove_data( size );
524 525
}

526
static void dump_varargs_unicode_str( const char *prefix, data_size_t size )
527
{
528
    fprintf( stderr, "%sL\"", prefix );
529
    dump_strW( cur_data, size / sizeof(WCHAR), stderr, "\"\"" );
530
    fputc( '\"', stderr );
531
    remove_data( size );
532 533
}

534
static void dump_varargs_context( const char *prefix, data_size_t size )
535
{
536 537 538 539
    const context_t *context = cur_data;
    context_t ctx;
    unsigned int i;

540 541
    if (!size)
    {
542
        fprintf( stderr, "%s{}", prefix );
543 544
        return;
    }
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
    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)
        {
572
            fprintf( stderr, ",fp.ctrl=%08x,fp.status=%08x,fp.tag=%08x,fp.err_off=%08x,fp.err_sel=%08x",
573 574 575 576 577
                     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++)
578 579 580 581 582
            {
                long double reg = 0;
                memcpy( &reg, &ctx.fp.i386_regs.regs[10 * i], 10 );
                fprintf( stderr, ",fp.reg%u=%Lg", i, reg );
            }
583 584
        }
        if (ctx.flags & SERVER_CTX_EXTENDED_REGISTERS)
585 586
            dump_uints( ",extended=", (const unsigned int *)ctx.ext.i386_regs,
                        sizeof(ctx.ext.i386_regs) / sizeof(int) );
587 588 589 590 591 592 593
        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 );
594 595
            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 );
596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656
        }
        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_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;
657 658 659 660 661 662 663 664
    case CPU_ARM:
        if (ctx.flags & SERVER_CTX_CONTROL)
            fprintf( stderr, ",sp=%08x,lr=%08x,pc=%08x,cpsr=%08x",
                     ctx.ctl.arm_regs.sp, ctx.ctl.arm_regs.lr,
                     ctx.ctl.arm_regs.pc, ctx.ctl.arm_regs.cpsr );
        if (ctx.flags & SERVER_CTX_INTEGER)
            for (i = 0; i < 13; i++) fprintf( stderr, ",r%u=%08x", i, ctx.integer.arm_regs.r[i] );
        break;
665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706
    case CPU_ARM64:
        if (ctx.flags & SERVER_CTX_CONTROL)
        {
            dump_uint64( ",sp=", &ctx.ctl.arm64_regs.sp );
            dump_uint64( ",pc=", &ctx.ctl.arm64_regs.pc );
            dump_uint64( ",pstate=", &ctx.ctl.arm64_regs.pstate );
        }
        if (ctx.flags & SERVER_CTX_INTEGER)
        {
            dump_uint64( ",x0=",  &ctx.integer.arm64_regs.x[0] );
            dump_uint64( ",x1=",  &ctx.integer.arm64_regs.x[1] );
            dump_uint64( ",x2=",  &ctx.integer.arm64_regs.x[2] );
            dump_uint64( ",x3=",  &ctx.integer.arm64_regs.x[3] );
            dump_uint64( ",x4=",  &ctx.integer.arm64_regs.x[4] );
            dump_uint64( ",x5=",  &ctx.integer.arm64_regs.x[5] );
            dump_uint64( ",x6=",  &ctx.integer.arm64_regs.x[6] );
            dump_uint64( ",x7=",  &ctx.integer.arm64_regs.x[7] );
            dump_uint64( ",x8=",  &ctx.integer.arm64_regs.x[8] );
            dump_uint64( ",x9=",  &ctx.integer.arm64_regs.x[9] );
            dump_uint64( ",x10=", &ctx.integer.arm64_regs.x[10] );
            dump_uint64( ",x11=", &ctx.integer.arm64_regs.x[11] );
            dump_uint64( ",x12=", &ctx.integer.arm64_regs.x[12] );
            dump_uint64( ",x13=", &ctx.integer.arm64_regs.x[13] );
            dump_uint64( ",x14=", &ctx.integer.arm64_regs.x[14] );
            dump_uint64( ",x15=", &ctx.integer.arm64_regs.x[15] );
            dump_uint64( ",x16=", &ctx.integer.arm64_regs.x[16] );
            dump_uint64( ",x17=", &ctx.integer.arm64_regs.x[17] );
            dump_uint64( ",x18=", &ctx.integer.arm64_regs.x[18] );
            dump_uint64( ",x19=", &ctx.integer.arm64_regs.x[19] );
            dump_uint64( ",x20=", &ctx.integer.arm64_regs.x[20] );
            dump_uint64( ",x21=", &ctx.integer.arm64_regs.x[21] );
            dump_uint64( ",x22=", &ctx.integer.arm64_regs.x[22] );
            dump_uint64( ",x23=", &ctx.integer.arm64_regs.x[23] );
            dump_uint64( ",x24=", &ctx.integer.arm64_regs.x[24] );
            dump_uint64( ",x25=", &ctx.integer.arm64_regs.x[25] );
            dump_uint64( ",x26=", &ctx.integer.arm64_regs.x[26] );
            dump_uint64( ",x27=", &ctx.integer.arm64_regs.x[27] );
            dump_uint64( ",x28=", &ctx.integer.arm64_regs.x[28] );
            dump_uint64( ",x29=", &ctx.integer.arm64_regs.x[29] );
            dump_uint64( ",x30=", &ctx.integer.arm64_regs.x[30] );
        }
        break;
707 708 709
    }
    fputc( '}', stderr );
    remove_data( size );
710 711
}

712
static void dump_varargs_debug_event( const char *prefix, data_size_t size )
713
{
714 715
    debug_event_t event;
    unsigned int i;
716

717
    if (!size)
718
    {
719
        fprintf( stderr, "%s{}", prefix );
720
        return;
721
    }
722 723 724 725 726
    size = min( size, sizeof(event) );
    memset( &event, 0, sizeof(event) );
    memcpy( &event, cur_data, size );

    switch(event.code)
727 728
    {
    case EXCEPTION_DEBUG_EVENT:
729
        fprintf( stderr, "%s{exception,first=%d,exc_code=%08x,flags=%08x", prefix,
730
                 event.exception.first, event.exception.exc_code, event.exception.flags );
731 732
        dump_uint64( ",record=", &event.exception.record );
        dump_uint64( ",address=", &event.exception.address );
733 734 735 736
        fprintf( stderr, ",params={" );
        event.exception.nb_params = min( event.exception.nb_params, EXCEPTION_MAXIMUM_PARAMETERS );
        for (i = 0; i < event.exception.nb_params; i++)
        {
737
            dump_uint64( "", &event.exception.params[i] );
738 739 740
            if (i < event.exception.nb_params) fputc( ',', stderr );
        }
        fprintf( stderr, "}}" );
741 742
        break;
    case CREATE_THREAD_DEBUG_EVENT:
743 744 745
        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 );
746
        fputc( '}', stderr );
747 748
        break;
    case CREATE_PROCESS_DEBUG_EVENT:
749
        fprintf( stderr, "%s{create_process,file=%04x,process=%04x,thread=%04x", prefix,
750 751
                 event.create_process.file, event.create_process.process,
                 event.create_process.thread );
752 753
        dump_uint64( ",base=", &event.create_process.base );
        fprintf( stderr, ",offset=%d,size=%d",
754
                 event.create_process.dbg_offset, event.create_process.dbg_size );
755 756 757
        dump_uint64( ",teb=", &event.create_process.teb );
        dump_uint64( ",start=", &event.create_process.start );
        dump_uint64( ",name=", &event.create_process.name );
758
        fprintf( stderr, ",unicode=%d}", event.create_process.unicode );
759 760
        break;
    case EXIT_THREAD_DEBUG_EVENT:
761
        fprintf( stderr, "%s{exit_thread,code=%d}", prefix, event.exit.exit_code );
762 763
        break;
    case EXIT_PROCESS_DEBUG_EVENT:
764
        fprintf( stderr, "%s{exit_process,code=%d}", prefix, event.exit.exit_code );
765 766
        break;
    case LOAD_DLL_DEBUG_EVENT:
767 768 769
        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",
770
                 event.load_dll.dbg_offset, event.load_dll.dbg_size );
771
        dump_uint64( ",name=", &event.load_dll.name );
772
        fprintf( stderr, ",unicode=%d}", event.load_dll.unicode );
773 774
        break;
    case UNLOAD_DLL_DEBUG_EVENT:
775 776
        fprintf( stderr, "%s{unload_dll", prefix );
        dump_uint64( ",base=", &event.unload_dll.base );
777
        fputc( '}', stderr );
778 779
        break;
    case 0:  /* zero is the code returned on timeouts */
780
        fprintf( stderr, "%s{}", prefix );
781 782
        break;
    default:
783
        fprintf( stderr, "%s{code=??? (%d)}", prefix, event.code );
784 785
        break;
    }
786
    remove_data( size );
787 788
}

789
/* dump a unicode string contained in a buffer; helper for dump_varargs_startup_info */
790
static data_size_t dump_inline_unicode_string( const char *prefix, data_size_t pos, data_size_t len, data_size_t total_size )
791
{
792 793 794 795 796 797
    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);
798 799
}

800
static void dump_varargs_startup_info( const char *prefix, data_size_t size )
801
{
802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821
    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 );
822
    fprintf( stderr, "\"}" );
823 824 825
    remove_data( size );
}

826
static void dump_varargs_input_records( const char *prefix, data_size_t size )
827
{
828
    const INPUT_RECORD *rec = cur_data;
829
    data_size_t len = size / sizeof(*rec);
830

831
    fprintf( stderr,"%s{", prefix );
832 833 834 835 836 837 838
    while (len > 0)
    {
        fprintf( stderr, "{%04x,...}", rec->EventType );
        rec++;
        if (--len) fputc( ',', stderr );
    }
    fputc( '}', stderr );
839
    remove_data( size );
840 841
}

842
static void dump_varargs_rectangles( const char *prefix, data_size_t size )
843 844
{
    const rectangle_t *rect = cur_data;
845
    data_size_t len = size / sizeof(*rect);
846

847
    fprintf( stderr,"%s{", prefix );
848 849
    while (len > 0)
    {
850
        dump_rectangle( "", rect++ );
851 852 853 854 855 856
        if (--len) fputc( ',', stderr );
    }
    fputc( '}', stderr );
    remove_data( size );
}

857
static void dump_varargs_message_data( const char *prefix, data_size_t size )
858 859
{
    /* FIXME: dump the structured data */
860
    dump_varargs_bytes( prefix, size );
861 862
}

863
static void dump_varargs_properties( const char *prefix, data_size_t size )
864
{
865
    const property_data_t *prop = cur_data;
866
    data_size_t len = size / sizeof(*prop);
867

868
    fprintf( stderr,"%s{", prefix );
869 870
    while (len > 0)
    {
871 872
        fprintf( stderr, "{atom=%04x,str=%d", prop->atom, prop->string );
        dump_uint64( ",data=", &prop->data );
873
        fputc( '}', stderr );
874 875 876 877
        prop++;
        if (--len) fputc( ',', stderr );
    }
    fputc( '}', stderr );
878
    remove_data( size );
879 880
}

881
static void dump_varargs_LUID_AND_ATTRIBUTES( const char *prefix, data_size_t size )
882 883
{
    const LUID_AND_ATTRIBUTES *lat = cur_data;
884
    data_size_t len = size / sizeof(*lat);
885

886
    fprintf( stderr,"%s{", prefix );
887 888
    while (len > 0)
    {
889
        fprintf( stderr, "{luid=%08x%08x,attr=%x}",
890 891 892 893 894 895 896 897
                 lat->Luid.HighPart, lat->Luid.LowPart, lat->Attributes );
        lat++;
        if (--len) fputc( ',', stderr );
    }
    fputc( '}', stderr );
    remove_data( size );
}

898
static void dump_inline_sid( const char *prefix, const SID *sid, data_size_t size )
899 900 901 902
{
    DWORD i;

    /* security check */
903 904 905 906
    if ((FIELD_OFFSET(SID, SubAuthority[0]) > size) ||
        (FIELD_OFFSET(SID, SubAuthority[sid->SubAuthorityCount]) > size))
    {
        fprintf( stderr, "<invalid sid>" );
907
        return;
908
    }
909

910
    fprintf( stderr,"%s{", prefix );
911
    fprintf( stderr, "S-%u-%u", sid->Revision, MAKELONG(
912 913 914 915 916
        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++)
917
        fprintf( stderr, "-%u", sid->SubAuthority[i] );
918 919 920
    fputc( '}', stderr );
}

921
static void dump_varargs_SID( const char *prefix, data_size_t size )
922 923
{
    const SID *sid = cur_data;
924
    dump_inline_sid( prefix, sid, size );
925 926 927
    remove_data( size );
}

928
static void dump_inline_acl( const char *prefix, const ACL *acl, data_size_t size )
929 930 931 932
{
    const ACE_HEADER *ace;
    ULONG i;

933
    fprintf( stderr,"%s{", prefix );
934 935 936
    if (size)
    {
        if (size < sizeof(ACL))
937
        {
938
            fprintf( stderr, "<invalid acl>}" );
939
            return;
940
        }
941 942 943 944 945
        size -= sizeof(ACL);
        ace = (const ACE_HEADER *)(acl + 1);
        for (i = 0; i < acl->AceCount; i++)
        {
            const SID *sid = NULL;
946
            data_size_t sid_size = 0;
947

948
            if (size < sizeof(ACE_HEADER) || size < ace->AceSize) break;
949
            size -= ace->AceSize;
950
            if (i != 0) fputc( ',', stderr );
951 952 953 954 955
            fprintf( stderr, "{AceType=" );
            switch (ace->AceType)
            {
            case ACCESS_DENIED_ACE_TYPE:
                sid = (const SID *)&((const ACCESS_DENIED_ACE *)ace)->SidStart;
956
                sid_size = ace->AceSize - FIELD_OFFSET(ACCESS_DENIED_ACE, SidStart);
957
                fprintf( stderr, "ACCESS_DENIED_ACE_TYPE,Mask=%x",
958
                         ((const ACCESS_DENIED_ACE *)ace)->Mask );
959 960 961
                break;
            case ACCESS_ALLOWED_ACE_TYPE:
                sid = (const SID *)&((const ACCESS_ALLOWED_ACE *)ace)->SidStart;
962
                sid_size = ace->AceSize - FIELD_OFFSET(ACCESS_ALLOWED_ACE, SidStart);
963
                fprintf( stderr, "ACCESS_ALLOWED_ACE_TYPE,Mask=%x",
964
                         ((const ACCESS_ALLOWED_ACE *)ace)->Mask );
965 966 967
                break;
            case SYSTEM_AUDIT_ACE_TYPE:
                sid = (const SID *)&((const SYSTEM_AUDIT_ACE *)ace)->SidStart;
968
                sid_size = ace->AceSize - FIELD_OFFSET(SYSTEM_AUDIT_ACE, SidStart);
969
                fprintf( stderr, "SYSTEM_AUDIT_ACE_TYPE,Mask=%x",
970
                         ((const SYSTEM_AUDIT_ACE *)ace)->Mask );
971 972 973
                break;
            case SYSTEM_ALARM_ACE_TYPE:
                sid = (const SID *)&((const SYSTEM_ALARM_ACE *)ace)->SidStart;
974
                sid_size = ace->AceSize - FIELD_OFFSET(SYSTEM_ALARM_ACE, SidStart);
975
                fprintf( stderr, "SYSTEM_ALARM_ACE_TYPE,Mask=%x",
976
                         ((const SYSTEM_ALARM_ACE *)ace)->Mask );
977
                break;
978 979 980 981 982 983
            case SYSTEM_MANDATORY_LABEL_ACE_TYPE:
                sid = (const SID *)&((const SYSTEM_MANDATORY_LABEL_ACE *)ace)->SidStart;
                sid_size = ace->AceSize - FIELD_OFFSET(SYSTEM_MANDATORY_LABEL_ACE, SidStart);
                fprintf( stderr, "SYSTEM_MANDATORY_LABEL_ACE_TYPE,Mask=%x",
                         ((const SYSTEM_MANDATORY_LABEL_ACE *)ace)->Mask );
                break;
984 985 986 987
            default:
                fprintf( stderr, "unknown<%d>", ace->AceType );
                break;
            }
988
            fprintf( stderr, ",AceFlags=%x", ace->AceFlags );
989
            if (sid)
990
                dump_inline_sid( ",Sid=", sid, sid_size );
991 992 993 994 995 996 997
            ace = (const ACE_HEADER *)((const char *)ace + ace->AceSize);
            fputc( '}', stderr );
        }
    }
    fputc( '}', stderr );
}

998 999 1000 1001 1002 1003 1004
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 );
}

1005
static void dump_inline_security_descriptor( const char *prefix, const struct security_descriptor *sd, data_size_t size )
1006
{
1007
    fprintf( stderr,"%s{", prefix );
1008 1009 1010 1011 1012 1013
    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;
1014
        if (sd->owner_len)
1015
            dump_inline_sid( ",owner=", (const SID *)((const char *)sd + offset), sd->owner_len );
1016
        else
1017
            fprintf( stderr, ",owner=<not present>" );
1018 1019 1020
        offset += sd->owner_len;
        if ((sd->group_len > FIELD_OFFSET(SID, SubAuthority[255])) || (offset + sd->group_len > size))
            return;
1021
        if (sd->group_len)
1022
            dump_inline_sid( ",group=", (const SID *)((const char *)sd + offset), sd->group_len );
1023
        else
1024
            fprintf( stderr, ",group=<not present>" );
1025 1026 1027
        offset += sd->group_len;
        if ((sd->sacl_len >= MAX_ACL_LEN) || (offset + sd->sacl_len > size))
            return;
1028
        dump_inline_acl( ",sacl=", (const ACL *)((const char *)sd + offset), sd->sacl_len );
1029 1030 1031
        offset += sd->sacl_len;
        if ((sd->dacl_len >= MAX_ACL_LEN) || (offset + sd->dacl_len > size))
            return;
1032
        dump_inline_acl( ",dacl=", (const ACL *)((const char *)sd + offset), sd->dacl_len );
1033 1034 1035 1036 1037
        offset += sd->dacl_len;
    }
    fputc( '}', stderr );
}

1038
static void dump_varargs_security_descriptor( const char *prefix, data_size_t size )
1039 1040
{
    const struct security_descriptor *sd = cur_data;
1041
    dump_inline_security_descriptor( prefix, sd, size );
1042 1043 1044
    remove_data( size );
}

1045
static void dump_varargs_token_groups( const char *prefix, data_size_t size )
1046 1047
{
    const struct token_groups *tg = cur_data;
1048 1049

    fprintf( stderr,"%s{", prefix );
1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068
    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] );
1069
                dump_inline_sid( ",sid=", sid, size - offset );
1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081
                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 );
}

1082
static void dump_varargs_object_attributes( const char *prefix, data_size_t size )
1083 1084
{
    const struct object_attributes *objattr = cur_data;
1085 1086

    fprintf( stderr,"%s{", prefix );
1087
    if (size)
1088 1089
    {
        const WCHAR *str;
1090 1091 1092 1093 1094 1095 1096

        if (size < sizeof(*objattr) ||
            (size - sizeof(*objattr) < objattr->sd_len) ||
            (size - sizeof(*objattr) - objattr->sd_len < objattr->name_len))
        {
            fprintf( stderr, "***invalid***}" );
            remove_data( size );
1097
            return;
1098 1099 1100
        }

        fprintf( stderr, "rootdir=%04x,attributes=%08x", objattr->rootdir, objattr->attributes );
1101
        dump_inline_security_descriptor( ",sd=", (const struct security_descriptor *)(objattr + 1), objattr->sd_len );
1102
        str = (const WCHAR *)objattr + (sizeof(*objattr) + objattr->sd_len) / sizeof(WCHAR);
1103
        fprintf( stderr, ",name=L\"" );
1104
        dump_strW( str, objattr->name_len / sizeof(WCHAR), stderr, "\"\"" );
1105
        fputc( '\"', stderr );
1106
        remove_data( ((sizeof(*objattr) + objattr->sd_len) / sizeof(WCHAR)) * sizeof(WCHAR) +
1107
                     (objattr->name_len / sizeof(WCHAR)) * sizeof(WCHAR) );
1108 1109 1110 1111
    }
    fputc( '}', stderr );
}

1112 1113
static void dump_varargs_filesystem_event( const char *prefix, data_size_t size )
{
1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125
    static const char * const actions[] = {
        NULL,
        "ADDED",
        "REMOVED",
        "MODIFIED",
        "RENAMED_OLD_NAME",
        "RENAMED_NEW_NAME",
        "ADDED_STREAM",
        "REMOVED_STREAM",
        "MODIFIED_STREAM"
    };

1126 1127 1128 1129 1130 1131 1132
    fprintf( stderr,"%s{", prefix );
    while (size)
    {
        const struct filesystem_event *event = cur_data;
        data_size_t len = (offsetof( struct filesystem_event, name[event->len] ) + sizeof(int)-1)
                           / sizeof(int) * sizeof(int);
        if (size < len) break;
1133 1134 1135 1136 1137
        if (event->action < sizeof(actions)/sizeof(actions[0]) && actions[event->action])
            fprintf( stderr, "{action=%s", actions[event->action] );
        else
            fprintf( stderr, "{action=%u", event->action );
        fprintf( stderr, ",name=\"%.*s\"}", event->len, event->name );
1138 1139 1140 1141 1142 1143 1144
        size -= len;
        remove_data( len );
        if (size)fputc( ',', stderr );
    }
    fputc( '}', stderr );
}

1145 1146 1147 1148
static void dump_varargs_pe_image_info( const char *prefix, data_size_t size )
{
    pe_image_info_t info;

1149 1150 1151 1152 1153
    if (!size)
    {
        fprintf( stderr, "%s{}", prefix );
        return;
    }
1154 1155 1156 1157 1158 1159
    memset( &info, 0, sizeof(info) );
    memcpy( &info, cur_data, min( size, sizeof(info) ));

    fprintf( stderr, "%s{", prefix );
    dump_uint64( "base=", &info.base );
    dump_uint64( ",entry_point=", &info.entry_point );
1160
    dump_uint64( ",map_size=", &info.map_size );
1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171
    dump_uint64( ",stack_size=", &info.stack_size );
    dump_uint64( ",stack_commit=", &info.stack_commit );
    fprintf( stderr, ",zerobits=%08x,subsystem=%08x,subsystem_low=%04x,subsystem_high=%04x,gp=%08x"
             ",image_charact=%04x,dll_charact=%04x,machine=%04x,contains_code=%u,image_flags=%02x"
             ",loader_flags=%08x,header_size=%08x,file_size=%08x,checksum=%08x}",
             info.zerobits, info.subsystem, info.subsystem_low, info.subsystem_high, info.gp,
             info.image_charact, info.dll_charact, info.machine, info.contains_code, info.image_flags,
             info.loader_flags, info.header_size, info.file_size, info.checksum );
    remove_data( size );
}

1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188
static void dump_varargs_rawinput_devices(const char *prefix, data_size_t size )
{
    const struct rawinput_device *device;

    fprintf( stderr, "%s{", prefix );
    while (size >= sizeof(*device))
    {
        device = cur_data;
        fprintf( stderr, "{usage_page=%04x,usage=%04x,flags=%08x,target=%08x}",
                 device->usage_page, device->usage, device->flags, device->target );
        size -= sizeof(*device);
        remove_data( sizeof(*device) );
        if (size) fputc( ',', stderr );
    }
    fputc( '}', stderr );
}

1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205
static void dump_varargs_handle_infos( const char *prefix, data_size_t size )
{
    const struct handle_info *handle;

    fprintf( stderr, "%s{", prefix );
    while (size >= sizeof(*handle))
    {
        handle = cur_data;
        fprintf( stderr, "{owner=%04x,handle=%04x,access=%08x}",
                 handle->owner, handle->handle, handle->access );
        size -= sizeof(*handle);
        remove_data( sizeof(*handle) );
        if (size) fputc( ',', stderr );
    }
    fputc( '}', stderr );
}

1206
typedef void (*dump_func)( const void *req );
1207 1208 1209 1210

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

1211
static void dump_new_process_request( const struct new_process_request *req )
1212
{
1213 1214 1215 1216 1217 1218 1219 1220
    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 );
1221
    dump_cpu_type( ", cpu=", &req->cpu );
1222 1223
    fprintf( stderr, ", info_size=%u", req->info_size );
    dump_varargs_startup_info( ", info=", min(cur_size,req->info_size) );
1224
    dump_varargs_unicode_str( ", env=", cur_size );
1225 1226
}

1227
static void dump_new_process_reply( const struct new_process_reply *req )
1228
{
1229 1230 1231 1232 1233
    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 );
1234 1235 1236 1237
}

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

1241
static void dump_get_new_process_info_reply( const struct get_new_process_info_reply *req )
1242
{
1243 1244
    fprintf( stderr, " success=%d", req->success );
    fprintf( stderr, ", exit_code=%d", req->exit_code );
1245 1246
}

1247
static void dump_new_thread_request( const struct new_thread_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1248
{
1249 1250 1251 1252
    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
1253 1254
}

1255
static void dump_new_thread_reply( const struct new_thread_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1256
{
1257 1258
    fprintf( stderr, " tid=%04x", req->tid );
    fprintf( stderr, ", handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1259 1260
}

1261 1262 1263 1264 1265 1266
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 )
{
1267
    fprintf( stderr, " exe_file=%04x", req->exe_file );
1268 1269
    fprintf( stderr, ", info_size=%u", req->info_size );
    dump_varargs_startup_info( ", info=", min(cur_size,req->info_size) );
1270
    dump_varargs_unicode_str( ", env=", cur_size );
1271 1272
}

1273
static void dump_init_process_done_request( const struct init_process_done_request *req )
1274
{
1275 1276 1277 1278
    fprintf( stderr, " gui=%d", req->gui );
    dump_uint64( ", module=", &req->module );
    dump_uint64( ", ldt_copy=", &req->ldt_copy );
    dump_uint64( ", entry=", &req->entry );
1279 1280
}

1281
static void dump_init_thread_request( const struct init_thread_request *req )
1282
{
1283 1284 1285 1286 1287 1288 1289 1290
    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 );
1291 1292
}

1293
static void dump_init_thread_reply( const struct init_thread_reply *req )
1294
{
1295 1296 1297 1298 1299 1300
    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 );
1301 1302
}

1303
static void dump_terminate_process_request( const struct terminate_process_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1304
{
1305 1306
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", exit_code=%d", req->exit_code );
Alexandre Julliard's avatar
Alexandre Julliard committed
1307 1308
}

1309
static void dump_terminate_process_reply( const struct terminate_process_reply *req )
1310 1311 1312 1313
{
    fprintf( stderr, " self=%d", req->self );
}

1314
static void dump_terminate_thread_request( const struct terminate_thread_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1315
{
1316 1317
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", exit_code=%d", req->exit_code );
Alexandre Julliard's avatar
Alexandre Julliard committed
1318 1319
}

1320
static void dump_terminate_thread_reply( const struct terminate_thread_reply *req )
1321
{
1322 1323
    fprintf( stderr, " self=%d", req->self );
    fprintf( stderr, ", last=%d", req->last );
1324 1325
}

1326
static void dump_get_process_info_request( const struct get_process_info_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1327
{
1328
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1329 1330
}

1331
static void dump_get_process_info_reply( const struct get_process_info_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1332
{
1333 1334 1335 1336 1337 1338 1339 1340
    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 );
1341
    dump_cpu_type( ", cpu=", &req->cpu );
1342
    fprintf( stderr, ", debugger_present=%d", req->debugger_present );
1343
    fprintf( stderr, ", debug_children=%d", req->debug_children );
1344 1345
}

1346
static void dump_set_process_info_request( const struct set_process_info_request *req )
1347
{
1348 1349 1350 1351
    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
1352 1353
}

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

1360
static void dump_get_thread_info_reply( const struct get_thread_info_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1361
{
1362 1363 1364
    fprintf( stderr, " pid=%04x", req->pid );
    fprintf( stderr, ", tid=%04x", req->tid );
    dump_uint64( ", teb=", &req->teb );
1365
    dump_uint64( ", entry_point=", &req->entry_point );
1366 1367 1368 1369
    dump_uint64( ", affinity=", &req->affinity );
    fprintf( stderr, ", exit_code=%d", req->exit_code );
    fprintf( stderr, ", priority=%d", req->priority );
    fprintf( stderr, ", last=%d", req->last );
1370 1371
}

1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382
static void dump_get_thread_times_request( const struct get_thread_times_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
}

static void dump_get_thread_times_reply( const struct get_thread_times_reply *req )
{
    dump_timeout( " creation_time=", &req->creation_time );
    dump_timeout( ", exit_time=", &req->exit_time );
}

1383
static void dump_set_thread_info_request( const struct set_thread_info_request *req )
1384
{
1385 1386 1387 1388
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", mask=%d", req->mask );
    fprintf( stderr, ", priority=%d", req->priority );
    dump_uint64( ", affinity=", &req->affinity );
1389
    dump_uint64( ", entry_point=", &req->entry_point );
1390
    fprintf( stderr, ", token=%04x", req->token );
1391 1392
}

1393 1394
static void dump_get_dll_info_request( const struct get_dll_info_request *req )
{
1395 1396
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", base_address=", &req->base_address );
1397 1398 1399 1400
}

static void dump_get_dll_info_reply( const struct get_dll_info_reply *req )
{
1401 1402 1403 1404
    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 );
1405 1406
}

1407
static void dump_suspend_thread_request( const struct suspend_thread_request *req )
1408
{
1409
    fprintf( stderr, " handle=%04x", req->handle );
1410 1411
}

1412
static void dump_suspend_thread_reply( const struct suspend_thread_reply *req )
1413 1414 1415 1416
{
    fprintf( stderr, " count=%d", req->count );
}

1417
static void dump_resume_thread_request( const struct resume_thread_request *req )
1418
{
1419
    fprintf( stderr, " handle=%04x", req->handle );
1420 1421
}

1422
static void dump_resume_thread_reply( const struct resume_thread_reply *req )
1423 1424 1425 1426
{
    fprintf( stderr, " count=%d", req->count );
}

1427
static void dump_load_dll_request( const struct load_dll_request *req )
1428
{
1429
    fprintf( stderr, " mapping=%04x", req->mapping );
1430 1431 1432 1433 1434 1435
    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 );
1436 1437 1438 1439
}

static void dump_unload_dll_request( const struct unload_dll_request *req )
{
1440
    dump_uint64( " base=", &req->base );
1441 1442
}

1443
static void dump_queue_apc_request( const struct queue_apc_request *req )
1444
{
1445 1446
    fprintf( stderr, " handle=%04x", req->handle );
    dump_apc_call( ", call=", &req->call );
Alexandre Julliard's avatar
Alexandre Julliard committed
1447 1448
}

1449 1450
static void dump_queue_apc_reply( const struct queue_apc_reply *req )
{
1451 1452
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", self=%d", req->self );
1453 1454
}

1455 1456
static void dump_get_apc_result_request( const struct get_apc_result_request *req )
{
1457
    fprintf( stderr, " handle=%04x", req->handle );
1458 1459 1460 1461
}

static void dump_get_apc_result_reply( const struct get_apc_result_reply *req )
{
1462
    dump_apc_result( " result=", &req->result );
1463 1464
}

1465
static void dump_close_handle_request( const struct close_handle_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1466
{
1467
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1468 1469
}

1470
static void dump_set_handle_info_request( const struct set_handle_info_request *req )
1471
{
1472 1473 1474
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", flags=%d", req->flags );
    fprintf( stderr, ", mask=%d", req->mask );
1475 1476
}

1477
static void dump_set_handle_info_reply( const struct set_handle_info_reply *req )
1478
{
1479 1480 1481
    fprintf( stderr, " old_flags=%d", req->old_flags );
}

1482
static void dump_dup_handle_request( const struct dup_handle_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1483
{
1484 1485 1486 1487 1488 1489
    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
1490 1491
}

1492
static void dump_dup_handle_reply( const struct dup_handle_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1493
{
1494 1495 1496
    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
1497 1498
}

1499
static void dump_open_process_request( const struct open_process_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1500
{
1501 1502 1503
    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
1504 1505
}

1506
static void dump_open_process_reply( const struct open_process_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1507
{
1508
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1509 1510
}

1511 1512
static void dump_open_thread_request( const struct open_thread_request *req )
{
1513 1514 1515
    fprintf( stderr, " tid=%04x", req->tid );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
1516 1517 1518 1519
}

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

1523
static void dump_select_request( const struct select_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1524
{
1525 1526 1527
    fprintf( stderr, " flags=%d", req->flags );
    dump_uint64( ", cookie=", &req->cookie );
    dump_timeout( ", timeout=", &req->timeout );
1528
    fprintf( stderr, ", prev_apc=%04x", req->prev_apc );
1529
    dump_varargs_apc_result( ", result=", cur_size );
1530
    dump_varargs_select_op( ", data=", cur_size );
Alexandre Julliard's avatar
Alexandre Julliard committed
1531 1532
}

1533 1534
static void dump_select_reply( const struct select_reply *req )
{
1535 1536 1537
    dump_timeout( " timeout=", &req->timeout );
    dump_apc_call( ", call=", &req->call );
    fprintf( stderr, ", apc_handle=%04x", req->apc_handle );
1538 1539
}

1540
static void dump_create_event_request( const struct create_event_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1541
{
1542 1543 1544 1545
    fprintf( stderr, " access=%08x", req->access );
    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
1546 1547
}

1548
static void dump_create_event_reply( const struct create_event_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1549
{
1550
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1551 1552
}

1553
static void dump_event_op_request( const struct event_op_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1554
{
1555 1556
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", op=%d", req->op );
Alexandre Julliard's avatar
Alexandre Julliard committed
1557 1558
}

1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569
static void dump_query_event_request( const struct query_event_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
}

static void dump_query_event_reply( const struct query_event_reply *req )
{
    fprintf( stderr, " manual_reset=%d", req->manual_reset );
    fprintf( stderr, ", state=%d", req->state );
}

1570
static void dump_open_event_request( const struct open_event_request *req )
1571
{
1572 1573 1574 1575
    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 );
1576 1577
}

1578
static void dump_open_event_reply( const struct open_event_reply *req )
1579
{
1580
    fprintf( stderr, " handle=%04x", req->handle );
1581 1582
}

1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606
static void dump_create_keyed_event_request( const struct create_keyed_event_request *req )
{
    fprintf( stderr, " access=%08x", req->access );
    dump_varargs_object_attributes( ", objattr=", cur_size );
}

static void dump_create_keyed_event_reply( const struct create_keyed_event_reply *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
}

static void dump_open_keyed_event_request( const struct open_keyed_event_request *req )
{
    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 );
}

static void dump_open_keyed_event_reply( const struct open_keyed_event_reply *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
}

1607
static void dump_create_mutex_request( const struct create_mutex_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1608
{
1609 1610 1611
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", owned=%d", req->owned );
    dump_varargs_object_attributes( ", objattr=", cur_size );
Alexandre Julliard's avatar
Alexandre Julliard committed
1612 1613
}

1614
static void dump_create_mutex_reply( const struct create_mutex_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1615
{
1616
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1617 1618
}

1619
static void dump_release_mutex_request( const struct release_mutex_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1620
{
1621
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1622 1623
}

1624 1625 1626 1627 1628
static void dump_release_mutex_reply( const struct release_mutex_reply *req )
{
    fprintf( stderr, " prev_count=%08x", req->prev_count );
}

1629
static void dump_open_mutex_request( const struct open_mutex_request *req )
1630
{
1631 1632 1633 1634
    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 );
1635 1636
}

1637
static void dump_open_mutex_reply( const struct open_mutex_reply *req )
1638
{
1639
    fprintf( stderr, " handle=%04x", req->handle );
1640 1641
}

1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653
static void dump_query_mutex_request( const struct query_mutex_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
}

static void dump_query_mutex_reply( const struct query_mutex_reply *req )
{
    fprintf( stderr, " count=%08x", req->count );
    fprintf( stderr, ", owned=%d", req->owned );
    fprintf( stderr, ", abandoned=%d", req->abandoned );
}

1654
static void dump_create_semaphore_request( const struct create_semaphore_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1655
{
1656 1657 1658 1659
    fprintf( stderr, " access=%08x", req->access );
    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
1660 1661
}

1662
static void dump_create_semaphore_reply( const struct create_semaphore_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1663
{
1664
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1665 1666
}

1667
static void dump_release_semaphore_request( const struct release_semaphore_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1668
{
1669 1670
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", count=%08x", req->count );
Alexandre Julliard's avatar
Alexandre Julliard committed
1671 1672
}

1673
static void dump_release_semaphore_reply( const struct release_semaphore_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1674
{
1675
    fprintf( stderr, " prev_count=%08x", req->prev_count );
Alexandre Julliard's avatar
Alexandre Julliard committed
1676 1677
}

1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688
static void dump_query_semaphore_request( const struct query_semaphore_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
}

static void dump_query_semaphore_reply( const struct query_semaphore_reply *req )
{
    fprintf( stderr, " current=%08x", req->current );
    fprintf( stderr, ", max=%08x", req->max );
}

1689
static void dump_open_semaphore_request( const struct open_semaphore_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1690
{
1691 1692 1693 1694
    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 );
1695 1696
}

1697
static void dump_open_semaphore_reply( const struct open_semaphore_reply *req )
1698
{
1699
    fprintf( stderr, " handle=%04x", req->handle );
1700 1701
}

1702
static void dump_create_file_request( const struct create_file_request *req )
1703
{
1704 1705 1706 1707 1708 1709 1710
    fprintf( stderr, " access=%08x", req->access );
    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 );
1711 1712
}

1713
static void dump_create_file_reply( const struct create_file_reply *req )
1714
{
1715
    fprintf( stderr, " handle=%04x", req->handle );
1716 1717
}

1718 1719
static void dump_open_file_object_request( const struct open_file_object_request *req )
{
1720 1721 1722 1723 1724 1725
    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 );
1726 1727 1728 1729
}

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

1733
static void dump_alloc_file_handle_request( const struct alloc_file_handle_request *req )
1734
{
1735 1736 1737
    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
1738 1739
}

1740
static void dump_alloc_file_handle_reply( const struct alloc_file_handle_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1741
{
1742
    fprintf( stderr, " handle=%04x", req->handle );
1743 1744
}

1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755
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 );
}

1756
static void dump_get_handle_fd_request( const struct get_handle_fd_request *req )
1757
{
1758
    fprintf( stderr, " handle=%04x", req->handle );
1759 1760
}

1761
static void dump_get_handle_fd_reply( const struct get_handle_fd_reply *req )
1762
{
1763
    fprintf( stderr, " type=%d", req->type );
1764
    fprintf( stderr, ", cacheable=%d", req->cacheable );
1765 1766
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", options=%08x", req->options );
1767 1768
}

1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779
static void dump_get_directory_cache_entry_request( const struct get_directory_cache_entry_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
}

static void dump_get_directory_cache_entry_reply( const struct get_directory_cache_entry_reply *req )
{
    fprintf( stderr, " entry=%d", req->entry );
    dump_varargs_ints( ", free=", cur_size );
}

1780
static void dump_flush_request( const struct flush_request *req )
1781
{
1782 1783
    fprintf( stderr, " blocking=%d", req->blocking );
    dump_async_data( ", async=", &req->async );
1784 1785
}

1786
static void dump_flush_reply( const struct flush_reply *req )
1787
{
1788
    fprintf( stderr, " event=%04x", req->event );
1789 1790
}

1791
static void dump_lock_file_request( const struct lock_file_request *req )
1792
{
1793 1794 1795 1796 1797
    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 );
1798 1799 1800 1801
}

static void dump_lock_file_reply( const struct lock_file_reply *req )
{
1802 1803
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", overlapped=%d", req->overlapped );
1804 1805
}

1806
static void dump_unlock_file_request( const struct unlock_file_request *req )
1807
{
1808 1809 1810
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", offset=", &req->offset );
    dump_uint64( ", count=", &req->count );
1811 1812
}

1813
static void dump_create_socket_request( const struct create_socket_request *req )
1814
{
1815 1816 1817 1818 1819 1820
    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 );
1821 1822
}

1823
static void dump_create_socket_reply( const struct create_socket_reply *req )
1824
{
1825
    fprintf( stderr, " handle=%04x", req->handle );
1826 1827
}

1828
static void dump_accept_socket_request( const struct accept_socket_request *req )
1829
{
1830 1831 1832
    fprintf( stderr, " lhandle=%04x", req->lhandle );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
1833 1834
}

1835
static void dump_accept_socket_reply( const struct accept_socket_reply *req )
1836
{
1837
    fprintf( stderr, " handle=%04x", req->handle );
1838 1839
}

1840 1841 1842 1843 1844 1845
static void dump_accept_into_socket_request( const struct accept_into_socket_request *req )
{
    fprintf( stderr, " lhandle=%04x", req->lhandle );
    fprintf( stderr, ", ahandle=%04x", req->ahandle );
}

1846
static void dump_set_socket_event_request( const struct set_socket_event_request *req )
1847
{
1848 1849 1850 1851 1852
    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 );
1853 1854
}

1855
static void dump_get_socket_event_request( const struct get_socket_event_request *req )
1856
{
1857 1858 1859
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", service=%d", req->service );
    fprintf( stderr, ", c_event=%04x", req->c_event );
1860 1861
}

1862
static void dump_get_socket_event_reply( const struct get_socket_event_reply *req )
1863
{
1864 1865 1866 1867
    fprintf( stderr, " mask=%08x", req->mask );
    fprintf( stderr, ", pmask=%08x", req->pmask );
    fprintf( stderr, ", state=%08x", req->state );
    dump_varargs_ints( ", errors=", cur_size );
1868 1869
}

1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881
static void dump_get_socket_info_request( const struct get_socket_info_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
}

static void dump_get_socket_info_reply( const struct get_socket_info_reply *req )
{
    fprintf( stderr, " family=%d", req->family );
    fprintf( stderr, ", type=%d", req->type );
    fprintf( stderr, ", protocol=%d", req->protocol );
}

1882
static void dump_enable_socket_event_request( const struct enable_socket_event_request *req )
1883
{
1884 1885 1886 1887
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", mask=%08x", req->mask );
    fprintf( stderr, ", sstate=%08x", req->sstate );
    fprintf( stderr, ", cstate=%08x", req->cstate );
1888 1889
}

1890 1891
static void dump_set_socket_deferred_request( const struct set_socket_deferred_request *req )
{
1892 1893
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", deferred=%04x", req->deferred );
1894 1895
}

1896
static void dump_alloc_console_request( const struct alloc_console_request *req )
1897
{
1898 1899 1900
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", pid=%04x", req->pid );
1901
    fprintf( stderr, ", input_fd=%d", req->input_fd );
1902 1903
}

1904
static void dump_alloc_console_reply( const struct alloc_console_reply *req )
1905
{
1906 1907
    fprintf( stderr, " handle_in=%04x", req->handle_in );
    fprintf( stderr, ", event=%04x", req->event );
1908 1909
}

1910
static void dump_free_console_request( const struct free_console_request *req )
1911 1912 1913
{
}

1914 1915
static void dump_get_console_renderer_events_request( const struct get_console_renderer_events_request *req )
{
1916
    fprintf( stderr, " handle=%04x", req->handle );
1917 1918
}

1919
static void dump_get_console_renderer_events_reply( const struct get_console_renderer_events_reply *req )
1920
{
1921
    dump_varargs_bytes( " data=", cur_size );
1922 1923
}

1924
static void dump_open_console_request( const struct open_console_request *req )
1925
{
1926 1927 1928 1929
    fprintf( stderr, " from=%04x", req->from );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", share=%d", req->share );
1930 1931
}

1932
static void dump_open_console_reply( const struct open_console_reply *req )
1933
{
1934
    fprintf( stderr, " handle=%04x", req->handle );
1935 1936
}

1937 1938 1939 1940 1941 1942
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 )
{
1943
    fprintf( stderr, " handle=%04x", req->handle );
1944 1945
}

1946
static void dump_get_console_mode_request( const struct get_console_mode_request *req )
1947
{
1948
    fprintf( stderr, " handle=%04x", req->handle );
1949 1950
}

1951
static void dump_get_console_mode_reply( const struct get_console_mode_reply *req )
1952 1953 1954 1955
{
    fprintf( stderr, " mode=%d", req->mode );
}

1956
static void dump_set_console_mode_request( const struct set_console_mode_request *req )
1957
{
1958 1959
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", mode=%d", req->mode );
1960 1961
}

1962 1963
static void dump_set_console_input_info_request( const struct set_console_input_info_request *req )
{
1964 1965 1966 1967 1968 1969 1970 1971 1972 1973
    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 );
1974 1975 1976 1977
}

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

1981
static void dump_get_console_input_info_reply( const struct get_console_input_info_reply *req )
1982
{
1983 1984 1985 1986 1987 1988 1989 1990
    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 );
1991 1992 1993 1994
}

static void dump_append_console_input_history_request( const struct append_console_input_history_request *req )
{
1995 1996
    fprintf( stderr, " handle=%04x", req->handle );
    dump_varargs_unicode_str( ", line=", cur_size );
1997 1998 1999 2000
}

static void dump_get_console_input_history_request( const struct get_console_input_history_request *req )
{
2001 2002
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", index=%d", req->index );
2003 2004
}

2005
static void dump_get_console_input_history_reply( const struct get_console_input_history_reply *req )
2006
{
2007 2008
    fprintf( stderr, " total=%d", req->total );
    dump_varargs_unicode_str( ", line=", cur_size );
2009 2010 2011 2012
}

static void dump_create_console_output_request( const struct create_console_output_request *req )
{
2013 2014 2015 2016
    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 );
2017
    fprintf( stderr, ", fd=%d", req->fd );
2018 2019
}

2020
static void dump_create_console_output_reply( const struct create_console_output_reply *req )
2021
{
2022
    fprintf( stderr, " handle_out=%04x", req->handle_out );
2023 2024 2025
}

static void dump_set_console_output_info_request( const struct set_console_output_info_request *req )
2026
{
2027 2028 2029 2030 2031 2032 2033 2034 2035
    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 );
2036
    fprintf( stderr, ", popup_attr=%d", req->popup_attr );
2037 2038 2039 2040 2041 2042
    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 );
2043 2044
    fprintf( stderr, ", font_width=%d", req->font_width );
    fprintf( stderr, ", font_height=%d", req->font_height );
2045
    dump_varargs_uints( ", colors=", cur_size );
2046 2047
}

2048
static void dump_get_console_output_info_request( const struct get_console_output_info_request *req )
2049
{
2050
    fprintf( stderr, " handle=%04x", req->handle );
2051 2052
}

2053
static void dump_get_console_output_info_reply( const struct get_console_output_info_reply *req )
2054
{
2055 2056 2057 2058 2059 2060 2061
    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 );
2062
    fprintf( stderr, ", popup_attr=%d", req->popup_attr );
2063 2064 2065 2066 2067 2068
    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 );
2069 2070
    fprintf( stderr, ", font_width=%d", req->font_width );
    fprintf( stderr, ", font_height=%d", req->font_height );
2071
    dump_varargs_uints( ", colors=", cur_size );
2072 2073
}

2074
static void dump_write_console_input_request( const struct write_console_input_request *req )
2075
{
2076 2077
    fprintf( stderr, " handle=%04x", req->handle );
    dump_varargs_input_records( ", rec=", cur_size );
2078 2079
}

2080
static void dump_write_console_input_reply( const struct write_console_input_reply *req )
2081 2082 2083 2084
{
    fprintf( stderr, " written=%d", req->written );
}

2085
static void dump_read_console_input_request( const struct read_console_input_request *req )
2086
{
2087 2088
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", flush=%d", req->flush );
2089 2090
}

2091
static void dump_read_console_input_reply( const struct read_console_input_reply *req )
2092
{
2093 2094
    fprintf( stderr, " read=%d", req->read );
    dump_varargs_input_records( ", rec=", cur_size );
2095 2096
}

2097 2098
static void dump_write_console_output_request( const struct write_console_output_request *req )
{
2099 2100 2101 2102 2103 2104
    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 );
2105 2106 2107 2108
}

static void dump_write_console_output_reply( const struct write_console_output_reply *req )
{
2109 2110 2111
    fprintf( stderr, " written=%d", req->written );
    fprintf( stderr, ", width=%d", req->width );
    fprintf( stderr, ", height=%d", req->height );
2112 2113 2114 2115
}

static void dump_fill_console_output_request( const struct fill_console_output_request *req )
{
2116 2117 2118 2119 2120 2121 2122
    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 );
2123 2124
}

2125
static void dump_fill_console_output_reply( const struct fill_console_output_reply *req )
2126 2127 2128 2129 2130 2131
{
    fprintf( stderr, " written=%d", req->written );
}

static void dump_read_console_output_request( const struct read_console_output_request *req )
{
2132 2133 2134 2135 2136
    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 );
2137 2138
}

2139
static void dump_read_console_output_reply( const struct read_console_output_reply *req )
2140
{
2141 2142 2143
    fprintf( stderr, " width=%d", req->width );
    fprintf( stderr, ", height=%d", req->height );
    dump_varargs_bytes( ", data=", cur_size );
2144 2145 2146 2147
}

static void dump_move_console_output_request( const struct move_console_output_request *req )
{
2148 2149 2150 2151 2152 2153 2154
    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 );
2155 2156
}

2157 2158
static void dump_send_console_signal_request( const struct send_console_signal_request *req )
{
2159 2160
    fprintf( stderr, " signal=%d", req->signal );
    fprintf( stderr, ", group_id=%04x", req->group_id );
2161 2162
}

2163
static void dump_read_directory_changes_request( const struct read_directory_changes_request *req )
2164
{
2165 2166 2167 2168
    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 );
2169 2170 2171 2172
}

static void dump_read_change_request( const struct read_change_request *req )
{
2173
    fprintf( stderr, " handle=%04x", req->handle );
2174 2175 2176 2177
}

static void dump_read_change_reply( const struct read_change_reply *req )
{
2178
    dump_varargs_filesystem_event( " events=", cur_size );
2179 2180
}

2181
static void dump_create_mapping_request( const struct create_mapping_request *req )
2182
{
2183
    fprintf( stderr, " access=%08x", req->access );
2184
    fprintf( stderr, ", flags=%08x", req->flags );
2185 2186 2187 2188
    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 );
2189 2190
}

2191
static void dump_create_mapping_reply( const struct create_mapping_reply *req )
2192
{
2193
    fprintf( stderr, " handle=%04x", req->handle );
2194 2195
}

2196
static void dump_open_mapping_request( const struct open_mapping_request *req )
2197
{
2198 2199 2200 2201
    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 );
2202 2203
}

2204
static void dump_open_mapping_reply( const struct open_mapping_reply *req )
2205
{
2206
    fprintf( stderr, " handle=%04x", req->handle );
2207 2208
}

2209
static void dump_get_mapping_info_request( const struct get_mapping_info_request *req )
2210
{
2211 2212
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", access=%08x", req->access );
2213 2214
}

2215
static void dump_get_mapping_info_reply( const struct get_mapping_info_reply *req )
2216
{
2217
    dump_uint64( " size=", &req->size );
2218
    fprintf( stderr, ", flags=%08x", req->flags );
2219 2220 2221
    fprintf( stderr, ", protect=%d", req->protect );
    fprintf( stderr, ", mapping=%04x", req->mapping );
    fprintf( stderr, ", shared_file=%04x", req->shared_file );
2222
    dump_varargs_pe_image_info( ", image=", cur_size );
2223 2224
}

2225 2226
static void dump_get_mapping_committed_range_request( const struct get_mapping_committed_range_request *req )
{
2227 2228
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", offset=", &req->offset );
2229 2230 2231 2232
}

static void dump_get_mapping_committed_range_reply( const struct get_mapping_committed_range_reply *req )
{
2233 2234
    dump_uint64( " size=", &req->size );
    fprintf( stderr, ", committed=%d", req->committed );
2235 2236 2237 2238
}

static void dump_add_mapping_committed_range_request( const struct add_mapping_committed_range_request *req )
{
2239 2240 2241
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", offset=", &req->offset );
    dump_uint64( ", size=", &req->size );
2242 2243
}

2244
static void dump_create_snapshot_request( const struct create_snapshot_request *req )
2245
{
2246 2247
    fprintf( stderr, " attributes=%08x", req->attributes );
    fprintf( stderr, ", flags=%08x", req->flags );
2248 2249
}

2250
static void dump_create_snapshot_reply( const struct create_snapshot_reply *req )
2251
{
2252
    fprintf( stderr, " handle=%04x", req->handle );
2253 2254
}

2255
static void dump_next_process_request( const struct next_process_request *req )
2256
{
2257 2258
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", reset=%d", req->reset );
2259 2260
}

2261
static void dump_next_process_reply( const struct next_process_reply *req )
2262
{
2263 2264 2265 2266 2267 2268
    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 );
2269
    fprintf( stderr, ", unix_pid=%d", req->unix_pid );
2270
    dump_varargs_unicode_str( ", filename=", cur_size );
2271 2272
}

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

2279
static void dump_next_thread_reply( const struct next_thread_reply *req )
2280
{
2281 2282 2283 2284 2285
    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 );
2286 2287
}

2288
static void dump_wait_debug_event_request( const struct wait_debug_event_request *req )
2289
{
2290
    fprintf( stderr, " get_handle=%d", req->get_handle );
2291 2292
}

2293
static void dump_wait_debug_event_reply( const struct wait_debug_event_reply *req )
2294
{
2295 2296 2297 2298
    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 );
2299 2300
}

2301
static void dump_queue_exception_event_request( const struct queue_exception_event_request *req )
2302
{
2303 2304 2305 2306 2307 2308 2309 2310
    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 );
2311 2312
}

2313
static void dump_queue_exception_event_reply( const struct queue_exception_event_reply *req )
2314
{
2315
    fprintf( stderr, " handle=%04x", req->handle );
2316 2317 2318 2319
}

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

2323
static void dump_get_exception_status_reply( const struct get_exception_status_reply *req )
2324
{
2325
    dump_varargs_context( " context=", cur_size );
2326 2327
}

2328
static void dump_continue_debug_event_request( const struct continue_debug_event_request *req )
2329
{
2330 2331 2332
    fprintf( stderr, " pid=%04x", req->pid );
    fprintf( stderr, ", tid=%04x", req->tid );
    fprintf( stderr, ", status=%d", req->status );
2333 2334
}

2335
static void dump_debug_process_request( const struct debug_process_request *req )
2336
{
2337 2338
    fprintf( stderr, " pid=%04x", req->pid );
    fprintf( stderr, ", attach=%d", req->attach );
2339 2340
}

2341 2342
static void dump_debug_break_request( const struct debug_break_request *req )
{
2343
    fprintf( stderr, " handle=%04x", req->handle );
2344 2345 2346 2347 2348 2349 2350
}

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

2351 2352 2353
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 );
2354
}
2355

2356
static void dump_read_process_memory_request( const struct read_process_memory_request *req )
2357
{
2358 2359
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", addr=", &req->addr );
2360 2361
}

2362
static void dump_read_process_memory_reply( const struct read_process_memory_reply *req )
2363
{
2364
    dump_varargs_bytes( " data=", cur_size );
2365 2366
}

2367
static void dump_write_process_memory_request( const struct write_process_memory_request *req )
2368
{
2369 2370 2371
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", addr=", &req->addr );
    dump_varargs_bytes( ", data=", cur_size );
2372 2373
}

2374
static void dump_create_key_request( const struct create_key_request *req )
2375
{
2376
    fprintf( stderr, " access=%08x", req->access );
2377
    fprintf( stderr, ", options=%08x", req->options );
2378
    dump_varargs_object_attributes( ", objattr=", cur_size );
2379
    dump_varargs_unicode_str( ", class=", cur_size );
2380 2381
}

2382
static void dump_create_key_reply( const struct create_key_reply *req )
2383
{
2384 2385
    fprintf( stderr, " hkey=%04x", req->hkey );
    fprintf( stderr, ", created=%d", req->created );
2386 2387
}

2388
static void dump_open_key_request( const struct open_key_request *req )
2389
{
2390 2391 2392 2393
    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 );
2394 2395
}

2396
static void dump_open_key_reply( const struct open_key_reply *req )
2397
{
2398
    fprintf( stderr, " hkey=%04x", req->hkey );
2399 2400
}

2401
static void dump_delete_key_request( const struct delete_key_request *req )
2402
{
2403
    fprintf( stderr, " hkey=%04x", req->hkey );
2404 2405
}

2406 2407
static void dump_flush_key_request( const struct flush_key_request *req )
{
2408
    fprintf( stderr, " hkey=%04x", req->hkey );
2409 2410
}

2411
static void dump_enum_key_request( const struct enum_key_request *req )
2412
{
2413 2414 2415
    fprintf( stderr, " hkey=%04x", req->hkey );
    fprintf( stderr, ", index=%d", req->index );
    fprintf( stderr, ", info_class=%d", req->info_class );
2416 2417
}

2418
static void dump_enum_key_reply( const struct enum_key_reply *req )
2419
{
2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430
    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 );
2431 2432
}

2433
static void dump_set_key_value_request( const struct set_key_value_request *req )
2434
{
2435 2436 2437 2438 2439
    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 );
2440 2441
}

2442
static void dump_get_key_value_request( const struct get_key_value_request *req )
2443
{
2444 2445
    fprintf( stderr, " hkey=%04x", req->hkey );
    dump_varargs_unicode_str( ", name=", cur_size );
2446 2447
}

2448
static void dump_get_key_value_reply( const struct get_key_value_reply *req )
2449
{
2450 2451 2452
    fprintf( stderr, " type=%d", req->type );
    fprintf( stderr, ", total=%u", req->total );
    dump_varargs_bytes( ", data=", cur_size );
2453 2454
}

2455
static void dump_enum_key_value_request( const struct enum_key_value_request *req )
2456
{
2457 2458 2459
    fprintf( stderr, " hkey=%04x", req->hkey );
    fprintf( stderr, ", index=%d", req->index );
    fprintf( stderr, ", info_class=%d", req->info_class );
2460 2461
}

2462
static void dump_enum_key_value_reply( const struct enum_key_value_reply *req )
2463
{
2464 2465 2466 2467 2468
    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 );
2469 2470
}

2471
static void dump_delete_key_value_request( const struct delete_key_value_request *req )
2472
{
2473 2474
    fprintf( stderr, " hkey=%04x", req->hkey );
    dump_varargs_unicode_str( ", name=", cur_size );
2475 2476
}

2477
static void dump_load_registry_request( const struct load_registry_request *req )
2478
{
2479 2480
    fprintf( stderr, " file=%04x", req->file );
    dump_varargs_object_attributes( ", objattr=", cur_size );
2481 2482
}

2483 2484
static void dump_unload_registry_request( const struct unload_registry_request *req )
{
2485
    fprintf( stderr, " hkey=%04x", req->hkey );
2486 2487
}

2488
static void dump_save_registry_request( const struct save_registry_request *req )
2489
{
2490 2491
    fprintf( stderr, " hkey=%04x", req->hkey );
    fprintf( stderr, ", file=%04x", req->file );
2492 2493
}

2494 2495
static void dump_set_registry_notification_request( const struct set_registry_notification_request *req )
{
2496 2497 2498 2499
    fprintf( stderr, " hkey=%04x", req->hkey );
    fprintf( stderr, ", event=%04x", req->event );
    fprintf( stderr, ", subtree=%d", req->subtree );
    fprintf( stderr, ", filter=%08x", req->filter );
2500 2501
}

2502
static void dump_create_timer_request( const struct create_timer_request *req )
2503
{
2504 2505
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", manual=%d", req->manual );
2506
    dump_varargs_object_attributes( ", objattr=", cur_size );
2507 2508
}

2509
static void dump_create_timer_reply( const struct create_timer_reply *req )
2510
{
2511
    fprintf( stderr, " handle=%04x", req->handle );
2512 2513
}

2514
static void dump_open_timer_request( const struct open_timer_request *req )
2515
{
2516 2517 2518 2519
    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 );
2520 2521
}

2522
static void dump_open_timer_reply( const struct open_timer_reply *req )
2523
{
2524
    fprintf( stderr, " handle=%04x", req->handle );
2525 2526
}

2527
static void dump_set_timer_request( const struct set_timer_request *req )
2528
{
2529 2530 2531 2532 2533
    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 );
2534 2535
}

2536 2537 2538 2539 2540
static void dump_set_timer_reply( const struct set_timer_reply *req )
{
    fprintf( stderr, " signaled=%d", req->signaled );
}

2541
static void dump_cancel_timer_request( const struct cancel_timer_request *req )
2542
{
2543
    fprintf( stderr, " handle=%04x", req->handle );
2544 2545
}

2546 2547 2548 2549 2550
static void dump_cancel_timer_reply( const struct cancel_timer_reply *req )
{
    fprintf( stderr, " signaled=%d", req->signaled );
}

2551 2552
static void dump_get_timer_info_request( const struct get_timer_info_request *req )
{
2553
    fprintf( stderr, " handle=%04x", req->handle );
2554 2555 2556 2557
}

static void dump_get_timer_info_reply( const struct get_timer_info_reply *req )
{
2558 2559
    dump_timeout( " when=", &req->when );
    fprintf( stderr, ", signaled=%d", req->signaled );
2560 2561
}

2562 2563
static void dump_get_thread_context_request( const struct get_thread_context_request *req )
{
2564 2565 2566
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", flags=%08x", req->flags );
    fprintf( stderr, ", suspend=%d", req->suspend );
2567 2568
}

2569
static void dump_get_thread_context_reply( const struct get_thread_context_reply *req )
2570
{
2571 2572
    fprintf( stderr, " self=%d", req->self );
    dump_varargs_context( ", context=", cur_size );
2573 2574 2575 2576
}

static void dump_set_thread_context_request( const struct set_thread_context_request *req )
{
2577 2578 2579
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", suspend=%d", req->suspend );
    dump_varargs_context( ", context=", cur_size );
2580 2581
}

2582 2583 2584 2585 2586
static void dump_set_thread_context_reply( const struct set_thread_context_reply *req )
{
    fprintf( stderr, " self=%d", req->self );
}

2587 2588
static void dump_get_selector_entry_request( const struct get_selector_entry_request *req )
{
2589 2590
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", entry=%d", req->entry );
2591 2592
}

2593
static void dump_get_selector_entry_reply( const struct get_selector_entry_reply *req )
2594
{
2595 2596 2597
    fprintf( stderr, " base=%08x", req->base );
    fprintf( stderr, ", limit=%08x", req->limit );
    fprintf( stderr, ", flags=%02x", req->flags );
2598 2599
}

2600 2601
static void dump_add_atom_request( const struct add_atom_request *req )
{
2602 2603
    fprintf( stderr, " table=%04x", req->table );
    dump_varargs_unicode_str( ", name=", cur_size );
2604 2605
}

2606
static void dump_add_atom_reply( const struct add_atom_reply *req )
2607
{
2608
    fprintf( stderr, " atom=%04x", req->atom );
2609 2610 2611 2612
}

static void dump_delete_atom_request( const struct delete_atom_request *req )
{
2613 2614
    fprintf( stderr, " table=%04x", req->table );
    fprintf( stderr, ", atom=%04x", req->atom );
2615 2616 2617 2618
}

static void dump_find_atom_request( const struct find_atom_request *req )
{
2619 2620
    fprintf( stderr, " table=%04x", req->table );
    dump_varargs_unicode_str( ", name=", cur_size );
2621 2622
}

2623
static void dump_find_atom_reply( const struct find_atom_reply *req )
2624
{
2625
    fprintf( stderr, " atom=%04x", req->atom );
2626 2627
}

2628
static void dump_get_atom_information_request( const struct get_atom_information_request *req )
2629
{
2630 2631
    fprintf( stderr, " table=%04x", req->table );
    fprintf( stderr, ", atom=%04x", req->atom );
2632 2633
}

2634
static void dump_get_atom_information_reply( const struct get_atom_information_reply *req )
2635
{
2636 2637 2638 2639
    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 );
2640 2641
}

2642 2643
static void dump_set_atom_information_request( const struct set_atom_information_request *req )
{
2644 2645 2646
    fprintf( stderr, " table=%04x", req->table );
    fprintf( stderr, ", atom=%04x", req->atom );
    fprintf( stderr, ", pinned=%d", req->pinned );
2647 2648 2649 2650
}

static void dump_empty_atom_table_request( const struct empty_atom_table_request *req )
{
2651 2652
    fprintf( stderr, " table=%04x", req->table );
    fprintf( stderr, ", if_pinned=%d", req->if_pinned );
2653 2654
}

2655 2656 2657 2658 2659
static void dump_init_atom_table_request( const struct init_atom_table_request *req )
{
    fprintf( stderr, " entries=%d", req->entries );
}

2660 2661
static void dump_init_atom_table_reply( const struct init_atom_table_reply *req )
{
2662
    fprintf( stderr, " table=%04x", req->table );
2663 2664
}

2665 2666 2667 2668
static void dump_get_msg_queue_request( const struct get_msg_queue_request *req )
{
}

2669
static void dump_get_msg_queue_reply( const struct get_msg_queue_reply *req )
2670
{
2671
    fprintf( stderr, " handle=%04x", req->handle );
2672 2673
}

2674 2675
static void dump_set_queue_fd_request( const struct set_queue_fd_request *req )
{
2676
    fprintf( stderr, " handle=%04x", req->handle );
2677 2678
}

2679 2680
static void dump_set_queue_mask_request( const struct set_queue_mask_request *req )
{
2681 2682 2683
    fprintf( stderr, " wake_mask=%08x", req->wake_mask );
    fprintf( stderr, ", changed_mask=%08x", req->changed_mask );
    fprintf( stderr, ", skip_wait=%d", req->skip_wait );
2684 2685
}

2686
static void dump_set_queue_mask_reply( const struct set_queue_mask_reply *req )
2687
{
2688 2689
    fprintf( stderr, " wake_bits=%08x", req->wake_bits );
    fprintf( stderr, ", changed_bits=%08x", req->changed_bits );
2690 2691 2692 2693
}

static void dump_get_queue_status_request( const struct get_queue_status_request *req )
{
2694
    fprintf( stderr, " clear_bits=%08x", req->clear_bits );
2695 2696
}

2697
static void dump_get_queue_status_reply( const struct get_queue_status_reply *req )
2698
{
2699 2700
    fprintf( stderr, " wake_bits=%08x", req->wake_bits );
    fprintf( stderr, ", changed_bits=%08x", req->changed_bits );
2701 2702
}

2703
static void dump_get_process_idle_event_request( const struct get_process_idle_event_request *req )
2704
{
2705
    fprintf( stderr, " handle=%04x", req->handle );
2706 2707
}

2708
static void dump_get_process_idle_event_reply( const struct get_process_idle_event_reply *req )
2709
{
2710
    fprintf( stderr, " event=%04x", req->event );
2711 2712
}

2713 2714
static void dump_send_message_request( const struct send_message_request *req )
{
2715 2716 2717 2718 2719 2720 2721 2722 2723
    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 );
2724 2725
}

2726 2727 2728 2729 2730
static void dump_post_quit_message_request( const struct post_quit_message_request *req )
{
    fprintf( stderr, " exit_code=%d", req->exit_code );
}

2731 2732
static void dump_send_hardware_message_request( const struct send_hardware_message_request *req )
{
2733
    fprintf( stderr, " win=%08x", req->win );
2734 2735
    dump_hw_input( ", input=", &req->input );
    fprintf( stderr, ", flags=%08x", req->flags );
2736 2737 2738 2739 2740
}

static void dump_send_hardware_message_reply( const struct send_hardware_message_reply *req )
{
    fprintf( stderr, " wait=%d", req->wait );
2741 2742 2743 2744
    fprintf( stderr, ", prev_x=%d", req->prev_x );
    fprintf( stderr, ", prev_y=%d", req->prev_y );
    fprintf( stderr, ", new_x=%d", req->new_x );
    fprintf( stderr, ", new_y=%d", req->new_y );
2745
    dump_varargs_bytes( ", keystate=", cur_size );
2746 2747
}

2748 2749
static void dump_get_message_request( const struct get_message_request *req )
{
2750 2751 2752 2753 2754 2755 2756
    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 );
2757 2758
}

2759
static void dump_get_message_reply( const struct get_message_reply *req )
2760
{
2761 2762 2763 2764 2765
    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 );
2766 2767
    fprintf( stderr, ", x=%d", req->x );
    fprintf( stderr, ", y=%d", req->y );
2768 2769 2770 2771
    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 );
2772 2773 2774 2775
}

static void dump_reply_message_request( const struct reply_message_request *req )
{
2776 2777 2778
    fprintf( stderr, " remove=%d", req->remove );
    dump_uint64( ", result=", &req->result );
    dump_varargs_bytes( ", data=", cur_size );
2779 2780
}

2781 2782
static void dump_accept_hardware_message_request( const struct accept_hardware_message_request *req )
{
2783 2784
    fprintf( stderr, " hw_id=%08x", req->hw_id );
    fprintf( stderr, ", remove=%d", req->remove );
2785 2786
}

2787 2788 2789 2790 2791
static void dump_get_message_reply_request( const struct get_message_reply_request *req )
{
    fprintf( stderr, " cancel=%d", req->cancel );
}

2792
static void dump_get_message_reply_reply( const struct get_message_reply_reply *req )
2793
{
2794 2795
    dump_uint64( " result=", &req->result );
    dump_varargs_bytes( ", data=", cur_size );
2796 2797 2798 2799
}

static void dump_set_win_timer_request( const struct set_win_timer_request *req )
{
2800 2801 2802 2803 2804
    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 );
2805 2806
}

2807 2808
static void dump_set_win_timer_reply( const struct set_win_timer_reply *req )
{
2809
    dump_uint64( " id=", &req->id );
2810 2811
}

2812 2813
static void dump_kill_win_timer_request( const struct kill_win_timer_request *req )
{
2814 2815 2816
    fprintf( stderr, " win=%08x", req->win );
    dump_uint64( ", id=", &req->id );
    fprintf( stderr, ", msg=%08x", req->msg );
2817 2818
}

2819 2820
static void dump_is_window_hung_request( const struct is_window_hung_request *req )
{
2821
    fprintf( stderr, " win=%08x", req->win );
2822 2823 2824 2825 2826 2827 2828
}

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

2829 2830
static void dump_get_serial_info_request( const struct get_serial_info_request *req )
{
2831
    fprintf( stderr, " handle=%04x", req->handle );
2832
    fprintf( stderr, ", flags=%d", req->flags );
2833 2834
}

2835
static void dump_get_serial_info_reply( const struct get_serial_info_reply *req )
2836
{
2837 2838 2839 2840 2841 2842
    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 );
2843
    fprintf( stderr, ", cookie=%08x", req->cookie );
2844
    fprintf( stderr, ", pending_write=%08x", req->pending_write );
2845 2846 2847 2848
}

static void dump_set_serial_info_request( const struct set_serial_info_request *req )
{
2849 2850 2851 2852 2853 2854 2855 2856
    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 );
2857 2858
}

2859
static void dump_register_async_request( const struct register_async_request *req )
2860
{
2861 2862 2863
    fprintf( stderr, " type=%d", req->type );
    dump_async_data( ", async=", &req->async );
    fprintf( stderr, ", count=%d", req->count );
2864 2865 2866 2867
}

static void dump_cancel_async_request( const struct cancel_async_request *req )
{
2868
    fprintf( stderr, " handle=%04x", req->handle );
2869 2870
    dump_uint64( ", iosb=", &req->iosb );
    fprintf( stderr, ", only_thread=%d", req->only_thread );
2871 2872
}

2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901
static void dump_read_request( const struct read_request *req )
{
    fprintf( stderr, " blocking=%d", req->blocking );
    dump_async_data( ", async=", &req->async );
    dump_uint64( ", pos=", &req->pos );
}

static void dump_read_reply( const struct read_reply *req )
{
    fprintf( stderr, " wait=%04x", req->wait );
    fprintf( stderr, ", options=%08x", req->options );
    dump_varargs_bytes( ", data=", cur_size );
}

static void dump_write_request( const struct write_request *req )
{
    fprintf( stderr, " blocking=%d", req->blocking );
    dump_async_data( ", async=", &req->async );
    dump_uint64( ", pos=", &req->pos );
    dump_varargs_bytes( ", data=", cur_size );
}

static void dump_write_reply( const struct write_reply *req )
{
    fprintf( stderr, " wait=%04x", req->wait );
    fprintf( stderr, ", options=%08x", req->options );
    fprintf( stderr, ", size=%u", req->size );
}

2902 2903
static void dump_ioctl_request( const struct ioctl_request *req )
{
2904 2905 2906 2907
    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 );
2908 2909 2910 2911
}

static void dump_ioctl_reply( const struct ioctl_reply *req )
{
2912 2913 2914
    fprintf( stderr, " wait=%04x", req->wait );
    fprintf( stderr, ", options=%08x", req->options );
    dump_varargs_bytes( ", out_data=", cur_size );
2915 2916
}

2917
static void dump_set_irp_result_request( const struct set_irp_result_request *req )
2918
{
2919
    fprintf( stderr, " handle=%04x", req->handle );
2920
    fprintf( stderr, ", status=%08x", req->status );
2921
    fprintf( stderr, ", size=%u", req->size );
2922
    dump_uint64( ", file_ptr=", &req->file_ptr );
2923 2924 2925
    dump_varargs_bytes( ", data=", cur_size );
}

2926
static void dump_get_irp_result_request( const struct get_irp_result_request *req )
2927
{
2928 2929
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", user_arg=", &req->user_arg );
2930 2931
}

2932
static void dump_get_irp_result_reply( const struct get_irp_result_reply *req )
2933
{
2934 2935
    fprintf( stderr, " size=%u", req->size );
    dump_varargs_bytes( ", out_data=", cur_size );
2936 2937
}

2938 2939
static void dump_create_named_pipe_request( const struct create_named_pipe_request *req )
{
2940 2941
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", options=%08x", req->options );
2942
    fprintf( stderr, ", sharing=%08x", req->sharing );
2943 2944 2945 2946 2947
    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 );
2948
    dump_varargs_object_attributes( ", objattr=", cur_size );
2949 2950
}

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

2956 2957
static void dump_get_named_pipe_info_request( const struct get_named_pipe_info_request *req )
{
2958
    fprintf( stderr, " handle=%04x", req->handle );
2959 2960
}

2961
static void dump_get_named_pipe_info_reply( const struct get_named_pipe_info_reply *req )
2962
{
2963
    fprintf( stderr, " flags=%08x", req->flags );
2964
    fprintf( stderr, ", sharing=%08x", req->sharing );
2965 2966 2967 2968
    fprintf( stderr, ", maxinstances=%08x", req->maxinstances );
    fprintf( stderr, ", instances=%08x", req->instances );
    fprintf( stderr, ", outsize=%08x", req->outsize );
    fprintf( stderr, ", insize=%08x", req->insize );
2969 2970
}

2971 2972 2973 2974 2975 2976
static void dump_set_named_pipe_info_request( const struct set_named_pipe_info_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", flags=%08x", req->flags );
}

2977 2978
static void dump_create_window_request( const struct create_window_request *req )
{
2979 2980 2981 2982 2983
    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 );
2984 2985
}

2986
static void dump_create_window_reply( const struct create_window_reply *req )
2987
{
2988 2989 2990 2991 2992
    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 );
2993 2994 2995 2996
}

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

3000 3001
static void dump_get_desktop_window_request( const struct get_desktop_window_request *req )
{
3002
    fprintf( stderr, " force=%d", req->force );
3003 3004 3005 3006
}

static void dump_get_desktop_window_reply( const struct get_desktop_window_reply *req )
{
3007 3008
    fprintf( stderr, " top_window=%08x", req->top_window );
    fprintf( stderr, ", msg_window=%08x", req->msg_window );
3009 3010
}

3011 3012
static void dump_set_window_owner_request( const struct set_window_owner_request *req )
{
3013 3014
    fprintf( stderr, " handle=%08x", req->handle );
    fprintf( stderr, ", owner=%08x", req->owner );
3015 3016
}

3017
static void dump_set_window_owner_reply( const struct set_window_owner_reply *req )
3018
{
3019 3020
    fprintf( stderr, " full_owner=%08x", req->full_owner );
    fprintf( stderr, ", prev_owner=%08x", req->prev_owner );
3021 3022
}

3023 3024
static void dump_get_window_info_request( const struct get_window_info_request *req )
{
3025
    fprintf( stderr, " handle=%08x", req->handle );
3026 3027
}

3028
static void dump_get_window_info_reply( const struct get_window_info_reply *req )
3029
{
3030 3031 3032 3033 3034 3035
    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 );
3036 3037 3038 3039
}

static void dump_set_window_info_request( const struct set_window_info_request *req )
{
3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050
    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 );
3051 3052
}

3053
static void dump_set_window_info_reply( const struct set_window_info_reply *req )
3054
{
3055 3056 3057 3058 3059 3060
    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 );
3061 3062
}

3063 3064
static void dump_set_parent_request( const struct set_parent_request *req )
{
3065 3066
    fprintf( stderr, " handle=%08x", req->handle );
    fprintf( stderr, ", parent=%08x", req->parent );
3067 3068 3069 3070
}

static void dump_set_parent_reply( const struct set_parent_reply *req )
{
3071 3072
    fprintf( stderr, " old_parent=%08x", req->old_parent );
    fprintf( stderr, ", full_parent=%08x", req->full_parent );
3073 3074
}

3075 3076
static void dump_get_window_parents_request( const struct get_window_parents_request *req )
{
3077
    fprintf( stderr, " handle=%08x", req->handle );
3078 3079
}

3080
static void dump_get_window_parents_reply( const struct get_window_parents_reply *req )
3081
{
3082 3083
    fprintf( stderr, " count=%d", req->count );
    dump_varargs_user_handles( ", parents=", cur_size );
3084 3085 3086 3087
}

static void dump_get_window_children_request( const struct get_window_children_request *req )
{
3088 3089 3090 3091 3092
    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 );
3093 3094
}

3095
static void dump_get_window_children_reply( const struct get_window_children_reply *req )
3096
{
3097 3098
    fprintf( stderr, " count=%d", req->count );
    dump_varargs_user_handles( ", children=", cur_size );
3099 3100
}

3101 3102
static void dump_get_window_children_from_point_request( const struct get_window_children_from_point_request *req )
{
3103 3104 3105
    fprintf( stderr, " parent=%08x", req->parent );
    fprintf( stderr, ", x=%d", req->x );
    fprintf( stderr, ", y=%d", req->y );
3106 3107 3108 3109
}

static void dump_get_window_children_from_point_reply( const struct get_window_children_from_point_reply *req )
{
3110 3111
    fprintf( stderr, " count=%d", req->count );
    dump_varargs_user_handles( ", children=", cur_size );
3112 3113
}

3114 3115
static void dump_get_window_tree_request( const struct get_window_tree_request *req )
{
3116
    fprintf( stderr, " handle=%08x", req->handle );
3117 3118
}

3119
static void dump_get_window_tree_reply( const struct get_window_tree_reply *req )
3120
{
3121 3122 3123 3124 3125 3126 3127 3128
    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 );
3129 3130
}

3131
static void dump_set_window_pos_request( const struct set_window_pos_request *req )
3132
{
3133 3134
    fprintf( stderr, " swp_flags=%04x", req->swp_flags );
    fprintf( stderr, ", paint_flags=%04x", req->paint_flags );
3135 3136 3137 3138 3139
    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 );
3140 3141
}

3142 3143
static void dump_set_window_pos_reply( const struct set_window_pos_reply *req )
{
3144 3145
    fprintf( stderr, " new_style=%08x", req->new_style );
    fprintf( stderr, ", new_ex_style=%08x", req->new_ex_style );
3146
    fprintf( stderr, ", surface_win=%08x", req->surface_win );
3147 3148
}

3149 3150
static void dump_get_window_rectangles_request( const struct get_window_rectangles_request *req )
{
3151
    fprintf( stderr, " handle=%08x", req->handle );
3152
    fprintf( stderr, ", relative=%d", req->relative );
3153 3154
}

3155
static void dump_get_window_rectangles_reply( const struct get_window_rectangles_reply *req )
3156
{
3157 3158 3159
    dump_rectangle( " window=", &req->window );
    dump_rectangle( ", visible=", &req->visible );
    dump_rectangle( ", client=", &req->client );
3160 3161
}

3162 3163
static void dump_get_window_text_request( const struct get_window_text_request *req )
{
3164
    fprintf( stderr, " handle=%08x", req->handle );
3165 3166
}

3167
static void dump_get_window_text_reply( const struct get_window_text_reply *req )
3168
{
3169
    dump_varargs_unicode_str( " text=", cur_size );
3170 3171 3172 3173
}

static void dump_set_window_text_request( const struct set_window_text_request *req )
{
3174 3175
    fprintf( stderr, " handle=%08x", req->handle );
    dump_varargs_unicode_str( ", text=", cur_size );
3176 3177
}

3178 3179
static void dump_get_windows_offset_request( const struct get_windows_offset_request *req )
{
3180 3181
    fprintf( stderr, " from=%08x", req->from );
    fprintf( stderr, ", to=%08x", req->to );
3182 3183
}

3184
static void dump_get_windows_offset_reply( const struct get_windows_offset_reply *req )
3185
{
3186 3187
    fprintf( stderr, " x=%d", req->x );
    fprintf( stderr, ", y=%d", req->y );
3188
    fprintf( stderr, ", mirror=%d", req->mirror );
3189 3190
}

3191 3192
static void dump_get_visible_region_request( const struct get_visible_region_request *req )
{
3193 3194
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", flags=%08x", req->flags );
3195 3196 3197 3198
}

static void dump_get_visible_region_reply( const struct get_visible_region_reply *req )
{
3199 3200 3201
    fprintf( stderr, " top_win=%08x", req->top_win );
    dump_rectangle( ", top_rect=", &req->top_rect );
    dump_rectangle( ", win_rect=", &req->win_rect );
3202
    fprintf( stderr, ", paint_flags=%08x", req->paint_flags );
3203 3204
    fprintf( stderr, ", total_size=%u", req->total_size );
    dump_varargs_rectangles( ", region=", cur_size );
3205 3206
}

3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218
static void dump_get_surface_region_request( const struct get_surface_region_request *req )
{
    fprintf( stderr, " window=%08x", req->window );
}

static void dump_get_surface_region_reply( const struct get_surface_region_reply *req )
{
    dump_rectangle( " visible_rect=", &req->visible_rect );
    fprintf( stderr, ", total_size=%u", req->total_size );
    dump_varargs_rectangles( ", region=", cur_size );
}

3219 3220
static void dump_get_window_region_request( const struct get_window_region_request *req )
{
3221
    fprintf( stderr, " window=%08x", req->window );
3222 3223 3224 3225
}

static void dump_get_window_region_reply( const struct get_window_region_reply *req )
{
3226 3227
    fprintf( stderr, " total_size=%u", req->total_size );
    dump_varargs_rectangles( ", region=", cur_size );
3228 3229 3230 3231
}

static void dump_set_window_region_request( const struct set_window_region_request *req )
{
3232 3233 3234
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", redraw=%d", req->redraw );
    dump_varargs_rectangles( ", region=", cur_size );
3235 3236
}

3237 3238
static void dump_get_update_region_request( const struct get_update_region_request *req )
{
3239 3240 3241
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", from_child=%08x", req->from_child );
    fprintf( stderr, ", flags=%08x", req->flags );
3242 3243 3244 3245
}

static void dump_get_update_region_reply( const struct get_update_region_reply *req )
{
3246 3247 3248 3249
    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 );
3250 3251
}

3252 3253
static void dump_update_window_zorder_request( const struct update_window_zorder_request *req )
{
3254 3255
    fprintf( stderr, " window=%08x", req->window );
    dump_rectangle( ", rect=", &req->rect );
3256 3257
}

3258 3259
static void dump_redraw_window_request( const struct redraw_window_request *req )
{
3260 3261 3262
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", flags=%08x", req->flags );
    dump_varargs_rectangles( ", region=", cur_size );
3263 3264
}

3265 3266
static void dump_set_window_property_request( const struct set_window_property_request *req )
{
3267 3268 3269 3270
    fprintf( stderr, " window=%08x", req->window );
    dump_uint64( ", data=", &req->data );
    fprintf( stderr, ", atom=%04x", req->atom );
    dump_varargs_unicode_str( ", name=", cur_size );
3271 3272 3273 3274
}

static void dump_remove_window_property_request( const struct remove_window_property_request *req )
{
3275 3276 3277
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", atom=%04x", req->atom );
    dump_varargs_unicode_str( ", name=", cur_size );
3278 3279
}

3280
static void dump_remove_window_property_reply( const struct remove_window_property_reply *req )
3281
{
3282
    dump_uint64( " data=", &req->data );
3283 3284 3285 3286
}

static void dump_get_window_property_request( const struct get_window_property_request *req )
{
3287 3288 3289
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", atom=%04x", req->atom );
    dump_varargs_unicode_str( ", name=", cur_size );
3290 3291
}

3292
static void dump_get_window_property_reply( const struct get_window_property_reply *req )
3293
{
3294
    dump_uint64( " data=", &req->data );
3295 3296 3297 3298
}

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

3302
static void dump_get_window_properties_reply( const struct get_window_properties_reply *req )
3303
{
3304 3305
    fprintf( stderr, " total=%d", req->total );
    dump_varargs_properties( ", props=", cur_size );
3306 3307
}

3308 3309
static void dump_create_winstation_request( const struct create_winstation_request *req )
{
3310 3311 3312
    fprintf( stderr, " flags=%08x", req->flags );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
3313
    fprintf( stderr, ", rootdir=%04x", req->rootdir );
3314
    dump_varargs_unicode_str( ", name=", cur_size );
3315 3316 3317 3318
}

static void dump_create_winstation_reply( const struct create_winstation_reply *req )
{
3319
    fprintf( stderr, " handle=%04x", req->handle );
3320 3321 3322 3323
}

static void dump_open_winstation_request( const struct open_winstation_request *req )
{
3324 3325
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
3326
    fprintf( stderr, ", rootdir=%04x", req->rootdir );
3327
    dump_varargs_unicode_str( ", name=", cur_size );
3328 3329 3330 3331
}

static void dump_open_winstation_reply( const struct open_winstation_reply *req )
{
3332
    fprintf( stderr, " handle=%04x", req->handle );
3333 3334 3335 3336
}

static void dump_close_winstation_request( const struct close_winstation_request *req )
{
3337
    fprintf( stderr, " handle=%04x", req->handle );
3338 3339 3340 3341 3342 3343 3344 3345
}

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 )
{
3346
    fprintf( stderr, " handle=%04x", req->handle );
3347 3348 3349 3350
}

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

3354 3355 3356 3357 3358 3359 3360
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 )
{
3361 3362
    fprintf( stderr, " next=%08x", req->next );
    dump_varargs_unicode_str( ", name=", cur_size );
3363 3364
}

3365 3366
static void dump_create_desktop_request( const struct create_desktop_request *req )
{
3367 3368 3369 3370
    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 );
3371 3372 3373 3374
}

static void dump_create_desktop_reply( const struct create_desktop_reply *req )
{
3375
    fprintf( stderr, " handle=%04x", req->handle );
3376 3377 3378 3379
}

static void dump_open_desktop_request( const struct open_desktop_request *req )
{
3380 3381 3382 3383 3384
    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 );
3385 3386 3387 3388
}

static void dump_open_desktop_reply( const struct open_desktop_reply *req )
{
3389
    fprintf( stderr, " handle=%04x", req->handle );
3390 3391
}

3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403
static void dump_open_input_desktop_request( const struct open_input_desktop_request *req )
{
    fprintf( stderr, " flags=%08x", req->flags );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
}

static void dump_open_input_desktop_reply( const struct open_input_desktop_reply *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
}

3404 3405
static void dump_close_desktop_request( const struct close_desktop_request *req )
{
3406
    fprintf( stderr, " handle=%04x", req->handle );
3407 3408 3409 3410 3411 3412 3413 3414 3415
}

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 )
{
3416
    fprintf( stderr, " handle=%04x", req->handle );
3417 3418 3419 3420
}

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

3424 3425
static void dump_enum_desktop_request( const struct enum_desktop_request *req )
{
3426 3427
    fprintf( stderr, " winstation=%04x", req->winstation );
    fprintf( stderr, ", index=%08x", req->index );
3428 3429 3430 3431
}

static void dump_enum_desktop_reply( const struct enum_desktop_reply *req )
{
3432 3433
    fprintf( stderr, " next=%08x", req->next );
    dump_varargs_unicode_str( ", name=", cur_size );
3434 3435
}

3436 3437
static void dump_set_user_object_info_request( const struct set_user_object_info_request *req )
{
3438 3439 3440
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", flags=%08x", req->flags );
    fprintf( stderr, ", obj_flags=%08x", req->obj_flags );
3441 3442 3443 3444
}

static void dump_set_user_object_info_reply( const struct set_user_object_info_reply *req )
{
3445 3446 3447
    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 );
3448 3449
}

3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476
static void dump_register_hotkey_request( const struct register_hotkey_request *req )
{
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", id=%d", req->id );
    fprintf( stderr, ", flags=%08x", req->flags );
    fprintf( stderr, ", vkey=%08x", req->vkey );
}

static void dump_register_hotkey_reply( const struct register_hotkey_reply *req )
{
    fprintf( stderr, " replaced=%d", req->replaced );
    fprintf( stderr, ", flags=%08x", req->flags );
    fprintf( stderr, ", vkey=%08x", req->vkey );
}

static void dump_unregister_hotkey_request( const struct unregister_hotkey_request *req )
{
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", id=%d", req->id );
}

static void dump_unregister_hotkey_reply( const struct unregister_hotkey_reply *req )
{
    fprintf( stderr, " flags=%08x", req->flags );
    fprintf( stderr, ", vkey=%08x", req->vkey );
}

3477 3478
static void dump_attach_thread_input_request( const struct attach_thread_input_request *req )
{
3479 3480 3481
    fprintf( stderr, " tid_from=%04x", req->tid_from );
    fprintf( stderr, ", tid_to=%04x", req->tid_to );
    fprintf( stderr, ", attach=%d", req->attach );
3482 3483 3484 3485
}

static void dump_get_thread_input_request( const struct get_thread_input_request *req )
{
3486
    fprintf( stderr, " tid=%04x", req->tid );
3487 3488 3489 3490
}

static void dump_get_thread_input_reply( const struct get_thread_input_reply *req )
{
3491 3492 3493 3494 3495 3496 3497
    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 );
3498 3499
    fprintf( stderr, ", cursor=%08x", req->cursor );
    fprintf( stderr, ", show_count=%d", req->show_count );
3500
    dump_rectangle( ", rect=", &req->rect );
3501 3502
}

3503 3504 3505 3506 3507 3508 3509 3510 3511
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 );
}

3512 3513
static void dump_get_key_state_request( const struct get_key_state_request *req )
{
3514 3515
    fprintf( stderr, " tid=%04x", req->tid );
    fprintf( stderr, ", key=%d", req->key );
3516 3517 3518 3519
}

static void dump_get_key_state_reply( const struct get_key_state_reply *req )
{
3520 3521
    fprintf( stderr, " state=%02x", req->state );
    dump_varargs_bytes( ", keystate=", cur_size );
3522 3523 3524 3525
}

static void dump_set_key_state_request( const struct set_key_state_request *req )
{
3526
    fprintf( stderr, " tid=%04x", req->tid );
3527
    fprintf( stderr, ", async=%d", req->async );
3528
    dump_varargs_bytes( ", keystate=", cur_size );
3529 3530
}

3531 3532
static void dump_set_foreground_window_request( const struct set_foreground_window_request *req )
{
3533
    fprintf( stderr, " handle=%08x", req->handle );
3534 3535 3536 3537
}

static void dump_set_foreground_window_reply( const struct set_foreground_window_reply *req )
{
3538 3539 3540
    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 );
3541 3542 3543 3544
}

static void dump_set_focus_window_request( const struct set_focus_window_request *req )
{
3545
    fprintf( stderr, " handle=%08x", req->handle );
3546 3547 3548 3549
}

static void dump_set_focus_window_reply( const struct set_focus_window_reply *req )
{
3550
    fprintf( stderr, " previous=%08x", req->previous );
3551 3552 3553 3554
}

static void dump_set_active_window_request( const struct set_active_window_request *req )
{
3555
    fprintf( stderr, " handle=%08x", req->handle );
3556 3557 3558 3559
}

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

3563 3564
static void dump_set_capture_window_request( const struct set_capture_window_request *req )
{
3565 3566
    fprintf( stderr, " handle=%08x", req->handle );
    fprintf( stderr, ", flags=%08x", req->flags );
3567 3568 3569 3570
}

static void dump_set_capture_window_reply( const struct set_capture_window_reply *req )
{
3571 3572
    fprintf( stderr, " previous=%08x", req->previous );
    fprintf( stderr, ", full_handle=%08x", req->full_handle );
3573 3574
}

3575 3576
static void dump_set_caret_window_request( const struct set_caret_window_request *req )
{
3577 3578 3579
    fprintf( stderr, " handle=%08x", req->handle );
    fprintf( stderr, ", width=%d", req->width );
    fprintf( stderr, ", height=%d", req->height );
3580 3581 3582 3583
}

static void dump_set_caret_window_reply( const struct set_caret_window_reply *req )
{
3584 3585 3586 3587
    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 );
3588 3589 3590 3591
}

static void dump_set_caret_info_request( const struct set_caret_info_request *req )
{
3592 3593 3594 3595 3596 3597
    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 );
3598 3599 3600 3601
}

static void dump_set_caret_info_reply( const struct set_caret_info_reply *req )
{
3602 3603 3604 3605
    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 );
3606 3607
}

3608 3609
static void dump_set_hook_request( const struct set_hook_request *req )
{
3610 3611 3612 3613 3614 3615 3616 3617 3618
    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 );
3619 3620 3621 3622
}

static void dump_set_hook_reply( const struct set_hook_reply *req )
{
3623 3624
    fprintf( stderr, " handle=%08x", req->handle );
    fprintf( stderr, ", active_hooks=%08x", req->active_hooks );
3625 3626 3627 3628
}

static void dump_remove_hook_request( const struct remove_hook_request *req )
{
3629 3630 3631
    fprintf( stderr, " handle=%08x", req->handle );
    dump_uint64( ", proc=", &req->proc );
    fprintf( stderr, ", id=%d", req->id );
3632 3633
}

3634 3635 3636 3637 3638
static void dump_remove_hook_reply( const struct remove_hook_reply *req )
{
    fprintf( stderr, " active_hooks=%08x", req->active_hooks );
}

3639 3640
static void dump_start_hook_chain_request( const struct start_hook_chain_request *req )
{
3641 3642 3643 3644 3645
    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 );
3646 3647 3648 3649
}

static void dump_start_hook_chain_reply( const struct start_hook_chain_reply *req )
{
3650 3651 3652 3653 3654 3655 3656
    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 );
3657 3658 3659 3660 3661 3662 3663
}

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

3664
static void dump_get_hook_info_request( const struct get_hook_info_request *req )
3665
{
3666 3667 3668 3669 3670 3671
    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 );
3672 3673
}

3674
static void dump_get_hook_info_reply( const struct get_hook_info_reply *req )
3675
{
3676 3677 3678 3679 3680 3681 3682
    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 );
3683 3684
}

3685 3686
static void dump_create_class_request( const struct create_class_request *req )
{
3687 3688 3689 3690 3691 3692 3693 3694
    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 );
3695 3696 3697 3698 3699
}

static void dump_create_class_reply( const struct create_class_reply *req )
{
    fprintf( stderr, " atom=%04x", req->atom );
3700 3701 3702 3703
}

static void dump_destroy_class_request( const struct destroy_class_request *req )
{
3704 3705 3706
    fprintf( stderr, " atom=%04x", req->atom );
    dump_uint64( ", instance=", &req->instance );
    dump_varargs_unicode_str( ", name=", cur_size );
3707 3708
}

3709 3710
static void dump_destroy_class_reply( const struct destroy_class_reply *req )
{
3711
    dump_uint64( " client_ptr=", &req->client_ptr );
3712 3713
}

3714 3715
static void dump_set_class_info_request( const struct set_class_info_request *req )
{
3716 3717 3718 3719 3720 3721 3722 3723 3724
    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 );
3725 3726 3727 3728
}

static void dump_set_class_info_reply( const struct set_class_info_reply *req )
{
3729 3730 3731 3732 3733 3734
    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 );
3735 3736
}

3737 3738 3739 3740 3741 3742 3743
static void dump_open_clipboard_request( const struct open_clipboard_request *req )
{
    fprintf( stderr, " window=%08x", req->window );
}

static void dump_open_clipboard_reply( const struct open_clipboard_reply *req )
{
3744
    fprintf( stderr, " owner=%08x", req->owner );
3745 3746 3747 3748 3749 3750 3751 3752 3753
}

static void dump_close_clipboard_request( const struct close_clipboard_request *req )
{
}

static void dump_close_clipboard_reply( const struct close_clipboard_reply *req )
{
    fprintf( stderr, " viewer=%08x", req->viewer );
3754
    fprintf( stderr, ", owner=%08x", req->owner );
3755 3756
}

3757 3758
static void dump_set_clipboard_info_request( const struct set_clipboard_info_request *req )
{
3759 3760
    fprintf( stderr, " flags=%08x", req->flags );
    fprintf( stderr, ", owner=%08x", req->owner );
3761 3762 3763 3764
}

static void dump_set_clipboard_info_reply( const struct set_clipboard_info_reply *req )
{
3765 3766 3767 3768 3769
    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 );
3770 3771
}

3772 3773 3774 3775
static void dump_empty_clipboard_request( const struct empty_clipboard_request *req )
{
}

3776 3777 3778
static void dump_set_clipboard_data_request( const struct set_clipboard_data_request *req )
{
    fprintf( stderr, " format=%08x", req->format );
3779
    fprintf( stderr, ", lcid=%08x", req->lcid );
3780 3781 3782
    dump_varargs_bytes( ", data=", cur_size );
}

3783 3784 3785 3786 3787
static void dump_set_clipboard_data_reply( const struct set_clipboard_data_reply *req )
{
    fprintf( stderr, " seqno=%08x", req->seqno );
}

3788 3789 3790
static void dump_get_clipboard_data_request( const struct get_clipboard_data_request *req )
{
    fprintf( stderr, " format=%08x", req->format );
3791 3792
    fprintf( stderr, ", cached=%d", req->cached );
    fprintf( stderr, ", seqno=%08x", req->seqno );
3793 3794 3795 3796
}

static void dump_get_clipboard_data_reply( const struct get_clipboard_data_reply *req )
{
3797 3798
    fprintf( stderr, " from=%08x", req->from );
    fprintf( stderr, ", owner=%08x", req->owner );
3799
    fprintf( stderr, ", seqno=%08x", req->seqno );
3800 3801 3802 3803
    fprintf( stderr, ", total=%u", req->total );
    dump_varargs_bytes( ", data=", cur_size );
}

3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824
static void dump_get_clipboard_formats_request( const struct get_clipboard_formats_request *req )
{
    fprintf( stderr, " format=%08x", req->format );
}

static void dump_get_clipboard_formats_reply( const struct get_clipboard_formats_reply *req )
{
    fprintf( stderr, " count=%08x", req->count );
    dump_varargs_uints( ", formats=", cur_size );
}

static void dump_enum_clipboard_formats_request( const struct enum_clipboard_formats_request *req )
{
    fprintf( stderr, " previous=%08x", req->previous );
}

static void dump_enum_clipboard_formats_reply( const struct enum_clipboard_formats_reply *req )
{
    fprintf( stderr, " format=%08x", req->format );
}

3825 3826 3827 3828 3829 3830 3831 3832
static void dump_release_clipboard_request( const struct release_clipboard_request *req )
{
    fprintf( stderr, " owner=%08x", req->owner );
}

static void dump_release_clipboard_reply( const struct release_clipboard_reply *req )
{
    fprintf( stderr, " viewer=%08x", req->viewer );
3833
    fprintf( stderr, ", owner=%08x", req->owner );
3834 3835
}

3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847
static void dump_get_clipboard_info_request( const struct get_clipboard_info_request *req )
{
}

static void dump_get_clipboard_info_reply( const struct get_clipboard_info_reply *req )
{
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", owner=%08x", req->owner );
    fprintf( stderr, ", viewer=%08x", req->viewer );
    fprintf( stderr, ", seqno=%08x", req->seqno );
}

3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859
static void dump_set_clipboard_viewer_request( const struct set_clipboard_viewer_request *req )
{
    fprintf( stderr, " viewer=%08x", req->viewer );
    fprintf( stderr, ", previous=%08x", req->previous );
}

static void dump_set_clipboard_viewer_reply( const struct set_clipboard_viewer_reply *req )
{
    fprintf( stderr, " old_viewer=%08x", req->old_viewer );
    fprintf( stderr, ", owner=%08x", req->owner );
}

3860 3861 3862 3863 3864 3865 3866 3867 3868 3869
static void dump_add_clipboard_listener_request( const struct add_clipboard_listener_request *req )
{
    fprintf( stderr, " window=%08x", req->window );
}

static void dump_remove_clipboard_listener_request( const struct remove_clipboard_listener_request *req )
{
    fprintf( stderr, " window=%08x", req->window );
}

3870 3871
static void dump_open_token_request( const struct open_token_request *req )
{
3872 3873 3874 3875
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", flags=%08x", req->flags );
3876 3877 3878 3879
}

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

3883 3884
static void dump_set_global_windows_request( const struct set_global_windows_request *req )
{
3885 3886 3887 3888 3889
    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 );
3890 3891 3892 3893
}

static void dump_set_global_windows_reply( const struct set_global_windows_reply *req )
{
3894 3895 3896 3897
    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 );
3898 3899
}

3900 3901
static void dump_adjust_token_privileges_request( const struct adjust_token_privileges_request *req )
{
3902 3903 3904 3905
    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 );
3906 3907 3908 3909
}

static void dump_adjust_token_privileges_reply( const struct adjust_token_privileges_reply *req )
{
3910 3911
    fprintf( stderr, " len=%08x", req->len );
    dump_varargs_LUID_AND_ATTRIBUTES( ", privileges=", cur_size );
3912 3913 3914 3915
}

static void dump_get_token_privileges_request( const struct get_token_privileges_request *req )
{
3916
    fprintf( stderr, " handle=%04x", req->handle );
3917 3918 3919 3920
}

static void dump_get_token_privileges_reply( const struct get_token_privileges_reply *req )
{
3921 3922
    fprintf( stderr, " len=%08x", req->len );
    dump_varargs_LUID_AND_ATTRIBUTES( ", privileges=", cur_size );
3923 3924
}

3925 3926
static void dump_check_token_privileges_request( const struct check_token_privileges_request *req )
{
3927 3928 3929
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", all_required=%d", req->all_required );
    dump_varargs_LUID_AND_ATTRIBUTES( ", privileges=", cur_size );
3930 3931 3932 3933
}

static void dump_check_token_privileges_reply( const struct check_token_privileges_reply *req )
{
3934 3935
    fprintf( stderr, " has_privileges=%d", req->has_privileges );
    dump_varargs_LUID_AND_ATTRIBUTES( ", privileges=", cur_size );
3936 3937
}

3938 3939
static void dump_duplicate_token_request( const struct duplicate_token_request *req )
{
3940 3941 3942 3943 3944
    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 );
3945 3946 3947 3948
}

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

3952 3953
static void dump_access_check_request( const struct access_check_request *req )
{
3954 3955 3956 3957 3958 3959 3960
    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 );
3961 3962 3963 3964
}

static void dump_access_check_reply( const struct access_check_reply *req )
{
3965 3966 3967 3968
    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 );
3969 3970
}

3971
static void dump_get_token_sid_request( const struct get_token_sid_request *req )
3972
{
3973
    fprintf( stderr, " handle=%04x", req->handle );
3974
    fprintf( stderr, ", which_sid=%08x", req->which_sid );
3975 3976
}

3977
static void dump_get_token_sid_reply( const struct get_token_sid_reply *req )
3978
{
3979 3980
    fprintf( stderr, " sid_len=%u", req->sid_len );
    dump_varargs_SID( ", sid=", cur_size );
3981 3982
}

3983 3984
static void dump_get_token_groups_request( const struct get_token_groups_request *req )
{
3985
    fprintf( stderr, " handle=%04x", req->handle );
3986 3987 3988 3989
}

static void dump_get_token_groups_reply( const struct get_token_groups_reply *req )
{
3990 3991
    fprintf( stderr, " user_len=%u", req->user_len );
    dump_varargs_token_groups( ", user=", cur_size );
3992 3993
}

3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010
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 );
}

4011 4012
static void dump_set_security_object_request( const struct set_security_object_request *req )
{
4013 4014 4015
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", security_info=%08x", req->security_info );
    dump_varargs_security_descriptor( ", sd=", cur_size );
4016 4017
}

4018 4019
static void dump_get_security_object_request( const struct get_security_object_request *req )
{
4020 4021
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", security_info=%08x", req->security_info );
4022 4023 4024 4025
}

static void dump_get_security_object_reply( const struct get_security_object_reply *req )
{
4026 4027
    fprintf( stderr, " sd_len=%08x", req->sd_len );
    dump_varargs_security_descriptor( ", sd=", cur_size );
4028 4029
}

4030 4031 4032 4033 4034 4035 4036 4037 4038 4039
static void dump_get_system_handles_request( const struct get_system_handles_request *req )
{
}

static void dump_get_system_handles_reply( const struct get_system_handles_reply *req )
{
    fprintf( stderr, " count=%08x", req->count );
    dump_varargs_handle_infos( ", data=", cur_size );
}

Mike McCormack's avatar
Mike McCormack committed
4040 4041
static void dump_create_mailslot_request( const struct create_mailslot_request *req )
{
4042 4043 4044
    fprintf( stderr, " access=%08x", req->access );
    dump_timeout( ", read_timeout=", &req->read_timeout );
    fprintf( stderr, ", max_msgsize=%08x", req->max_msgsize );
4045
    dump_varargs_object_attributes( ", objattr=", cur_size );
Mike McCormack's avatar
Mike McCormack committed
4046 4047 4048 4049
}

static void dump_create_mailslot_reply( const struct create_mailslot_reply *req )
{
4050
    fprintf( stderr, " handle=%04x", req->handle );
Mike McCormack's avatar
Mike McCormack committed
4051 4052 4053 4054
}

static void dump_set_mailslot_info_request( const struct set_mailslot_info_request *req )
{
4055 4056 4057
    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
4058 4059 4060 4061
}

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

4066 4067
static void dump_create_directory_request( const struct create_directory_request *req )
{
4068
    fprintf( stderr, " access=%08x", req->access );
4069
    dump_varargs_object_attributes( ", objattr=", cur_size );
4070 4071 4072 4073
}

static void dump_create_directory_reply( const struct create_directory_reply *req )
{
4074
    fprintf( stderr, " handle=%04x", req->handle );
4075 4076 4077 4078
}

static void dump_open_directory_request( const struct open_directory_request *req )
{
4079 4080 4081 4082
    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 );
4083 4084 4085 4086
}

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

4090 4091
static void dump_get_directory_entry_request( const struct get_directory_entry_request *req )
{
4092 4093
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", index=%08x", req->index );
4094 4095 4096 4097
}

static void dump_get_directory_entry_reply( const struct get_directory_entry_reply *req )
{
4098 4099 4100
    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 );
4101 4102
}

4103 4104
static void dump_create_symlink_request( const struct create_symlink_request *req )
{
4105
    fprintf( stderr, " access=%08x", req->access );
4106
    dump_varargs_object_attributes( ", objattr=", cur_size );
4107
    dump_varargs_unicode_str( ", target_name=", cur_size );
4108 4109 4110 4111
}

static void dump_create_symlink_reply( const struct create_symlink_reply *req )
{
4112
    fprintf( stderr, " handle=%04x", req->handle );
4113 4114 4115 4116
}

static void dump_open_symlink_request( const struct open_symlink_request *req )
{
4117 4118 4119 4120
    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 );
4121 4122 4123 4124
}

static void dump_open_symlink_reply( const struct open_symlink_reply *req )
{
4125
    fprintf( stderr, " handle=%04x", req->handle );
4126 4127 4128 4129
}

static void dump_query_symlink_request( const struct query_symlink_request *req )
{
4130
    fprintf( stderr, " handle=%04x", req->handle );
4131 4132 4133 4134
}

static void dump_query_symlink_reply( const struct query_symlink_reply *req )
{
4135 4136
    fprintf( stderr, " total=%u", req->total );
    dump_varargs_unicode_str( ", target_name=", cur_size );
4137 4138
}

4139 4140
static void dump_get_object_info_request( const struct get_object_info_request *req )
{
4141
    fprintf( stderr, " handle=%04x", req->handle );
4142 4143 4144 4145
}

static void dump_get_object_info_reply( const struct get_object_info_reply *req )
{
4146 4147
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", ref_count=%08x", req->ref_count );
4148
    fprintf( stderr, ", handle_count=%08x", req->handle_count );
4149 4150
    fprintf( stderr, ", total=%u", req->total );
    dump_varargs_unicode_str( ", name=", cur_size );
4151 4152
}

4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163
static void dump_get_object_type_request( const struct get_object_type_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
}

static void dump_get_object_type_reply( const struct get_object_type_reply *req )
{
    fprintf( stderr, " total=%u", req->total );
    dump_varargs_unicode_str( ", type=", cur_size );
}

4164 4165
static void dump_unlink_object_request( const struct unlink_object_request *req )
{
4166
    fprintf( stderr, " handle=%04x", req->handle );
4167 4168
}

4169 4170
static void dump_get_token_impersonation_level_request( const struct get_token_impersonation_level_request *req )
{
4171
    fprintf( stderr, " handle=%04x", req->handle );
4172 4173 4174 4175 4176 4177 4178
}

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

4179 4180 4181 4182 4183 4184
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 )
{
4185
    dump_luid( " luid=", &req->luid );
4186 4187
}

4188 4189
static void dump_create_device_manager_request( const struct create_device_manager_request *req )
{
4190 4191
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
4192 4193 4194 4195
}

static void dump_create_device_manager_reply( const struct create_device_manager_reply *req )
{
4196
    fprintf( stderr, " handle=%04x", req->handle );
4197 4198 4199 4200
}

static void dump_create_device_request( const struct create_device_request *req )
{
4201 4202 4203 4204 4205 4206
    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 );
4207 4208 4209 4210
}

static void dump_create_device_reply( const struct create_device_reply *req )
{
4211
    fprintf( stderr, " handle=%04x", req->handle );
4212 4213 4214 4215
}

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

4219 4220
static void dump_get_next_device_request_request( const struct get_next_device_request_request *req )
{
4221 4222 4223
    fprintf( stderr, " manager=%04x", req->manager );
    fprintf( stderr, ", prev=%04x", req->prev );
    fprintf( stderr, ", status=%08x", req->status );
4224 4225 4226 4227
}

static void dump_get_next_device_request_reply( const struct get_next_device_request_reply *req )
{
4228
    dump_irp_params( " params=", &req->params );
4229
    fprintf( stderr, ", next=%04x", req->next );
4230 4231
    fprintf( stderr, ", client_pid=%04x", req->client_pid );
    fprintf( stderr, ", client_tid=%04x", req->client_tid );
4232 4233 4234
    fprintf( stderr, ", in_size=%u", req->in_size );
    fprintf( stderr, ", out_size=%u", req->out_size );
    dump_varargs_bytes( ", next_data=", cur_size );
4235 4236
}

4237 4238 4239 4240 4241 4242
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 )
{
4243
    fprintf( stderr, " event=%04x", req->event );
4244 4245
}

4246 4247
static void dump_get_token_statistics_request( const struct get_token_statistics_request *req )
{
4248
    fprintf( stderr, " handle=%04x", req->handle );
4249 4250 4251 4252
}

static void dump_get_token_statistics_reply( const struct get_token_statistics_reply *req )
{
4253 4254 4255 4256 4257 4258
    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 );
4259 4260
}

4261 4262
static void dump_create_completion_request( const struct create_completion_request *req )
{
4263 4264
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", concurrent=%08x", req->concurrent );
4265
    dump_varargs_object_attributes( ", objattr=", cur_size );
4266 4267 4268 4269
}

static void dump_create_completion_reply( const struct create_completion_reply *req )
{
4270
    fprintf( stderr, " handle=%04x", req->handle );
4271 4272 4273 4274
}

static void dump_open_completion_request( const struct open_completion_request *req )
{
4275 4276 4277
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", rootdir=%04x", req->rootdir );
4278
    dump_varargs_unicode_str( ", filename=", cur_size );
4279 4280 4281 4282
}

static void dump_open_completion_reply( const struct open_completion_reply *req )
{
4283
    fprintf( stderr, " handle=%04x", req->handle );
4284 4285 4286 4287
}

static void dump_add_completion_request( const struct add_completion_request *req )
{
4288 4289 4290
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", ckey=", &req->ckey );
    dump_uint64( ", cvalue=", &req->cvalue );
4291
    dump_uint64( ", information=", &req->information );
4292
    fprintf( stderr, ", status=%08x", req->status );
4293 4294 4295 4296
}

static void dump_remove_completion_request( const struct remove_completion_request *req )
{
4297
    fprintf( stderr, " handle=%04x", req->handle );
4298 4299 4300 4301
}

static void dump_remove_completion_reply( const struct remove_completion_reply *req )
{
4302 4303
    dump_uint64( " ckey=", &req->ckey );
    dump_uint64( ", cvalue=", &req->cvalue );
4304
    dump_uint64( ", information=", &req->information );
4305
    fprintf( stderr, ", status=%08x", req->status );
4306 4307 4308 4309
}

static void dump_query_completion_request( const struct query_completion_request *req )
{
4310
    fprintf( stderr, " handle=%04x", req->handle );
4311 4312 4313 4314 4315 4316 4317
}

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

4318 4319
static void dump_set_completion_info_request( const struct set_completion_info_request *req )
{
4320 4321 4322
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", ckey=", &req->ckey );
    fprintf( stderr, ", chandle=%04x", req->chandle );
4323 4324
}

4325 4326
static void dump_add_fd_completion_request( const struct add_fd_completion_request *req )
{
4327 4328
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", cvalue=", &req->cvalue );
4329
    dump_uint64( ", information=", &req->information );
4330
    fprintf( stderr, ", status=%08x", req->status );
4331 4332
}

4333
static void dump_set_fd_disp_info_request( const struct set_fd_disp_info_request *req )
4334 4335 4336 4337 4338
{
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", unlink=%d", req->unlink );
}

4339 4340 4341 4342
static void dump_set_fd_name_info_request( const struct set_fd_name_info_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", rootdir=%04x", req->rootdir );
4343
    fprintf( stderr, ", link=%d", req->link );
4344 4345 4346
    dump_varargs_string( ", filename=", cur_size );
}

4347 4348
static void dump_get_window_layered_info_request( const struct get_window_layered_info_request *req )
{
4349
    fprintf( stderr, " handle=%08x", req->handle );
4350 4351 4352 4353
}

static void dump_get_window_layered_info_reply( const struct get_window_layered_info_reply *req )
{
4354 4355 4356
    fprintf( stderr, " color_key=%08x", req->color_key );
    fprintf( stderr, ", alpha=%08x", req->alpha );
    fprintf( stderr, ", flags=%08x", req->flags );
4357 4358 4359 4360
}

static void dump_set_window_layered_info_request( const struct set_window_layered_info_request *req )
{
4361 4362 4363 4364
    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 );
4365 4366
}

4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380
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 );
}

4381 4382 4383 4384 4385
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 );
4386 4387
    fprintf( stderr, ", x=%d", req->x );
    fprintf( stderr, ", y=%d", req->y );
4388
    dump_rectangle( ", clip=", &req->clip );
4389
    fprintf( stderr, ", clip_msg=%08x", req->clip_msg );
4390 4391 4392 4393 4394 4395
}

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 );
4396 4397
    fprintf( stderr, ", prev_x=%d", req->prev_x );
    fprintf( stderr, ", prev_y=%d", req->prev_y );
4398 4399
    fprintf( stderr, ", new_x=%d", req->new_x );
    fprintf( stderr, ", new_y=%d", req->new_y );
4400
    dump_rectangle( ", new_clip=", &req->new_clip );
4401
    fprintf( stderr, ", last_change=%08x", req->last_change );
4402 4403
}

4404 4405 4406 4407 4408
static void dump_update_rawinput_devices_request( const struct update_rawinput_devices_request *req )
{
    dump_varargs_rawinput_devices( " devices=", cur_size );
}

4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422
static void dump_get_suspend_context_request( const struct get_suspend_context_request *req )
{
}

static void dump_get_suspend_context_reply( const struct get_suspend_context_reply *req )
{
    dump_varargs_context( " context=", cur_size );
}

static void dump_set_suspend_context_request( const struct set_suspend_context_request *req )
{
    dump_varargs_context( " context=", cur_size );
}

4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433
static void dump_create_job_request( const struct create_job_request *req )
{
    fprintf( stderr, " access=%08x", req->access );
    dump_varargs_object_attributes( ", objattr=", cur_size );
}

static void dump_create_job_reply( const struct create_job_reply *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
}

4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446
static void dump_open_job_request( const struct open_job_request *req )
{
    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 );
}

static void dump_open_job_reply( const struct open_job_reply *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
}

4447 4448 4449 4450 4451 4452
static void dump_assign_job_request( const struct assign_job_request *req )
{
    fprintf( stderr, " job=%04x", req->job );
    fprintf( stderr, ", process=%04x", req->process );
}

4453 4454 4455 4456 4457 4458
static void dump_process_in_job_request( const struct process_in_job_request *req )
{
    fprintf( stderr, " job=%04x", req->job );
    fprintf( stderr, ", process=%04x", req->process );
}

4459 4460 4461 4462 4463 4464
static void dump_set_job_limits_request( const struct set_job_limits_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", limit_flags=%08x", req->limit_flags );
}

4465 4466 4467 4468 4469 4470 4471
static void dump_set_job_completion_port_request( const struct set_job_completion_port_request *req )
{
    fprintf( stderr, " job=%04x", req->job );
    fprintf( stderr, ", port=%04x", req->port );
    dump_uint64( ", key=", &req->key );
}

4472 4473 4474 4475 4476 4477
static void dump_terminate_job_request( const struct terminate_job_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", status=%d", req->status );
}

4478 4479
static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
    (dump_func)dump_new_process_request,
4480
    (dump_func)dump_get_new_process_info_request,
4481
    (dump_func)dump_new_thread_request,
4482
    (dump_func)dump_get_startup_info_request,
4483
    (dump_func)dump_init_process_done_request,
4484 4485 4486 4487 4488 4489
    (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,
4490
    (dump_func)dump_get_thread_times_request,
4491
    (dump_func)dump_set_thread_info_request,
4492
    (dump_func)dump_get_dll_info_request,
4493 4494
    (dump_func)dump_suspend_thread_request,
    (dump_func)dump_resume_thread_request,
4495 4496
    (dump_func)dump_load_dll_request,
    (dump_func)dump_unload_dll_request,
4497
    (dump_func)dump_queue_apc_request,
4498
    (dump_func)dump_get_apc_result_request,
4499 4500 4501 4502
    (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,
4503
    (dump_func)dump_open_thread_request,
4504 4505 4506
    (dump_func)dump_select_request,
    (dump_func)dump_create_event_request,
    (dump_func)dump_event_op_request,
4507
    (dump_func)dump_query_event_request,
4508
    (dump_func)dump_open_event_request,
4509 4510
    (dump_func)dump_create_keyed_event_request,
    (dump_func)dump_open_keyed_event_request,
4511 4512 4513
    (dump_func)dump_create_mutex_request,
    (dump_func)dump_release_mutex_request,
    (dump_func)dump_open_mutex_request,
4514
    (dump_func)dump_query_mutex_request,
4515 4516
    (dump_func)dump_create_semaphore_request,
    (dump_func)dump_release_semaphore_request,
4517
    (dump_func)dump_query_semaphore_request,
4518 4519
    (dump_func)dump_open_semaphore_request,
    (dump_func)dump_create_file_request,
4520
    (dump_func)dump_open_file_object_request,
4521
    (dump_func)dump_alloc_file_handle_request,
4522
    (dump_func)dump_get_handle_unix_name_request,
4523
    (dump_func)dump_get_handle_fd_request,
4524
    (dump_func)dump_get_directory_cache_entry_request,
4525
    (dump_func)dump_flush_request,
4526 4527
    (dump_func)dump_lock_file_request,
    (dump_func)dump_unlock_file_request,
4528 4529
    (dump_func)dump_create_socket_request,
    (dump_func)dump_accept_socket_request,
4530
    (dump_func)dump_accept_into_socket_request,
4531 4532
    (dump_func)dump_set_socket_event_request,
    (dump_func)dump_get_socket_event_request,
4533
    (dump_func)dump_get_socket_info_request,
4534
    (dump_func)dump_enable_socket_event_request,
4535
    (dump_func)dump_set_socket_deferred_request,
4536 4537
    (dump_func)dump_alloc_console_request,
    (dump_func)dump_free_console_request,
4538
    (dump_func)dump_get_console_renderer_events_request,
4539
    (dump_func)dump_open_console_request,
4540
    (dump_func)dump_get_console_wait_event_request,
4541 4542
    (dump_func)dump_get_console_mode_request,
    (dump_func)dump_set_console_mode_request,
4543 4544 4545 4546 4547 4548 4549
    (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,
4550 4551
    (dump_func)dump_write_console_input_request,
    (dump_func)dump_read_console_input_request,
4552
    (dump_func)dump_write_console_output_request,
4553
    (dump_func)dump_fill_console_output_request,
4554 4555
    (dump_func)dump_read_console_output_request,
    (dump_func)dump_move_console_output_request,
4556
    (dump_func)dump_send_console_signal_request,
4557
    (dump_func)dump_read_directory_changes_request,
4558
    (dump_func)dump_read_change_request,
4559 4560 4561
    (dump_func)dump_create_mapping_request,
    (dump_func)dump_open_mapping_request,
    (dump_func)dump_get_mapping_info_request,
4562 4563
    (dump_func)dump_get_mapping_committed_range_request,
    (dump_func)dump_add_mapping_committed_range_request,
4564 4565
    (dump_func)dump_create_snapshot_request,
    (dump_func)dump_next_process_request,
4566
    (dump_func)dump_next_thread_request,
4567
    (dump_func)dump_wait_debug_event_request,
4568 4569
    (dump_func)dump_queue_exception_event_request,
    (dump_func)dump_get_exception_status_request,
4570 4571
    (dump_func)dump_continue_debug_event_request,
    (dump_func)dump_debug_process_request,
4572
    (dump_func)dump_debug_break_request,
4573
    (dump_func)dump_set_debugger_kill_on_exit_request,
4574
    (dump_func)dump_read_process_memory_request,
4575
    (dump_func)dump_write_process_memory_request,
4576 4577 4578
    (dump_func)dump_create_key_request,
    (dump_func)dump_open_key_request,
    (dump_func)dump_delete_key_request,
4579
    (dump_func)dump_flush_key_request,
4580 4581 4582 4583 4584 4585
    (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,
4586
    (dump_func)dump_unload_registry_request,
4587
    (dump_func)dump_save_registry_request,
4588
    (dump_func)dump_set_registry_notification_request,
4589 4590 4591 4592
    (dump_func)dump_create_timer_request,
    (dump_func)dump_open_timer_request,
    (dump_func)dump_set_timer_request,
    (dump_func)dump_cancel_timer_request,
4593
    (dump_func)dump_get_timer_info_request,
4594 4595
    (dump_func)dump_get_thread_context_request,
    (dump_func)dump_set_thread_context_request,
4596
    (dump_func)dump_get_selector_entry_request,
4597 4598 4599
    (dump_func)dump_add_atom_request,
    (dump_func)dump_delete_atom_request,
    (dump_func)dump_find_atom_request,
4600 4601 4602
    (dump_func)dump_get_atom_information_request,
    (dump_func)dump_set_atom_information_request,
    (dump_func)dump_empty_atom_table_request,
4603
    (dump_func)dump_init_atom_table_request,
4604
    (dump_func)dump_get_msg_queue_request,
4605
    (dump_func)dump_set_queue_fd_request,
4606 4607
    (dump_func)dump_set_queue_mask_request,
    (dump_func)dump_get_queue_status_request,
4608
    (dump_func)dump_get_process_idle_event_request,
4609
    (dump_func)dump_send_message_request,
4610
    (dump_func)dump_post_quit_message_request,
4611
    (dump_func)dump_send_hardware_message_request,
4612 4613
    (dump_func)dump_get_message_request,
    (dump_func)dump_reply_message_request,
4614
    (dump_func)dump_accept_hardware_message_request,
4615 4616 4617
    (dump_func)dump_get_message_reply_request,
    (dump_func)dump_set_win_timer_request,
    (dump_func)dump_kill_win_timer_request,
4618
    (dump_func)dump_is_window_hung_request,
4619 4620
    (dump_func)dump_get_serial_info_request,
    (dump_func)dump_set_serial_info_request,
4621
    (dump_func)dump_register_async_request,
4622
    (dump_func)dump_cancel_async_request,
4623 4624
    (dump_func)dump_read_request,
    (dump_func)dump_write_request,
4625
    (dump_func)dump_ioctl_request,
4626 4627
    (dump_func)dump_set_irp_result_request,
    (dump_func)dump_get_irp_result_request,
4628
    (dump_func)dump_create_named_pipe_request,
4629
    (dump_func)dump_get_named_pipe_info_request,
4630
    (dump_func)dump_set_named_pipe_info_request,
4631 4632
    (dump_func)dump_create_window_request,
    (dump_func)dump_destroy_window_request,
4633
    (dump_func)dump_get_desktop_window_request,
4634
    (dump_func)dump_set_window_owner_request,
4635
    (dump_func)dump_get_window_info_request,
4636
    (dump_func)dump_set_window_info_request,
4637
    (dump_func)dump_set_parent_request,
4638 4639
    (dump_func)dump_get_window_parents_request,
    (dump_func)dump_get_window_children_request,
4640
    (dump_func)dump_get_window_children_from_point_request,
4641
    (dump_func)dump_get_window_tree_request,
4642
    (dump_func)dump_set_window_pos_request,
4643
    (dump_func)dump_get_window_rectangles_request,
4644 4645
    (dump_func)dump_get_window_text_request,
    (dump_func)dump_set_window_text_request,
4646
    (dump_func)dump_get_windows_offset_request,
4647
    (dump_func)dump_get_visible_region_request,
4648
    (dump_func)dump_get_surface_region_request,
4649 4650
    (dump_func)dump_get_window_region_request,
    (dump_func)dump_set_window_region_request,
4651
    (dump_func)dump_get_update_region_request,
4652
    (dump_func)dump_update_window_zorder_request,
4653
    (dump_func)dump_redraw_window_request,
4654 4655 4656 4657
    (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,
4658 4659 4660 4661 4662
    (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,
4663
    (dump_func)dump_enum_winstation_request,
4664 4665
    (dump_func)dump_create_desktop_request,
    (dump_func)dump_open_desktop_request,
4666
    (dump_func)dump_open_input_desktop_request,
4667 4668 4669
    (dump_func)dump_close_desktop_request,
    (dump_func)dump_get_thread_desktop_request,
    (dump_func)dump_set_thread_desktop_request,
4670
    (dump_func)dump_enum_desktop_request,
4671
    (dump_func)dump_set_user_object_info_request,
4672 4673
    (dump_func)dump_register_hotkey_request,
    (dump_func)dump_unregister_hotkey_request,
4674 4675
    (dump_func)dump_attach_thread_input_request,
    (dump_func)dump_get_thread_input_request,
4676
    (dump_func)dump_get_last_input_time_request,
4677 4678
    (dump_func)dump_get_key_state_request,
    (dump_func)dump_set_key_state_request,
4679 4680 4681
    (dump_func)dump_set_foreground_window_request,
    (dump_func)dump_set_focus_window_request,
    (dump_func)dump_set_active_window_request,
4682
    (dump_func)dump_set_capture_window_request,
4683 4684
    (dump_func)dump_set_caret_window_request,
    (dump_func)dump_set_caret_info_request,
4685 4686 4687 4688
    (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,
4689
    (dump_func)dump_get_hook_info_request,
4690 4691 4692
    (dump_func)dump_create_class_request,
    (dump_func)dump_destroy_class_request,
    (dump_func)dump_set_class_info_request,
4693 4694
    (dump_func)dump_open_clipboard_request,
    (dump_func)dump_close_clipboard_request,
4695
    (dump_func)dump_set_clipboard_info_request,
4696
    (dump_func)dump_empty_clipboard_request,
4697
    (dump_func)dump_set_clipboard_data_request,
4698
    (dump_func)dump_get_clipboard_data_request,
4699 4700
    (dump_func)dump_get_clipboard_formats_request,
    (dump_func)dump_enum_clipboard_formats_request,
4701
    (dump_func)dump_release_clipboard_request,
4702
    (dump_func)dump_get_clipboard_info_request,
4703
    (dump_func)dump_set_clipboard_viewer_request,
4704 4705
    (dump_func)dump_add_clipboard_listener_request,
    (dump_func)dump_remove_clipboard_listener_request,
4706
    (dump_func)dump_open_token_request,
4707
    (dump_func)dump_set_global_windows_request,
4708 4709
    (dump_func)dump_adjust_token_privileges_request,
    (dump_func)dump_get_token_privileges_request,
4710
    (dump_func)dump_check_token_privileges_request,
4711
    (dump_func)dump_duplicate_token_request,
4712
    (dump_func)dump_access_check_request,
4713
    (dump_func)dump_get_token_sid_request,
4714
    (dump_func)dump_get_token_groups_request,
4715 4716
    (dump_func)dump_get_token_default_dacl_request,
    (dump_func)dump_set_token_default_dacl_request,
4717
    (dump_func)dump_set_security_object_request,
4718
    (dump_func)dump_get_security_object_request,
4719
    (dump_func)dump_get_system_handles_request,
Mike McCormack's avatar
Mike McCormack committed
4720 4721
    (dump_func)dump_create_mailslot_request,
    (dump_func)dump_set_mailslot_info_request,
4722 4723
    (dump_func)dump_create_directory_request,
    (dump_func)dump_open_directory_request,
4724
    (dump_func)dump_get_directory_entry_request,
4725 4726 4727
    (dump_func)dump_create_symlink_request,
    (dump_func)dump_open_symlink_request,
    (dump_func)dump_query_symlink_request,
4728
    (dump_func)dump_get_object_info_request,
4729
    (dump_func)dump_get_object_type_request,
4730
    (dump_func)dump_unlink_object_request,
4731
    (dump_func)dump_get_token_impersonation_level_request,
4732
    (dump_func)dump_allocate_locally_unique_id_request,
4733 4734 4735
    (dump_func)dump_create_device_manager_request,
    (dump_func)dump_create_device_request,
    (dump_func)dump_delete_device_request,
4736
    (dump_func)dump_get_next_device_request_request,
4737
    (dump_func)dump_make_process_system_request,
4738
    (dump_func)dump_get_token_statistics_request,
4739 4740 4741 4742 4743
    (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,
4744
    (dump_func)dump_set_completion_info_request,
4745
    (dump_func)dump_add_fd_completion_request,
4746 4747
    (dump_func)dump_set_fd_disp_info_request,
    (dump_func)dump_set_fd_name_info_request,
4748 4749
    (dump_func)dump_get_window_layered_info_request,
    (dump_func)dump_set_window_layered_info_request,
4750 4751
    (dump_func)dump_alloc_user_handle_request,
    (dump_func)dump_free_user_handle_request,
4752
    (dump_func)dump_set_cursor_request,
4753
    (dump_func)dump_update_rawinput_devices_request,
4754 4755
    (dump_func)dump_get_suspend_context_request,
    (dump_func)dump_set_suspend_context_request,
4756
    (dump_func)dump_create_job_request,
4757
    (dump_func)dump_open_job_request,
4758
    (dump_func)dump_assign_job_request,
4759
    (dump_func)dump_process_in_job_request,
4760
    (dump_func)dump_set_job_limits_request,
4761
    (dump_func)dump_set_job_completion_port_request,
4762
    (dump_func)dump_terminate_job_request,
Alexandre Julliard's avatar
Alexandre Julliard committed
4763 4764
};

4765
static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
4766 4767
    (dump_func)dump_new_process_reply,
    (dump_func)dump_get_new_process_info_reply,
4768
    (dump_func)dump_new_thread_reply,
4769
    (dump_func)dump_get_startup_info_reply,
4770
    NULL,
4771
    (dump_func)dump_init_thread_reply,
4772 4773
    (dump_func)dump_terminate_process_reply,
    (dump_func)dump_terminate_thread_reply,
4774
    (dump_func)dump_get_process_info_reply,
4775
    NULL,
4776
    (dump_func)dump_get_thread_info_reply,
4777
    (dump_func)dump_get_thread_times_reply,
4778
    NULL,
4779
    (dump_func)dump_get_dll_info_reply,
4780 4781
    (dump_func)dump_suspend_thread_reply,
    (dump_func)dump_resume_thread_reply,
4782 4783
    NULL,
    NULL,
4784
    (dump_func)dump_queue_apc_reply,
4785
    (dump_func)dump_get_apc_result_reply,
4786
    NULL,
4787
    (dump_func)dump_set_handle_info_reply,
4788 4789
    (dump_func)dump_dup_handle_reply,
    (dump_func)dump_open_process_reply,
4790
    (dump_func)dump_open_thread_reply,
4791
    (dump_func)dump_select_reply,
4792
    (dump_func)dump_create_event_reply,
4793
    NULL,
4794
    (dump_func)dump_query_event_reply,
4795
    (dump_func)dump_open_event_reply,
4796 4797
    (dump_func)dump_create_keyed_event_reply,
    (dump_func)dump_open_keyed_event_reply,
4798
    (dump_func)dump_create_mutex_reply,
4799
    (dump_func)dump_release_mutex_reply,
4800
    (dump_func)dump_open_mutex_reply,
4801
    (dump_func)dump_query_mutex_reply,
4802 4803
    (dump_func)dump_create_semaphore_reply,
    (dump_func)dump_release_semaphore_reply,
4804
    (dump_func)dump_query_semaphore_reply,
4805 4806
    (dump_func)dump_open_semaphore_reply,
    (dump_func)dump_create_file_reply,
4807
    (dump_func)dump_open_file_object_reply,
4808
    (dump_func)dump_alloc_file_handle_reply,
4809
    (dump_func)dump_get_handle_unix_name_reply,
4810
    (dump_func)dump_get_handle_fd_reply,
4811
    (dump_func)dump_get_directory_cache_entry_reply,
4812
    (dump_func)dump_flush_reply,
4813
    (dump_func)dump_lock_file_reply,
4814
    NULL,
4815 4816
    (dump_func)dump_create_socket_reply,
    (dump_func)dump_accept_socket_reply,
4817
    NULL,
4818
    NULL,
4819
    (dump_func)dump_get_socket_event_reply,
4820
    (dump_func)dump_get_socket_info_reply,
4821 4822
    NULL,
    NULL,
4823
    (dump_func)dump_alloc_console_reply,
4824
    NULL,
4825
    (dump_func)dump_get_console_renderer_events_reply,
4826
    (dump_func)dump_open_console_reply,
4827
    (dump_func)dump_get_console_wait_event_reply,
4828
    (dump_func)dump_get_console_mode_reply,
4829 4830
    NULL,
    NULL,
4831
    (dump_func)dump_get_console_input_info_reply,
4832
    NULL,
4833 4834
    (dump_func)dump_get_console_input_history_reply,
    (dump_func)dump_create_console_output_reply,
4835
    NULL,
4836
    (dump_func)dump_get_console_output_info_reply,
4837 4838
    (dump_func)dump_write_console_input_reply,
    (dump_func)dump_read_console_input_reply,
4839
    (dump_func)dump_write_console_output_reply,
4840
    (dump_func)dump_fill_console_output_reply,
4841
    (dump_func)dump_read_console_output_reply,
4842 4843 4844
    NULL,
    NULL,
    NULL,
4845
    (dump_func)dump_read_change_reply,
4846 4847 4848
    (dump_func)dump_create_mapping_reply,
    (dump_func)dump_open_mapping_reply,
    (dump_func)dump_get_mapping_info_reply,
4849 4850
    (dump_func)dump_get_mapping_committed_range_reply,
    NULL,
4851 4852
    (dump_func)dump_create_snapshot_reply,
    (dump_func)dump_next_process_reply,
4853
    (dump_func)dump_next_thread_reply,
4854
    (dump_func)dump_wait_debug_event_reply,
4855 4856
    (dump_func)dump_queue_exception_event_reply,
    (dump_func)dump_get_exception_status_reply,
4857 4858
    NULL,
    NULL,
4859
    (dump_func)dump_debug_break_reply,
4860
    NULL,
4861
    (dump_func)dump_read_process_memory_reply,
4862
    NULL,
4863 4864
    (dump_func)dump_create_key_reply,
    (dump_func)dump_open_key_reply,
4865 4866
    NULL,
    NULL,
4867
    (dump_func)dump_enum_key_reply,
4868
    NULL,
4869 4870
    (dump_func)dump_get_key_value_reply,
    (dump_func)dump_enum_key_value_reply,
4871 4872 4873 4874 4875
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
4876 4877
    (dump_func)dump_create_timer_reply,
    (dump_func)dump_open_timer_reply,
4878 4879
    (dump_func)dump_set_timer_reply,
    (dump_func)dump_cancel_timer_reply,
4880
    (dump_func)dump_get_timer_info_reply,
4881
    (dump_func)dump_get_thread_context_reply,
4882
    (dump_func)dump_set_thread_context_reply,
4883
    (dump_func)dump_get_selector_entry_reply,
4884
    (dump_func)dump_add_atom_reply,
4885
    NULL,
4886
    (dump_func)dump_find_atom_reply,
4887
    (dump_func)dump_get_atom_information_reply,
4888 4889
    NULL,
    NULL,
4890
    (dump_func)dump_init_atom_table_reply,
4891
    (dump_func)dump_get_msg_queue_reply,
4892
    NULL,
4893 4894
    (dump_func)dump_set_queue_mask_reply,
    (dump_func)dump_get_queue_status_reply,
4895
    (dump_func)dump_get_process_idle_event_reply,
4896 4897
    NULL,
    NULL,
4898
    (dump_func)dump_send_hardware_message_reply,
4899
    (dump_func)dump_get_message_reply,
4900 4901
    NULL,
    NULL,
4902
    (dump_func)dump_get_message_reply_reply,
4903
    (dump_func)dump_set_win_timer_reply,
4904
    NULL,
4905
    (dump_func)dump_is_window_hung_reply,
4906
    (dump_func)dump_get_serial_info_reply,
4907 4908 4909
    NULL,
    NULL,
    NULL,
4910 4911
    (dump_func)dump_read_reply,
    (dump_func)dump_write_reply,
4912
    (dump_func)dump_ioctl_reply,
4913
    NULL,
4914
    (dump_func)dump_get_irp_result_reply,
4915
    (dump_func)dump_create_named_pipe_reply,
4916
    (dump_func)dump_get_named_pipe_info_reply,
4917
    NULL,
4918
    (dump_func)dump_create_window_reply,
4919
    NULL,
4920
    (dump_func)dump_get_desktop_window_reply,
4921
    (dump_func)dump_set_window_owner_reply,
4922
    (dump_func)dump_get_window_info_reply,
4923
    (dump_func)dump_set_window_info_reply,
4924
    (dump_func)dump_set_parent_reply,
4925 4926
    (dump_func)dump_get_window_parents_reply,
    (dump_func)dump_get_window_children_reply,
4927
    (dump_func)dump_get_window_children_from_point_reply,
4928
    (dump_func)dump_get_window_tree_reply,
4929
    (dump_func)dump_set_window_pos_reply,
4930
    (dump_func)dump_get_window_rectangles_reply,
4931
    (dump_func)dump_get_window_text_reply,
4932
    NULL,
4933
    (dump_func)dump_get_windows_offset_reply,
4934
    (dump_func)dump_get_visible_region_reply,
4935
    (dump_func)dump_get_surface_region_reply,
4936
    (dump_func)dump_get_window_region_reply,
4937
    NULL,
4938
    (dump_func)dump_get_update_region_reply,
4939 4940 4941
    NULL,
    NULL,
    NULL,
4942 4943 4944
    (dump_func)dump_remove_window_property_reply,
    (dump_func)dump_get_window_property_reply,
    (dump_func)dump_get_window_properties_reply,
4945 4946
    (dump_func)dump_create_winstation_reply,
    (dump_func)dump_open_winstation_reply,
4947
    NULL,
4948
    (dump_func)dump_get_process_winstation_reply,
4949
    NULL,
4950
    (dump_func)dump_enum_winstation_reply,
4951 4952
    (dump_func)dump_create_desktop_reply,
    (dump_func)dump_open_desktop_reply,
4953
    (dump_func)dump_open_input_desktop_reply,
4954
    NULL,
4955
    (dump_func)dump_get_thread_desktop_reply,
4956
    NULL,
4957
    (dump_func)dump_enum_desktop_reply,
4958
    (dump_func)dump_set_user_object_info_reply,
4959 4960
    (dump_func)dump_register_hotkey_reply,
    (dump_func)dump_unregister_hotkey_reply,
4961
    NULL,
4962
    (dump_func)dump_get_thread_input_reply,
4963
    (dump_func)dump_get_last_input_time_reply,
4964
    (dump_func)dump_get_key_state_reply,
4965
    NULL,
4966 4967 4968
    (dump_func)dump_set_foreground_window_reply,
    (dump_func)dump_set_focus_window_reply,
    (dump_func)dump_set_active_window_reply,
4969
    (dump_func)dump_set_capture_window_reply,
4970 4971
    (dump_func)dump_set_caret_window_reply,
    (dump_func)dump_set_caret_info_reply,
4972
    (dump_func)dump_set_hook_reply,
4973
    (dump_func)dump_remove_hook_reply,
4974
    (dump_func)dump_start_hook_chain_reply,
4975
    NULL,
4976
    (dump_func)dump_get_hook_info_reply,
4977
    (dump_func)dump_create_class_reply,
4978
    (dump_func)dump_destroy_class_reply,
4979
    (dump_func)dump_set_class_info_reply,
4980 4981
    (dump_func)dump_open_clipboard_reply,
    (dump_func)dump_close_clipboard_reply,
4982
    (dump_func)dump_set_clipboard_info_reply,
4983
    NULL,
4984
    (dump_func)dump_set_clipboard_data_reply,
4985
    (dump_func)dump_get_clipboard_data_reply,
4986 4987
    (dump_func)dump_get_clipboard_formats_reply,
    (dump_func)dump_enum_clipboard_formats_reply,
4988
    (dump_func)dump_release_clipboard_reply,
4989
    (dump_func)dump_get_clipboard_info_reply,
4990
    (dump_func)dump_set_clipboard_viewer_reply,
4991 4992
    NULL,
    NULL,
4993
    (dump_func)dump_open_token_reply,
4994
    (dump_func)dump_set_global_windows_reply,
4995 4996
    (dump_func)dump_adjust_token_privileges_reply,
    (dump_func)dump_get_token_privileges_reply,
4997
    (dump_func)dump_check_token_privileges_reply,
4998
    (dump_func)dump_duplicate_token_reply,
4999
    (dump_func)dump_access_check_reply,
5000
    (dump_func)dump_get_token_sid_reply,
5001
    (dump_func)dump_get_token_groups_reply,
5002 5003
    (dump_func)dump_get_token_default_dacl_reply,
    NULL,
5004
    NULL,
5005
    (dump_func)dump_get_security_object_reply,
5006
    (dump_func)dump_get_system_handles_reply,
Mike McCormack's avatar
Mike McCormack committed
5007 5008
    (dump_func)dump_create_mailslot_reply,
    (dump_func)dump_set_mailslot_info_reply,
5009 5010
    (dump_func)dump_create_directory_reply,
    (dump_func)dump_open_directory_reply,
5011
    (dump_func)dump_get_directory_entry_reply,
5012 5013 5014
    (dump_func)dump_create_symlink_reply,
    (dump_func)dump_open_symlink_reply,
    (dump_func)dump_query_symlink_reply,
5015
    (dump_func)dump_get_object_info_reply,
5016
    (dump_func)dump_get_object_type_reply,
5017
    NULL,
5018
    (dump_func)dump_get_token_impersonation_level_reply,
5019
    (dump_func)dump_allocate_locally_unique_id_reply,
5020 5021
    (dump_func)dump_create_device_manager_reply,
    (dump_func)dump_create_device_reply,
5022
    NULL,
5023
    (dump_func)dump_get_next_device_request_reply,
5024
    (dump_func)dump_make_process_system_reply,
5025
    (dump_func)dump_get_token_statistics_reply,
5026 5027
    (dump_func)dump_create_completion_reply,
    (dump_func)dump_open_completion_reply,
5028
    NULL,
5029 5030
    (dump_func)dump_remove_completion_reply,
    (dump_func)dump_query_completion_reply,
5031 5032
    NULL,
    NULL,
5033
    NULL,
5034
    NULL,
5035
    (dump_func)dump_get_window_layered_info_reply,
5036
    NULL,
5037 5038
    (dump_func)dump_alloc_user_handle_reply,
    NULL,
5039
    (dump_func)dump_set_cursor_reply,
5040
    NULL,
5041 5042
    (dump_func)dump_get_suspend_context_reply,
    NULL,
5043
    (dump_func)dump_create_job_reply,
5044
    (dump_func)dump_open_job_reply,
5045
    NULL,
5046
    NULL,
5047
    NULL,
5048
    NULL,
5049
    NULL,
Alexandre Julliard's avatar
Alexandre Julliard committed
5050 5051
};

5052
static const char * const req_names[REQ_NB_REQUESTS] = {
5053
    "new_process",
5054
    "get_new_process_info",
Alexandre Julliard's avatar
Alexandre Julliard committed
5055
    "new_thread",
5056
    "get_startup_info",
5057
    "init_process_done",
Alexandre Julliard's avatar
Alexandre Julliard committed
5058 5059 5060 5061
    "init_thread",
    "terminate_process",
    "terminate_thread",
    "get_process_info",
5062
    "set_process_info",
Alexandre Julliard's avatar
Alexandre Julliard committed
5063
    "get_thread_info",
5064
    "get_thread_times",
5065
    "set_thread_info",
5066
    "get_dll_info",
5067 5068
    "suspend_thread",
    "resume_thread",
5069 5070
    "load_dll",
    "unload_dll",
5071
    "queue_apc",
5072
    "get_apc_result",
Alexandre Julliard's avatar
Alexandre Julliard committed
5073
    "close_handle",
5074
    "set_handle_info",
Alexandre Julliard's avatar
Alexandre Julliard committed
5075 5076
    "dup_handle",
    "open_process",
5077
    "open_thread",
Alexandre Julliard's avatar
Alexandre Julliard committed
5078
    "select",
Alexandre Julliard's avatar
Alexandre Julliard committed
5079 5080
    "create_event",
    "event_op",
5081
    "query_event",
5082
    "open_event",
5083 5084
    "create_keyed_event",
    "open_keyed_event",
Alexandre Julliard's avatar
Alexandre Julliard committed
5085 5086
    "create_mutex",
    "release_mutex",
5087
    "open_mutex",
5088
    "query_mutex",
Alexandre Julliard's avatar
Alexandre Julliard committed
5089 5090
    "create_semaphore",
    "release_semaphore",
5091
    "query_semaphore",
5092
    "open_semaphore",
5093
    "create_file",
5094
    "open_file_object",
5095
    "alloc_file_handle",
5096
    "get_handle_unix_name",
5097
    "get_handle_fd",
5098
    "get_directory_cache_entry",
5099
    "flush",
5100 5101
    "lock_file",
    "unlock_file",
5102 5103
    "create_socket",
    "accept_socket",
5104
    "accept_into_socket",
5105 5106
    "set_socket_event",
    "get_socket_event",
5107
    "get_socket_info",
5108
    "enable_socket_event",
5109
    "set_socket_deferred",
5110 5111
    "alloc_console",
    "free_console",
5112
    "get_console_renderer_events",
5113
    "open_console",
5114
    "get_console_wait_event",
5115 5116
    "get_console_mode",
    "set_console_mode",
5117 5118 5119 5120 5121 5122 5123
    "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",
5124 5125
    "write_console_input",
    "read_console_input",
5126
    "write_console_output",
5127
    "fill_console_output",
5128 5129
    "read_console_output",
    "move_console_output",
5130
    "send_console_signal",
5131
    "read_directory_changes",
5132
    "read_change",
5133
    "create_mapping",
5134
    "open_mapping",
5135
    "get_mapping_info",
5136 5137
    "get_mapping_committed_range",
    "add_mapping_committed_range",
5138 5139
    "create_snapshot",
    "next_process",
5140
    "next_thread",
5141
    "wait_debug_event",
5142 5143
    "queue_exception_event",
    "get_exception_status",
5144 5145
    "continue_debug_event",
    "debug_process",
5146
    "debug_break",
5147
    "set_debugger_kill_on_exit",
5148
    "read_process_memory",
5149
    "write_process_memory",
5150 5151 5152
    "create_key",
    "open_key",
    "delete_key",
5153
    "flush_key",
5154 5155 5156 5157 5158 5159
    "enum_key",
    "set_key_value",
    "get_key_value",
    "enum_key_value",
    "delete_key_value",
    "load_registry",
5160
    "unload_registry",
5161
    "save_registry",
5162
    "set_registry_notification",
5163 5164 5165 5166
    "create_timer",
    "open_timer",
    "set_timer",
    "cancel_timer",
5167
    "get_timer_info",
5168 5169
    "get_thread_context",
    "set_thread_context",
5170
    "get_selector_entry",
5171 5172 5173
    "add_atom",
    "delete_atom",
    "find_atom",
5174 5175 5176
    "get_atom_information",
    "set_atom_information",
    "empty_atom_table",
5177
    "init_atom_table",
5178
    "get_msg_queue",
5179
    "set_queue_fd",
5180 5181
    "set_queue_mask",
    "get_queue_status",
5182
    "get_process_idle_event",
5183
    "send_message",
5184
    "post_quit_message",
5185
    "send_hardware_message",
5186 5187
    "get_message",
    "reply_message",
5188
    "accept_hardware_message",
5189 5190 5191
    "get_message_reply",
    "set_win_timer",
    "kill_win_timer",
5192
    "is_window_hung",
5193 5194
    "get_serial_info",
    "set_serial_info",
5195
    "register_async",
5196
    "cancel_async",
5197 5198
    "read",
    "write",
5199
    "ioctl",
5200 5201
    "set_irp_result",
    "get_irp_result",
5202
    "create_named_pipe",
5203
    "get_named_pipe_info",
5204
    "set_named_pipe_info",
5205 5206
    "create_window",
    "destroy_window",
5207
    "get_desktop_window",
5208
    "set_window_owner",
5209
    "get_window_info",
5210
    "set_window_info",
5211
    "set_parent",
5212 5213
    "get_window_parents",
    "get_window_children",
5214
    "get_window_children_from_point",
5215
    "get_window_tree",
5216
    "set_window_pos",
5217
    "get_window_rectangles",
5218 5219
    "get_window_text",
    "set_window_text",
5220
    "get_windows_offset",
5221
    "get_visible_region",
5222
    "get_surface_region",
5223 5224
    "get_window_region",
    "set_window_region",
5225
    "get_update_region",
5226
    "update_window_zorder",
5227
    "redraw_window",
5228 5229 5230 5231
    "set_window_property",
    "remove_window_property",
    "get_window_property",
    "get_window_properties",
5232 5233 5234 5235 5236
    "create_winstation",
    "open_winstation",
    "close_winstation",
    "get_process_winstation",
    "set_process_winstation",
5237
    "enum_winstation",
5238 5239
    "create_desktop",
    "open_desktop",
5240
    "open_input_desktop",
5241 5242 5243
    "close_desktop",
    "get_thread_desktop",
    "set_thread_desktop",
5244
    "enum_desktop",
5245
    "set_user_object_info",
5246 5247
    "register_hotkey",
    "unregister_hotkey",
5248 5249
    "attach_thread_input",
    "get_thread_input",
5250
    "get_last_input_time",
5251 5252
    "get_key_state",
    "set_key_state",
5253 5254 5255
    "set_foreground_window",
    "set_focus_window",
    "set_active_window",
5256
    "set_capture_window",
5257 5258
    "set_caret_window",
    "set_caret_info",
5259 5260 5261 5262
    "set_hook",
    "remove_hook",
    "start_hook_chain",
    "finish_hook_chain",
5263
    "get_hook_info",
5264 5265 5266
    "create_class",
    "destroy_class",
    "set_class_info",
5267 5268
    "open_clipboard",
    "close_clipboard",
5269
    "set_clipboard_info",
5270
    "empty_clipboard",
5271
    "set_clipboard_data",
5272
    "get_clipboard_data",
5273 5274
    "get_clipboard_formats",
    "enum_clipboard_formats",
5275
    "release_clipboard",
5276
    "get_clipboard_info",
5277
    "set_clipboard_viewer",
5278 5279
    "add_clipboard_listener",
    "remove_clipboard_listener",
5280
    "open_token",
5281
    "set_global_windows",
5282 5283
    "adjust_token_privileges",
    "get_token_privileges",
5284
    "check_token_privileges",
5285
    "duplicate_token",
5286
    "access_check",
5287
    "get_token_sid",
5288
    "get_token_groups",
5289 5290
    "get_token_default_dacl",
    "set_token_default_dacl",
5291
    "set_security_object",
5292
    "get_security_object",
5293
    "get_system_handles",
Mike McCormack's avatar
Mike McCormack committed
5294 5295
    "create_mailslot",
    "set_mailslot_info",
5296 5297
    "create_directory",
    "open_directory",
5298
    "get_directory_entry",
5299 5300 5301
    "create_symlink",
    "open_symlink",
    "query_symlink",
5302
    "get_object_info",
5303
    "get_object_type",
5304
    "unlink_object",
5305
    "get_token_impersonation_level",
5306
    "allocate_locally_unique_id",
5307 5308 5309
    "create_device_manager",
    "create_device",
    "delete_device",
5310
    "get_next_device_request",
5311
    "make_process_system",
5312
    "get_token_statistics",
5313 5314 5315 5316 5317
    "create_completion",
    "open_completion",
    "add_completion",
    "remove_completion",
    "query_completion",
5318
    "set_completion_info",
5319
    "add_fd_completion",
5320 5321
    "set_fd_disp_info",
    "set_fd_name_info",
5322 5323
    "get_window_layered_info",
    "set_window_layered_info",
5324 5325
    "alloc_user_handle",
    "free_user_handle",
5326
    "set_cursor",
5327
    "update_rawinput_devices",
5328 5329
    "get_suspend_context",
    "set_suspend_context",
5330
    "create_job",
5331
    "open_job",
5332
    "assign_job",
5333
    "process_in_job",
5334
    "set_job_limits",
5335
    "set_job_completion_port",
5336
    "terminate_job",
Alexandre Julliard's avatar
Alexandre Julliard committed
5337 5338
};

5339 5340 5341 5342 5343 5344
static const struct
{
    const char  *name;
    unsigned int value;
} status_names[] =
{
5345
    { "ABANDONED_WAIT_0",            STATUS_ABANDONED_WAIT_0 },
5346 5347
    { "ACCESS_DENIED",               STATUS_ACCESS_DENIED },
    { "ACCESS_VIOLATION",            STATUS_ACCESS_VIOLATION },
5348
    { "ADDRESS_ALREADY_ASSOCIATED",  STATUS_ADDRESS_ALREADY_ASSOCIATED },
5349
    { "ALERTED",                     STATUS_ALERTED },
5350
    { "ALIAS_EXISTS",                STATUS_ALIAS_EXISTS },
5351
    { "BAD_DEVICE_TYPE",             STATUS_BAD_DEVICE_TYPE },
5352
    { "BAD_IMPERSONATION_LEVEL",     STATUS_BAD_IMPERSONATION_LEVEL },
5353
    { "BREAKPOINT",                  STATUS_BREAKPOINT },
5354 5355
    { "BUFFER_OVERFLOW",             STATUS_BUFFER_OVERFLOW },
    { "BUFFER_TOO_SMALL",            STATUS_BUFFER_TOO_SMALL },
5356
    { "CANCELLED",                   STATUS_CANCELLED },
5357
    { "CANNOT_DELETE",               STATUS_CANNOT_DELETE },
5358
    { "CANT_OPEN_ANONYMOUS",         STATUS_CANT_OPEN_ANONYMOUS },
5359
    { "CANT_WAIT",                   STATUS_CANT_WAIT },
5360
    { "CHILD_MUST_BE_VOLATILE",      STATUS_CHILD_MUST_BE_VOLATILE },
5361 5362 5363 5364
    { "CONNECTION_ABORTED",          STATUS_CONNECTION_ABORTED },
    { "CONNECTION_DISCONNECTED",     STATUS_CONNECTION_DISCONNECTED },
    { "CONNECTION_REFUSED",          STATUS_CONNECTION_REFUSED },
    { "CONNECTION_RESET",            STATUS_CONNECTION_RESET },
5365
    { "DEBUGGER_INACTIVE",           STATUS_DEBUGGER_INACTIVE },
5366 5367 5368 5369 5370 5371 5372 5373
    { "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 },
5374 5375
    { "ERROR_HOTKEY_ALREADY_REGISTERED", 0xc0010000 | ERROR_HOTKEY_ALREADY_REGISTERED },
    { "ERROR_HOTKEY_NOT_REGISTERED", 0xc0010000 | ERROR_HOTKEY_NOT_REGISTERED },
5376
    { "ERROR_INVALID_CURSOR_HANDLE", 0xc0010000 | ERROR_INVALID_CURSOR_HANDLE },
5377
    { "ERROR_INVALID_INDEX",         0xc0010000 | ERROR_INVALID_INDEX },
5378
    { "ERROR_INVALID_WINDOW_HANDLE", 0xc0010000 | ERROR_INVALID_WINDOW_HANDLE },
5379
    { "ERROR_NO_MORE_USER_HANDLES",  0xc0010000 | ERROR_NO_MORE_USER_HANDLES },
5380
    { "ERROR_WINDOW_OF_OTHER_THREAD", 0xc0010000 | ERROR_WINDOW_OF_OTHER_THREAD },
5381
    { "FILE_DELETED",                STATUS_FILE_DELETED },
5382 5383
    { "FILE_IS_A_DIRECTORY",         STATUS_FILE_IS_A_DIRECTORY },
    { "FILE_LOCK_CONFLICT",          STATUS_FILE_LOCK_CONFLICT },
5384
    { "GENERIC_NOT_MAPPED",          STATUS_GENERIC_NOT_MAPPED },
5385
    { "HANDLES_CLOSED",              STATUS_HANDLES_CLOSED },
5386
    { "HANDLE_NOT_CLOSABLE",         STATUS_HANDLE_NOT_CLOSABLE },
5387
    { "HOST_UNREACHABLE",            STATUS_HOST_UNREACHABLE },
5388
    { "ILLEGAL_FUNCTION",            STATUS_ILLEGAL_FUNCTION },
5389
    { "INSTANCE_NOT_AVAILABLE",      STATUS_INSTANCE_NOT_AVAILABLE },
5390
    { "INSUFFICIENT_RESOURCES",      STATUS_INSUFFICIENT_RESOURCES },
5391
    { "INVALID_CID",                 STATUS_INVALID_CID },
5392
    { "INVALID_DEVICE_REQUEST",      STATUS_INVALID_DEVICE_REQUEST },
5393 5394
    { "INVALID_FILE_FOR_SECTION",    STATUS_INVALID_FILE_FOR_SECTION },
    { "INVALID_HANDLE",              STATUS_INVALID_HANDLE },
5395 5396 5397 5398 5399
    { "INVALID_IMAGE_FORMAT",        STATUS_INVALID_IMAGE_FORMAT },
    { "INVALID_IMAGE_NE_FORMAT",     STATUS_INVALID_IMAGE_NE_FORMAT },
    { "INVALID_IMAGE_NOT_MZ",        STATUS_INVALID_IMAGE_NOT_MZ },
    { "INVALID_IMAGE_PROTECT",       STATUS_INVALID_IMAGE_PROTECT },
    { "INVALID_IMAGE_WIN_64",        STATUS_INVALID_IMAGE_WIN_64 },
5400
    { "INVALID_LOCK_SEQUENCE",       STATUS_INVALID_LOCK_SEQUENCE },
5401
    { "INVALID_OWNER",               STATUS_INVALID_OWNER },
5402
    { "INVALID_PARAMETER",           STATUS_INVALID_PARAMETER },
5403
    { "INVALID_SECURITY_DESCR",      STATUS_INVALID_SECURITY_DESCR },
5404 5405
    { "IO_TIMEOUT",                  STATUS_IO_TIMEOUT },
    { "KEY_DELETED",                 STATUS_KEY_DELETED },
5406
    { "MAPPED_FILE_SIZE_ZERO",       STATUS_MAPPED_FILE_SIZE_ZERO },
5407
    { "MORE_PROCESSING_REQUIRED",    STATUS_MORE_PROCESSING_REQUIRED },
5408
    { "MUTANT_NOT_OWNED",            STATUS_MUTANT_NOT_OWNED },
5409
    { "NAME_TOO_LONG",               STATUS_NAME_TOO_LONG },
5410 5411
    { "NETWORK_BUSY",                STATUS_NETWORK_BUSY },
    { "NETWORK_UNREACHABLE",         STATUS_NETWORK_UNREACHABLE },
5412 5413
    { "NOT_ALL_ASSIGNED",            STATUS_NOT_ALL_ASSIGNED },
    { "NOT_A_DIRECTORY",             STATUS_NOT_A_DIRECTORY },
5414
    { "NOT_FOUND",                   STATUS_NOT_FOUND },
5415 5416
    { "NOT_IMPLEMENTED",             STATUS_NOT_IMPLEMENTED },
    { "NOT_REGISTRY_FILE",           STATUS_NOT_REGISTRY_FILE },
5417
    { "NOT_SUPPORTED",               STATUS_NOT_SUPPORTED },
5418 5419 5420 5421 5422 5423 5424 5425 5426
    { "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 },
5427
    { "OBJECT_NAME_EXISTS",          STATUS_OBJECT_NAME_EXISTS },
5428 5429 5430
    { "OBJECT_NAME_INVALID",         STATUS_OBJECT_NAME_INVALID },
    { "OBJECT_NAME_NOT_FOUND",       STATUS_OBJECT_NAME_NOT_FOUND },
    { "OBJECT_PATH_INVALID",         STATUS_OBJECT_PATH_INVALID },
5431 5432
    { "OBJECT_PATH_NOT_FOUND",       STATUS_OBJECT_PATH_NOT_FOUND },
    { "OBJECT_PATH_SYNTAX_BAD",      STATUS_OBJECT_PATH_SYNTAX_BAD },
5433 5434 5435 5436 5437 5438 5439 5440
    { "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 },
5441
    { "PROCESS_IN_JOB",              STATUS_PROCESS_IN_JOB },
5442
    { "PROCESS_IS_TERMINATING",      STATUS_PROCESS_IS_TERMINATING },
5443 5444 5445
    { "SECTION_TOO_BIG",             STATUS_SECTION_TOO_BIG },
    { "SEMAPHORE_LIMIT_EXCEEDED",    STATUS_SEMAPHORE_LIMIT_EXCEEDED },
    { "SHARING_VIOLATION",           STATUS_SHARING_VIOLATION },
5446
    { "SHUTDOWN_IN_PROGRESS",        STATUS_SHUTDOWN_IN_PROGRESS },
5447
    { "SUSPEND_COUNT_EXCEEDED",      STATUS_SUSPEND_COUNT_EXCEEDED },
5448
    { "THREAD_IS_TERMINATING",       STATUS_THREAD_IS_TERMINATING },
5449
    { "TIMEOUT",                     STATUS_TIMEOUT },
5450
    { "TOO_MANY_OPENED_FILES",       STATUS_TOO_MANY_OPENED_FILES },
5451
    { "UNSUCCESSFUL",                STATUS_UNSUCCESSFUL },
5452
    { "USER_APC",                    STATUS_USER_APC },
5453
    { "USER_MAPPED_FILE",            STATUS_USER_MAPPED_FILE },
5454
    { "VOLUME_DISMOUNTED",           STATUS_VOLUME_DISMOUNTED },
5455 5456 5457 5458
    { "WAS_LOCKED",                  STATUS_WAS_LOCKED },
    { NULL, 0 }
};

5459 5460 5461
/* ### make_requests end ### */
/* Everything above this line is generated automatically by tools/make_requests */

5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475
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;
}

5476
void trace_request(void)
Alexandre Julliard's avatar
Alexandre Julliard committed
5477
{
5478
    enum request req = current->req.request_header.req;
5479
    if (req < REQ_NB_REQUESTS)
Alexandre Julliard's avatar
Alexandre Julliard committed
5480
    {
5481
        fprintf( stderr, "%04x: %s(", current->id, req_names[req] );
5482 5483 5484 5485 5486 5487
        if (req_dumpers[req])
        {
            cur_data = get_req_data();
            cur_size = get_req_data_size();
            req_dumpers[req]( &current->req );
        }
5488
        fprintf( stderr, " )\n" );
Alexandre Julliard's avatar
Alexandre Julliard committed
5489
    }
5490
    else fprintf( stderr, "%04x: %d(?)\n", current->id, req );
Alexandre Julliard's avatar
Alexandre Julliard committed
5491 5492
}

5493
void trace_reply( enum request req, const union generic_reply *reply )
Alexandre Julliard's avatar
Alexandre Julliard committed
5494
{
5495
    if (req < REQ_NB_REQUESTS)
Alexandre Julliard's avatar
Alexandre Julliard committed
5496
    {
5497 5498
        fprintf( stderr, "%04x: %s() = %s",
                 current->id, req_names[req], get_status_name(current->error) );
5499 5500 5501
        if (reply_dumpers[req])
        {
            fprintf( stderr, " {" );
5502 5503 5504
            cur_data = current->reply_data;
            cur_size = reply->reply_header.reply_size;
            reply_dumpers[req]( reply );
5505 5506 5507
            fprintf( stderr, " }" );
        }
        fputc( '\n', stderr );
Alexandre Julliard's avatar
Alexandre Julliard committed
5508
    }
5509 5510
    else fprintf( stderr, "%04x: %d() = %s\n",
                  current->id, req, get_status_name(current->error) );
Alexandre Julliard's avatar
Alexandre Julliard committed
5511
}