trace.c 195 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
#include "ddk/ntddser.h"
43 44
#define USE_WS_PREFIX
#include "winsock2.h"
45
#include "file.h"
46
#include "request.h"
47
#include "unicode.h"
Alexandre Julliard's avatar
Alexandre Julliard committed
48

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

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

54 55
/* utility functions */

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

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

73 74 75 76 77 78 79 80 81 82 83 84 85
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 );
}

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

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

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

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

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

132
static void dump_cpu_type( const char *prefix, const cpu_type_t *code )
133 134 135
{
    switch (*code)
    {
136
#define CASE(c) case CPU_##c: fprintf( stderr, "%s%s", prefix, #c ); break
137 138 139
        CASE(x86);
        CASE(x86_64);
        CASE(POWERPC);
140 141
        CASE(ARM);
        CASE(ARM64);
142
        default: fprintf( stderr, "%s%u", prefix, *code ); break;
143 144 145 146
#undef CASE
    }
}

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

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

308
static void dump_async_data( const char *prefix, const async_data_t *data )
309
{
310 311
    fprintf( stderr, "%s{handle=%04x,event=%04x", prefix, data->handle, data->event );
    dump_uint64( ",iosb=", &data->iosb );
312 313 314
    dump_uint64( ",user=", &data->user );
    dump_uint64( ",apc=", &data->apc );
    dump_uint64( ",apc_context=", &data->apc_context );
315
    fputc( '}', stderr );
316 317
}

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

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 390 391 392
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;
    }
}

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

398
static void dump_varargs_ints( const char *prefix, data_size_t size )
399
{
400 401 402
    const int *data = cur_data;
    data_size_t len = size / sizeof(*data);

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

413 414 415 416 417 418 419 420
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 );
}

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

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

436
static void dump_varargs_apc_result( const char *prefix, data_size_t size )
437 438 439 440 441
{
    const apc_result_t *result = cur_data;

    if (size >= sizeof(*result))
    {
442
        dump_apc_result( prefix, result );
443 444 445 446 447
        size = sizeof(*result);
    }
    remove_data( size );
}

448
static void dump_varargs_select_op( const char *prefix, data_size_t size )
449
{
450
    select_op_t data;
451

452
    if (!size)
453
    {
454 455 456 457 458 459 460 461 462 463 464 465 466
        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:
467 468
    case SELECT_WAIT_ALL:
        fprintf( stderr, "%s", data.op == SELECT_WAIT ? "WAIT" : "WAIT_ALL" );
469 470 471 472
        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;
473 474 475 476
    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;
477 478 479 480 481 482 483
    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;
484 485 486
    default:
        fprintf( stderr, "op=%u", data.op );
        break;
487 488
    }
    fputc( '}', stderr );
489
    remove_data( size );
490 491
}

492
static void dump_varargs_user_handles( const char *prefix, data_size_t size )
493
{
494
    const user_handle_t *data = cur_data;
495
    data_size_t len = size / sizeof(*data);
496

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

507
static void dump_varargs_bytes( const char *prefix, data_size_t size )
508
{
509
    const unsigned char *data = cur_data;
510
    data_size_t len = min( 1024, size );
511

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

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

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

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

543 544
    if (!size)
    {
545
        fprintf( stderr, "%s{}", prefix );
546 547
        return;
    }
548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574
    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)
        {
575
            fprintf( stderr, ",fp.ctrl=%08x,fp.status=%08x,fp.tag=%08x,fp.err_off=%08x,fp.err_sel=%08x",
576 577 578 579 580
                     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++)
581 582 583 584 585
            {
                long double reg = 0;
                memcpy( &reg, &ctx.fp.i386_regs.regs[10 * i], 10 );
                fprintf( stderr, ",fp.reg%u=%Lg", i, reg );
            }
586 587
        }
        if (ctx.flags & SERVER_CTX_EXTENDED_REGISTERS)
588 589
            dump_uints( ",extended=", (const unsigned int *)ctx.ext.i386_regs,
                        sizeof(ctx.ext.i386_regs) / sizeof(int) );
590 591 592 593 594 595 596
        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 );
597 598
            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 );
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 657 658 659
        }
        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;
660 661 662 663 664 665 666
    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] );
667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683
        if (ctx.flags & SERVER_CTX_DEBUG_REGISTERS)
        {
            for (i = 0; i < 8; i++)
                fprintf( stderr, ",bcr%u=%08x,bvr%u=%08x",
                         i, ctx.debug.arm_regs.bcr[i], i, ctx.debug.arm_regs.bvr[i] );
            fprintf( stderr, ",wcr0=%08x,wvr0=%08x",
                     ctx.debug.arm_regs.wcr[0], ctx.debug.arm_regs.wvr[0] );
        }
        if (ctx.flags & SERVER_CTX_FLOATING_POINT)
        {
            for (i = 0; i < 32; i++)
            {
                fprintf( stderr, ",d%u=", i );
                dump_uint64( "", &ctx.fp.arm_regs.d[i] );
            }
            fprintf( stderr, ",fpscr=%08x", ctx.fp.arm_regs.fpscr );
        }
684
        break;
685 686 687 688 689 690 691 692 693
    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)
        {
694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720
            for (i = 0; i < 31; i++)
            {
                fprintf( stderr, ",x%u=", i );
                dump_uint64( "", &ctx.integer.arm64_regs.x[i] );
            }
        }
        if (ctx.flags & SERVER_CTX_DEBUG_REGISTERS)
        {
            for (i = 0; i < 8; i++)
            {
                fprintf( stderr, ",bcr%u=%08x,bvr%u=", i, ctx.debug.arm64_regs.bcr[i], i );
                dump_uint64( "", &ctx.debug.arm64_regs.bvr[i] );
            }
            for (i = 0; i < 2; i++)
            {
                fprintf( stderr, ",wcr%u=%08x,wvr%u=", i, ctx.debug.arm64_regs.wcr[i], i );
                dump_uint64( "", &ctx.debug.arm64_regs.wvr[i] );
            }
        }
        if (ctx.flags & SERVER_CTX_FLOATING_POINT)
        {
            for (i = 0; i < 64; i++)
            {
                fprintf( stderr, ",d%u=", i );
                dump_uint64( "", &ctx.fp.arm64_regs.d[i] );
            }
            fprintf( stderr, ",fpcr=%08x,fpsr=%08x", ctx.fp.arm64_regs.fpcr, ctx.fp.arm64_regs.fpsr );
721 722
        }
        break;
723 724 725
    }
    fputc( '}', stderr );
    remove_data( size );
726 727
}

728
static void dump_varargs_debug_event( const char *prefix, data_size_t size )
729
{
730 731
    debug_event_t event;
    unsigned int i;
732

733
    if (!size)
734
    {
735
        fprintf( stderr, "%s{}", prefix );
736
        return;
737
    }
738 739 740 741 742
    size = min( size, sizeof(event) );
    memset( &event, 0, sizeof(event) );
    memcpy( &event, cur_data, size );

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

805
/* dump a unicode string contained in a buffer; helper for dump_varargs_startup_info */
806
static data_size_t dump_inline_unicode_string( const char *prefix, data_size_t pos, data_size_t len, data_size_t total_size )
807
{
808 809 810 811 812 813
    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);
814 815
}

816
static void dump_varargs_startup_info( const char *prefix, data_size_t size )
817
{
818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837
    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 );
838
    fprintf( stderr, "\"}" );
839 840 841
    remove_data( size );
}

842
static void dump_varargs_input_records( const char *prefix, data_size_t size )
843
{
844
    const INPUT_RECORD *rec = cur_data;
845
    data_size_t len = size / sizeof(*rec);
846

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

858
static void dump_varargs_rectangles( const char *prefix, data_size_t size )
859 860
{
    const rectangle_t *rect = cur_data;
861
    data_size_t len = size / sizeof(*rect);
862

863
    fprintf( stderr,"%s{", prefix );
864 865
    while (len > 0)
    {
866
        dump_rectangle( "", rect++ );
867 868 869 870 871 872
        if (--len) fputc( ',', stderr );
    }
    fputc( '}', stderr );
    remove_data( size );
}

873
static void dump_varargs_message_data( const char *prefix, data_size_t size )
874 875
{
    /* FIXME: dump the structured data */
876
    dump_varargs_bytes( prefix, size );
877 878
}

879
static void dump_varargs_properties( const char *prefix, data_size_t size )
880
{
881
    const property_data_t *prop = cur_data;
882
    data_size_t len = size / sizeof(*prop);
883

884
    fprintf( stderr,"%s{", prefix );
885 886
    while (len > 0)
    {
887 888
        fprintf( stderr, "{atom=%04x,str=%d", prop->atom, prop->string );
        dump_uint64( ",data=", &prop->data );
889
        fputc( '}', stderr );
890 891 892 893
        prop++;
        if (--len) fputc( ',', stderr );
    }
    fputc( '}', stderr );
894
    remove_data( size );
895 896
}

897
static void dump_varargs_LUID_AND_ATTRIBUTES( const char *prefix, data_size_t size )
898 899
{
    const LUID_AND_ATTRIBUTES *lat = cur_data;
900
    data_size_t len = size / sizeof(*lat);
901

902
    fprintf( stderr,"%s{", prefix );
903 904
    while (len > 0)
    {
905
        fprintf( stderr, "{luid=%08x%08x,attr=%x}",
906 907 908 909 910 911 912 913
                 lat->Luid.HighPart, lat->Luid.LowPart, lat->Attributes );
        lat++;
        if (--len) fputc( ',', stderr );
    }
    fputc( '}', stderr );
    remove_data( size );
}

914
static void dump_inline_sid( const char *prefix, const SID *sid, data_size_t size )
915 916 917 918
{
    DWORD i;

    /* security check */
919 920 921 922
    if ((FIELD_OFFSET(SID, SubAuthority[0]) > size) ||
        (FIELD_OFFSET(SID, SubAuthority[sid->SubAuthorityCount]) > size))
    {
        fprintf( stderr, "<invalid sid>" );
923
        return;
924
    }
925

926
    fprintf( stderr,"%s{", prefix );
927
    fprintf( stderr, "S-%u-%u", sid->Revision, MAKELONG(
928 929 930 931 932
        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++)
933
        fprintf( stderr, "-%u", sid->SubAuthority[i] );
934 935 936
    fputc( '}', stderr );
}

937
static void dump_varargs_SID( const char *prefix, data_size_t size )
938 939
{
    const SID *sid = cur_data;
940
    dump_inline_sid( prefix, sid, size );
941 942 943
    remove_data( size );
}

944
static void dump_inline_acl( const char *prefix, const ACL *acl, data_size_t size )
945 946 947 948
{
    const ACE_HEADER *ace;
    ULONG i;

949
    fprintf( stderr,"%s{", prefix );
950 951 952
    if (size)
    {
        if (size < sizeof(ACL))
953
        {
954
            fprintf( stderr, "<invalid acl>}" );
955
            return;
956
        }
957 958 959 960 961
        size -= sizeof(ACL);
        ace = (const ACE_HEADER *)(acl + 1);
        for (i = 0; i < acl->AceCount; i++)
        {
            const SID *sid = NULL;
962
            data_size_t sid_size = 0;
963

964
            if (size < sizeof(ACE_HEADER) || size < ace->AceSize) break;
965
            size -= ace->AceSize;
966
            if (i != 0) fputc( ',', stderr );
967 968 969 970 971
            fprintf( stderr, "{AceType=" );
            switch (ace->AceType)
            {
            case ACCESS_DENIED_ACE_TYPE:
                sid = (const SID *)&((const ACCESS_DENIED_ACE *)ace)->SidStart;
972
                sid_size = ace->AceSize - FIELD_OFFSET(ACCESS_DENIED_ACE, SidStart);
973
                fprintf( stderr, "ACCESS_DENIED_ACE_TYPE,Mask=%x",
974
                         ((const ACCESS_DENIED_ACE *)ace)->Mask );
975 976 977
                break;
            case ACCESS_ALLOWED_ACE_TYPE:
                sid = (const SID *)&((const ACCESS_ALLOWED_ACE *)ace)->SidStart;
978
                sid_size = ace->AceSize - FIELD_OFFSET(ACCESS_ALLOWED_ACE, SidStart);
979
                fprintf( stderr, "ACCESS_ALLOWED_ACE_TYPE,Mask=%x",
980
                         ((const ACCESS_ALLOWED_ACE *)ace)->Mask );
981 982 983
                break;
            case SYSTEM_AUDIT_ACE_TYPE:
                sid = (const SID *)&((const SYSTEM_AUDIT_ACE *)ace)->SidStart;
984
                sid_size = ace->AceSize - FIELD_OFFSET(SYSTEM_AUDIT_ACE, SidStart);
985
                fprintf( stderr, "SYSTEM_AUDIT_ACE_TYPE,Mask=%x",
986
                         ((const SYSTEM_AUDIT_ACE *)ace)->Mask );
987 988 989
                break;
            case SYSTEM_ALARM_ACE_TYPE:
                sid = (const SID *)&((const SYSTEM_ALARM_ACE *)ace)->SidStart;
990
                sid_size = ace->AceSize - FIELD_OFFSET(SYSTEM_ALARM_ACE, SidStart);
991
                fprintf( stderr, "SYSTEM_ALARM_ACE_TYPE,Mask=%x",
992
                         ((const SYSTEM_ALARM_ACE *)ace)->Mask );
993
                break;
994 995 996 997 998 999
            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;
1000 1001 1002 1003
            default:
                fprintf( stderr, "unknown<%d>", ace->AceType );
                break;
            }
1004
            fprintf( stderr, ",AceFlags=%x", ace->AceFlags );
1005
            if (sid)
1006
                dump_inline_sid( ",Sid=", sid, sid_size );
1007 1008 1009 1010 1011 1012 1013
            ace = (const ACE_HEADER *)((const char *)ace + ace->AceSize);
            fputc( '}', stderr );
        }
    }
    fputc( '}', stderr );
}

1014 1015 1016 1017 1018 1019 1020
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 );
}

1021
static void dump_inline_security_descriptor( const char *prefix, const struct security_descriptor *sd, data_size_t size )
1022
{
1023
    fprintf( stderr,"%s{", prefix );
1024 1025 1026 1027 1028 1029
    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;
1030
        if (sd->owner_len)
1031
            dump_inline_sid( ",owner=", (const SID *)((const char *)sd + offset), sd->owner_len );
1032
        else
1033
            fprintf( stderr, ",owner=<not present>" );
1034 1035 1036
        offset += sd->owner_len;
        if ((sd->group_len > FIELD_OFFSET(SID, SubAuthority[255])) || (offset + sd->group_len > size))
            return;
1037
        if (sd->group_len)
1038
            dump_inline_sid( ",group=", (const SID *)((const char *)sd + offset), sd->group_len );
1039
        else
1040
            fprintf( stderr, ",group=<not present>" );
1041 1042 1043
        offset += sd->group_len;
        if ((sd->sacl_len >= MAX_ACL_LEN) || (offset + sd->sacl_len > size))
            return;
1044
        dump_inline_acl( ",sacl=", (const ACL *)((const char *)sd + offset), sd->sacl_len );
1045 1046 1047
        offset += sd->sacl_len;
        if ((sd->dacl_len >= MAX_ACL_LEN) || (offset + sd->dacl_len > size))
            return;
1048
        dump_inline_acl( ",dacl=", (const ACL *)((const char *)sd + offset), sd->dacl_len );
1049 1050 1051 1052 1053
        offset += sd->dacl_len;
    }
    fputc( '}', stderr );
}

1054
static void dump_varargs_security_descriptor( const char *prefix, data_size_t size )
1055 1056
{
    const struct security_descriptor *sd = cur_data;
1057
    dump_inline_security_descriptor( prefix, sd, size );
1058 1059 1060
    remove_data( size );
}

1061
static void dump_varargs_token_groups( const char *prefix, data_size_t size )
1062 1063
{
    const struct token_groups *tg = cur_data;
1064 1065

    fprintf( stderr,"%s{", prefix );
1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084
    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] );
1085
                dump_inline_sid( ",sid=", sid, size - offset );
1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097
                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 );
}

1098
static void dump_varargs_object_attributes( const char *prefix, data_size_t size )
1099 1100
{
    const struct object_attributes *objattr = cur_data;
1101 1102

    fprintf( stderr,"%s{", prefix );
1103
    if (size)
1104 1105
    {
        const WCHAR *str;
1106 1107 1108 1109 1110 1111 1112

        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 );
1113
            return;
1114 1115 1116
        }

        fprintf( stderr, "rootdir=%04x,attributes=%08x", objattr->rootdir, objattr->attributes );
1117
        dump_inline_security_descriptor( ",sd=", (const struct security_descriptor *)(objattr + 1), objattr->sd_len );
1118
        str = (const WCHAR *)objattr + (sizeof(*objattr) + objattr->sd_len) / sizeof(WCHAR);
1119
        fprintf( stderr, ",name=L\"" );
1120
        dump_strW( str, objattr->name_len / sizeof(WCHAR), stderr, "\"\"" );
1121
        fputc( '\"', stderr );
1122
        remove_data( ((sizeof(*objattr) + objattr->sd_len) / sizeof(WCHAR)) * sizeof(WCHAR) +
1123
                     (objattr->name_len / sizeof(WCHAR)) * sizeof(WCHAR) );
1124 1125 1126 1127
    }
    fputc( '}', stderr );
}

1128 1129
static void dump_varargs_filesystem_event( const char *prefix, data_size_t size )
{
1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141
    static const char * const actions[] = {
        NULL,
        "ADDED",
        "REMOVED",
        "MODIFIED",
        "RENAMED_OLD_NAME",
        "RENAMED_NEW_NAME",
        "ADDED_STREAM",
        "REMOVED_STREAM",
        "MODIFIED_STREAM"
    };

1142 1143 1144 1145 1146 1147 1148
    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;
1149 1150 1151 1152 1153
        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 );
1154 1155 1156 1157 1158 1159 1160
        size -= len;
        remove_data( len );
        if (size)fputc( ',', stderr );
    }
    fputc( '}', stderr );
}

1161 1162 1163 1164
static void dump_varargs_pe_image_info( const char *prefix, data_size_t size )
{
    pe_image_info_t info;

1165 1166 1167 1168 1169
    if (!size)
    {
        fprintf( stderr, "%s{}", prefix );
        return;
    }
1170 1171 1172 1173 1174 1175
    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 );
1176
    dump_uint64( ",map_size=", &info.map_size );
1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187
    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 );
}

1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204
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 );
}

1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221
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 );
}

1222
typedef void (*dump_func)( const void *req );
1223 1224 1225 1226

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

1227
static void dump_new_process_request( const struct new_process_request *req )
1228
{
1229 1230 1231 1232 1233 1234 1235 1236
    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 );
1237
    dump_cpu_type( ", cpu=", &req->cpu );
1238 1239
    fprintf( stderr, ", info_size=%u", req->info_size );
    dump_varargs_startup_info( ", info=", min(cur_size,req->info_size) );
1240
    dump_varargs_unicode_str( ", env=", cur_size );
1241 1242
}

1243
static void dump_new_process_reply( const struct new_process_reply *req )
1244
{
1245 1246 1247 1248 1249
    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 );
1250 1251 1252 1253
}

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

1257
static void dump_get_new_process_info_reply( const struct get_new_process_info_reply *req )
1258
{
1259 1260
    fprintf( stderr, " success=%d", req->success );
    fprintf( stderr, ", exit_code=%d", req->exit_code );
1261 1262
}

1263
static void dump_new_thread_request( const struct new_thread_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1264
{
1265 1266 1267 1268
    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
1269 1270
}

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

1277 1278 1279 1280 1281 1282
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 )
{
1283
    fprintf( stderr, " exe_file=%04x", req->exe_file );
1284 1285
    fprintf( stderr, ", info_size=%u", req->info_size );
    dump_varargs_startup_info( ", info=", min(cur_size,req->info_size) );
1286
    dump_varargs_unicode_str( ", env=", cur_size );
1287 1288
}

1289
static void dump_init_process_done_request( const struct init_process_done_request *req )
1290
{
1291 1292 1293 1294
    fprintf( stderr, " gui=%d", req->gui );
    dump_uint64( ", module=", &req->module );
    dump_uint64( ", ldt_copy=", &req->ldt_copy );
    dump_uint64( ", entry=", &req->entry );
1295 1296
}

1297 1298 1299 1300 1301
static void dump_init_process_done_reply( const struct init_process_done_reply *req )
{
    fprintf( stderr, " suspend=%d", req->suspend );
}

1302
static void dump_init_thread_request( const struct init_thread_request *req )
1303
{
1304 1305 1306 1307 1308 1309 1310 1311
    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 );
1312 1313
}

1314
static void dump_init_thread_reply( const struct init_thread_reply *req )
1315
{
1316 1317 1318 1319 1320 1321
    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 );
1322
    fprintf( stderr, ", suspend=%d", req->suspend );
1323 1324
}

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

1331
static void dump_terminate_process_reply( const struct terminate_process_reply *req )
1332 1333 1334 1335
{
    fprintf( stderr, " self=%d", req->self );
}

1336
static void dump_terminate_thread_request( const struct terminate_thread_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1337
{
1338 1339
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", exit_code=%d", req->exit_code );
Alexandre Julliard's avatar
Alexandre Julliard committed
1340 1341
}

1342
static void dump_terminate_thread_reply( const struct terminate_thread_reply *req )
1343
{
1344 1345
    fprintf( stderr, " self=%d", req->self );
    fprintf( stderr, ", last=%d", req->last );
1346 1347
}

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

1353
static void dump_get_process_info_reply( const struct get_process_info_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1354
{
1355 1356 1357 1358 1359 1360 1361 1362
    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 );
1363
    dump_cpu_type( ", cpu=", &req->cpu );
1364
    fprintf( stderr, ", debugger_present=%d", req->debugger_present );
1365
    fprintf( stderr, ", debug_children=%d", req->debug_children );
1366 1367
}

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

static void dump_get_process_vm_counters_reply( const struct get_process_vm_counters_reply *req )
{
    dump_uint64( " peak_virtual_size=", &req->peak_virtual_size );
    dump_uint64( ", virtual_size=", &req->virtual_size );
    dump_uint64( ", peak_working_set_size=", &req->peak_working_set_size );
    dump_uint64( ", working_set_size=", &req->working_set_size );
    dump_uint64( ", pagefile_usage=", &req->pagefile_usage );
    dump_uint64( ", peak_pagefile_usage=", &req->peak_pagefile_usage );
}

1383
static void dump_set_process_info_request( const struct set_process_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 );
Alexandre Julliard's avatar
Alexandre Julliard committed
1389 1390
}

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

1397
static void dump_get_thread_info_reply( const struct get_thread_info_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1398
{
1399 1400 1401
    fprintf( stderr, " pid=%04x", req->pid );
    fprintf( stderr, ", tid=%04x", req->tid );
    dump_uint64( ", teb=", &req->teb );
1402
    dump_uint64( ", entry_point=", &req->entry_point );
1403 1404 1405 1406
    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 );
1407 1408
}

1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419
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 );
}

1420
static void dump_set_thread_info_request( const struct set_thread_info_request *req )
1421
{
1422 1423 1424 1425
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", mask=%d", req->mask );
    fprintf( stderr, ", priority=%d", req->priority );
    dump_uint64( ", affinity=", &req->affinity );
1426
    dump_uint64( ", entry_point=", &req->entry_point );
1427
    fprintf( stderr, ", token=%04x", req->token );
1428 1429
}

1430 1431
static void dump_get_dll_info_request( const struct get_dll_info_request *req )
{
1432 1433
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", base_address=", &req->base_address );
1434 1435 1436 1437
}

static void dump_get_dll_info_reply( const struct get_dll_info_reply *req )
{
1438 1439 1440
    dump_uint64( " entry_point=", &req->entry_point );
    fprintf( stderr, ", filename_len=%u", req->filename_len );
    dump_varargs_unicode_str( ", filename=", cur_size );
1441 1442
}

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

1448
static void dump_suspend_thread_reply( const struct suspend_thread_reply *req )
1449 1450 1451 1452
{
    fprintf( stderr, " count=%d", req->count );
}

1453
static void dump_resume_thread_request( const struct resume_thread_request *req )
1454
{
1455
    fprintf( stderr, " handle=%04x", req->handle );
1456 1457
}

1458
static void dump_resume_thread_reply( const struct resume_thread_reply *req )
1459 1460 1461 1462
{
    fprintf( stderr, " count=%d", req->count );
}

1463
static void dump_load_dll_request( const struct load_dll_request *req )
1464
{
1465
    fprintf( stderr, " dbg_offset=%u", req->dbg_offset );
1466 1467
    dump_uint64( ", base=", &req->base );
    dump_uint64( ", name=", &req->name );
1468
    fprintf( stderr, ", dbg_size=%u", req->dbg_size );
1469
    dump_varargs_unicode_str( ", filename=", cur_size );
1470 1471 1472 1473
}

static void dump_unload_dll_request( const struct unload_dll_request *req )
{
1474
    dump_uint64( " base=", &req->base );
1475 1476
}

1477
static void dump_queue_apc_request( const struct queue_apc_request *req )
1478
{
1479 1480
    fprintf( stderr, " handle=%04x", req->handle );
    dump_apc_call( ", call=", &req->call );
Alexandre Julliard's avatar
Alexandre Julliard committed
1481 1482
}

1483 1484
static void dump_queue_apc_reply( const struct queue_apc_reply *req )
{
1485 1486
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", self=%d", req->self );
1487 1488
}

1489 1490
static void dump_get_apc_result_request( const struct get_apc_result_request *req )
{
1491
    fprintf( stderr, " handle=%04x", req->handle );
1492 1493 1494 1495
}

static void dump_get_apc_result_reply( const struct get_apc_result_reply *req )
{
1496
    dump_apc_result( " result=", &req->result );
1497 1498
}

1499
static void dump_close_handle_request( const struct close_handle_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1500
{
1501
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1502 1503
}

1504
static void dump_set_handle_info_request( const struct set_handle_info_request *req )
1505
{
1506 1507 1508
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", flags=%d", req->flags );
    fprintf( stderr, ", mask=%d", req->mask );
1509 1510
}

1511
static void dump_set_handle_info_reply( const struct set_handle_info_reply *req )
1512
{
1513 1514 1515
    fprintf( stderr, " old_flags=%d", req->old_flags );
}

1516
static void dump_dup_handle_request( const struct dup_handle_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1517
{
1518 1519 1520 1521 1522 1523
    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
1524 1525
}

1526
static void dump_dup_handle_reply( const struct dup_handle_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1527
{
1528 1529 1530
    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
1531 1532
}

1533
static void dump_open_process_request( const struct open_process_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1534
{
1535 1536 1537
    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
1538 1539
}

1540
static void dump_open_process_reply( const struct open_process_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1541
{
1542
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1543 1544
}

1545 1546
static void dump_open_thread_request( const struct open_thread_request *req )
{
1547 1548 1549
    fprintf( stderr, " tid=%04x", req->tid );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
1550 1551 1552 1553
}

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

1557
static void dump_select_request( const struct select_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1558
{
1559 1560 1561
    fprintf( stderr, " flags=%d", req->flags );
    dump_uint64( ", cookie=", &req->cookie );
    dump_timeout( ", timeout=", &req->timeout );
1562
    fprintf( stderr, ", prev_apc=%04x", req->prev_apc );
1563
    dump_varargs_apc_result( ", result=", cur_size );
1564
    dump_varargs_select_op( ", data=", cur_size );
Alexandre Julliard's avatar
Alexandre Julliard committed
1565 1566
}

1567 1568
static void dump_select_reply( const struct select_reply *req )
{
1569 1570 1571
    dump_timeout( " timeout=", &req->timeout );
    dump_apc_call( ", call=", &req->call );
    fprintf( stderr, ", apc_handle=%04x", req->apc_handle );
1572 1573
}

1574
static void dump_create_event_request( const struct create_event_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1575
{
1576 1577 1578 1579
    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
1580 1581
}

1582
static void dump_create_event_reply( const struct create_event_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1583
{
1584
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1585 1586
}

1587
static void dump_event_op_request( const struct event_op_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1588
{
1589 1590
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", op=%d", req->op );
Alexandre Julliard's avatar
Alexandre Julliard committed
1591 1592
}

1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603
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 );
}

1604
static void dump_open_event_request( const struct open_event_request *req )
1605
{
1606 1607 1608 1609
    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 );
1610 1611
}

1612
static void dump_open_event_reply( const struct open_event_reply *req )
1613
{
1614
    fprintf( stderr, " handle=%04x", req->handle );
1615 1616
}

1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640
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 );
}

1641
static void dump_create_mutex_request( const struct create_mutex_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1642
{
1643 1644 1645
    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
1646 1647
}

1648
static void dump_create_mutex_reply( const struct create_mutex_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1649
{
1650
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1651 1652
}

1653
static void dump_release_mutex_request( const struct release_mutex_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1654
{
1655
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1656 1657
}

1658 1659 1660 1661 1662
static void dump_release_mutex_reply( const struct release_mutex_reply *req )
{
    fprintf( stderr, " prev_count=%08x", req->prev_count );
}

1663
static void dump_open_mutex_request( const struct open_mutex_request *req )
1664
{
1665 1666 1667 1668
    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 );
1669 1670
}

1671
static void dump_open_mutex_reply( const struct open_mutex_reply *req )
1672
{
1673
    fprintf( stderr, " handle=%04x", req->handle );
1674 1675
}

1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687
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 );
}

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

1696
static void dump_create_semaphore_reply( const struct create_semaphore_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1697
{
1698
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1699 1700
}

1701
static void dump_release_semaphore_request( const struct release_semaphore_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1702
{
1703 1704
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", count=%08x", req->count );
Alexandre Julliard's avatar
Alexandre Julliard committed
1705 1706
}

1707
static void dump_release_semaphore_reply( const struct release_semaphore_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1708
{
1709
    fprintf( stderr, " prev_count=%08x", req->prev_count );
Alexandre Julliard's avatar
Alexandre Julliard committed
1710 1711
}

1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722
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 );
}

1723
static void dump_open_semaphore_request( const struct open_semaphore_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1724
{
1725 1726 1727 1728
    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 );
1729 1730
}

1731
static void dump_open_semaphore_reply( const struct open_semaphore_reply *req )
1732
{
1733
    fprintf( stderr, " handle=%04x", req->handle );
1734 1735
}

1736
static void dump_create_file_request( const struct create_file_request *req )
1737
{
1738 1739 1740 1741 1742 1743 1744
    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 );
1745 1746
}

1747
static void dump_create_file_reply( const struct create_file_reply *req )
1748
{
1749
    fprintf( stderr, " handle=%04x", req->handle );
1750 1751
}

1752 1753
static void dump_open_file_object_request( const struct open_file_object_request *req )
{
1754 1755 1756 1757 1758 1759
    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 );
1760 1761 1762 1763
}

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

1767
static void dump_alloc_file_handle_request( const struct alloc_file_handle_request *req )
1768
{
1769 1770 1771
    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
1772 1773
}

1774
static void dump_alloc_file_handle_reply( const struct alloc_file_handle_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1775
{
1776
    fprintf( stderr, " handle=%04x", req->handle );
1777 1778
}

1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789
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 );
}

1790
static void dump_get_handle_fd_request( const struct get_handle_fd_request *req )
1791
{
1792
    fprintf( stderr, " handle=%04x", req->handle );
1793 1794
}

1795
static void dump_get_handle_fd_reply( const struct get_handle_fd_reply *req )
1796
{
1797
    fprintf( stderr, " type=%d", req->type );
1798
    fprintf( stderr, ", cacheable=%d", req->cacheable );
1799 1800
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", options=%08x", req->options );
1801 1802
}

1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813
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 );
}

1814
static void dump_flush_request( const struct flush_request *req )
1815
{
1816
    dump_async_data( " async=", &req->async );
1817 1818
}

1819
static void dump_flush_reply( const struct flush_reply *req )
1820
{
1821
    fprintf( stderr, " event=%04x", req->event );
1822 1823
}

1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834
static void dump_get_file_info_request( const struct get_file_info_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", info_class=%08x", req->info_class );
}

static void dump_get_file_info_reply( const struct get_file_info_reply *req )
{
    dump_varargs_bytes( " data=", cur_size );
}

1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845
static void dump_get_volume_info_request( const struct get_volume_info_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", info_class=%08x", req->info_class );
}

static void dump_get_volume_info_reply( const struct get_volume_info_reply *req )
{
    dump_varargs_bytes( " data=", cur_size );
}

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

static void dump_lock_file_reply( const struct lock_file_reply *req )
{
1857 1858
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", overlapped=%d", req->overlapped );
1859 1860
}

1861
static void dump_unlock_file_request( const struct unlock_file_request *req )
1862
{
1863 1864 1865
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", offset=", &req->offset );
    dump_uint64( ", count=", &req->count );
1866 1867
}

1868
static void dump_create_socket_request( const struct create_socket_request *req )
1869
{
1870 1871 1872 1873 1874 1875
    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 );
1876 1877
}

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

1883
static void dump_accept_socket_request( const struct accept_socket_request *req )
1884
{
1885 1886 1887
    fprintf( stderr, " lhandle=%04x", req->lhandle );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
1888 1889
}

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

1895 1896 1897 1898 1899 1900
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 );
}

1901
static void dump_set_socket_event_request( const struct set_socket_event_request *req )
1902
{
1903 1904 1905 1906 1907
    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 );
1908 1909
}

1910
static void dump_get_socket_event_request( const struct get_socket_event_request *req )
1911
{
1912 1913 1914
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", service=%d", req->service );
    fprintf( stderr, ", c_event=%04x", req->c_event );
1915 1916
}

1917
static void dump_get_socket_event_reply( const struct get_socket_event_reply *req )
1918
{
1919 1920 1921 1922
    fprintf( stderr, " mask=%08x", req->mask );
    fprintf( stderr, ", pmask=%08x", req->pmask );
    fprintf( stderr, ", state=%08x", req->state );
    dump_varargs_ints( ", errors=", cur_size );
1923 1924
}

1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936
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 );
}

1937
static void dump_enable_socket_event_request( const struct enable_socket_event_request *req )
1938
{
1939 1940 1941 1942
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", mask=%08x", req->mask );
    fprintf( stderr, ", sstate=%08x", req->sstate );
    fprintf( stderr, ", cstate=%08x", req->cstate );
1943 1944
}

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

1951
static void dump_alloc_console_request( const struct alloc_console_request *req )
1952
{
1953 1954 1955
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", pid=%04x", req->pid );
1956
    fprintf( stderr, ", input_fd=%d", req->input_fd );
1957 1958
}

1959
static void dump_alloc_console_reply( const struct alloc_console_reply *req )
1960
{
1961 1962
    fprintf( stderr, " handle_in=%04x", req->handle_in );
    fprintf( stderr, ", event=%04x", req->event );
1963 1964
}

1965
static void dump_free_console_request( const struct free_console_request *req )
1966 1967 1968
{
}

1969 1970
static void dump_get_console_renderer_events_request( const struct get_console_renderer_events_request *req )
{
1971
    fprintf( stderr, " handle=%04x", req->handle );
1972 1973
}

1974
static void dump_get_console_renderer_events_reply( const struct get_console_renderer_events_reply *req )
1975
{
1976
    dump_varargs_bytes( " data=", cur_size );
1977 1978
}

1979
static void dump_open_console_request( const struct open_console_request *req )
1980
{
1981 1982 1983 1984
    fprintf( stderr, " from=%04x", req->from );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", share=%d", req->share );
1985 1986
}

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

1992 1993 1994 1995 1996 1997
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 )
{
1998
    fprintf( stderr, " handle=%04x", req->handle );
1999 2000
}

2001
static void dump_get_console_mode_request( const struct get_console_mode_request *req )
2002
{
2003
    fprintf( stderr, " handle=%04x", req->handle );
2004 2005
}

2006
static void dump_get_console_mode_reply( const struct get_console_mode_reply *req )
2007 2008 2009 2010
{
    fprintf( stderr, " mode=%d", req->mode );
}

2011
static void dump_set_console_mode_request( const struct set_console_mode_request *req )
2012
{
2013 2014
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", mode=%d", req->mode );
2015 2016
}

2017 2018
static void dump_set_console_input_info_request( const struct set_console_input_info_request *req )
{
2019 2020 2021 2022 2023 2024 2025 2026 2027 2028
    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 );
2029 2030 2031 2032
}

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

2036
static void dump_get_console_input_info_reply( const struct get_console_input_info_reply *req )
2037
{
2038 2039 2040 2041 2042 2043 2044 2045
    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 );
2046 2047 2048 2049
}

static void dump_append_console_input_history_request( const struct append_console_input_history_request *req )
{
2050 2051
    fprintf( stderr, " handle=%04x", req->handle );
    dump_varargs_unicode_str( ", line=", cur_size );
2052 2053 2054 2055
}

static void dump_get_console_input_history_request( const struct get_console_input_history_request *req )
{
2056 2057
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", index=%d", req->index );
2058 2059
}

2060
static void dump_get_console_input_history_reply( const struct get_console_input_history_reply *req )
2061
{
2062 2063
    fprintf( stderr, " total=%d", req->total );
    dump_varargs_unicode_str( ", line=", cur_size );
2064 2065 2066 2067
}

static void dump_create_console_output_request( const struct create_console_output_request *req )
{
2068 2069 2070 2071
    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 );
2072
    fprintf( stderr, ", fd=%d", req->fd );
2073 2074
}

2075
static void dump_create_console_output_reply( const struct create_console_output_reply *req )
2076
{
2077
    fprintf( stderr, " handle_out=%04x", req->handle_out );
2078 2079 2080
}

static void dump_set_console_output_info_request( const struct set_console_output_info_request *req )
2081
{
2082 2083 2084 2085 2086 2087 2088 2089 2090
    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 );
2091
    fprintf( stderr, ", popup_attr=%d", req->popup_attr );
2092 2093 2094 2095 2096 2097
    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 );
2098 2099
    fprintf( stderr, ", font_width=%d", req->font_width );
    fprintf( stderr, ", font_height=%d", req->font_height );
2100
    dump_varargs_uints( ", colors=", cur_size );
2101 2102
}

2103
static void dump_get_console_output_info_request( const struct get_console_output_info_request *req )
2104
{
2105
    fprintf( stderr, " handle=%04x", req->handle );
2106 2107
}

2108
static void dump_get_console_output_info_reply( const struct get_console_output_info_reply *req )
2109
{
2110 2111 2112 2113 2114 2115 2116
    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 );
2117
    fprintf( stderr, ", popup_attr=%d", req->popup_attr );
2118 2119 2120 2121 2122 2123
    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 );
2124 2125
    fprintf( stderr, ", font_width=%d", req->font_width );
    fprintf( stderr, ", font_height=%d", req->font_height );
2126
    dump_varargs_uints( ", colors=", cur_size );
2127 2128
}

2129
static void dump_write_console_input_request( const struct write_console_input_request *req )
2130
{
2131 2132
    fprintf( stderr, " handle=%04x", req->handle );
    dump_varargs_input_records( ", rec=", cur_size );
2133 2134
}

2135
static void dump_write_console_input_reply( const struct write_console_input_reply *req )
2136 2137 2138 2139
{
    fprintf( stderr, " written=%d", req->written );
}

2140
static void dump_read_console_input_request( const struct read_console_input_request *req )
2141
{
2142 2143
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", flush=%d", req->flush );
2144 2145
}

2146
static void dump_read_console_input_reply( const struct read_console_input_reply *req )
2147
{
2148 2149
    fprintf( stderr, " read=%d", req->read );
    dump_varargs_input_records( ", rec=", cur_size );
2150 2151
}

2152 2153
static void dump_write_console_output_request( const struct write_console_output_request *req )
{
2154 2155 2156 2157 2158 2159
    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 );
2160 2161 2162 2163
}

static void dump_write_console_output_reply( const struct write_console_output_reply *req )
{
2164 2165 2166
    fprintf( stderr, " written=%d", req->written );
    fprintf( stderr, ", width=%d", req->width );
    fprintf( stderr, ", height=%d", req->height );
2167 2168 2169 2170
}

static void dump_fill_console_output_request( const struct fill_console_output_request *req )
{
2171 2172 2173 2174 2175 2176 2177
    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 );
2178 2179
}

2180
static void dump_fill_console_output_reply( const struct fill_console_output_reply *req )
2181 2182 2183 2184 2185 2186
{
    fprintf( stderr, " written=%d", req->written );
}

static void dump_read_console_output_request( const struct read_console_output_request *req )
{
2187 2188 2189 2190 2191
    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 );
2192 2193
}

2194
static void dump_read_console_output_reply( const struct read_console_output_reply *req )
2195
{
2196 2197 2198
    fprintf( stderr, " width=%d", req->width );
    fprintf( stderr, ", height=%d", req->height );
    dump_varargs_bytes( ", data=", cur_size );
2199 2200 2201 2202
}

static void dump_move_console_output_request( const struct move_console_output_request *req )
{
2203 2204 2205 2206 2207 2208 2209
    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 );
2210 2211
}

2212 2213
static void dump_send_console_signal_request( const struct send_console_signal_request *req )
{
2214 2215
    fprintf( stderr, " signal=%d", req->signal );
    fprintf( stderr, ", group_id=%04x", req->group_id );
2216 2217
}

2218
static void dump_read_directory_changes_request( const struct read_directory_changes_request *req )
2219
{
2220 2221 2222 2223
    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 );
2224 2225 2226 2227
}

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

static void dump_read_change_reply( const struct read_change_reply *req )
{
2233
    dump_varargs_filesystem_event( " events=", cur_size );
2234 2235
}

2236
static void dump_create_mapping_request( const struct create_mapping_request *req )
2237
{
2238
    fprintf( stderr, " access=%08x", req->access );
2239
    fprintf( stderr, ", flags=%08x", req->flags );
2240
    fprintf( stderr, ", file_access=%08x", req->file_access );
2241 2242 2243
    dump_uint64( ", size=", &req->size );
    fprintf( stderr, ", file_handle=%04x", req->file_handle );
    dump_varargs_object_attributes( ", objattr=", cur_size );
2244 2245
}

2246
static void dump_create_mapping_reply( const struct create_mapping_reply *req )
2247
{
2248
    fprintf( stderr, " handle=%04x", req->handle );
2249 2250
}

2251
static void dump_open_mapping_request( const struct open_mapping_request *req )
2252
{
2253 2254 2255 2256
    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 );
2257 2258
}

2259
static void dump_open_mapping_reply( const struct open_mapping_reply *req )
2260
{
2261
    fprintf( stderr, " handle=%04x", req->handle );
2262 2263
}

2264
static void dump_get_mapping_info_request( const struct get_mapping_info_request *req )
2265
{
2266 2267
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", access=%08x", req->access );
2268 2269
}

2270
static void dump_get_mapping_info_reply( const struct get_mapping_info_reply *req )
2271
{
2272
    dump_uint64( " size=", &req->size );
2273
    fprintf( stderr, ", flags=%08x", req->flags );
2274
    fprintf( stderr, ", shared_file=%04x", req->shared_file );
2275
    dump_varargs_pe_image_info( ", image=", cur_size );
2276 2277
}

2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291
static void dump_map_view_request( const struct map_view_request *req )
{
    fprintf( stderr, " mapping=%04x", req->mapping );
    fprintf( stderr, ", access=%08x", req->access );
    dump_uint64( ", base=", &req->base );
    dump_uint64( ", size=", &req->size );
    dump_uint64( ", start=", &req->start );
}

static void dump_unmap_view_request( const struct unmap_view_request *req )
{
    dump_uint64( " base=", &req->base );
}

2292 2293
static void dump_get_mapping_committed_range_request( const struct get_mapping_committed_range_request *req )
{
2294
    dump_uint64( " base=", &req->base );
2295
    dump_uint64( ", offset=", &req->offset );
2296 2297 2298 2299
}

static void dump_get_mapping_committed_range_reply( const struct get_mapping_committed_range_reply *req )
{
2300 2301
    dump_uint64( " size=", &req->size );
    fprintf( stderr, ", committed=%d", req->committed );
2302 2303 2304 2305
}

static void dump_add_mapping_committed_range_request( const struct add_mapping_committed_range_request *req )
{
2306
    dump_uint64( " base=", &req->base );
2307 2308
    dump_uint64( ", offset=", &req->offset );
    dump_uint64( ", size=", &req->size );
2309 2310
}

2311 2312 2313 2314 2315 2316
static void dump_is_same_mapping_request( const struct is_same_mapping_request *req )
{
    dump_uint64( " base1=", &req->base1 );
    dump_uint64( ", base2=", &req->base2 );
}

2317
static void dump_create_snapshot_request( const struct create_snapshot_request *req )
2318
{
2319 2320
    fprintf( stderr, " attributes=%08x", req->attributes );
    fprintf( stderr, ", flags=%08x", req->flags );
2321 2322
}

2323
static void dump_create_snapshot_reply( const struct create_snapshot_reply *req )
2324
{
2325
    fprintf( stderr, " handle=%04x", req->handle );
2326 2327
}

2328
static void dump_next_process_request( const struct next_process_request *req )
2329
{
2330 2331
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", reset=%d", req->reset );
2332 2333
}

2334
static void dump_next_process_reply( const struct next_process_reply *req )
2335
{
2336 2337 2338 2339 2340 2341
    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 );
2342
    fprintf( stderr, ", unix_pid=%d", req->unix_pid );
2343
    dump_varargs_unicode_str( ", filename=", cur_size );
2344 2345
}

2346 2347
static void dump_next_thread_request( const struct next_thread_request *req )
{
2348 2349
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", reset=%d", req->reset );
2350 2351
}

2352
static void dump_next_thread_reply( const struct next_thread_reply *req )
2353
{
2354 2355 2356 2357 2358
    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 );
2359 2360
}

2361
static void dump_wait_debug_event_request( const struct wait_debug_event_request *req )
2362
{
2363
    fprintf( stderr, " get_handle=%d", req->get_handle );
2364 2365
}

2366
static void dump_wait_debug_event_reply( const struct wait_debug_event_reply *req )
2367
{
2368 2369 2370 2371
    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 );
2372 2373
}

2374
static void dump_queue_exception_event_request( const struct queue_exception_event_request *req )
2375
{
2376 2377 2378 2379 2380 2381 2382 2383
    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 );
2384 2385
}

2386
static void dump_queue_exception_event_reply( const struct queue_exception_event_reply *req )
2387
{
2388
    fprintf( stderr, " handle=%04x", req->handle );
2389 2390 2391 2392
}

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

2396
static void dump_get_exception_status_reply( const struct get_exception_status_reply *req )
2397
{
2398
    dump_varargs_context( " context=", cur_size );
2399 2400
}

2401
static void dump_continue_debug_event_request( const struct continue_debug_event_request *req )
2402
{
2403 2404 2405
    fprintf( stderr, " pid=%04x", req->pid );
    fprintf( stderr, ", tid=%04x", req->tid );
    fprintf( stderr, ", status=%d", req->status );
2406 2407
}

2408
static void dump_debug_process_request( const struct debug_process_request *req )
2409
{
2410 2411
    fprintf( stderr, " pid=%04x", req->pid );
    fprintf( stderr, ", attach=%d", req->attach );
2412 2413
}

2414 2415
static void dump_debug_break_request( const struct debug_break_request *req )
{
2416
    fprintf( stderr, " handle=%04x", req->handle );
2417 2418 2419 2420 2421 2422 2423
}

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

2424 2425 2426
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 );
2427
}
2428

2429
static void dump_read_process_memory_request( const struct read_process_memory_request *req )
2430
{
2431 2432
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", addr=", &req->addr );
2433 2434
}

2435
static void dump_read_process_memory_reply( const struct read_process_memory_reply *req )
2436
{
2437
    dump_varargs_bytes( " data=", cur_size );
2438 2439
}

2440
static void dump_write_process_memory_request( const struct write_process_memory_request *req )
2441
{
2442 2443 2444
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", addr=", &req->addr );
    dump_varargs_bytes( ", data=", cur_size );
2445 2446
}

2447
static void dump_create_key_request( const struct create_key_request *req )
2448
{
2449
    fprintf( stderr, " access=%08x", req->access );
2450
    fprintf( stderr, ", options=%08x", req->options );
2451
    dump_varargs_object_attributes( ", objattr=", cur_size );
2452
    dump_varargs_unicode_str( ", class=", cur_size );
2453 2454
}

2455
static void dump_create_key_reply( const struct create_key_reply *req )
2456
{
2457 2458
    fprintf( stderr, " hkey=%04x", req->hkey );
    fprintf( stderr, ", created=%d", req->created );
2459 2460
}

2461
static void dump_open_key_request( const struct open_key_request *req )
2462
{
2463 2464 2465 2466
    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 );
2467 2468
}

2469
static void dump_open_key_reply( const struct open_key_reply *req )
2470
{
2471
    fprintf( stderr, " hkey=%04x", req->hkey );
2472 2473
}

2474
static void dump_delete_key_request( const struct delete_key_request *req )
2475
{
2476
    fprintf( stderr, " hkey=%04x", req->hkey );
2477 2478
}

2479 2480
static void dump_flush_key_request( const struct flush_key_request *req )
{
2481
    fprintf( stderr, " hkey=%04x", req->hkey );
2482 2483
}

2484
static void dump_enum_key_request( const struct enum_key_request *req )
2485
{
2486 2487 2488
    fprintf( stderr, " hkey=%04x", req->hkey );
    fprintf( stderr, ", index=%d", req->index );
    fprintf( stderr, ", info_class=%d", req->info_class );
2489 2490
}

2491
static void dump_enum_key_reply( const struct enum_key_reply *req )
2492
{
2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503
    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 );
2504 2505
}

2506
static void dump_set_key_value_request( const struct set_key_value_request *req )
2507
{
2508 2509 2510 2511 2512
    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 );
2513 2514
}

2515
static void dump_get_key_value_request( const struct get_key_value_request *req )
2516
{
2517 2518
    fprintf( stderr, " hkey=%04x", req->hkey );
    dump_varargs_unicode_str( ", name=", cur_size );
2519 2520
}

2521
static void dump_get_key_value_reply( const struct get_key_value_reply *req )
2522
{
2523 2524 2525
    fprintf( stderr, " type=%d", req->type );
    fprintf( stderr, ", total=%u", req->total );
    dump_varargs_bytes( ", data=", cur_size );
2526 2527
}

2528
static void dump_enum_key_value_request( const struct enum_key_value_request *req )
2529
{
2530 2531 2532
    fprintf( stderr, " hkey=%04x", req->hkey );
    fprintf( stderr, ", index=%d", req->index );
    fprintf( stderr, ", info_class=%d", req->info_class );
2533 2534
}

2535
static void dump_enum_key_value_reply( const struct enum_key_value_reply *req )
2536
{
2537 2538 2539 2540 2541
    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 );
2542 2543
}

2544
static void dump_delete_key_value_request( const struct delete_key_value_request *req )
2545
{
2546 2547
    fprintf( stderr, " hkey=%04x", req->hkey );
    dump_varargs_unicode_str( ", name=", cur_size );
2548 2549
}

2550
static void dump_load_registry_request( const struct load_registry_request *req )
2551
{
2552 2553
    fprintf( stderr, " file=%04x", req->file );
    dump_varargs_object_attributes( ", objattr=", cur_size );
2554 2555
}

2556 2557
static void dump_unload_registry_request( const struct unload_registry_request *req )
{
2558
    fprintf( stderr, " hkey=%04x", req->hkey );
2559 2560
}

2561
static void dump_save_registry_request( const struct save_registry_request *req )
2562
{
2563 2564
    fprintf( stderr, " hkey=%04x", req->hkey );
    fprintf( stderr, ", file=%04x", req->file );
2565 2566
}

2567 2568
static void dump_set_registry_notification_request( const struct set_registry_notification_request *req )
{
2569 2570 2571 2572
    fprintf( stderr, " hkey=%04x", req->hkey );
    fprintf( stderr, ", event=%04x", req->event );
    fprintf( stderr, ", subtree=%d", req->subtree );
    fprintf( stderr, ", filter=%08x", req->filter );
2573 2574
}

2575
static void dump_create_timer_request( const struct create_timer_request *req )
2576
{
2577 2578
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", manual=%d", req->manual );
2579
    dump_varargs_object_attributes( ", objattr=", cur_size );
2580 2581
}

2582
static void dump_create_timer_reply( const struct create_timer_reply *req )
2583
{
2584
    fprintf( stderr, " handle=%04x", req->handle );
2585 2586
}

2587
static void dump_open_timer_request( const struct open_timer_request *req )
2588
{
2589 2590 2591 2592
    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 );
2593 2594
}

2595
static void dump_open_timer_reply( const struct open_timer_reply *req )
2596
{
2597
    fprintf( stderr, " handle=%04x", req->handle );
2598 2599
}

2600
static void dump_set_timer_request( const struct set_timer_request *req )
2601
{
2602 2603 2604 2605 2606
    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 );
2607 2608
}

2609 2610 2611 2612 2613
static void dump_set_timer_reply( const struct set_timer_reply *req )
{
    fprintf( stderr, " signaled=%d", req->signaled );
}

2614
static void dump_cancel_timer_request( const struct cancel_timer_request *req )
2615
{
2616
    fprintf( stderr, " handle=%04x", req->handle );
2617 2618
}

2619 2620 2621 2622 2623
static void dump_cancel_timer_reply( const struct cancel_timer_reply *req )
{
    fprintf( stderr, " signaled=%d", req->signaled );
}

2624 2625
static void dump_get_timer_info_request( const struct get_timer_info_request *req )
{
2626
    fprintf( stderr, " handle=%04x", req->handle );
2627 2628 2629 2630
}

static void dump_get_timer_info_reply( const struct get_timer_info_reply *req )
{
2631 2632
    dump_timeout( " when=", &req->when );
    fprintf( stderr, ", signaled=%d", req->signaled );
2633 2634
}

2635 2636
static void dump_get_thread_context_request( const struct get_thread_context_request *req )
{
2637 2638 2639
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", flags=%08x", req->flags );
    fprintf( stderr, ", suspend=%d", req->suspend );
2640 2641
}

2642
static void dump_get_thread_context_reply( const struct get_thread_context_reply *req )
2643
{
2644 2645
    fprintf( stderr, " self=%d", req->self );
    dump_varargs_context( ", context=", cur_size );
2646 2647 2648 2649
}

static void dump_set_thread_context_request( const struct set_thread_context_request *req )
{
2650 2651 2652
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", suspend=%d", req->suspend );
    dump_varargs_context( ", context=", cur_size );
2653 2654
}

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

2660 2661
static void dump_get_selector_entry_request( const struct get_selector_entry_request *req )
{
2662 2663
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", entry=%d", req->entry );
2664 2665
}

2666
static void dump_get_selector_entry_reply( const struct get_selector_entry_reply *req )
2667
{
2668 2669 2670
    fprintf( stderr, " base=%08x", req->base );
    fprintf( stderr, ", limit=%08x", req->limit );
    fprintf( stderr, ", flags=%02x", req->flags );
2671 2672
}

2673 2674
static void dump_add_atom_request( const struct add_atom_request *req )
{
2675 2676
    fprintf( stderr, " table=%04x", req->table );
    dump_varargs_unicode_str( ", name=", cur_size );
2677 2678
}

2679
static void dump_add_atom_reply( const struct add_atom_reply *req )
2680
{
2681
    fprintf( stderr, " atom=%04x", req->atom );
2682 2683 2684 2685
}

static void dump_delete_atom_request( const struct delete_atom_request *req )
{
2686 2687
    fprintf( stderr, " table=%04x", req->table );
    fprintf( stderr, ", atom=%04x", req->atom );
2688 2689 2690 2691
}

static void dump_find_atom_request( const struct find_atom_request *req )
{
2692 2693
    fprintf( stderr, " table=%04x", req->table );
    dump_varargs_unicode_str( ", name=", cur_size );
2694 2695
}

2696
static void dump_find_atom_reply( const struct find_atom_reply *req )
2697
{
2698
    fprintf( stderr, " atom=%04x", req->atom );
2699 2700
}

2701
static void dump_get_atom_information_request( const struct get_atom_information_request *req )
2702
{
2703 2704
    fprintf( stderr, " table=%04x", req->table );
    fprintf( stderr, ", atom=%04x", req->atom );
2705 2706
}

2707
static void dump_get_atom_information_reply( const struct get_atom_information_reply *req )
2708
{
2709 2710 2711 2712
    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 );
2713 2714
}

2715 2716
static void dump_set_atom_information_request( const struct set_atom_information_request *req )
{
2717 2718 2719
    fprintf( stderr, " table=%04x", req->table );
    fprintf( stderr, ", atom=%04x", req->atom );
    fprintf( stderr, ", pinned=%d", req->pinned );
2720 2721 2722 2723
}

static void dump_empty_atom_table_request( const struct empty_atom_table_request *req )
{
2724 2725
    fprintf( stderr, " table=%04x", req->table );
    fprintf( stderr, ", if_pinned=%d", req->if_pinned );
2726 2727
}

2728 2729 2730 2731 2732
static void dump_init_atom_table_request( const struct init_atom_table_request *req )
{
    fprintf( stderr, " entries=%d", req->entries );
}

2733 2734
static void dump_init_atom_table_reply( const struct init_atom_table_reply *req )
{
2735
    fprintf( stderr, " table=%04x", req->table );
2736 2737
}

2738 2739 2740 2741
static void dump_get_msg_queue_request( const struct get_msg_queue_request *req )
{
}

2742
static void dump_get_msg_queue_reply( const struct get_msg_queue_reply *req )
2743
{
2744
    fprintf( stderr, " handle=%04x", req->handle );
2745 2746
}

2747 2748
static void dump_set_queue_fd_request( const struct set_queue_fd_request *req )
{
2749
    fprintf( stderr, " handle=%04x", req->handle );
2750 2751
}

2752 2753
static void dump_set_queue_mask_request( const struct set_queue_mask_request *req )
{
2754 2755 2756
    fprintf( stderr, " wake_mask=%08x", req->wake_mask );
    fprintf( stderr, ", changed_mask=%08x", req->changed_mask );
    fprintf( stderr, ", skip_wait=%d", req->skip_wait );
2757 2758
}

2759
static void dump_set_queue_mask_reply( const struct set_queue_mask_reply *req )
2760
{
2761 2762
    fprintf( stderr, " wake_bits=%08x", req->wake_bits );
    fprintf( stderr, ", changed_bits=%08x", req->changed_bits );
2763 2764 2765 2766
}

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

2770
static void dump_get_queue_status_reply( const struct get_queue_status_reply *req )
2771
{
2772 2773
    fprintf( stderr, " wake_bits=%08x", req->wake_bits );
    fprintf( stderr, ", changed_bits=%08x", req->changed_bits );
2774 2775
}

2776
static void dump_get_process_idle_event_request( const struct get_process_idle_event_request *req )
2777
{
2778
    fprintf( stderr, " handle=%04x", req->handle );
2779 2780
}

2781
static void dump_get_process_idle_event_reply( const struct get_process_idle_event_reply *req )
2782
{
2783
    fprintf( stderr, " event=%04x", req->event );
2784 2785
}

2786 2787
static void dump_send_message_request( const struct send_message_request *req )
{
2788 2789 2790 2791 2792 2793 2794 2795 2796
    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 );
2797 2798
}

2799 2800 2801 2802 2803
static void dump_post_quit_message_request( const struct post_quit_message_request *req )
{
    fprintf( stderr, " exit_code=%d", req->exit_code );
}

2804 2805
static void dump_send_hardware_message_request( const struct send_hardware_message_request *req )
{
2806
    fprintf( stderr, " win=%08x", req->win );
2807 2808
    dump_hw_input( ", input=", &req->input );
    fprintf( stderr, ", flags=%08x", req->flags );
2809 2810 2811 2812 2813
}

static void dump_send_hardware_message_reply( const struct send_hardware_message_reply *req )
{
    fprintf( stderr, " wait=%d", req->wait );
2814 2815 2816 2817
    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 );
2818
    dump_varargs_bytes( ", keystate=", cur_size );
2819 2820
}

2821 2822
static void dump_get_message_request( const struct get_message_request *req )
{
2823 2824 2825 2826 2827 2828 2829
    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 );
2830 2831
}

2832
static void dump_get_message_reply( const struct get_message_reply *req )
2833
{
2834 2835 2836 2837 2838
    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 );
2839 2840
    fprintf( stderr, ", x=%d", req->x );
    fprintf( stderr, ", y=%d", req->y );
2841 2842 2843 2844
    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 );
2845 2846 2847 2848
}

static void dump_reply_message_request( const struct reply_message_request *req )
{
2849 2850 2851
    fprintf( stderr, " remove=%d", req->remove );
    dump_uint64( ", result=", &req->result );
    dump_varargs_bytes( ", data=", cur_size );
2852 2853
}

2854 2855
static void dump_accept_hardware_message_request( const struct accept_hardware_message_request *req )
{
2856 2857
    fprintf( stderr, " hw_id=%08x", req->hw_id );
    fprintf( stderr, ", remove=%d", req->remove );
2858 2859
}

2860 2861 2862 2863 2864
static void dump_get_message_reply_request( const struct get_message_reply_request *req )
{
    fprintf( stderr, " cancel=%d", req->cancel );
}

2865
static void dump_get_message_reply_reply( const struct get_message_reply_reply *req )
2866
{
2867 2868
    dump_uint64( " result=", &req->result );
    dump_varargs_bytes( ", data=", cur_size );
2869 2870 2871 2872
}

static void dump_set_win_timer_request( const struct set_win_timer_request *req )
{
2873 2874 2875 2876 2877
    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 );
2878 2879
}

2880 2881
static void dump_set_win_timer_reply( const struct set_win_timer_reply *req )
{
2882
    dump_uint64( " id=", &req->id );
2883 2884
}

2885 2886
static void dump_kill_win_timer_request( const struct kill_win_timer_request *req )
{
2887 2888 2889
    fprintf( stderr, " win=%08x", req->win );
    dump_uint64( ", id=", &req->id );
    fprintf( stderr, ", msg=%08x", req->msg );
2890 2891
}

2892 2893
static void dump_is_window_hung_request( const struct is_window_hung_request *req )
{
2894
    fprintf( stderr, " win=%08x", req->win );
2895 2896 2897 2898 2899 2900 2901
}

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

2902 2903
static void dump_get_serial_info_request( const struct get_serial_info_request *req )
{
2904
    fprintf( stderr, " handle=%04x", req->handle );
2905
    fprintf( stderr, ", flags=%d", req->flags );
2906 2907
}

2908
static void dump_get_serial_info_reply( const struct get_serial_info_reply *req )
2909
{
2910
    fprintf( stderr, " eventmask=%08x", req->eventmask );
2911
    fprintf( stderr, ", cookie=%08x", req->cookie );
2912
    fprintf( stderr, ", pending_write=%08x", req->pending_write );
2913 2914 2915 2916
}

static void dump_set_serial_info_request( const struct set_serial_info_request *req )
{
2917 2918
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", flags=%d", req->flags );
2919 2920
}

2921
static void dump_register_async_request( const struct register_async_request *req )
2922
{
2923 2924 2925
    fprintf( stderr, " type=%d", req->type );
    dump_async_data( ", async=", &req->async );
    fprintf( stderr, ", count=%d", req->count );
2926 2927 2928 2929
}

static void dump_cancel_async_request( const struct cancel_async_request *req )
{
2930
    fprintf( stderr, " handle=%04x", req->handle );
2931 2932
    dump_uint64( ", iosb=", &req->iosb );
    fprintf( stderr, ", only_thread=%d", req->only_thread );
2933 2934
}

2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945
static void dump_get_async_result_request( const struct get_async_result_request *req )
{
    dump_uint64( " user_arg=", &req->user_arg );
}

static void dump_get_async_result_reply( const struct get_async_result_reply *req )
{
    fprintf( stderr, " size=%u", req->size );
    dump_varargs_bytes( ", out_data=", cur_size );
}

2946 2947
static void dump_read_request( const struct read_request *req )
{
2948
    dump_async_data( " async=", &req->async );
2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960
    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 )
{
2961
    dump_async_data( " async=", &req->async );
2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972
    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 );
}

2973 2974
static void dump_ioctl_request( const struct ioctl_request *req )
{
2975 2976 2977
    dump_ioctl_code( " code=", &req->code );
    dump_async_data( ", async=", &req->async );
    dump_varargs_bytes( ", in_data=", cur_size );
2978 2979 2980 2981
}

static void dump_ioctl_reply( const struct ioctl_reply *req )
{
2982 2983 2984
    fprintf( stderr, " wait=%04x", req->wait );
    fprintf( stderr, ", options=%08x", req->options );
    dump_varargs_bytes( ", out_data=", cur_size );
2985 2986
}

2987
static void dump_set_irp_result_request( const struct set_irp_result_request *req )
2988
{
2989
    fprintf( stderr, " handle=%04x", req->handle );
2990
    fprintf( stderr, ", status=%08x", req->status );
2991
    fprintf( stderr, ", size=%u", req->size );
2992
    dump_uint64( ", file_ptr=", &req->file_ptr );
2993 2994 2995
    dump_varargs_bytes( ", data=", cur_size );
}

2996 2997
static void dump_create_named_pipe_request( const struct create_named_pipe_request *req )
{
2998 2999
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", options=%08x", req->options );
3000
    fprintf( stderr, ", sharing=%08x", req->sharing );
3001 3002 3003 3004 3005
    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 );
3006
    dump_varargs_object_attributes( ", objattr=", cur_size );
3007 3008
}

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

3014 3015
static void dump_get_named_pipe_info_request( const struct get_named_pipe_info_request *req )
{
3016
    fprintf( stderr, " handle=%04x", req->handle );
3017 3018
}

3019
static void dump_get_named_pipe_info_reply( const struct get_named_pipe_info_reply *req )
3020
{
3021
    fprintf( stderr, " flags=%08x", req->flags );
3022
    fprintf( stderr, ", sharing=%08x", req->sharing );
3023 3024 3025 3026
    fprintf( stderr, ", maxinstances=%08x", req->maxinstances );
    fprintf( stderr, ", instances=%08x", req->instances );
    fprintf( stderr, ", outsize=%08x", req->outsize );
    fprintf( stderr, ", insize=%08x", req->insize );
3027 3028
}

3029 3030 3031 3032 3033 3034
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 );
}

3035 3036
static void dump_create_window_request( const struct create_window_request *req )
{
3037 3038 3039 3040 3041
    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 );
3042 3043
}

3044
static void dump_create_window_reply( const struct create_window_reply *req )
3045
{
3046 3047 3048 3049 3050
    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 );
3051 3052 3053 3054
}

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

3058 3059
static void dump_get_desktop_window_request( const struct get_desktop_window_request *req )
{
3060
    fprintf( stderr, " force=%d", req->force );
3061 3062 3063 3064
}

static void dump_get_desktop_window_reply( const struct get_desktop_window_reply *req )
{
3065 3066
    fprintf( stderr, " top_window=%08x", req->top_window );
    fprintf( stderr, ", msg_window=%08x", req->msg_window );
3067 3068
}

3069 3070
static void dump_set_window_owner_request( const struct set_window_owner_request *req )
{
3071 3072
    fprintf( stderr, " handle=%08x", req->handle );
    fprintf( stderr, ", owner=%08x", req->owner );
3073 3074
}

3075
static void dump_set_window_owner_reply( const struct set_window_owner_reply *req )
3076
{
3077 3078
    fprintf( stderr, " full_owner=%08x", req->full_owner );
    fprintf( stderr, ", prev_owner=%08x", req->prev_owner );
3079 3080
}

3081 3082
static void dump_get_window_info_request( const struct get_window_info_request *req )
{
3083
    fprintf( stderr, " handle=%08x", req->handle );
3084 3085
}

3086
static void dump_get_window_info_reply( const struct get_window_info_reply *req )
3087
{
3088 3089 3090 3091 3092 3093
    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 );
3094 3095 3096 3097
}

static void dump_set_window_info_request( const struct set_window_info_request *req )
{
3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108
    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 );
3109 3110
}

3111
static void dump_set_window_info_reply( const struct set_window_info_reply *req )
3112
{
3113 3114 3115 3116 3117 3118
    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 );
3119 3120
}

3121 3122
static void dump_set_parent_request( const struct set_parent_request *req )
{
3123 3124
    fprintf( stderr, " handle=%08x", req->handle );
    fprintf( stderr, ", parent=%08x", req->parent );
3125 3126 3127 3128
}

static void dump_set_parent_reply( const struct set_parent_reply *req )
{
3129 3130
    fprintf( stderr, " old_parent=%08x", req->old_parent );
    fprintf( stderr, ", full_parent=%08x", req->full_parent );
3131 3132
}

3133 3134
static void dump_get_window_parents_request( const struct get_window_parents_request *req )
{
3135
    fprintf( stderr, " handle=%08x", req->handle );
3136 3137
}

3138
static void dump_get_window_parents_reply( const struct get_window_parents_reply *req )
3139
{
3140 3141
    fprintf( stderr, " count=%d", req->count );
    dump_varargs_user_handles( ", parents=", cur_size );
3142 3143 3144 3145
}

static void dump_get_window_children_request( const struct get_window_children_request *req )
{
3146 3147 3148 3149 3150
    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 );
3151 3152
}

3153
static void dump_get_window_children_reply( const struct get_window_children_reply *req )
3154
{
3155 3156
    fprintf( stderr, " count=%d", req->count );
    dump_varargs_user_handles( ", children=", cur_size );
3157 3158
}

3159 3160
static void dump_get_window_children_from_point_request( const struct get_window_children_from_point_request *req )
{
3161 3162 3163
    fprintf( stderr, " parent=%08x", req->parent );
    fprintf( stderr, ", x=%d", req->x );
    fprintf( stderr, ", y=%d", req->y );
3164 3165 3166 3167
}

static void dump_get_window_children_from_point_reply( const struct get_window_children_from_point_reply *req )
{
3168 3169
    fprintf( stderr, " count=%d", req->count );
    dump_varargs_user_handles( ", children=", cur_size );
3170 3171
}

3172 3173
static void dump_get_window_tree_request( const struct get_window_tree_request *req )
{
3174
    fprintf( stderr, " handle=%08x", req->handle );
3175 3176
}

3177
static void dump_get_window_tree_reply( const struct get_window_tree_reply *req )
3178
{
3179 3180 3181 3182 3183 3184 3185 3186
    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 );
3187 3188
}

3189
static void dump_set_window_pos_request( const struct set_window_pos_request *req )
3190
{
3191 3192
    fprintf( stderr, " swp_flags=%04x", req->swp_flags );
    fprintf( stderr, ", paint_flags=%04x", req->paint_flags );
3193 3194 3195 3196 3197
    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 );
3198 3199
}

3200 3201
static void dump_set_window_pos_reply( const struct set_window_pos_reply *req )
{
3202 3203
    fprintf( stderr, " new_style=%08x", req->new_style );
    fprintf( stderr, ", new_ex_style=%08x", req->new_ex_style );
3204
    fprintf( stderr, ", surface_win=%08x", req->surface_win );
3205
    fprintf( stderr, ", needs_update=%d", req->needs_update );
3206 3207
}

3208 3209
static void dump_get_window_rectangles_request( const struct get_window_rectangles_request *req )
{
3210
    fprintf( stderr, " handle=%08x", req->handle );
3211
    fprintf( stderr, ", relative=%d", req->relative );
3212 3213
}

3214
static void dump_get_window_rectangles_reply( const struct get_window_rectangles_reply *req )
3215
{
3216 3217 3218
    dump_rectangle( " window=", &req->window );
    dump_rectangle( ", visible=", &req->visible );
    dump_rectangle( ", client=", &req->client );
3219 3220
}

3221 3222
static void dump_get_window_text_request( const struct get_window_text_request *req )
{
3223
    fprintf( stderr, " handle=%08x", req->handle );
3224 3225
}

3226
static void dump_get_window_text_reply( const struct get_window_text_reply *req )
3227
{
3228
    dump_varargs_unicode_str( " text=", cur_size );
3229 3230 3231 3232
}

static void dump_set_window_text_request( const struct set_window_text_request *req )
{
3233 3234
    fprintf( stderr, " handle=%08x", req->handle );
    dump_varargs_unicode_str( ", text=", cur_size );
3235 3236
}

3237 3238
static void dump_get_windows_offset_request( const struct get_windows_offset_request *req )
{
3239 3240
    fprintf( stderr, " from=%08x", req->from );
    fprintf( stderr, ", to=%08x", req->to );
3241 3242
}

3243
static void dump_get_windows_offset_reply( const struct get_windows_offset_reply *req )
3244
{
3245 3246
    fprintf( stderr, " x=%d", req->x );
    fprintf( stderr, ", y=%d", req->y );
3247
    fprintf( stderr, ", mirror=%d", req->mirror );
3248 3249
}

3250 3251
static void dump_get_visible_region_request( const struct get_visible_region_request *req )
{
3252 3253
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", flags=%08x", req->flags );
3254 3255 3256 3257
}

static void dump_get_visible_region_reply( const struct get_visible_region_reply *req )
{
3258 3259 3260
    fprintf( stderr, " top_win=%08x", req->top_win );
    dump_rectangle( ", top_rect=", &req->top_rect );
    dump_rectangle( ", win_rect=", &req->win_rect );
3261
    fprintf( stderr, ", paint_flags=%08x", req->paint_flags );
3262 3263
    fprintf( stderr, ", total_size=%u", req->total_size );
    dump_varargs_rectangles( ", region=", cur_size );
3264 3265
}

3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277
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 );
}

3278 3279
static void dump_get_window_region_request( const struct get_window_region_request *req )
{
3280
    fprintf( stderr, " window=%08x", req->window );
3281 3282 3283 3284
}

static void dump_get_window_region_reply( const struct get_window_region_reply *req )
{
3285 3286
    fprintf( stderr, " total_size=%u", req->total_size );
    dump_varargs_rectangles( ", region=", cur_size );
3287 3288 3289 3290
}

static void dump_set_window_region_request( const struct set_window_region_request *req )
{
3291 3292 3293
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", redraw=%d", req->redraw );
    dump_varargs_rectangles( ", region=", cur_size );
3294 3295
}

3296 3297
static void dump_get_update_region_request( const struct get_update_region_request *req )
{
3298 3299 3300
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", from_child=%08x", req->from_child );
    fprintf( stderr, ", flags=%08x", req->flags );
3301 3302 3303 3304
}

static void dump_get_update_region_reply( const struct get_update_region_reply *req )
{
3305 3306 3307 3308
    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 );
3309 3310
}

3311 3312
static void dump_update_window_zorder_request( const struct update_window_zorder_request *req )
{
3313 3314
    fprintf( stderr, " window=%08x", req->window );
    dump_rectangle( ", rect=", &req->rect );
3315 3316
}

3317 3318
static void dump_redraw_window_request( const struct redraw_window_request *req )
{
3319 3320 3321
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", flags=%08x", req->flags );
    dump_varargs_rectangles( ", region=", cur_size );
3322 3323
}

3324 3325
static void dump_set_window_property_request( const struct set_window_property_request *req )
{
3326 3327 3328 3329
    fprintf( stderr, " window=%08x", req->window );
    dump_uint64( ", data=", &req->data );
    fprintf( stderr, ", atom=%04x", req->atom );
    dump_varargs_unicode_str( ", name=", cur_size );
3330 3331 3332 3333
}

static void dump_remove_window_property_request( const struct remove_window_property_request *req )
{
3334 3335 3336
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", atom=%04x", req->atom );
    dump_varargs_unicode_str( ", name=", cur_size );
3337 3338
}

3339
static void dump_remove_window_property_reply( const struct remove_window_property_reply *req )
3340
{
3341
    dump_uint64( " data=", &req->data );
3342 3343 3344 3345
}

static void dump_get_window_property_request( const struct get_window_property_request *req )
{
3346 3347 3348
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", atom=%04x", req->atom );
    dump_varargs_unicode_str( ", name=", cur_size );
3349 3350
}

3351
static void dump_get_window_property_reply( const struct get_window_property_reply *req )
3352
{
3353
    dump_uint64( " data=", &req->data );
3354 3355 3356 3357
}

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

3361
static void dump_get_window_properties_reply( const struct get_window_properties_reply *req )
3362
{
3363 3364
    fprintf( stderr, " total=%d", req->total );
    dump_varargs_properties( ", props=", cur_size );
3365 3366
}

3367 3368
static void dump_create_winstation_request( const struct create_winstation_request *req )
{
3369 3370 3371
    fprintf( stderr, " flags=%08x", req->flags );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
3372
    fprintf( stderr, ", rootdir=%04x", req->rootdir );
3373
    dump_varargs_unicode_str( ", name=", cur_size );
3374 3375 3376 3377
}

static void dump_create_winstation_reply( const struct create_winstation_reply *req )
{
3378
    fprintf( stderr, " handle=%04x", req->handle );
3379 3380 3381 3382
}

static void dump_open_winstation_request( const struct open_winstation_request *req )
{
3383 3384
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
3385
    fprintf( stderr, ", rootdir=%04x", req->rootdir );
3386
    dump_varargs_unicode_str( ", name=", cur_size );
3387 3388 3389 3390
}

static void dump_open_winstation_reply( const struct open_winstation_reply *req )
{
3391
    fprintf( stderr, " handle=%04x", req->handle );
3392 3393 3394 3395
}

static void dump_close_winstation_request( const struct close_winstation_request *req )
{
3396
    fprintf( stderr, " handle=%04x", req->handle );
3397 3398 3399 3400 3401 3402 3403 3404
}

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 )
{
3405
    fprintf( stderr, " handle=%04x", req->handle );
3406 3407 3408 3409
}

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

3413 3414 3415 3416 3417 3418 3419
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 )
{
3420 3421
    fprintf( stderr, " next=%08x", req->next );
    dump_varargs_unicode_str( ", name=", cur_size );
3422 3423
}

3424 3425
static void dump_create_desktop_request( const struct create_desktop_request *req )
{
3426 3427 3428 3429
    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 );
3430 3431 3432 3433
}

static void dump_create_desktop_reply( const struct create_desktop_reply *req )
{
3434
    fprintf( stderr, " handle=%04x", req->handle );
3435 3436 3437 3438
}

static void dump_open_desktop_request( const struct open_desktop_request *req )
{
3439 3440 3441 3442 3443
    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 );
3444 3445 3446 3447
}

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

3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462
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 );
}

3463 3464
static void dump_close_desktop_request( const struct close_desktop_request *req )
{
3465
    fprintf( stderr, " handle=%04x", req->handle );
3466 3467 3468 3469 3470 3471 3472 3473 3474
}

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 )
{
3475
    fprintf( stderr, " handle=%04x", req->handle );
3476 3477 3478 3479
}

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

3483 3484
static void dump_enum_desktop_request( const struct enum_desktop_request *req )
{
3485 3486
    fprintf( stderr, " winstation=%04x", req->winstation );
    fprintf( stderr, ", index=%08x", req->index );
3487 3488 3489 3490
}

static void dump_enum_desktop_reply( const struct enum_desktop_reply *req )
{
3491 3492
    fprintf( stderr, " next=%08x", req->next );
    dump_varargs_unicode_str( ", name=", cur_size );
3493 3494
}

3495 3496
static void dump_set_user_object_info_request( const struct set_user_object_info_request *req )
{
3497 3498 3499
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", flags=%08x", req->flags );
    fprintf( stderr, ", obj_flags=%08x", req->obj_flags );
3500 3501 3502 3503
}

static void dump_set_user_object_info_reply( const struct set_user_object_info_reply *req )
{
3504 3505 3506
    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 );
3507 3508
}

3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535
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 );
}

3536 3537
static void dump_attach_thread_input_request( const struct attach_thread_input_request *req )
{
3538 3539 3540
    fprintf( stderr, " tid_from=%04x", req->tid_from );
    fprintf( stderr, ", tid_to=%04x", req->tid_to );
    fprintf( stderr, ", attach=%d", req->attach );
3541 3542 3543 3544
}

static void dump_get_thread_input_request( const struct get_thread_input_request *req )
{
3545
    fprintf( stderr, " tid=%04x", req->tid );
3546 3547 3548 3549
}

static void dump_get_thread_input_reply( const struct get_thread_input_reply *req )
{
3550 3551 3552 3553 3554 3555 3556
    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 );
3557 3558
    fprintf( stderr, ", cursor=%08x", req->cursor );
    fprintf( stderr, ", show_count=%d", req->show_count );
3559
    dump_rectangle( ", rect=", &req->rect );
3560 3561
}

3562 3563 3564 3565 3566 3567 3568 3569 3570
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 );
}

3571 3572
static void dump_get_key_state_request( const struct get_key_state_request *req )
{
3573 3574
    fprintf( stderr, " tid=%04x", req->tid );
    fprintf( stderr, ", key=%d", req->key );
3575 3576 3577 3578
}

static void dump_get_key_state_reply( const struct get_key_state_reply *req )
{
3579 3580
    fprintf( stderr, " state=%02x", req->state );
    dump_varargs_bytes( ", keystate=", cur_size );
3581 3582 3583 3584
}

static void dump_set_key_state_request( const struct set_key_state_request *req )
{
3585
    fprintf( stderr, " tid=%04x", req->tid );
3586
    fprintf( stderr, ", async=%d", req->async );
3587
    dump_varargs_bytes( ", keystate=", cur_size );
3588 3589
}

3590 3591
static void dump_set_foreground_window_request( const struct set_foreground_window_request *req )
{
3592
    fprintf( stderr, " handle=%08x", req->handle );
3593 3594 3595 3596
}

static void dump_set_foreground_window_reply( const struct set_foreground_window_reply *req )
{
3597 3598 3599
    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 );
3600 3601 3602 3603
}

static void dump_set_focus_window_request( const struct set_focus_window_request *req )
{
3604
    fprintf( stderr, " handle=%08x", req->handle );
3605 3606 3607 3608
}

static void dump_set_focus_window_reply( const struct set_focus_window_reply *req )
{
3609
    fprintf( stderr, " previous=%08x", req->previous );
3610 3611 3612 3613
}

static void dump_set_active_window_request( const struct set_active_window_request *req )
{
3614
    fprintf( stderr, " handle=%08x", req->handle );
3615 3616 3617 3618
}

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

3622 3623
static void dump_set_capture_window_request( const struct set_capture_window_request *req )
{
3624 3625
    fprintf( stderr, " handle=%08x", req->handle );
    fprintf( stderr, ", flags=%08x", req->flags );
3626 3627 3628 3629
}

static void dump_set_capture_window_reply( const struct set_capture_window_reply *req )
{
3630 3631
    fprintf( stderr, " previous=%08x", req->previous );
    fprintf( stderr, ", full_handle=%08x", req->full_handle );
3632 3633
}

3634 3635
static void dump_set_caret_window_request( const struct set_caret_window_request *req )
{
3636 3637 3638
    fprintf( stderr, " handle=%08x", req->handle );
    fprintf( stderr, ", width=%d", req->width );
    fprintf( stderr, ", height=%d", req->height );
3639 3640 3641 3642
}

static void dump_set_caret_window_reply( const struct set_caret_window_reply *req )
{
3643 3644 3645 3646
    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 );
3647 3648 3649 3650
}

static void dump_set_caret_info_request( const struct set_caret_info_request *req )
{
3651 3652 3653 3654 3655 3656
    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 );
3657 3658 3659 3660
}

static void dump_set_caret_info_reply( const struct set_caret_info_reply *req )
{
3661 3662 3663 3664
    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 );
3665 3666
}

3667 3668
static void dump_set_hook_request( const struct set_hook_request *req )
{
3669 3670 3671 3672 3673 3674 3675 3676 3677
    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 );
3678 3679 3680 3681
}

static void dump_set_hook_reply( const struct set_hook_reply *req )
{
3682 3683
    fprintf( stderr, " handle=%08x", req->handle );
    fprintf( stderr, ", active_hooks=%08x", req->active_hooks );
3684 3685 3686 3687
}

static void dump_remove_hook_request( const struct remove_hook_request *req )
{
3688 3689 3690
    fprintf( stderr, " handle=%08x", req->handle );
    dump_uint64( ", proc=", &req->proc );
    fprintf( stderr, ", id=%d", req->id );
3691 3692
}

3693 3694 3695 3696 3697
static void dump_remove_hook_reply( const struct remove_hook_reply *req )
{
    fprintf( stderr, " active_hooks=%08x", req->active_hooks );
}

3698 3699
static void dump_start_hook_chain_request( const struct start_hook_chain_request *req )
{
3700 3701 3702 3703 3704
    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 );
3705 3706 3707 3708
}

static void dump_start_hook_chain_reply( const struct start_hook_chain_reply *req )
{
3709 3710 3711 3712 3713 3714 3715
    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 );
3716 3717 3718 3719 3720 3721 3722
}

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

3723
static void dump_get_hook_info_request( const struct get_hook_info_request *req )
3724
{
3725 3726 3727 3728 3729 3730
    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 );
3731 3732
}

3733
static void dump_get_hook_info_reply( const struct get_hook_info_reply *req )
3734
{
3735 3736 3737 3738 3739 3740 3741
    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 );
3742 3743
}

3744 3745
static void dump_create_class_request( const struct create_class_request *req )
{
3746 3747 3748 3749 3750 3751 3752 3753
    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 );
3754 3755 3756 3757 3758
}

static void dump_create_class_reply( const struct create_class_reply *req )
{
    fprintf( stderr, " atom=%04x", req->atom );
3759 3760 3761 3762
}

static void dump_destroy_class_request( const struct destroy_class_request *req )
{
3763 3764 3765
    fprintf( stderr, " atom=%04x", req->atom );
    dump_uint64( ", instance=", &req->instance );
    dump_varargs_unicode_str( ", name=", cur_size );
3766 3767
}

3768 3769
static void dump_destroy_class_reply( const struct destroy_class_reply *req )
{
3770
    dump_uint64( " client_ptr=", &req->client_ptr );
3771 3772
}

3773 3774
static void dump_set_class_info_request( const struct set_class_info_request *req )
{
3775 3776 3777 3778 3779 3780 3781 3782 3783
    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 );
3784 3785 3786 3787
}

static void dump_set_class_info_reply( const struct set_class_info_reply *req )
{
3788 3789 3790 3791 3792 3793
    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 );
3794 3795
}

3796 3797 3798 3799 3800 3801 3802
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 )
{
3803
    fprintf( stderr, " owner=%08x", req->owner );
3804 3805 3806 3807 3808 3809 3810 3811 3812
}

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 );
3813
    fprintf( stderr, ", owner=%08x", req->owner );
3814 3815
}

3816 3817 3818 3819
static void dump_empty_clipboard_request( const struct empty_clipboard_request *req )
{
}

3820 3821 3822
static void dump_set_clipboard_data_request( const struct set_clipboard_data_request *req )
{
    fprintf( stderr, " format=%08x", req->format );
3823
    fprintf( stderr, ", lcid=%08x", req->lcid );
3824 3825 3826
    dump_varargs_bytes( ", data=", cur_size );
}

3827 3828 3829 3830 3831
static void dump_set_clipboard_data_reply( const struct set_clipboard_data_reply *req )
{
    fprintf( stderr, " seqno=%08x", req->seqno );
}

3832 3833 3834
static void dump_get_clipboard_data_request( const struct get_clipboard_data_request *req )
{
    fprintf( stderr, " format=%08x", req->format );
3835
    fprintf( stderr, ", render=%d", req->render );
3836 3837
    fprintf( stderr, ", cached=%d", req->cached );
    fprintf( stderr, ", seqno=%08x", req->seqno );
3838 3839 3840 3841
}

static void dump_get_clipboard_data_reply( const struct get_clipboard_data_reply *req )
{
3842 3843
    fprintf( stderr, " from=%08x", req->from );
    fprintf( stderr, ", owner=%08x", req->owner );
3844
    fprintf( stderr, ", seqno=%08x", req->seqno );
3845 3846 3847 3848
    fprintf( stderr, ", total=%u", req->total );
    dump_varargs_bytes( ", data=", cur_size );
}

3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869
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 );
}

3870 3871 3872 3873 3874 3875 3876 3877
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 );
3878
    fprintf( stderr, ", owner=%08x", req->owner );
3879 3880
}

3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892
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 );
}

3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904
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 );
}

3905 3906 3907 3908 3909 3910 3911 3912 3913 3914
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 );
}

3915 3916
static void dump_open_token_request( const struct open_token_request *req )
{
3917 3918 3919 3920
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", flags=%08x", req->flags );
3921 3922 3923 3924
}

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

3928 3929
static void dump_set_global_windows_request( const struct set_global_windows_request *req )
{
3930 3931 3932 3933 3934
    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 );
3935 3936 3937 3938
}

static void dump_set_global_windows_reply( const struct set_global_windows_reply *req )
{
3939 3940 3941 3942
    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 );
3943 3944
}

3945 3946
static void dump_adjust_token_privileges_request( const struct adjust_token_privileges_request *req )
{
3947 3948 3949 3950
    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 );
3951 3952 3953 3954
}

static void dump_adjust_token_privileges_reply( const struct adjust_token_privileges_reply *req )
{
3955 3956
    fprintf( stderr, " len=%08x", req->len );
    dump_varargs_LUID_AND_ATTRIBUTES( ", privileges=", cur_size );
3957 3958 3959 3960
}

static void dump_get_token_privileges_request( const struct get_token_privileges_request *req )
{
3961
    fprintf( stderr, " handle=%04x", req->handle );
3962 3963 3964 3965
}

static void dump_get_token_privileges_reply( const struct get_token_privileges_reply *req )
{
3966 3967
    fprintf( stderr, " len=%08x", req->len );
    dump_varargs_LUID_AND_ATTRIBUTES( ", privileges=", cur_size );
3968 3969
}

3970 3971
static void dump_check_token_privileges_request( const struct check_token_privileges_request *req )
{
3972 3973 3974
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", all_required=%d", req->all_required );
    dump_varargs_LUID_AND_ATTRIBUTES( ", privileges=", cur_size );
3975 3976 3977 3978
}

static void dump_check_token_privileges_reply( const struct check_token_privileges_reply *req )
{
3979 3980
    fprintf( stderr, " has_privileges=%d", req->has_privileges );
    dump_varargs_LUID_AND_ATTRIBUTES( ", privileges=", cur_size );
3981 3982
}

3983 3984
static void dump_duplicate_token_request( const struct duplicate_token_request *req )
{
3985 3986 3987 3988
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", primary=%d", req->primary );
    fprintf( stderr, ", impersonation_level=%d", req->impersonation_level );
3989
    dump_varargs_object_attributes( ", objattr=", cur_size );
3990 3991 3992 3993
}

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

3997 3998
static void dump_access_check_request( const struct access_check_request *req )
{
3999 4000 4001 4002 4003 4004 4005
    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 );
4006 4007 4008 4009
}

static void dump_access_check_reply( const struct access_check_reply *req )
{
4010 4011 4012 4013
    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 );
4014 4015
}

4016
static void dump_get_token_sid_request( const struct get_token_sid_request *req )
4017
{
4018
    fprintf( stderr, " handle=%04x", req->handle );
4019
    fprintf( stderr, ", which_sid=%08x", req->which_sid );
4020 4021
}

4022
static void dump_get_token_sid_reply( const struct get_token_sid_reply *req )
4023
{
4024 4025
    fprintf( stderr, " sid_len=%u", req->sid_len );
    dump_varargs_SID( ", sid=", cur_size );
4026 4027
}

4028 4029
static void dump_get_token_groups_request( const struct get_token_groups_request *req )
{
4030
    fprintf( stderr, " handle=%04x", req->handle );
4031 4032 4033 4034
}

static void dump_get_token_groups_reply( const struct get_token_groups_reply *req )
{
4035 4036
    fprintf( stderr, " user_len=%u", req->user_len );
    dump_varargs_token_groups( ", user=", cur_size );
4037 4038
}

4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055
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 );
}

4056 4057
static void dump_set_security_object_request( const struct set_security_object_request *req )
{
4058 4059 4060
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", security_info=%08x", req->security_info );
    dump_varargs_security_descriptor( ", sd=", cur_size );
4061 4062
}

4063 4064
static void dump_get_security_object_request( const struct get_security_object_request *req )
{
4065 4066
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", security_info=%08x", req->security_info );
4067 4068 4069 4070
}

static void dump_get_security_object_reply( const struct get_security_object_reply *req )
{
4071 4072
    fprintf( stderr, " sd_len=%08x", req->sd_len );
    dump_varargs_security_descriptor( ", sd=", cur_size );
4073 4074
}

4075 4076 4077 4078 4079 4080 4081 4082 4083 4084
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
4085 4086
static void dump_create_mailslot_request( const struct create_mailslot_request *req )
{
4087 4088 4089
    fprintf( stderr, " access=%08x", req->access );
    dump_timeout( ", read_timeout=", &req->read_timeout );
    fprintf( stderr, ", max_msgsize=%08x", req->max_msgsize );
4090
    dump_varargs_object_attributes( ", objattr=", cur_size );
Mike McCormack's avatar
Mike McCormack committed
4091 4092 4093 4094
}

static void dump_create_mailslot_reply( const struct create_mailslot_reply *req )
{
4095
    fprintf( stderr, " handle=%04x", req->handle );
Mike McCormack's avatar
Mike McCormack committed
4096 4097 4098 4099
}

static void dump_set_mailslot_info_request( const struct set_mailslot_info_request *req )
{
4100 4101 4102
    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
4103 4104 4105 4106
}

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

4111 4112
static void dump_create_directory_request( const struct create_directory_request *req )
{
4113
    fprintf( stderr, " access=%08x", req->access );
4114
    dump_varargs_object_attributes( ", objattr=", cur_size );
4115 4116 4117 4118
}

static void dump_create_directory_reply( const struct create_directory_reply *req )
{
4119
    fprintf( stderr, " handle=%04x", req->handle );
4120 4121 4122 4123
}

static void dump_open_directory_request( const struct open_directory_request *req )
{
4124 4125 4126 4127
    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 );
4128 4129 4130 4131
}

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

4135 4136
static void dump_get_directory_entry_request( const struct get_directory_entry_request *req )
{
4137 4138
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", index=%08x", req->index );
4139 4140 4141 4142
}

static void dump_get_directory_entry_reply( const struct get_directory_entry_reply *req )
{
4143 4144 4145
    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 );
4146 4147
}

4148 4149
static void dump_create_symlink_request( const struct create_symlink_request *req )
{
4150
    fprintf( stderr, " access=%08x", req->access );
4151
    dump_varargs_object_attributes( ", objattr=", cur_size );
4152
    dump_varargs_unicode_str( ", target_name=", cur_size );
4153 4154 4155 4156
}

static void dump_create_symlink_reply( const struct create_symlink_reply *req )
{
4157
    fprintf( stderr, " handle=%04x", req->handle );
4158 4159 4160 4161
}

static void dump_open_symlink_request( const struct open_symlink_request *req )
{
4162 4163 4164 4165
    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 );
4166 4167 4168 4169
}

static void dump_open_symlink_reply( const struct open_symlink_reply *req )
{
4170
    fprintf( stderr, " handle=%04x", req->handle );
4171 4172 4173 4174
}

static void dump_query_symlink_request( const struct query_symlink_request *req )
{
4175
    fprintf( stderr, " handle=%04x", req->handle );
4176 4177 4178 4179
}

static void dump_query_symlink_reply( const struct query_symlink_reply *req )
{
4180 4181
    fprintf( stderr, " total=%u", req->total );
    dump_varargs_unicode_str( ", target_name=", cur_size );
4182 4183
}

4184 4185
static void dump_get_object_info_request( const struct get_object_info_request *req )
{
4186
    fprintf( stderr, " handle=%04x", req->handle );
4187 4188 4189 4190
}

static void dump_get_object_info_reply( const struct get_object_info_reply *req )
{
4191 4192
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", ref_count=%08x", req->ref_count );
4193
    fprintf( stderr, ", handle_count=%08x", req->handle_count );
4194 4195
    fprintf( stderr, ", total=%u", req->total );
    dump_varargs_unicode_str( ", name=", cur_size );
4196 4197
}

4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208
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 );
}

4209 4210
static void dump_unlink_object_request( const struct unlink_object_request *req )
{
4211
    fprintf( stderr, " handle=%04x", req->handle );
4212 4213
}

4214 4215
static void dump_get_token_impersonation_level_request( const struct get_token_impersonation_level_request *req )
{
4216
    fprintf( stderr, " handle=%04x", req->handle );
4217 4218 4219 4220 4221 4222 4223
}

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

4224 4225 4226 4227 4228 4229
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 )
{
4230
    dump_luid( " luid=", &req->luid );
4231 4232
}

4233 4234
static void dump_create_device_manager_request( const struct create_device_manager_request *req )
{
4235 4236
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
4237 4238 4239 4240
}

static void dump_create_device_manager_reply( const struct create_device_manager_reply *req )
{
4241
    fprintf( stderr, " handle=%04x", req->handle );
4242 4243 4244 4245
}

static void dump_create_device_request( const struct create_device_request *req )
{
4246 4247 4248 4249 4250 4251
    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 );
4252 4253 4254 4255
}

static void dump_create_device_reply( const struct create_device_reply *req )
{
4256
    fprintf( stderr, " handle=%04x", req->handle );
4257 4258 4259 4260
}

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

4264 4265
static void dump_get_next_device_request_request( const struct get_next_device_request_request *req )
{
4266 4267 4268
    fprintf( stderr, " manager=%04x", req->manager );
    fprintf( stderr, ", prev=%04x", req->prev );
    fprintf( stderr, ", status=%08x", req->status );
4269 4270 4271 4272
}

static void dump_get_next_device_request_reply( const struct get_next_device_request_reply *req )
{
4273
    dump_irp_params( " params=", &req->params );
4274
    fprintf( stderr, ", next=%04x", req->next );
4275 4276
    fprintf( stderr, ", client_pid=%04x", req->client_pid );
    fprintf( stderr, ", client_tid=%04x", req->client_tid );
4277 4278 4279
    fprintf( stderr, ", in_size=%u", req->in_size );
    fprintf( stderr, ", out_size=%u", req->out_size );
    dump_varargs_bytes( ", next_data=", cur_size );
4280 4281
}

4282 4283 4284 4285 4286 4287
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 )
{
4288
    fprintf( stderr, " event=%04x", req->event );
4289 4290
}

4291 4292
static void dump_get_token_statistics_request( const struct get_token_statistics_request *req )
{
4293
    fprintf( stderr, " handle=%04x", req->handle );
4294 4295 4296 4297
}

static void dump_get_token_statistics_reply( const struct get_token_statistics_reply *req )
{
4298 4299 4300 4301 4302 4303
    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 );
4304 4305
}

4306 4307
static void dump_create_completion_request( const struct create_completion_request *req )
{
4308 4309
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", concurrent=%08x", req->concurrent );
4310
    dump_varargs_object_attributes( ", objattr=", cur_size );
4311 4312 4313 4314
}

static void dump_create_completion_reply( const struct create_completion_reply *req )
{
4315
    fprintf( stderr, " handle=%04x", req->handle );
4316 4317 4318 4319
}

static void dump_open_completion_request( const struct open_completion_request *req )
{
4320 4321 4322
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", rootdir=%04x", req->rootdir );
4323
    dump_varargs_unicode_str( ", filename=", cur_size );
4324 4325 4326 4327
}

static void dump_open_completion_reply( const struct open_completion_reply *req )
{
4328
    fprintf( stderr, " handle=%04x", req->handle );
4329 4330 4331 4332
}

static void dump_add_completion_request( const struct add_completion_request *req )
{
4333 4334 4335
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", ckey=", &req->ckey );
    dump_uint64( ", cvalue=", &req->cvalue );
4336
    dump_uint64( ", information=", &req->information );
4337
    fprintf( stderr, ", status=%08x", req->status );
4338 4339 4340 4341
}

static void dump_remove_completion_request( const struct remove_completion_request *req )
{
4342
    fprintf( stderr, " handle=%04x", req->handle );
4343 4344 4345 4346
}

static void dump_remove_completion_reply( const struct remove_completion_reply *req )
{
4347 4348
    dump_uint64( " ckey=", &req->ckey );
    dump_uint64( ", cvalue=", &req->cvalue );
4349
    dump_uint64( ", information=", &req->information );
4350
    fprintf( stderr, ", status=%08x", req->status );
4351 4352 4353 4354
}

static void dump_query_completion_request( const struct query_completion_request *req )
{
4355
    fprintf( stderr, " handle=%04x", req->handle );
4356 4357 4358 4359 4360 4361 4362
}

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

4363 4364
static void dump_set_completion_info_request( const struct set_completion_info_request *req )
{
4365 4366 4367
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", ckey=", &req->ckey );
    fprintf( stderr, ", chandle=%04x", req->chandle );
4368 4369
}

4370 4371
static void dump_add_fd_completion_request( const struct add_fd_completion_request *req )
{
4372 4373
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", cvalue=", &req->cvalue );
4374
    dump_uint64( ", information=", &req->information );
4375
    fprintf( stderr, ", status=%08x", req->status );
4376 4377
}

4378
static void dump_set_fd_disp_info_request( const struct set_fd_disp_info_request *req )
4379 4380 4381 4382 4383
{
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", unlink=%d", req->unlink );
}

4384 4385 4386 4387
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 );
4388
    fprintf( stderr, ", link=%d", req->link );
4389 4390 4391
    dump_varargs_string( ", filename=", cur_size );
}

4392 4393
static void dump_get_window_layered_info_request( const struct get_window_layered_info_request *req )
{
4394
    fprintf( stderr, " handle=%08x", req->handle );
4395 4396 4397 4398
}

static void dump_get_window_layered_info_reply( const struct get_window_layered_info_reply *req )
{
4399 4400 4401
    fprintf( stderr, " color_key=%08x", req->color_key );
    fprintf( stderr, ", alpha=%08x", req->alpha );
    fprintf( stderr, ", flags=%08x", req->flags );
4402 4403 4404 4405
}

static void dump_set_window_layered_info_request( const struct set_window_layered_info_request *req )
{
4406 4407 4408 4409
    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 );
4410 4411
}

4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425
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 );
}

4426 4427 4428 4429 4430
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 );
4431 4432
    fprintf( stderr, ", x=%d", req->x );
    fprintf( stderr, ", y=%d", req->y );
4433
    dump_rectangle( ", clip=", &req->clip );
4434
    fprintf( stderr, ", clip_msg=%08x", req->clip_msg );
4435 4436 4437 4438 4439 4440
}

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 );
4441 4442
    fprintf( stderr, ", prev_x=%d", req->prev_x );
    fprintf( stderr, ", prev_y=%d", req->prev_y );
4443 4444
    fprintf( stderr, ", new_x=%d", req->new_x );
    fprintf( stderr, ", new_y=%d", req->new_y );
4445
    dump_rectangle( ", new_clip=", &req->new_clip );
4446
    fprintf( stderr, ", last_change=%08x", req->last_change );
4447 4448
}

4449 4450 4451 4452 4453
static void dump_update_rawinput_devices_request( const struct update_rawinput_devices_request *req )
{
    dump_varargs_rawinput_devices( " devices=", cur_size );
}

4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467
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 );
}

4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478
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 );
}

4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491
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 );
}

4492 4493 4494 4495 4496 4497
static void dump_assign_job_request( const struct assign_job_request *req )
{
    fprintf( stderr, " job=%04x", req->job );
    fprintf( stderr, ", process=%04x", req->process );
}

4498 4499 4500 4501 4502 4503
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 );
}

4504 4505 4506 4507 4508 4509
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 );
}

4510 4511 4512 4513 4514 4515 4516
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 );
}

4517 4518 4519 4520 4521 4522
static void dump_terminate_job_request( const struct terminate_job_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", status=%d", req->status );
}

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

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

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

5399 5400 5401 5402 5403 5404
static const struct
{
    const char  *name;
    unsigned int value;
} status_names[] =
{
5405
    { "ABANDONED_WAIT_0",            STATUS_ABANDONED_WAIT_0 },
5406 5407
    { "ACCESS_DENIED",               STATUS_ACCESS_DENIED },
    { "ACCESS_VIOLATION",            STATUS_ACCESS_VIOLATION },
5408
    { "ADDRESS_ALREADY_ASSOCIATED",  STATUS_ADDRESS_ALREADY_ASSOCIATED },
5409
    { "ALERTED",                     STATUS_ALERTED },
5410
    { "ALIAS_EXISTS",                STATUS_ALIAS_EXISTS },
5411
    { "BAD_DEVICE_TYPE",             STATUS_BAD_DEVICE_TYPE },
5412
    { "BAD_IMPERSONATION_LEVEL",     STATUS_BAD_IMPERSONATION_LEVEL },
5413
    { "BREAKPOINT",                  STATUS_BREAKPOINT },
5414 5415
    { "BUFFER_OVERFLOW",             STATUS_BUFFER_OVERFLOW },
    { "BUFFER_TOO_SMALL",            STATUS_BUFFER_TOO_SMALL },
5416
    { "CANCELLED",                   STATUS_CANCELLED },
5417
    { "CANNOT_DELETE",               STATUS_CANNOT_DELETE },
5418
    { "CANT_OPEN_ANONYMOUS",         STATUS_CANT_OPEN_ANONYMOUS },
5419
    { "CANT_WAIT",                   STATUS_CANT_WAIT },
5420
    { "CHILD_MUST_BE_VOLATILE",      STATUS_CHILD_MUST_BE_VOLATILE },
5421 5422 5423 5424
    { "CONNECTION_ABORTED",          STATUS_CONNECTION_ABORTED },
    { "CONNECTION_DISCONNECTED",     STATUS_CONNECTION_DISCONNECTED },
    { "CONNECTION_REFUSED",          STATUS_CONNECTION_REFUSED },
    { "CONNECTION_RESET",            STATUS_CONNECTION_RESET },
5425
    { "DEBUGGER_INACTIVE",           STATUS_DEBUGGER_INACTIVE },
5426 5427 5428 5429 5430 5431 5432 5433
    { "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 },
5434 5435
    { "ERROR_HOTKEY_ALREADY_REGISTERED", 0xc0010000 | ERROR_HOTKEY_ALREADY_REGISTERED },
    { "ERROR_HOTKEY_NOT_REGISTERED", 0xc0010000 | ERROR_HOTKEY_NOT_REGISTERED },
5436
    { "ERROR_INVALID_CURSOR_HANDLE", 0xc0010000 | ERROR_INVALID_CURSOR_HANDLE },
5437
    { "ERROR_INVALID_INDEX",         0xc0010000 | ERROR_INVALID_INDEX },
5438
    { "ERROR_INVALID_WINDOW_HANDLE", 0xc0010000 | ERROR_INVALID_WINDOW_HANDLE },
5439
    { "ERROR_NO_MORE_USER_HANDLES",  0xc0010000 | ERROR_NO_MORE_USER_HANDLES },
5440
    { "ERROR_WINDOW_OF_OTHER_THREAD", 0xc0010000 | ERROR_WINDOW_OF_OTHER_THREAD },
5441
    { "FILE_DELETED",                STATUS_FILE_DELETED },
5442 5443
    { "FILE_IS_A_DIRECTORY",         STATUS_FILE_IS_A_DIRECTORY },
    { "FILE_LOCK_CONFLICT",          STATUS_FILE_LOCK_CONFLICT },
5444
    { "GENERIC_NOT_MAPPED",          STATUS_GENERIC_NOT_MAPPED },
5445
    { "HANDLES_CLOSED",              STATUS_HANDLES_CLOSED },
5446
    { "HANDLE_NOT_CLOSABLE",         STATUS_HANDLE_NOT_CLOSABLE },
5447
    { "HOST_UNREACHABLE",            STATUS_HOST_UNREACHABLE },
5448
    { "ILLEGAL_FUNCTION",            STATUS_ILLEGAL_FUNCTION },
5449
    { "INFO_LENGTH_MISMATCH",        STATUS_INFO_LENGTH_MISMATCH },
5450
    { "INSTANCE_NOT_AVAILABLE",      STATUS_INSTANCE_NOT_AVAILABLE },
5451
    { "INSUFFICIENT_RESOURCES",      STATUS_INSUFFICIENT_RESOURCES },
5452
    { "INVALID_CID",                 STATUS_INVALID_CID },
5453
    { "INVALID_DEVICE_REQUEST",      STATUS_INVALID_DEVICE_REQUEST },
5454 5455
    { "INVALID_FILE_FOR_SECTION",    STATUS_INVALID_FILE_FOR_SECTION },
    { "INVALID_HANDLE",              STATUS_INVALID_HANDLE },
5456 5457 5458 5459 5460
    { "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 },
5461
    { "INVALID_LOCK_SEQUENCE",       STATUS_INVALID_LOCK_SEQUENCE },
5462
    { "INVALID_OWNER",               STATUS_INVALID_OWNER },
5463
    { "INVALID_PARAMETER",           STATUS_INVALID_PARAMETER },
5464
    { "INVALID_SECURITY_DESCR",      STATUS_INVALID_SECURITY_DESCR },
5465 5466
    { "IO_TIMEOUT",                  STATUS_IO_TIMEOUT },
    { "KEY_DELETED",                 STATUS_KEY_DELETED },
5467
    { "MAPPED_FILE_SIZE_ZERO",       STATUS_MAPPED_FILE_SIZE_ZERO },
5468
    { "MORE_PROCESSING_REQUIRED",    STATUS_MORE_PROCESSING_REQUIRED },
5469
    { "MUTANT_NOT_OWNED",            STATUS_MUTANT_NOT_OWNED },
5470
    { "NAME_TOO_LONG",               STATUS_NAME_TOO_LONG },
5471 5472
    { "NETWORK_BUSY",                STATUS_NETWORK_BUSY },
    { "NETWORK_UNREACHABLE",         STATUS_NETWORK_UNREACHABLE },
5473 5474
    { "NOT_ALL_ASSIGNED",            STATUS_NOT_ALL_ASSIGNED },
    { "NOT_A_DIRECTORY",             STATUS_NOT_A_DIRECTORY },
5475
    { "NOT_FOUND",                   STATUS_NOT_FOUND },
5476
    { "NOT_IMPLEMENTED",             STATUS_NOT_IMPLEMENTED },
5477
    { "NOT_MAPPED_VIEW",             STATUS_NOT_MAPPED_VIEW },
5478
    { "NOT_REGISTRY_FILE",           STATUS_NOT_REGISTRY_FILE },
5479
    { "NOT_SAME_DEVICE",             STATUS_NOT_SAME_DEVICE },
5480
    { "NOT_SUPPORTED",               STATUS_NOT_SUPPORTED },
5481 5482 5483 5484 5485 5486 5487 5488 5489
    { "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 },
5490
    { "OBJECT_NAME_EXISTS",          STATUS_OBJECT_NAME_EXISTS },
5491 5492 5493
    { "OBJECT_NAME_INVALID",         STATUS_OBJECT_NAME_INVALID },
    { "OBJECT_NAME_NOT_FOUND",       STATUS_OBJECT_NAME_NOT_FOUND },
    { "OBJECT_PATH_INVALID",         STATUS_OBJECT_PATH_INVALID },
5494 5495
    { "OBJECT_PATH_NOT_FOUND",       STATUS_OBJECT_PATH_NOT_FOUND },
    { "OBJECT_PATH_SYNTAX_BAD",      STATUS_OBJECT_PATH_SYNTAX_BAD },
5496 5497
    { "OBJECT_TYPE_MISMATCH",        STATUS_OBJECT_TYPE_MISMATCH },
    { "PENDING",                     STATUS_PENDING },
5498
    { "PIPE_BROKEN",                 STATUS_PIPE_BROKEN },
5499 5500 5501 5502 5503
    { "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 },
5504
    { "PROCESS_IN_JOB",              STATUS_PROCESS_IN_JOB },
5505
    { "PROCESS_IS_TERMINATING",      STATUS_PROCESS_IS_TERMINATING },
5506
    { "PROCESS_NOT_IN_JOB",          STATUS_PROCESS_NOT_IN_JOB },
5507 5508 5509
    { "SECTION_TOO_BIG",             STATUS_SECTION_TOO_BIG },
    { "SEMAPHORE_LIMIT_EXCEEDED",    STATUS_SEMAPHORE_LIMIT_EXCEEDED },
    { "SHARING_VIOLATION",           STATUS_SHARING_VIOLATION },
5510
    { "SHUTDOWN_IN_PROGRESS",        STATUS_SHUTDOWN_IN_PROGRESS },
5511
    { "SUSPEND_COUNT_EXCEEDED",      STATUS_SUSPEND_COUNT_EXCEEDED },
5512
    { "THREAD_IS_TERMINATING",       STATUS_THREAD_IS_TERMINATING },
5513
    { "TIMEOUT",                     STATUS_TIMEOUT },
5514
    { "TOO_MANY_OPENED_FILES",       STATUS_TOO_MANY_OPENED_FILES },
5515
    { "UNSUCCESSFUL",                STATUS_UNSUCCESSFUL },
5516
    { "USER_APC",                    STATUS_USER_APC },
5517
    { "USER_MAPPED_FILE",            STATUS_USER_MAPPED_FILE },
5518
    { "VOLUME_DISMOUNTED",           STATUS_VOLUME_DISMOUNTED },
5519 5520 5521 5522
    { "WAS_LOCKED",                  STATUS_WAS_LOCKED },
    { NULL, 0 }
};

5523 5524 5525
/* ### make_requests end ### */
/* Everything above this line is generated automatically by tools/make_requests */

5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539
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;
}

5540
void trace_request(void)
Alexandre Julliard's avatar
Alexandre Julliard committed
5541
{
5542
    enum request req = current->req.request_header.req;
5543
    if (req < REQ_NB_REQUESTS)
Alexandre Julliard's avatar
Alexandre Julliard committed
5544
    {
5545
        fprintf( stderr, "%04x: %s(", current->id, req_names[req] );
5546 5547 5548 5549 5550 5551
        if (req_dumpers[req])
        {
            cur_data = get_req_data();
            cur_size = get_req_data_size();
            req_dumpers[req]( &current->req );
        }
5552
        fprintf( stderr, " )\n" );
Alexandre Julliard's avatar
Alexandre Julliard committed
5553
    }
5554
    else fprintf( stderr, "%04x: %d(?)\n", current->id, req );
Alexandre Julliard's avatar
Alexandre Julliard committed
5555 5556
}

5557
void trace_reply( enum request req, const union generic_reply *reply )
Alexandre Julliard's avatar
Alexandre Julliard committed
5558
{
5559
    if (req < REQ_NB_REQUESTS)
Alexandre Julliard's avatar
Alexandre Julliard committed
5560
    {
5561 5562
        fprintf( stderr, "%04x: %s() = %s",
                 current->id, req_names[req], get_status_name(current->error) );
5563 5564 5565
        if (reply_dumpers[req])
        {
            fprintf( stderr, " {" );
5566 5567 5568
            cur_data = current->reply_data;
            cur_size = reply->reply_header.reply_size;
            reply_dumpers[req]( reply );
5569 5570 5571
            fprintf( stderr, " }" );
        }
        fputc( '\n', stderr );
Alexandre Julliard's avatar
Alexandre Julliard committed
5572
    }
5573 5574
    else fprintf( stderr, "%04x: %d() = %s\n",
                  current->id, req, get_status_name(current->error) );
Alexandre Julliard's avatar
Alexandre Julliard committed
5575
}