trace.c 196 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 22
#include "config.h"

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

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

32 33
#include "ntstatus.h"
#define WIN32_NO_STATUS
34
#include "windef.h"
35 36
#include "winbase.h"
#include "wincon.h"
37
#include "winternl.h"
38
#include "winuser.h"
39
#include "winioctl.h"
40
#include "wine/condrv.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 "security.h"
48
#include "unicode.h"
Alexandre Julliard's avatar
Alexandre Julliard committed
49

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

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

55 56
/* utility functions */

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

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

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

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

92 93 94 95 96 97
static void dump_abstime( const char *prefix, const abstime_t *when )
{
    timeout_t timeout = abstime_to_timeout( *when );
    dump_timeout( prefix, &timeout );
}

98
static void dump_uint64( const char *prefix, const unsigned __int64 *val )
99
{
100
    if ((unsigned int)*val != *val)
101
        fprintf( stderr, "%s%x%08x", prefix, (unsigned int)(*val >> 32), (unsigned int)*val );
102
    else
103
        fprintf( stderr, "%s%08x", prefix, (unsigned int)*val );
104 105
}

106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
static void dump_uint128( const char *prefix, const unsigned __int64 val[2] )
{
    unsigned __int64 low = val[0], high = val[1];

    if ((unsigned int)high != high)
        fprintf( stderr, "%s%x%08x%08x%08x", prefix, (unsigned int)(high >> 32), (unsigned int)high,
                 (unsigned int)(low >> 32), (unsigned int)low );
    else if (high)
        fprintf( stderr, "%s%x%08x%08x", prefix, (unsigned int)high,
                 (unsigned int)(low >> 32), (unsigned int)low );
    else if ((unsigned int)low != low)
        fprintf( stderr, "%s%x%08x", prefix, (unsigned int)(low >> 32), (unsigned int)low );
    else
        fprintf( stderr, "%s%x", prefix, (unsigned int)low );
}

122
static void dump_rectangle( const char *prefix, const rectangle_t *rect )
123
{
124
    fprintf( stderr, "%s{%d,%d;%d,%d}", prefix,
125 126 127
             rect->left, rect->top, rect->right, rect->bottom );
}

128
static void dump_ioctl_code( const char *prefix, const ioctl_code_t *code )
129 130 131
{
    switch(*code)
    {
132
#define CASE(c) case c: fprintf( stderr, "%s%s", prefix, #c ); break
133
        CASE(IOCTL_CONDRV_ACTIVATE);
134
        CASE(IOCTL_CONDRV_BIND_PID);
135
        CASE(IOCTL_CONDRV_CTRL_EVENT);
136 137 138 139 140 141
        CASE(IOCTL_CONDRV_FILL_OUTPUT);
        CASE(IOCTL_CONDRV_GET_INPUT_INFO);
        CASE(IOCTL_CONDRV_GET_MODE);
        CASE(IOCTL_CONDRV_GET_OUTPUT_INFO);
        CASE(IOCTL_CONDRV_GET_TITLE);
        CASE(IOCTL_CONDRV_PEEK);
142
        CASE(IOCTL_CONDRV_READ_CONSOLE);
143
        CASE(IOCTL_CONDRV_READ_INPUT);
144
        CASE(IOCTL_CONDRV_READ_OUTPUT);
145 146
        CASE(IOCTL_CONDRV_SET_MODE);
        CASE(IOCTL_CONDRV_SET_OUTPUT_INFO);
147
        CASE(IOCTL_CONDRV_SETUP_INPUT);
148
        CASE(IOCTL_CONDRV_WRITE_CONSOLE);
149
        CASE(IOCTL_CONDRV_WRITE_INPUT);
150
        CASE(IOCTL_CONDRV_WRITE_OUTPUT);
151 152
        CASE(FSCTL_DISMOUNT_VOLUME);
        CASE(FSCTL_PIPE_DISCONNECT);
153
        CASE(FSCTL_PIPE_LISTEN);
154
        CASE(FSCTL_PIPE_PEEK);
155
        CASE(FSCTL_PIPE_WAIT);
156
        CASE(IOCTL_SERIAL_GET_TIMEOUTS);
157
        CASE(IOCTL_SERIAL_GET_WAIT_MASK);
158
        CASE(IOCTL_SERIAL_SET_TIMEOUTS);
159
        CASE(IOCTL_SERIAL_SET_WAIT_MASK);
160
        CASE(WS_SIO_ADDRESS_LIST_CHANGE);
161
        default: fprintf( stderr, "%s%08x", prefix, *code ); break;
162 163 164 165
#undef CASE
    }
}

166
static void dump_apc_call( const char *prefix, const apc_call_t *call )
167
{
168
    fprintf( stderr, "%s{", prefix );
169 170 171 172 173 174
    switch(call->type)
    {
    case APC_NONE:
        fprintf( stderr, "APC_NONE" );
        break;
    case APC_USER:
175 176 177 178
        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] );
179
        fputc( '}', stderr );
180 181
        break;
    case APC_ASYNC_IO:
182
        dump_uint64( "APC_ASYNC_IO,user=", &call->async_io.user );
183
        dump_uint64( ",sb=", &call->async_io.sb );
184
        fprintf( stderr, ",status=%s,result=%u", get_status_name(call->async_io.status), call->async_io.result );
185
        break;
186
    case APC_VIRTUAL_ALLOC:
187 188
        dump_uint64( "APC_VIRTUAL_ALLOC,addr==", &call->virtual_alloc.addr );
        dump_uint64( ",size=", &call->virtual_alloc.size );
189 190
        dump_uint64( ",zero_bits=", &call->virtual_alloc.zero_bits );
        fprintf( stderr, ",op_type=%x,prot=%x", call->virtual_alloc.op_type, call->virtual_alloc.prot );
191 192
        break;
    case APC_VIRTUAL_FREE:
193 194
        dump_uint64( "APC_VIRTUAL_FREE,addr=", &call->virtual_free.addr );
        dump_uint64( ",size=", &call->virtual_free.size );
195
        fprintf( stderr, ",op_type=%x", call->virtual_free.op_type );
196
        break;
197
    case APC_VIRTUAL_QUERY:
198
        dump_uint64( "APC_VIRTUAL_QUERY,addr=", &call->virtual_query.addr );
199
        break;
200
    case APC_VIRTUAL_PROTECT:
201 202
        dump_uint64( "APC_VIRTUAL_PROTECT,addr=", &call->virtual_protect.addr );
        dump_uint64( ",size=", &call->virtual_protect.size );
203
        fprintf( stderr, ",prot=%x", call->virtual_protect.prot );
204
        break;
205
    case APC_VIRTUAL_FLUSH:
206 207
        dump_uint64( "APC_VIRTUAL_FLUSH,addr=", &call->virtual_flush.addr );
        dump_uint64( ",size=", &call->virtual_flush.size );
208
        break;
209
    case APC_VIRTUAL_LOCK:
210 211
        dump_uint64( "APC_VIRTUAL_LOCK,addr=", &call->virtual_lock.addr );
        dump_uint64( ",size=", &call->virtual_lock.size );
212 213
        break;
    case APC_VIRTUAL_UNLOCK:
214 215
        dump_uint64( "APC_VIRTUAL_UNLOCK,addr=", &call->virtual_unlock.addr );
        dump_uint64( ",size=", &call->virtual_unlock.size );
216
        break;
217
    case APC_MAP_VIEW:
218 219 220 221
        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 );
222 223
        dump_uint64( ",zero_bits=", &call->map_view.zero_bits );
        fprintf( stderr, ",alloc_type=%x,prot=%x", call->map_view.alloc_type, call->map_view.prot );
224 225
        break;
    case APC_UNMAP_VIEW:
226
        dump_uint64( "APC_UNMAP_VIEW,addr=", &call->unmap_view.addr );
227
        break;
228
    case APC_CREATE_THREAD:
229 230
        dump_uint64( "APC_CREATE_THREAD,func=", &call->create_thread.func );
        dump_uint64( ",arg=", &call->create_thread.arg );
231
        dump_uint64( ",zero_bits=", &call->create_thread.zero_bits );
232 233
        dump_uint64( ",reserve=", &call->create_thread.reserve );
        dump_uint64( ",commit=", &call->create_thread.commit );
234
        fprintf( stderr, ",flags=%x", call->create_thread.flags );
235
        break;
236 237 238 239 240
    case APC_DUP_HANDLE:
        fprintf( stderr, "APC_DUP_HANDLE,src_handle=%04x,dst_process=%04x,access=%x,attributes=%x,options=%x",
                 call->dup_handle.src_handle, call->dup_handle.dst_process, call->dup_handle.access,
                 call->dup_handle.attributes, call->dup_handle.options );
        break;
241 242 243 244 245 246 247
    default:
        fprintf( stderr, "type=%u", call->type );
        break;
    }
    fputc( '}', stderr );
}

248
static void dump_apc_result( const char *prefix, const apc_result_t *result )
249
{
250
    fprintf( stderr, "%s{", prefix );
251 252 253 254
    switch(result->type)
    {
    case APC_NONE:
        break;
255
    case APC_ASYNC_IO:
256
        fprintf( stderr, "APC_ASYNC_IO,status=%s,total=%u",
257
                 get_status_name( result->async_io.status ), result->async_io.total );
258
        break;
259
    case APC_VIRTUAL_ALLOC:
260
        fprintf( stderr, "APC_VIRTUAL_ALLOC,status=%s",
261
                 get_status_name( result->virtual_alloc.status ));
262 263
        dump_uint64( ",addr=", &result->virtual_alloc.addr );
        dump_uint64( ",size=", &result->virtual_alloc.size );
264 265
        break;
    case APC_VIRTUAL_FREE:
266
        fprintf( stderr, "APC_VIRTUAL_FREE,status=%s",
267
                 get_status_name( result->virtual_free.status ));
268 269
        dump_uint64( ",addr=", &result->virtual_free.addr );
        dump_uint64( ",size=", &result->virtual_free.size );
270
        break;
271
    case APC_VIRTUAL_QUERY:
272
        fprintf( stderr, "APC_VIRTUAL_QUERY,status=%s",
273
                 get_status_name( result->virtual_query.status ));
274 275 276
        dump_uint64( ",base=", &result->virtual_query.base );
        dump_uint64( ",alloc_base=", &result->virtual_query.alloc_base );
        dump_uint64( ",size=", &result->virtual_query.size );
277 278 279
        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 );
280
        break;
281
    case APC_VIRTUAL_PROTECT:
282
        fprintf( stderr, "APC_VIRTUAL_PROTECT,status=%s",
283
                 get_status_name( result->virtual_protect.status ));
284 285
        dump_uint64( ",addr=", &result->virtual_protect.addr );
        dump_uint64( ",size=", &result->virtual_protect.size );
286
        fprintf( stderr, ",prot=%x", result->virtual_protect.prot );
287
        break;
288
    case APC_VIRTUAL_FLUSH:
289
        fprintf( stderr, "APC_VIRTUAL_FLUSH,status=%s",
290
                 get_status_name( result->virtual_flush.status ));
291 292
        dump_uint64( ",addr=", &result->virtual_flush.addr );
        dump_uint64( ",size=", &result->virtual_flush.size );
293
        break;
294
    case APC_VIRTUAL_LOCK:
295
        fprintf( stderr, "APC_VIRTUAL_LOCK,status=%s",
296
                 get_status_name( result->virtual_lock.status ));
297 298
        dump_uint64( ",addr=", &result->virtual_lock.addr );
        dump_uint64( ",size=", &result->virtual_lock.size );
299 300
        break;
    case APC_VIRTUAL_UNLOCK:
301
        fprintf( stderr, "APC_VIRTUAL_UNLOCK,status=%s",
302
                 get_status_name( result->virtual_unlock.status ));
303 304
        dump_uint64( ",addr=", &result->virtual_unlock.addr );
        dump_uint64( ",size=", &result->virtual_unlock.size );
305
        break;
306
    case APC_MAP_VIEW:
307
        fprintf( stderr, "APC_MAP_VIEW,status=%s",
308
                 get_status_name( result->map_view.status ));
309 310
        dump_uint64( ",addr=", &result->map_view.addr );
        dump_uint64( ",size=", &result->map_view.size );
311 312 313 314 315
        break;
    case APC_UNMAP_VIEW:
        fprintf( stderr, "APC_UNMAP_VIEW,status=%s",
                 get_status_name( result->unmap_view.status ) );
        break;
316
    case APC_CREATE_THREAD:
317
        fprintf( stderr, "APC_CREATE_THREAD,status=%s,pid=%04x,tid=%04x,handle=%04x",
318
                 get_status_name( result->create_thread.status ),
319
                 result->create_thread.pid, result->create_thread.tid, result->create_thread.handle );
320
        break;
321 322 323 324
    case APC_DUP_HANDLE:
        fprintf( stderr, "APC_DUP_HANDLE,status=%s,handle=%04x",
                 get_status_name( result->dup_handle.status ), result->dup_handle.handle );
        break;
325 326 327 328 329 330 331
    default:
        fprintf( stderr, "type=%u", result->type );
        break;
    }
    fputc( '}', stderr );
}

332
static void dump_async_data( const char *prefix, const async_data_t *data )
333
{
334 335
    fprintf( stderr, "%s{handle=%04x,event=%04x", prefix, data->handle, data->event );
    dump_uint64( ",iosb=", &data->iosb );
336 337 338
    dump_uint64( ",user=", &data->user );
    dump_uint64( ",apc=", &data->apc );
    dump_uint64( ",apc_context=", &data->apc_context );
339
    fputc( '}', stderr );
340 341
}

342 343
static void dump_irp_params( const char *prefix, const irp_params_t *data )
{
344
    switch (data->type)
345
    {
346 347 348 349 350
    case IRP_CALL_NONE:
        fprintf( stderr, "%s{NONE}", prefix );
        break;
    case IRP_CALL_CREATE:
        fprintf( stderr, "%s{CREATE,access=%08x,sharing=%08x,options=%08x",
351 352
                 prefix, data->create.access, data->create.sharing, data->create.options );
        dump_uint64( ",device=", &data->create.device );
353
        fprintf( stderr, ",file=%08x}", data->create.file );
354
        break;
355 356
    case IRP_CALL_CLOSE:
        fprintf( stderr, "%s{CLOSE", prefix );
357
        dump_uint64( ",file=", &data->close.file );
358 359
        fputc( '}', stderr );
        break;
360 361
    case IRP_CALL_READ:
        fprintf( stderr, "%s{READ,key=%08x,out_size=%u", prefix, data->read.key,
362
                 data->read.out_size );
363
        dump_uint64( ",pos=", &data->read.pos );
364
        dump_uint64( ",file=", &data->read.file );
365 366
        fputc( '}', stderr );
        break;
367 368
    case IRP_CALL_WRITE:
        fprintf( stderr, "%s{WRITE,key=%08x", prefix, data->write.key );
369
        dump_uint64( ",pos=", &data->write.pos );
370
        dump_uint64( ",file=", &data->write.file );
371 372
        fputc( '}', stderr );
        break;
373 374
    case IRP_CALL_FLUSH:
        fprintf( stderr, "%s{FLUSH", prefix );
375
        dump_uint64( ",file=", &data->flush.file );
376
        fputc( '}', stderr );
377
        break;
378 379
    case IRP_CALL_IOCTL:
        fprintf( stderr, "%s{IOCTL", prefix );
380
        dump_ioctl_code( ",code=", &data->ioctl.code );
381
        fprintf( stderr, ",out_size=%u", data->ioctl.out_size );
382
        dump_uint64( ",file=", &data->ioctl.file );
383 384
        fputc( '}', stderr );
        break;
385 386 387 388 389 390
    case IRP_CALL_VOLUME:
        fprintf( stderr, "%s{VOLUME,class=%u,out_size=%u", prefix,
                 data->volume.info_class, data->volume.out_size );
        dump_uint64( ",file=", &data->volume.file );
        fputc( '}', stderr );
        break;
391 392 393 394
    case IRP_CALL_FREE:
        fprintf( stderr, "%s{FREE", prefix );
        dump_uint64( ",obj=", &data->free.obj );
        fputc( '}', stderr );
395
        break;
396 397 398 399 400
    case IRP_CALL_CANCEL:
        fprintf( stderr, "%s{CANCEL", prefix );
        dump_uint64( ",irp=", &data->cancel.irp );
        fputc( '}', stderr );
        break;
401 402 403
    }
}

404 405 406 407 408 409 410 411 412 413 414 415
static void dump_rawinput( const char *prefix, const union rawinput *rawinput )
{
    switch (rawinput->type)
    {
    case RIM_TYPEMOUSE:
        fprintf( stderr, "%s{type=MOUSE,x=%d,y=%d,data=%08x}", prefix, rawinput->mouse.x,
                 rawinput->mouse.y, rawinput->mouse.data );
        break;
    case RIM_TYPEKEYBOARD:
        fprintf( stderr, "%s{type=KEYBOARD,message=%04x,vkey=%04hx,scan=%04hx}", prefix,
                 rawinput->kbd.message, rawinput->kbd.vkey, rawinput->kbd.scan );
        break;
416
    case RIM_TYPEHID:
417
        fprintf( stderr, "%s{type=HID,device=%04x,param=%04x,page=%04hx,usage=%04hx,count=%u,length=%u}",
418
                 prefix, rawinput->hid.device, rawinput->hid.param, rawinput->hid.usage_page,
419
                 rawinput->hid.usage, rawinput->hid.count, rawinput->hid.length );
420
        break;
421 422 423 424 425 426
    default:
        fprintf( stderr, "%s{type=%04x}", prefix, rawinput->type );
        break;
    }
}

427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446
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 );
447 448
        switch (input->hw.msg)
        {
449
        case WM_INPUT:
450 451 452
        case WM_INPUT_DEVICE_CHANGE:
            dump_rawinput( ",rawinput=", &input->hw.rawinput );
        }
453 454 455 456 457 458 459 460
        fputc( '}', stderr );
        break;
    default:
        fprintf( stderr, "%s{type=%04x}", prefix, input->type );
        break;
    }
}

461
static void dump_luid( const char *prefix, const struct luid *luid )
462
{
463
    fprintf( stderr, "%s%d.%u", prefix, luid->high_part, luid->low_part );
464 465
}

466 467 468 469 470 471
static void dump_generic_map( const char *prefix, const generic_map_t *map )
{
    fprintf( stderr, "%s{r=%08x,w=%08x,x=%08x,a=%08x}",
             prefix, map->read, map->write, map->exec, map->all );
}

472
static void dump_varargs_ints( const char *prefix, data_size_t size )
473
{
474 475 476
    const int *data = cur_data;
    data_size_t len = size / sizeof(*data);

477
    fprintf( stderr,"%s{", prefix );
478
    while (len > 0)
479
    {
480 481
        fprintf( stderr, "%d", *data++ );
        if (--len) fputc( ',', stderr );
482 483
    }
    fputc( '}', stderr );
484
    remove_data( size );
485 486
}

487 488 489 490 491 492 493 494
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 );
}

495
static void dump_varargs_uints64( const char *prefix, data_size_t size )
496
{
497
    const unsigned __int64 *data = cur_data;
498
    data_size_t len = size / sizeof(*data);
499

500
    fprintf( stderr,"%s{", prefix );
501 502
    while (len > 0)
    {
503
        dump_uint64( "", data++ );
504 505 506
        if (--len) fputc( ',', stderr );
    }
    fputc( '}', stderr );
507
    remove_data( size );
508 509
}

510 511 512 513 514 515 516 517 518 519 520 521 522 523 524
static void dump_varargs_ushorts( const char *prefix, data_size_t size )
{
    const unsigned short *data = cur_data;
    data_size_t len = size / sizeof(*data);

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

525
static void dump_varargs_apc_result( const char *prefix, data_size_t size )
526 527 528 529 530
{
    const apc_result_t *result = cur_data;

    if (size >= sizeof(*result))
    {
531
        dump_apc_result( prefix, result );
532 533 534 535 536
        size = sizeof(*result);
    }
    remove_data( size );
}

537
static void dump_varargs_select_op( const char *prefix, data_size_t size )
538
{
539
    select_op_t data;
540

541
    if (!size)
542
    {
543 544 545 546 547 548 549 550 551 552 553 554 555
        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:
556 557
    case SELECT_WAIT_ALL:
        fprintf( stderr, "%s", data.op == SELECT_WAIT ? "WAIT" : "WAIT_ALL" );
558 559 560 561
        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;
562 563 564 565
    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;
566 567 568 569 570 571 572
    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;
573 574 575
    default:
        fprintf( stderr, "op=%u", data.op );
        break;
576 577
    }
    fputc( '}', stderr );
578
    remove_data( size );
579 580
}

581
static void dump_varargs_user_handles( const char *prefix, data_size_t size )
582
{
583
    const user_handle_t *data = cur_data;
584
    data_size_t len = size / sizeof(*data);
585

586
    fprintf( stderr,"%s{", prefix );
587 588
    while (len > 0)
    {
589
        fprintf( stderr, "%08x", *data++ );
590 591 592
        if (--len) fputc( ',', stderr );
    }
    fputc( '}', stderr );
593
    remove_data( size );
594 595
}

596
static void dump_varargs_bytes( const char *prefix, data_size_t size )
597
{
598
    const unsigned char *data = cur_data;
599
    data_size_t len = min( 1024, size );
600

601
    fprintf( stderr,"%s{", prefix );
602 603 604 605 606
    while (len > 0)
    {
        fprintf( stderr, "%02x", *data++ );
        if (--len) fputc( ',', stderr );
    }
607
    if (size > 1024) fprintf( stderr, "...(total %u)", size );
608
    fputc( '}', stderr );
609
    remove_data( size );
610 611
}

612
static void dump_varargs_string( const char *prefix, data_size_t size )
613
{
614
    fprintf( stderr, "%s\"%.*s\"", prefix, (int)size, (const char *)cur_data );
615
    remove_data( size );
616 617
}

618
static void dump_varargs_unicode_str( const char *prefix, data_size_t size )
619
{
620
    fprintf( stderr, "%sL\"", prefix );
621
    dump_strW( cur_data, size, stderr, "\"\"" );
622
    fputc( '\"', stderr );
623
    remove_data( size );
624 625
}

626
static void dump_varargs_context( const char *prefix, data_size_t size )
627
{
628 629 630 631
    const context_t *context = cur_data;
    context_t ctx;
    unsigned int i;

632 633
    if (!size)
    {
634
        fprintf( stderr, "%s{}", prefix );
635 636
        return;
    }
637 638 639 640
    size = min( size, sizeof(ctx) );
    memset( &ctx, 0, sizeof(ctx) );
    memcpy( &ctx, context, size );

641
    switch (ctx.machine)
642
    {
643 644
    case IMAGE_FILE_MACHINE_I386:
        fprintf( stderr, "%s{machine=i386", prefix );
645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662
        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)
        {
663
            fprintf( stderr, ",fp.ctrl=%08x,fp.status=%08x,fp.tag=%08x,fp.err_off=%08x,fp.err_sel=%08x",
664 665 666 667 668
                     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++)
669
            {
670 671 672 673 674
                unsigned __int64 reg[2];
                memset( reg, 0, sizeof(reg) );
                memcpy( reg, &ctx.fp.i386_regs.regs[10 * i], 10 );
                fprintf( stderr, ",fp.reg%u=", i );
                dump_uint128( "", reg );
675
            }
676 677
        }
        if (ctx.flags & SERVER_CTX_EXTENDED_REGISTERS)
678 679
            dump_uints( ",extended=", (const unsigned int *)ctx.ext.i386_regs,
                        sizeof(ctx.ext.i386_regs) / sizeof(int) );
680
        if (ctx.flags & SERVER_CTX_YMM_REGISTERS)
681 682 683 684 685
            for (i = 0; i < 16; i++)
            {
                fprintf( stderr, ",ymm%u=", i );
                dump_uint128( "", (const unsigned __int64 *)&ctx.ymm.regs.ymm_high[i] );
            }
686
        break;
687 688
    case IMAGE_FILE_MACHINE_AMD64:
        fprintf( stderr, "%s{machine=x86_64", prefix );
689 690 691 692 693
        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 );
694 695
            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 );
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 721 722 723 724 725 726 727 728
        }
        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++)
729 730 731 732
            {
                fprintf( stderr, ",fp%u=", i );
                dump_uint128( "", (const unsigned __int64 *)&ctx.fp.x86_64_regs.fpregs[i] );
            }
733
        if (ctx.flags & SERVER_CTX_YMM_REGISTERS)
734 735 736 737 738
            for (i = 0; i < 16; i++)
            {
                fprintf( stderr, ",ymm%u=", i );
                dump_uint128( "", (const unsigned __int64 *)&ctx.ymm.regs.ymm_high[i] );
            }
739
        break;
740 741
    case IMAGE_FILE_MACHINE_ARMNT:
        fprintf( stderr, "%s{machine=arm", prefix );
742 743 744 745 746 747
        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] );
748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764
        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 );
        }
765
        break;
766 767
    case IMAGE_FILE_MACHINE_ARM64:
        fprintf( stderr, "%s{machine=arm64", prefix );
768 769 770 771 772 773 774 775
        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)
        {
776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796
            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)
        {
797
            for (i = 0; i < 32; i++)
798
            {
799 800 801
                fprintf( stderr, ",q%u=", i );
                dump_uint64( "", &ctx.fp.arm64_regs.q[i].high );
                dump_uint64( "", &ctx.fp.arm64_regs.q[i].low );
802 803
            }
            fprintf( stderr, ",fpcr=%08x,fpsr=%08x", ctx.fp.arm64_regs.fpcr, ctx.fp.arm64_regs.fpsr );
804 805
        }
        break;
806 807 808
    default:
        fprintf( stderr, "%s{machine=%04x", prefix, ctx.machine );
        break;
809 810 811
    }
    fputc( '}', stderr );
    remove_data( size );
812 813
}

814 815 816 817 818 819 820 821 822 823 824 825 826 827 828
static void dump_varargs_contexts( const char *prefix, data_size_t size )
{
    if (!size)
    {
        fprintf( stderr, "%s{}", prefix );
        return;
    }
    fprintf( stderr, "%s{", prefix );
    while (cur_size)
    {
        dump_varargs_context( "", cur_size );
        fputc( cur_size ? ',' : '}', stderr );
    }
}

829
static void dump_varargs_debug_event( const char *prefix, data_size_t size )
830
{
831 832
    debug_event_t event;
    unsigned int i;
833

834
    if (!size)
835
    {
836
        fprintf( stderr, "%s{}", prefix );
837
        return;
838
    }
839 840 841 842 843
    size = min( size, sizeof(event) );
    memset( &event, 0, sizeof(event) );
    memcpy( &event, cur_data, size );

    switch(event.code)
844
    {
845 846
    case DbgIdle:
        fprintf( stderr, "%s{idle}", prefix );
847
        break;
848 849 850 851
    case DbgReplyPending:
        fprintf( stderr, "%s{pending}", prefix );
        break;
    case DbgCreateThreadStateChange:
852 853
        fprintf( stderr, "%s{create_thread,thread=%04x", prefix, event.create_thread.handle );
        dump_uint64( ",start=", &event.create_thread.start );
854
        fputc( '}', stderr );
855
        break;
856
    case DbgCreateProcessStateChange:
857
        fprintf( stderr, "%s{create_process,file=%04x,process=%04x,thread=%04x", prefix,
858 859
                 event.create_process.file, event.create_process.process,
                 event.create_process.thread );
860 861
        dump_uint64( ",base=", &event.create_process.base );
        fprintf( stderr, ",offset=%d,size=%d",
862
                 event.create_process.dbg_offset, event.create_process.dbg_size );
863
        dump_uint64( ",start=", &event.create_process.start );
864
        fputc( '}', stderr );
865
        break;
866
    case DbgExitThreadStateChange:
867
        fprintf( stderr, "%s{exit_thread,code=%d}", prefix, event.exit.exit_code );
868
        break;
869
    case DbgExitProcessStateChange:
870
        fprintf( stderr, "%s{exit_process,code=%d}", prefix, event.exit.exit_code );
871
        break;
872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890
    case DbgExceptionStateChange:
    case DbgBreakpointStateChange:
    case DbgSingleStepStateChange:
        fprintf( stderr, "%s{%s,first=%d,exc_code=%08x,flags=%08x", prefix,
                 event.code == DbgBreakpointStateChange ? "breakpoint" :
                 event.code == DbgSingleStepStateChange ? "singlestep" : "exception",
                 event.exception.first, event.exception.exc_code, event.exception.flags );
        dump_uint64( ",record=", &event.exception.record );
        dump_uint64( ",address=", &event.exception.address );
        fprintf( stderr, ",params={" );
        event.exception.nb_params = min( event.exception.nb_params, EXCEPTION_MAXIMUM_PARAMETERS );
        for (i = 0; i < event.exception.nb_params; i++)
        {
            dump_uint64( "", &event.exception.params[i] );
            if (i < event.exception.nb_params) fputc( ',', stderr );
        }
        fprintf( stderr, "}}" );
        break;
    case DbgLoadDllStateChange:
891 892 893
        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",
894
                 event.load_dll.dbg_offset, event.load_dll.dbg_size );
895
        dump_uint64( ",name=", &event.load_dll.name );
896
        fputc( '}', stderr );
897
        break;
898
    case DbgUnloadDllStateChange:
899 900
        fprintf( stderr, "%s{unload_dll", prefix );
        dump_uint64( ",base=", &event.unload_dll.base );
901
        fputc( '}', stderr );
902 903
        break;
    default:
904
        fprintf( stderr, "%s{code=??? (%d)}", prefix, event.code );
905 906
        break;
    }
907
    remove_data( size );
908 909
}

910
/* dump a unicode string contained in a buffer; helper for dump_varargs_startup_info */
911
static data_size_t dump_inline_unicode_string( const char *prefix, data_size_t pos, data_size_t len, data_size_t total_size )
912
{
913 914 915 916
    fputs( prefix, stderr );
    if (pos >= total_size) return pos;
    if (len > total_size - pos) len = total_size - pos;
    dump_strW( (const WCHAR *)cur_data + pos/sizeof(WCHAR), len, stderr, "\"\"" );
917
    return pos + (len / sizeof(WCHAR)) * sizeof(WCHAR);
918 919
}

920
static void dump_varargs_startup_info( const char *prefix, data_size_t size )
921
{
922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941
    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 );
942
    fprintf( stderr, "\"}" );
943 944 945
    remove_data( size );
}

946
static void dump_varargs_rectangles( const char *prefix, data_size_t size )
947 948
{
    const rectangle_t *rect = cur_data;
949
    data_size_t len = size / sizeof(*rect);
950

951
    fprintf( stderr,"%s{", prefix );
952 953
    while (len > 0)
    {
954
        dump_rectangle( "", rect++ );
955 956 957 958 959 960
        if (--len) fputc( ',', stderr );
    }
    fputc( '}', stderr );
    remove_data( size );
}

961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978
static void dump_varargs_cursor_positions( const char *prefix, data_size_t size )
{
    const cursor_pos_t *pos = cur_data;
    data_size_t len = size / sizeof(*pos);

    fprintf( stderr, "%s{", prefix );
    while (len > 0)
    {
        fprintf( stderr, "{x=%d,y=%d,time=%u", pos->x, pos->y, pos->time );
        dump_uint64( ",info=", &pos->info );
        fputc( '}', stderr );
        pos++;
        if (--len) fputc( ',', stderr );
    }
    fputc( '}', stderr );
    remove_data( size );
}

979
static void dump_varargs_message_data( const char *prefix, data_size_t size )
980 981
{
    /* FIXME: dump the structured data */
982
    dump_varargs_bytes( prefix, size );
983 984
}

985
static void dump_varargs_properties( const char *prefix, data_size_t size )
986
{
987
    const property_data_t *prop = cur_data;
988
    data_size_t len = size / sizeof(*prop);
989

990
    fprintf( stderr,"%s{", prefix );
991 992
    while (len > 0)
    {
993 994
        fprintf( stderr, "{atom=%04x,str=%d", prop->atom, prop->string );
        dump_uint64( ",data=", &prop->data );
995
        fputc( '}', stderr );
996 997 998 999
        prop++;
        if (--len) fputc( ',', stderr );
    }
    fputc( '}', stderr );
1000
    remove_data( size );
1001 1002
}

1003
static void dump_varargs_luid_attr( const char *prefix, data_size_t size )
1004
{
1005
    const struct luid_attr *lat = cur_data;
1006
    data_size_t len = size / sizeof(*lat);
1007

1008
    fprintf( stderr,"%s{", prefix );
1009 1010
    while (len > 0)
    {
1011
        fprintf( stderr, "{luid=%08x%08x,attrs=%x}", lat->luid.high_part, lat->luid.low_part, lat->attrs );
1012 1013 1014 1015 1016 1017 1018
        lat++;
        if (--len) fputc( ',', stderr );
    }
    fputc( '}', stderr );
    remove_data( size );
}

1019
static void dump_inline_sid( const char *prefix, const struct sid *sid, data_size_t size )
1020 1021 1022
{
    DWORD i;

1023 1024
    fprintf( stderr,"%s", prefix );
    if (sid_valid_size( sid, size ))
1025
    {
1026 1027 1028 1029 1030 1031
        fprintf( stderr, "S-%u-%u", sid->revision,
                 ((unsigned int)sid->id_auth[2] << 24) |
                 ((unsigned int)sid->id_auth[3] << 16) |
                 ((unsigned int)sid->id_auth[4] << 8) |
                 ((unsigned int)sid->id_auth[5]) );
        for (i = 0; i < sid->sub_count; i++) fprintf( stderr, "-%u", sid->sub_auth[i] );
1032
    }
1033
    else fprintf( stderr, "<invalid>" );
1034 1035
}

1036
static void dump_varargs_sid( const char *prefix, data_size_t size )
1037
{
1038 1039
    const struct sid *sid = cur_data;
    if (size) dump_inline_sid( prefix, sid, size );
1040 1041 1042
    remove_data( size );
}

1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064
static void dump_varargs_sids( const char *prefix, data_size_t size )
{
    const struct sid *sid = cur_data;
    data_size_t len = size;

    fprintf( stderr,"%s{", prefix );
    while (len > 0)
    {
        if (!sid_valid_size( sid, len ))
        {
            fprintf( stderr, "bad len %u", len);
            break;
        }
        dump_inline_sid( "", sid, size );
        len -= sid_len( sid );
        sid = (const struct sid *)((const char *)sid + sid_len( sid ));
        if (len) fputc( ',', stderr );
    }
    fputc( '}', stderr );
    remove_data( size );
}

1065
static void dump_inline_acl( const char *prefix, const struct acl *acl, data_size_t size )
1066
{
1067
    const struct ace *ace;
1068 1069
    ULONG i;

1070
    fprintf( stderr,"%s{", prefix );
1071 1072
    if (size)
    {
1073
        if (size < sizeof(*acl))
1074
        {
1075
            fprintf( stderr, "<invalid acl>}" );
1076
            return;
1077
        }
1078
        size -= sizeof(*acl);
1079
        for (i = 0, ace = ace_first( acl ); i < acl->count; i++, ace = ace_next( ace ))
1080
        {
1081
            const struct sid *sid = (const struct sid *)(ace + 1);
1082
            data_size_t sid_size;
1083

1084 1085 1086
            if (size < sizeof(*ace) || size < ace->size) break;
            size -= ace->size;
            sid_size = ace->size - sizeof(*ace);
1087
            if (i != 0) fputc( ',', stderr );
1088 1089
            fprintf( stderr, "{type=" );
            switch (ace->type)
1090
            {
1091 1092 1093 1094 1095
            case ACCESS_DENIED_ACE_TYPE:          fprintf( stderr, "ACCESS_DENIED" ); break;
            case ACCESS_ALLOWED_ACE_TYPE:         fprintf( stderr, "ACCESS_ALLOWED" ); break;
            case SYSTEM_AUDIT_ACE_TYPE:           fprintf( stderr, "SYSTEM_AUDIT" ); break;
            case SYSTEM_ALARM_ACE_TYPE:           fprintf( stderr, "SYSTEM_ALARM" ); break;
            case SYSTEM_MANDATORY_LABEL_ACE_TYPE: fprintf( stderr, "SYSTEM_MANDATORY_LABEL" ); break;
1096
            default:
1097 1098
                fprintf( stderr, "%02x", ace->type );
                sid = NULL;
1099 1100
                break;
            }
1101 1102
            fprintf( stderr, ",flags=%x,mask=%x", ace->flags, ace->mask );
            if (sid) dump_inline_sid( ",sid=", sid, sid_size );
1103 1104 1105 1106 1107 1108
            fputc( '}', stderr );
        }
    }
    fputc( '}', stderr );
}

1109
static void dump_varargs_acl( const char *prefix, data_size_t size )
1110
{
1111
    const struct acl *acl = cur_data;
1112 1113 1114 1115
    dump_inline_acl( prefix, acl, size );
    remove_data( size );
}

1116
static void dump_inline_security_descriptor( const char *prefix, const struct security_descriptor *sd, data_size_t size )
1117
{
1118
    fprintf( stderr,"%s{", prefix );
1119 1120 1121 1122
    if (size >= sizeof(struct security_descriptor))
    {
        size_t offset = sizeof(struct security_descriptor);
        fprintf( stderr, "control=%08x", sd->control );
1123
        if ((sd->owner_len > offsetof(struct sid, sub_auth[255])) || (offset + sd->owner_len > size))
1124
            return;
1125
        if (sd->owner_len)
1126
            dump_inline_sid( ",owner=", (const struct sid *)((const char *)sd + offset), sd->owner_len );
1127
        else
1128
            fprintf( stderr, ",owner=<not present>" );
1129
        offset += sd->owner_len;
1130
        if ((sd->group_len > offsetof(struct sid, sub_auth[255])) || (offset + sd->group_len > size))
1131
            return;
1132
        if (sd->group_len)
1133
            dump_inline_sid( ",group=", (const struct sid *)((const char *)sd + offset), sd->group_len );
1134
        else
1135
            fprintf( stderr, ",group=<not present>" );
1136 1137 1138
        offset += sd->group_len;
        if ((sd->sacl_len >= MAX_ACL_LEN) || (offset + sd->sacl_len > size))
            return;
1139
        dump_inline_acl( ",sacl=", (const struct acl *)((const char *)sd + offset), sd->sacl_len );
1140 1141 1142
        offset += sd->sacl_len;
        if ((sd->dacl_len >= MAX_ACL_LEN) || (offset + sd->dacl_len > size))
            return;
1143
        dump_inline_acl( ",dacl=", (const struct acl *)((const char *)sd + offset), sd->dacl_len );
1144 1145 1146 1147 1148
        offset += sd->dacl_len;
    }
    fputc( '}', stderr );
}

1149
static void dump_varargs_security_descriptor( const char *prefix, data_size_t size )
1150 1151
{
    const struct security_descriptor *sd = cur_data;
1152
    dump_inline_security_descriptor( prefix, sd, size );
1153 1154 1155
    remove_data( size );
}

1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169
static void dump_varargs_process_info( const char *prefix, data_size_t size )
{
    data_size_t pos = 0;
    unsigned int i;

    fprintf( stderr,"%s{", prefix );

    while (size - pos >= sizeof(struct process_info))
    {
        const struct process_info *process;
        pos = (pos + 7) & ~7;
        process = (const struct process_info *)((const char *)cur_data + pos);
        if (size - pos < sizeof(*process)) break;
        if (pos) fputc( ',', stderr );
1170
        dump_timeout( "{start_time=", &process->start_time );
1171
        fprintf( stderr, ",thread_count=%u,priority=%d,pid=%04x,parent_pid=%04x,session_id=%08x,handle_count=%u,unix_pid=%d,",
1172
                 process->thread_count, process->priority, process->pid,
1173
                 process->parent_pid, process->session_id, process->handle_count, process->unix_pid );
1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184
        pos += sizeof(*process);

        pos = dump_inline_unicode_string( "name=L\"", pos, process->name_len, size );

        pos = (pos + 7) & ~7;
        fprintf( stderr, "\",threads={" );
        for (i = 0; i < process->thread_count; i++)
        {
            const struct thread_info *thread = (const struct thread_info *)((const char *)cur_data + pos);
            if (size - pos < sizeof(*thread)) break;
            if (i) fputc( ',', stderr );
1185 1186
            dump_timeout( "{start_time=", &thread->start_time );
            fprintf( stderr, ",tid=%04x,base_priority=%d,current_priority=%d,unix_tid=%d}",
1187 1188 1189 1190 1191 1192 1193 1194 1195
                     thread->tid, thread->base_priority, thread->current_priority, thread->unix_tid );
            pos += sizeof(*thread);
        }
        fprintf( stderr, "}}" );
    }
    fputc( '}', stderr );
    remove_data( size );
}

1196
static void dump_varargs_object_attributes( const char *prefix, data_size_t size )
1197 1198
{
    const struct object_attributes *objattr = cur_data;
1199 1200

    fprintf( stderr,"%s{", prefix );
1201
    if (size)
1202 1203
    {
        const WCHAR *str;
1204 1205 1206 1207 1208 1209 1210

        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 );
1211
            return;
1212 1213 1214
        }

        fprintf( stderr, "rootdir=%04x,attributes=%08x", objattr->rootdir, objattr->attributes );
1215
        dump_inline_security_descriptor( ",sd=", (const struct security_descriptor *)(objattr + 1), objattr->sd_len );
1216
        str = (const WCHAR *)objattr + (sizeof(*objattr) + objattr->sd_len) / sizeof(WCHAR);
1217
        fprintf( stderr, ",name=L\"" );
1218
        dump_strW( str, objattr->name_len, stderr, "\"\"" );
1219
        fputc( '\"', stderr );
1220
        remove_data( (sizeof(*objattr) + (objattr->sd_len & ~1) + (objattr->name_len & ~1) + 3) & ~3 );
1221 1222 1223 1224
    }
    fputc( '}', stderr );
}

1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238
static void dump_varargs_object_type_info( const char *prefix, data_size_t size )
{
    const struct object_type_info *info = cur_data;

    fprintf( stderr,"%s{", prefix );
    if (size)
    {
        if (size < sizeof(*info) || (size - sizeof(*info) < info->name_len))
        {
            fprintf( stderr, "***invalid***}" );
            remove_data( size );
            return;
        }

1239 1240 1241 1242 1243
        fprintf( stderr, "index=%u,obj_count=%u,handle_count=%u,obj_max=%u,handle_max=%u,valid=%08x",
                 info->index,info->obj_count, info->handle_count, info->obj_max, info->handle_max,
                 info->valid_access );
        dump_generic_map( ",access=", &info->mapping );
        fprintf( stderr, ",name=L\"" );
1244 1245 1246 1247 1248 1249 1250
        dump_strW( (const WCHAR *)(info + 1), info->name_len, stderr, "\"\"" );
        fputc( '\"', stderr );
        remove_data( min( size, sizeof(*info) + ((info->name_len + 2) & ~3 )));
    }
    fputc( '}', stderr );
}

1251 1252 1253 1254 1255 1256 1257
static void dump_varargs_object_types_info( const char *prefix, data_size_t size )
{
    fprintf( stderr,"%s{", prefix );
    while (cur_size) dump_varargs_object_type_info( ",", cur_size );
    fputc( '}', stderr );
}

1258 1259
static void dump_varargs_filesystem_event( const char *prefix, data_size_t size )
{
1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271
    static const char * const actions[] = {
        NULL,
        "ADDED",
        "REMOVED",
        "MODIFIED",
        "RENAMED_OLD_NAME",
        "RENAMED_NEW_NAME",
        "ADDED_STREAM",
        "REMOVED_STREAM",
        "MODIFIED_STREAM"
    };

1272 1273 1274 1275 1276 1277 1278
    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;
1279
        if (event->action < ARRAY_SIZE( actions ) && actions[event->action])
1280 1281 1282 1283
            fprintf( stderr, "{action=%s", actions[event->action] );
        else
            fprintf( stderr, "{action=%u", event->action );
        fprintf( stderr, ",name=\"%.*s\"}", event->len, event->name );
1284 1285 1286 1287 1288 1289 1290
        size -= len;
        remove_data( len );
        if (size)fputc( ',', stderr );
    }
    fputc( '}', stderr );
}

1291 1292 1293 1294
static void dump_varargs_pe_image_info( const char *prefix, data_size_t size )
{
    pe_image_info_t info;

1295 1296 1297 1298 1299
    if (!size)
    {
        fprintf( stderr, "%s{}", prefix );
        return;
    }
1300 1301 1302 1303 1304 1305 1306
    memset( &info, 0, sizeof(info) );
    memcpy( &info, cur_data, min( size, sizeof(info) ));

    fprintf( stderr, "%s{", prefix );
    dump_uint64( "base=", &info.base );
    dump_uint64( ",stack_size=", &info.stack_size );
    dump_uint64( ",stack_commit=", &info.stack_commit );
1307
    fprintf( stderr, ",entry_point=%08x,map_size=%08x,zerobits=%08x,subsystem=%08x,subsystem_minor=%04x,subsystem_major=%04x"
1308 1309
             ",osversion_major=%04x,osversion_minor=%04x,image_charact=%04x,dll_charact=%04x,machine=%04x"
             ",contains_code=%u,image_flags=%02x"
1310
             ",loader_flags=%08x,header_size=%08x,file_size=%08x,checksum=%08x}",
1311 1312 1313
             info.entry_point, info.map_size, info.zerobits, info.subsystem, info.subsystem_minor,
             info.subsystem_major, info.osversion_major, info.osversion_minor, info.image_charact,
             info.dll_charact, info.machine, info.contains_code, info.image_flags, info.loader_flags,
1314
             info.header_size, info.file_size, info.checksum );
1315
    remove_data( min( size, sizeof(info) ));
1316 1317
}

1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334
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 );
}

1335 1336 1337 1338 1339 1340 1341 1342
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;
1343 1344
        fprintf( stderr, "{owner=%04x,handle=%04x,access=%08x,attributes=%08x,type=%u}",
                 handle->owner, handle->handle, handle->access, handle->attributes, handle->type );
1345 1346 1347 1348 1349 1350 1351
        size -= sizeof(*handle);
        remove_data( sizeof(*handle) );
        if (size) fputc( ',', stderr );
    }
    fputc( '}', stderr );
}

1352
typedef void (*dump_func)( const void *req );
1353 1354 1355 1356

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

1357
static void dump_new_process_request( const struct new_process_request *req )
1358
{
1359
    fprintf( stderr, " token=%04x", req->token );
1360
    fprintf( stderr, ", debug=%04x", req->debug );
1361
    fprintf( stderr, ", parent_process=%04x", req->parent_process );
1362
    fprintf( stderr, ", flags=%08x", req->flags );
1363
    fprintf( stderr, ", socket_fd=%d", req->socket_fd );
1364
    fprintf( stderr, ", access=%08x", req->access );
1365
    fprintf( stderr, ", machine=%04x", req->machine );
1366
    fprintf( stderr, ", info_size=%u", req->info_size );
1367
    fprintf( stderr, ", handles_size=%u", req->handles_size );
1368
    fprintf( stderr, ", jobs_size=%u", req->jobs_size );
1369
    dump_varargs_object_attributes( ", objattr=", cur_size );
1370
    dump_varargs_uints( ", handles=", min(cur_size,req->handles_size) );
1371
    dump_varargs_uints( ", jobs=", min(cur_size,req->jobs_size) );
1372
    dump_varargs_startup_info( ", info=", min(cur_size,req->info_size) );
1373
    dump_varargs_unicode_str( ", env=", cur_size );
1374 1375
}

1376
static void dump_new_process_reply( const struct new_process_reply *req )
1377
{
1378 1379
    fprintf( stderr, " info=%04x", req->info );
    fprintf( stderr, ", pid=%04x", req->pid );
1380
    fprintf( stderr, ", handle=%04x", req->handle );
1381 1382 1383 1384
}

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

1388
static void dump_get_new_process_info_reply( const struct get_new_process_info_reply *req )
1389
{
1390 1391
    fprintf( stderr, " success=%d", req->success );
    fprintf( stderr, ", exit_code=%d", req->exit_code );
1392 1393
}

1394
static void dump_new_thread_request( const struct new_thread_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1395
{
1396 1397
    fprintf( stderr, " process=%04x", req->process );
    fprintf( stderr, ", access=%08x", req->access );
1398
    fprintf( stderr, ", flags=%08x", req->flags );
1399
    fprintf( stderr, ", request_fd=%d", req->request_fd );
1400
    dump_varargs_object_attributes( ", objattr=", cur_size );
Alexandre Julliard's avatar
Alexandre Julliard committed
1401 1402
}

1403
static void dump_new_thread_reply( const struct new_thread_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1404
{
1405 1406
    fprintf( stderr, " tid=%04x", req->tid );
    fprintf( stderr, ", handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1407 1408
}

1409 1410 1411 1412 1413 1414
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 )
{
1415
    fprintf( stderr, " info_size=%u", req->info_size );
1416
    dump_varargs_startup_info( ", info=", min(cur_size,req->info_size) );
1417
    dump_varargs_unicode_str( ", env=", cur_size );
1418 1419
}

1420
static void dump_init_process_done_request( const struct init_process_done_request *req )
1421
{
1422 1423 1424
    dump_uint64( " teb=", &req->teb );
    dump_uint64( ", peb=", &req->peb );
    dump_uint64( ", ldt_copy=", &req->ldt_copy );
1425 1426
}

1427 1428
static void dump_init_process_done_reply( const struct init_process_done_reply *req )
{
1429 1430
    dump_uint64( " entry=", &req->entry );
    fprintf( stderr, ", suspend=%d", req->suspend );
1431 1432
}

1433
static void dump_init_first_thread_request( const struct init_first_thread_request *req )
1434
{
1435 1436 1437 1438 1439
    fprintf( stderr, " unix_pid=%d", req->unix_pid );
    fprintf( stderr, ", unix_tid=%d", req->unix_tid );
    fprintf( stderr, ", debug_level=%d", req->debug_level );
    fprintf( stderr, ", reply_fd=%d", req->reply_fd );
    fprintf( stderr, ", wait_fd=%d", req->wait_fd );
1440 1441
}

1442
static void dump_init_first_thread_reply( const struct init_first_thread_reply *req )
1443
{
1444 1445 1446
    fprintf( stderr, " pid=%04x", req->pid );
    fprintf( stderr, ", tid=%04x", req->tid );
    dump_timeout( ", server_start=", &req->server_start );
1447
    fprintf( stderr, ", session_id=%08x", req->session_id );
1448
    fprintf( stderr, ", info_size=%u", req->info_size );
1449
    dump_varargs_ushorts( ", machines=", cur_size );
1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462
}

static void dump_init_thread_request( const struct init_thread_request *req )
{
    fprintf( stderr, " unix_tid=%d", req->unix_tid );
    fprintf( stderr, ", reply_fd=%d", req->reply_fd );
    fprintf( stderr, ", wait_fd=%d", req->wait_fd );
    dump_uint64( ", teb=", &req->teb );
    dump_uint64( ", entry=", &req->entry );
}

static void dump_init_thread_reply( const struct init_thread_reply *req )
{
1463
    fprintf( stderr, " suspend=%d", req->suspend );
1464 1465
}

1466
static void dump_terminate_process_request( const struct terminate_process_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1467
{
1468 1469
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", exit_code=%d", req->exit_code );
Alexandre Julliard's avatar
Alexandre Julliard committed
1470 1471
}

1472
static void dump_terminate_process_reply( const struct terminate_process_reply *req )
1473 1474 1475 1476
{
    fprintf( stderr, " self=%d", req->self );
}

1477
static void dump_terminate_thread_request( const struct terminate_thread_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1478
{
1479 1480
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", exit_code=%d", req->exit_code );
Alexandre Julliard's avatar
Alexandre Julliard committed
1481 1482
}

1483
static void dump_terminate_thread_reply( const struct terminate_thread_reply *req )
1484
{
1485
    fprintf( stderr, " self=%d", req->self );
1486 1487
}

1488
static void dump_get_process_info_request( const struct get_process_info_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1489
{
1490
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1491 1492
}

1493
static void dump_get_process_info_reply( const struct get_process_info_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1494
{
1495 1496 1497 1498 1499 1500
    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 );
1501
    fprintf( stderr, ", session_id=%08x", req->session_id );
1502 1503
    fprintf( stderr, ", exit_code=%d", req->exit_code );
    fprintf( stderr, ", priority=%d", req->priority );
1504
    fprintf( stderr, ", machine=%04x", req->machine );
1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515
    dump_varargs_pe_image_info( ", image=", cur_size );
}

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

static void dump_get_process_debug_info_reply( const struct get_process_debug_info_reply *req )
{
    fprintf( stderr, " debug=%04x", req->debug );
1516
    fprintf( stderr, ", debug_children=%d", req->debug_children );
1517
    dump_varargs_pe_image_info( ", image=", cur_size );
1518 1519
}

1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531
static void dump_get_process_image_name_request( const struct get_process_image_name_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", win32=%d", req->win32 );
}

static void dump_get_process_image_name_reply( const struct get_process_image_name_reply *req )
{
    fprintf( stderr, " len=%u", req->len );
    dump_varargs_unicode_str( ", name=", cur_size );
}

1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546
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 );
}

1547
static void dump_set_process_info_request( const struct set_process_info_request *req )
1548
{
1549 1550 1551 1552
    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
1553 1554
}

1555
static void dump_get_thread_info_request( const struct get_thread_info_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1556
{
1557
    fprintf( stderr, " handle=%04x", req->handle );
1558
    fprintf( stderr, ", access=%08x", req->access );
Alexandre Julliard's avatar
Alexandre Julliard committed
1559 1560
}

1561
static void dump_get_thread_info_reply( const struct get_thread_info_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1562
{
1563 1564 1565
    fprintf( stderr, " pid=%04x", req->pid );
    fprintf( stderr, ", tid=%04x", req->tid );
    dump_uint64( ", teb=", &req->teb );
1566
    dump_uint64( ", entry_point=", &req->entry_point );
1567 1568 1569 1570
    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 );
1571
    fprintf( stderr, ", suspend_count=%d", req->suspend_count );
1572
    fprintf( stderr, ", dbg_hidden=%d", req->dbg_hidden );
1573 1574
    fprintf( stderr, ", desc_len=%u", req->desc_len );
    dump_varargs_unicode_str( ", desc=", cur_size );
1575 1576
}

1577 1578 1579 1580 1581 1582 1583 1584 1585
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 );
1586 1587
    fprintf( stderr, ", unix_pid=%d", req->unix_pid );
    fprintf( stderr, ", unix_tid=%d", req->unix_tid );
1588 1589
}

1590
static void dump_set_thread_info_request( const struct set_thread_info_request *req )
1591
{
1592 1593 1594 1595
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", mask=%d", req->mask );
    fprintf( stderr, ", priority=%d", req->priority );
    dump_uint64( ", affinity=", &req->affinity );
1596
    dump_uint64( ", entry_point=", &req->entry_point );
1597
    fprintf( stderr, ", token=%04x", req->token );
1598
    dump_varargs_unicode_str( ", desc=", cur_size );
1599 1600
}

1601
static void dump_suspend_thread_request( const struct suspend_thread_request *req )
1602
{
1603
    fprintf( stderr, " handle=%04x", req->handle );
1604 1605
}

1606
static void dump_suspend_thread_reply( const struct suspend_thread_reply *req )
1607 1608 1609 1610
{
    fprintf( stderr, " count=%d", req->count );
}

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

1616
static void dump_resume_thread_reply( const struct resume_thread_reply *req )
1617 1618 1619 1620
{
    fprintf( stderr, " count=%d", req->count );
}

1621
static void dump_queue_apc_request( const struct queue_apc_request *req )
1622
{
1623 1624
    fprintf( stderr, " handle=%04x", req->handle );
    dump_apc_call( ", call=", &req->call );
Alexandre Julliard's avatar
Alexandre Julliard committed
1625 1626
}

1627 1628
static void dump_queue_apc_reply( const struct queue_apc_reply *req )
{
1629 1630
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", self=%d", req->self );
1631 1632
}

1633 1634
static void dump_get_apc_result_request( const struct get_apc_result_request *req )
{
1635
    fprintf( stderr, " handle=%04x", req->handle );
1636 1637 1638 1639
}

static void dump_get_apc_result_reply( const struct get_apc_result_reply *req )
{
1640
    dump_apc_result( " result=", &req->result );
1641 1642
}

1643
static void dump_close_handle_request( const struct close_handle_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1644
{
1645
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1646 1647
}

1648
static void dump_set_handle_info_request( const struct set_handle_info_request *req )
1649
{
1650 1651 1652
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", flags=%d", req->flags );
    fprintf( stderr, ", mask=%d", req->mask );
1653 1654
}

1655
static void dump_set_handle_info_reply( const struct set_handle_info_reply *req )
1656
{
1657 1658 1659
    fprintf( stderr, " old_flags=%d", req->old_flags );
}

1660
static void dump_dup_handle_request( const struct dup_handle_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1661
{
1662 1663 1664 1665 1666 1667
    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
1668 1669
}

1670
static void dump_dup_handle_reply( const struct dup_handle_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1671
{
1672
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1673 1674
}

1675 1676 1677 1678 1679 1680
static void dump_compare_objects_request( const struct compare_objects_request *req )
{
    fprintf( stderr, " first=%04x", req->first );
    fprintf( stderr, ", second=%04x", req->second );
}

1681 1682 1683 1684 1685
static void dump_make_temporary_request( const struct make_temporary_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
}

1686
static void dump_open_process_request( const struct open_process_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1687
{
1688 1689 1690
    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
1691 1692
}

1693
static void dump_open_process_reply( const struct open_process_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1694
{
1695
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1696 1697
}

1698 1699
static void dump_open_thread_request( const struct open_thread_request *req )
{
1700 1701 1702
    fprintf( stderr, " tid=%04x", req->tid );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
1703 1704 1705 1706
}

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

1710
static void dump_select_request( const struct select_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1711
{
1712 1713
    fprintf( stderr, " flags=%d", req->flags );
    dump_uint64( ", cookie=", &req->cookie );
1714
    dump_abstime( ", timeout=", &req->timeout );
1715
    fprintf( stderr, ", size=%u", req->size );
1716
    fprintf( stderr, ", prev_apc=%04x", req->prev_apc );
1717
    dump_varargs_apc_result( ", result=", cur_size );
1718
    dump_varargs_select_op( ", data=", min(cur_size,req->size) );
1719
    dump_varargs_contexts( ", contexts=", cur_size );
Alexandre Julliard's avatar
Alexandre Julliard committed
1720 1721
}

1722 1723
static void dump_select_reply( const struct select_reply *req )
{
1724
    dump_apc_call( " call=", &req->call );
1725
    fprintf( stderr, ", apc_handle=%04x", req->apc_handle );
1726
    fprintf( stderr, ", signaled=%d", req->signaled );
1727
    dump_varargs_contexts( ", contexts=", cur_size );
1728 1729
}

1730
static void dump_create_event_request( const struct create_event_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1731
{
1732 1733 1734 1735
    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
1736 1737
}

1738
static void dump_create_event_reply( const struct create_event_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1739
{
1740
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1741 1742
}

1743
static void dump_event_op_request( const struct event_op_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1744
{
1745 1746
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", op=%d", req->op );
Alexandre Julliard's avatar
Alexandre Julliard committed
1747 1748
}

1749 1750 1751 1752 1753
static void dump_event_op_reply( const struct event_op_reply *req )
{
    fprintf( stderr, " state=%d", req->state );
}

1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764
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 );
}

1765
static void dump_open_event_request( const struct open_event_request *req )
1766
{
1767 1768 1769 1770
    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 );
1771 1772
}

1773
static void dump_open_event_reply( const struct open_event_reply *req )
1774
{
1775
    fprintf( stderr, " handle=%04x", req->handle );
1776 1777
}

1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801
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 );
}

1802
static void dump_create_mutex_request( const struct create_mutex_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1803
{
1804 1805 1806
    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
1807 1808
}

1809
static void dump_create_mutex_reply( const struct create_mutex_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1810
{
1811
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1812 1813
}

1814
static void dump_release_mutex_request( const struct release_mutex_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1815
{
1816
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1817 1818
}

1819 1820 1821 1822 1823
static void dump_release_mutex_reply( const struct release_mutex_reply *req )
{
    fprintf( stderr, " prev_count=%08x", req->prev_count );
}

1824
static void dump_open_mutex_request( const struct open_mutex_request *req )
1825
{
1826 1827 1828 1829
    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 );
1830 1831
}

1832
static void dump_open_mutex_reply( const struct open_mutex_reply *req )
1833
{
1834
    fprintf( stderr, " handle=%04x", req->handle );
1835 1836
}

1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848
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 );
}

1849
static void dump_create_semaphore_request( const struct create_semaphore_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1850
{
1851 1852 1853 1854
    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
1855 1856
}

1857
static void dump_create_semaphore_reply( const struct create_semaphore_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1858
{
1859
    fprintf( stderr, " handle=%04x", req->handle );
Alexandre Julliard's avatar
Alexandre Julliard committed
1860 1861
}

1862
static void dump_release_semaphore_request( const struct release_semaphore_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1863
{
1864 1865
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", count=%08x", req->count );
Alexandre Julliard's avatar
Alexandre Julliard committed
1866 1867
}

1868
static void dump_release_semaphore_reply( const struct release_semaphore_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1869
{
1870
    fprintf( stderr, " prev_count=%08x", req->prev_count );
Alexandre Julliard's avatar
Alexandre Julliard committed
1871 1872
}

1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883
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 );
}

1884
static void dump_open_semaphore_request( const struct open_semaphore_request *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1885
{
1886 1887 1888 1889
    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 );
1890 1891
}

1892
static void dump_open_semaphore_reply( const struct open_semaphore_reply *req )
1893
{
1894
    fprintf( stderr, " handle=%04x", req->handle );
1895 1896
}

1897
static void dump_create_file_request( const struct create_file_request *req )
1898
{
1899 1900 1901 1902 1903 1904 1905
    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 );
1906 1907
}

1908
static void dump_create_file_reply( const struct create_file_reply *req )
1909
{
1910
    fprintf( stderr, " handle=%04x", req->handle );
1911 1912
}

1913 1914
static void dump_open_file_object_request( const struct open_file_object_request *req )
{
1915 1916 1917 1918 1919 1920
    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 );
1921 1922 1923 1924
}

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

1928
static void dump_alloc_file_handle_request( const struct alloc_file_handle_request *req )
1929
{
1930 1931 1932
    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
1933 1934
}

1935
static void dump_alloc_file_handle_reply( const struct alloc_file_handle_reply *req )
Alexandre Julliard's avatar
Alexandre Julliard committed
1936
{
1937
    fprintf( stderr, " handle=%04x", req->handle );
1938 1939
}

1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950
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 );
}

1951
static void dump_get_handle_fd_request( const struct get_handle_fd_request *req )
1952
{
1953
    fprintf( stderr, " handle=%04x", req->handle );
1954 1955
}

1956
static void dump_get_handle_fd_reply( const struct get_handle_fd_reply *req )
1957
{
1958
    fprintf( stderr, " type=%d", req->type );
1959
    fprintf( stderr, ", cacheable=%d", req->cacheable );
1960 1961
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", options=%08x", req->options );
1962 1963
}

1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974
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 );
}

1975
static void dump_flush_request( const struct flush_request *req )
1976
{
1977
    dump_async_data( " async=", &req->async );
1978 1979
}

1980
static void dump_flush_reply( const struct flush_reply *req )
1981
{
1982
    fprintf( stderr, " event=%04x", req->event );
1983 1984
}

1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995
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 );
}

1996 1997 1998
static void dump_get_volume_info_request( const struct get_volume_info_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
1999
    dump_async_data( ", async=", &req->async );
2000 2001 2002 2003 2004
    fprintf( stderr, ", info_class=%08x", req->info_class );
}

static void dump_get_volume_info_reply( const struct get_volume_info_reply *req )
{
2005 2006
    fprintf( stderr, " wait=%04x", req->wait );
    dump_varargs_bytes( ", data=", cur_size );
2007 2008
}

2009
static void dump_lock_file_request( const struct lock_file_request *req )
2010
{
2011 2012 2013 2014 2015
    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 );
2016 2017 2018 2019
}

static void dump_lock_file_reply( const struct lock_file_reply *req )
{
2020 2021
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", overlapped=%d", req->overlapped );
2022 2023
}

2024
static void dump_unlock_file_request( const struct unlock_file_request *req )
2025
{
2026 2027 2028
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", offset=", &req->offset );
    dump_uint64( ", count=", &req->count );
2029 2030
}

2031 2032
static void dump_recv_socket_request( const struct recv_socket_request *req )
{
2033 2034
    fprintf( stderr, " oob=%d", req->oob );
    dump_async_data( ", async=", &req->async );
2035
    fprintf( stderr, ", force_async=%d", req->force_async );
2036 2037 2038 2039 2040 2041
}

static void dump_recv_socket_reply( const struct recv_socket_reply *req )
{
    fprintf( stderr, " wait=%04x", req->wait );
    fprintf( stderr, ", options=%08x", req->options );
2042
    fprintf( stderr, ", nonblocking=%d", req->nonblocking );
2043 2044
}

2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057
static void dump_send_socket_request( const struct send_socket_request *req )
{
    dump_async_data( " async=", &req->async );
    fprintf( stderr, ", status=%08x", req->status );
    fprintf( stderr, ", total=%08x", req->total );
}

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

2058 2059 2060 2061
static void dump_get_next_console_request_request( const struct get_next_console_request_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", signal=%d", req->signal );
2062
    fprintf( stderr, ", read=%d", req->read );
2063 2064 2065 2066 2067 2068 2069
    fprintf( stderr, ", status=%08x", req->status );
    dump_varargs_bytes( ", out_data=", cur_size );
}

static void dump_get_next_console_request_reply( const struct get_next_console_request_reply *req )
{
    fprintf( stderr, " code=%08x", req->code );
2070
    fprintf( stderr, ", output=%08x", req->output );
2071 2072 2073 2074
    fprintf( stderr, ", out_size=%u", req->out_size );
    dump_varargs_bytes( ", in_data=", cur_size );
}

2075
static void dump_read_directory_changes_request( const struct read_directory_changes_request *req )
2076
{
2077 2078 2079 2080
    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 );
2081 2082 2083 2084
}

static void dump_read_change_request( const struct read_change_request *req )
{
2085
    fprintf( stderr, " handle=%04x", req->handle );
2086 2087 2088 2089
}

static void dump_read_change_reply( const struct read_change_reply *req )
{
2090
    dump_varargs_filesystem_event( " events=", cur_size );
2091 2092
}

2093
static void dump_create_mapping_request( const struct create_mapping_request *req )
2094
{
2095
    fprintf( stderr, " access=%08x", req->access );
2096
    fprintf( stderr, ", flags=%08x", req->flags );
2097
    fprintf( stderr, ", file_access=%08x", req->file_access );
2098 2099 2100
    dump_uint64( ", size=", &req->size );
    fprintf( stderr, ", file_handle=%04x", req->file_handle );
    dump_varargs_object_attributes( ", objattr=", cur_size );
2101 2102
}

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

2108
static void dump_open_mapping_request( const struct open_mapping_request *req )
2109
{
2110 2111 2112 2113
    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 );
2114 2115
}

2116
static void dump_open_mapping_reply( const struct open_mapping_reply *req )
2117
{
2118
    fprintf( stderr, " handle=%04x", req->handle );
2119 2120
}

2121
static void dump_get_mapping_info_request( const struct get_mapping_info_request *req )
2122
{
2123 2124
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", access=%08x", req->access );
2125 2126
}

2127
static void dump_get_mapping_info_reply( const struct get_mapping_info_reply *req )
2128
{
2129
    dump_uint64( " size=", &req->size );
2130
    fprintf( stderr, ", flags=%08x", req->flags );
2131
    fprintf( stderr, ", shared_file=%04x", req->shared_file );
2132
    fprintf( stderr, ", total=%u", req->total );
2133
    dump_varargs_pe_image_info( ", image=", cur_size );
2134
    dump_varargs_unicode_str( ", name=", cur_size );
2135 2136
}

2137 2138 2139 2140 2141 2142 2143
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 );
2144
    dump_varargs_pe_image_info( ", image=", cur_size );
2145
    dump_varargs_unicode_str( ", name=", cur_size );
2146 2147 2148 2149 2150 2151 2152
}

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

2153 2154
static void dump_get_mapping_committed_range_request( const struct get_mapping_committed_range_request *req )
{
2155
    dump_uint64( " base=", &req->base );
2156
    dump_uint64( ", offset=", &req->offset );
2157 2158 2159 2160
}

static void dump_get_mapping_committed_range_reply( const struct get_mapping_committed_range_reply *req )
{
2161 2162
    dump_uint64( " size=", &req->size );
    fprintf( stderr, ", committed=%d", req->committed );
2163 2164 2165 2166
}

static void dump_add_mapping_committed_range_request( const struct add_mapping_committed_range_request *req )
{
2167
    dump_uint64( " base=", &req->base );
2168 2169
    dump_uint64( ", offset=", &req->offset );
    dump_uint64( ", size=", &req->size );
2170 2171
}

2172 2173 2174 2175 2176 2177
static void dump_is_same_mapping_request( const struct is_same_mapping_request *req )
{
    dump_uint64( " base1=", &req->base1 );
    dump_uint64( ", base2=", &req->base2 );
}

2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189
static void dump_get_mapping_filename_request( const struct get_mapping_filename_request *req )
{
    fprintf( stderr, " process=%04x", req->process );
    dump_uint64( ", addr=", &req->addr );
}

static void dump_get_mapping_filename_reply( const struct get_mapping_filename_reply *req )
{
    fprintf( stderr, " len=%u", req->len );
    dump_varargs_unicode_str( ", filename=", cur_size );
}

2190 2191 2192 2193 2194 2195 2196 2197
static void dump_list_processes_request( const struct list_processes_request *req )
{
}

static void dump_list_processes_reply( const struct list_processes_reply *req )
{
    fprintf( stderr, " info_size=%u", req->info_size );
    fprintf( stderr, ", process_count=%d", req->process_count );
2198 2199
    fprintf( stderr, ", total_thread_count=%d", req->total_thread_count );
    fprintf( stderr, ", total_name_len=%u", req->total_name_len );
2200 2201 2202
    dump_varargs_process_info( ", data=", min(cur_size,req->info_size) );
}

2203 2204 2205
static void dump_create_debug_obj_request( const struct create_debug_obj_request *req )
{
    fprintf( stderr, " access=%08x", req->access );
2206
    fprintf( stderr, ", flags=%08x", req->flags );
2207 2208 2209 2210 2211 2212 2213 2214
    dump_varargs_object_attributes( ", objattr=", cur_size );
}

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

2215
static void dump_wait_debug_event_request( const struct wait_debug_event_request *req )
2216
{
2217
    fprintf( stderr, " debug=%04x", req->debug );
2218 2219
}

2220
static void dump_wait_debug_event_reply( const struct wait_debug_event_reply *req )
2221
{
2222 2223 2224
    fprintf( stderr, " pid=%04x", req->pid );
    fprintf( stderr, ", tid=%04x", req->tid );
    dump_varargs_debug_event( ", event=", cur_size );
2225 2226
}

2227
static void dump_queue_exception_event_request( const struct queue_exception_event_request *req )
2228
{
2229 2230 2231 2232 2233 2234 2235
    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) );
2236 2237
}

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

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

2248
static void dump_continue_debug_event_request( const struct continue_debug_event_request *req )
2249
{
2250 2251
    fprintf( stderr, " debug=%04x", req->debug );
    fprintf( stderr, ", pid=%04x", req->pid );
2252
    fprintf( stderr, ", tid=%04x", req->tid );
2253
    fprintf( stderr, ", status=%08x", req->status );
2254 2255
}

2256
static void dump_debug_process_request( const struct debug_process_request *req )
2257
{
2258 2259
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", debug=%04x", req->debug );
2260
    fprintf( stderr, ", attach=%d", req->attach );
2261 2262
}

2263
static void dump_set_debug_obj_info_request( const struct set_debug_obj_info_request *req )
2264
{
2265 2266
    fprintf( stderr, " debug=%04x", req->debug );
    fprintf( stderr, ", flags=%08x", req->flags );
2267
}
2268

2269
static void dump_read_process_memory_request( const struct read_process_memory_request *req )
2270
{
2271 2272
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", addr=", &req->addr );
2273 2274
}

2275
static void dump_read_process_memory_reply( const struct read_process_memory_reply *req )
2276
{
2277
    dump_varargs_bytes( " data=", cur_size );
2278 2279
}

2280
static void dump_write_process_memory_request( const struct write_process_memory_request *req )
2281
{
2282 2283 2284
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", addr=", &req->addr );
    dump_varargs_bytes( ", data=", cur_size );
2285 2286
}

2287
static void dump_create_key_request( const struct create_key_request *req )
2288
{
2289
    fprintf( stderr, " access=%08x", req->access );
2290
    fprintf( stderr, ", options=%08x", req->options );
2291
    dump_varargs_object_attributes( ", objattr=", cur_size );
2292
    dump_varargs_unicode_str( ", class=", cur_size );
2293 2294
}

2295
static void dump_create_key_reply( const struct create_key_reply *req )
2296
{
2297 2298
    fprintf( stderr, " hkey=%04x", req->hkey );
    fprintf( stderr, ", created=%d", req->created );
2299 2300
}

2301
static void dump_open_key_request( const struct open_key_request *req )
2302
{
2303 2304 2305 2306
    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 );
2307 2308
}

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

2314
static void dump_delete_key_request( const struct delete_key_request *req )
2315
{
2316
    fprintf( stderr, " hkey=%04x", req->hkey );
2317 2318
}

2319 2320
static void dump_flush_key_request( const struct flush_key_request *req )
{
2321
    fprintf( stderr, " hkey=%04x", req->hkey );
2322 2323
}

2324
static void dump_enum_key_request( const struct enum_key_request *req )
2325
{
2326 2327 2328
    fprintf( stderr, " hkey=%04x", req->hkey );
    fprintf( stderr, ", index=%d", req->index );
    fprintf( stderr, ", info_class=%d", req->info_class );
2329 2330
}

2331
static void dump_enum_key_reply( const struct enum_key_reply *req )
2332
{
2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343
    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 );
2344 2345
}

2346
static void dump_set_key_value_request( const struct set_key_value_request *req )
2347
{
2348 2349 2350 2351 2352
    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 );
2353 2354
}

2355
static void dump_get_key_value_request( const struct get_key_value_request *req )
2356
{
2357 2358
    fprintf( stderr, " hkey=%04x", req->hkey );
    dump_varargs_unicode_str( ", name=", cur_size );
2359 2360
}

2361
static void dump_get_key_value_reply( const struct get_key_value_reply *req )
2362
{
2363 2364 2365
    fprintf( stderr, " type=%d", req->type );
    fprintf( stderr, ", total=%u", req->total );
    dump_varargs_bytes( ", data=", cur_size );
2366 2367
}

2368
static void dump_enum_key_value_request( const struct enum_key_value_request *req )
2369
{
2370 2371 2372
    fprintf( stderr, " hkey=%04x", req->hkey );
    fprintf( stderr, ", index=%d", req->index );
    fprintf( stderr, ", info_class=%d", req->info_class );
2373 2374
}

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

2384
static void dump_delete_key_value_request( const struct delete_key_value_request *req )
2385
{
2386 2387
    fprintf( stderr, " hkey=%04x", req->hkey );
    dump_varargs_unicode_str( ", name=", cur_size );
2388 2389
}

2390
static void dump_load_registry_request( const struct load_registry_request *req )
2391
{
2392 2393
    fprintf( stderr, " file=%04x", req->file );
    dump_varargs_object_attributes( ", objattr=", cur_size );
2394 2395
}

2396 2397
static void dump_unload_registry_request( const struct unload_registry_request *req )
{
2398 2399 2400
    fprintf( stderr, " parent=%04x", req->parent );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    dump_varargs_unicode_str( ", name=", cur_size );
2401 2402
}

2403
static void dump_save_registry_request( const struct save_registry_request *req )
2404
{
2405 2406
    fprintf( stderr, " hkey=%04x", req->hkey );
    fprintf( stderr, ", file=%04x", req->file );
2407 2408
}

2409 2410
static void dump_set_registry_notification_request( const struct set_registry_notification_request *req )
{
2411 2412 2413 2414
    fprintf( stderr, " hkey=%04x", req->hkey );
    fprintf( stderr, ", event=%04x", req->event );
    fprintf( stderr, ", subtree=%d", req->subtree );
    fprintf( stderr, ", filter=%08x", req->filter );
2415 2416
}

2417
static void dump_create_timer_request( const struct create_timer_request *req )
2418
{
2419 2420
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", manual=%d", req->manual );
2421
    dump_varargs_object_attributes( ", objattr=", cur_size );
2422 2423
}

2424
static void dump_create_timer_reply( const struct create_timer_reply *req )
2425
{
2426
    fprintf( stderr, " handle=%04x", req->handle );
2427 2428
}

2429
static void dump_open_timer_request( const struct open_timer_request *req )
2430
{
2431 2432 2433 2434
    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 );
2435 2436
}

2437
static void dump_open_timer_reply( const struct open_timer_reply *req )
2438
{
2439
    fprintf( stderr, " handle=%04x", req->handle );
2440 2441
}

2442
static void dump_set_timer_request( const struct set_timer_request *req )
2443
{
2444 2445 2446 2447 2448
    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 );
2449 2450
}

2451 2452 2453 2454 2455
static void dump_set_timer_reply( const struct set_timer_reply *req )
{
    fprintf( stderr, " signaled=%d", req->signaled );
}

2456
static void dump_cancel_timer_request( const struct cancel_timer_request *req )
2457
{
2458
    fprintf( stderr, " handle=%04x", req->handle );
2459 2460
}

2461 2462 2463 2464 2465
static void dump_cancel_timer_reply( const struct cancel_timer_reply *req )
{
    fprintf( stderr, " signaled=%d", req->signaled );
}

2466 2467
static void dump_get_timer_info_request( const struct get_timer_info_request *req )
{
2468
    fprintf( stderr, " handle=%04x", req->handle );
2469 2470 2471 2472
}

static void dump_get_timer_info_reply( const struct get_timer_info_reply *req )
{
2473 2474
    dump_timeout( " when=", &req->when );
    fprintf( stderr, ", signaled=%d", req->signaled );
2475 2476
}

2477 2478
static void dump_get_thread_context_request( const struct get_thread_context_request *req )
{
2479
    fprintf( stderr, " handle=%04x", req->handle );
2480
    fprintf( stderr, ", context=%04x", req->context );
2481
    fprintf( stderr, ", flags=%08x", req->flags );
2482
    fprintf( stderr, ", machine=%04x", req->machine );
2483 2484
}

2485
static void dump_get_thread_context_reply( const struct get_thread_context_reply *req )
2486
{
2487
    fprintf( stderr, " self=%d", req->self );
2488
    fprintf( stderr, ", handle=%04x", req->handle );
2489
    dump_varargs_contexts( ", contexts=", cur_size );
2490 2491 2492 2493
}

static void dump_set_thread_context_request( const struct set_thread_context_request *req )
{
2494
    fprintf( stderr, " handle=%04x", req->handle );
2495
    dump_varargs_contexts( ", contexts=", cur_size );
2496 2497
}

2498 2499 2500 2501 2502
static void dump_set_thread_context_reply( const struct set_thread_context_reply *req )
{
    fprintf( stderr, " self=%d", req->self );
}

2503 2504
static void dump_get_selector_entry_request( const struct get_selector_entry_request *req )
{
2505 2506
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", entry=%d", req->entry );
2507 2508
}

2509
static void dump_get_selector_entry_reply( const struct get_selector_entry_reply *req )
2510
{
2511 2512 2513
    fprintf( stderr, " base=%08x", req->base );
    fprintf( stderr, ", limit=%08x", req->limit );
    fprintf( stderr, ", flags=%02x", req->flags );
2514 2515
}

2516 2517
static void dump_add_atom_request( const struct add_atom_request *req )
{
2518
    dump_varargs_unicode_str( " name=", cur_size );
2519 2520
}

2521
static void dump_add_atom_reply( const struct add_atom_reply *req )
2522
{
2523
    fprintf( stderr, " atom=%04x", req->atom );
2524 2525 2526 2527
}

static void dump_delete_atom_request( const struct delete_atom_request *req )
{
2528
    fprintf( stderr, " atom=%04x", req->atom );
2529 2530 2531 2532
}

static void dump_find_atom_request( const struct find_atom_request *req )
{
2533
    dump_varargs_unicode_str( " name=", cur_size );
2534 2535
}

2536
static void dump_find_atom_reply( const struct find_atom_reply *req )
2537
{
2538
    fprintf( stderr, " atom=%04x", req->atom );
2539 2540
}

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

2546
static void dump_get_atom_information_reply( const struct get_atom_information_reply *req )
2547
{
2548 2549 2550 2551
    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 );
2552 2553
}

2554 2555 2556 2557
static void dump_get_msg_queue_request( const struct get_msg_queue_request *req )
{
}

2558
static void dump_get_msg_queue_reply( const struct get_msg_queue_reply *req )
2559
{
2560
    fprintf( stderr, " handle=%04x", req->handle );
2561 2562
}

2563 2564
static void dump_set_queue_fd_request( const struct set_queue_fd_request *req )
{
2565
    fprintf( stderr, " handle=%04x", req->handle );
2566 2567
}

2568 2569
static void dump_set_queue_mask_request( const struct set_queue_mask_request *req )
{
2570 2571 2572
    fprintf( stderr, " wake_mask=%08x", req->wake_mask );
    fprintf( stderr, ", changed_mask=%08x", req->changed_mask );
    fprintf( stderr, ", skip_wait=%d", req->skip_wait );
2573 2574
}

2575
static void dump_set_queue_mask_reply( const struct set_queue_mask_reply *req )
2576
{
2577 2578
    fprintf( stderr, " wake_bits=%08x", req->wake_bits );
    fprintf( stderr, ", changed_bits=%08x", req->changed_bits );
2579 2580 2581 2582
}

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

2586
static void dump_get_queue_status_reply( const struct get_queue_status_reply *req )
2587
{
2588 2589
    fprintf( stderr, " wake_bits=%08x", req->wake_bits );
    fprintf( stderr, ", changed_bits=%08x", req->changed_bits );
2590 2591
}

2592
static void dump_get_process_idle_event_request( const struct get_process_idle_event_request *req )
2593
{
2594
    fprintf( stderr, " handle=%04x", req->handle );
2595 2596
}

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

2602 2603
static void dump_send_message_request( const struct send_message_request *req )
{
2604 2605 2606 2607 2608 2609 2610 2611 2612
    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 );
2613 2614
}

2615 2616 2617 2618 2619
static void dump_post_quit_message_request( const struct post_quit_message_request *req )
{
    fprintf( stderr, " exit_code=%d", req->exit_code );
}

2620 2621
static void dump_send_hardware_message_request( const struct send_hardware_message_request *req )
{
2622
    fprintf( stderr, " win=%08x", req->win );
2623 2624
    dump_hw_input( ", input=", &req->input );
    fprintf( stderr, ", flags=%08x", req->flags );
2625
    dump_varargs_bytes( ", report=", cur_size );
2626 2627 2628 2629 2630
}

static void dump_send_hardware_message_reply( const struct send_hardware_message_reply *req )
{
    fprintf( stderr, " wait=%d", req->wait );
2631 2632 2633 2634
    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 );
2635
    dump_varargs_bytes( ", keystate=", cur_size );
2636 2637
}

2638 2639
static void dump_get_message_request( const struct get_message_request *req )
{
2640 2641 2642 2643 2644 2645 2646
    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 );
2647 2648
}

2649
static void dump_get_message_reply( const struct get_message_reply *req )
2650
{
2651 2652 2653 2654 2655
    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 );
2656 2657
    fprintf( stderr, ", x=%d", req->x );
    fprintf( stderr, ", y=%d", req->y );
2658 2659 2660 2661
    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 );
2662 2663 2664 2665
}

static void dump_reply_message_request( const struct reply_message_request *req )
{
2666 2667 2668
    fprintf( stderr, " remove=%d", req->remove );
    dump_uint64( ", result=", &req->result );
    dump_varargs_bytes( ", data=", cur_size );
2669 2670
}

2671 2672
static void dump_accept_hardware_message_request( const struct accept_hardware_message_request *req )
{
2673
    fprintf( stderr, " hw_id=%08x", req->hw_id );
2674 2675
}

2676 2677 2678 2679 2680
static void dump_get_message_reply_request( const struct get_message_reply_request *req )
{
    fprintf( stderr, " cancel=%d", req->cancel );
}

2681
static void dump_get_message_reply_reply( const struct get_message_reply_reply *req )
2682
{
2683 2684
    dump_uint64( " result=", &req->result );
    dump_varargs_bytes( ", data=", cur_size );
2685 2686 2687 2688
}

static void dump_set_win_timer_request( const struct set_win_timer_request *req )
{
2689 2690 2691 2692 2693
    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 );
2694 2695
}

2696 2697
static void dump_set_win_timer_reply( const struct set_win_timer_reply *req )
{
2698
    dump_uint64( " id=", &req->id );
2699 2700
}

2701 2702
static void dump_kill_win_timer_request( const struct kill_win_timer_request *req )
{
2703 2704 2705
    fprintf( stderr, " win=%08x", req->win );
    dump_uint64( ", id=", &req->id );
    fprintf( stderr, ", msg=%08x", req->msg );
2706 2707
}

2708 2709
static void dump_is_window_hung_request( const struct is_window_hung_request *req )
{
2710
    fprintf( stderr, " win=%08x", req->win );
2711 2712 2713 2714 2715 2716 2717
}

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

2718 2719
static void dump_get_serial_info_request( const struct get_serial_info_request *req )
{
2720
    fprintf( stderr, " handle=%04x", req->handle );
2721
    fprintf( stderr, ", flags=%d", req->flags );
2722 2723
}

2724
static void dump_get_serial_info_reply( const struct get_serial_info_reply *req )
2725
{
2726
    fprintf( stderr, " eventmask=%08x", req->eventmask );
2727
    fprintf( stderr, ", cookie=%08x", req->cookie );
2728
    fprintf( stderr, ", pending_write=%08x", req->pending_write );
2729 2730 2731 2732
}

static void dump_set_serial_info_request( const struct set_serial_info_request *req )
{
2733 2734
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", flags=%d", req->flags );
2735 2736
}

2737
static void dump_register_async_request( const struct register_async_request *req )
2738
{
2739 2740 2741
    fprintf( stderr, " type=%d", req->type );
    dump_async_data( ", async=", &req->async );
    fprintf( stderr, ", count=%d", req->count );
2742 2743 2744 2745
}

static void dump_cancel_async_request( const struct cancel_async_request *req )
{
2746
    fprintf( stderr, " handle=%04x", req->handle );
2747 2748
    dump_uint64( ", iosb=", &req->iosb );
    fprintf( stderr, ", only_thread=%d", req->only_thread );
2749 2750
}

2751 2752 2753 2754 2755 2756 2757
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 )
{
2758
    dump_varargs_bytes( " out_data=", cur_size );
2759 2760
}

2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772
static void dump_set_async_direct_result_request( const struct set_async_direct_result_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", information=", &req->information );
    fprintf( stderr, ", status=%08x", req->status );
}

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

2773 2774
static void dump_read_request( const struct read_request *req )
{
2775
    dump_async_data( " async=", &req->async );
2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787
    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 )
{
2788
    dump_async_data( " async=", &req->async );
2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799
    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 );
}

2800 2801
static void dump_ioctl_request( const struct ioctl_request *req )
{
2802 2803 2804
    dump_ioctl_code( " code=", &req->code );
    dump_async_data( ", async=", &req->async );
    dump_varargs_bytes( ", in_data=", cur_size );
2805 2806 2807 2808
}

static void dump_ioctl_reply( const struct ioctl_reply *req )
{
2809 2810 2811
    fprintf( stderr, " wait=%04x", req->wait );
    fprintf( stderr, ", options=%08x", req->options );
    dump_varargs_bytes( ", out_data=", cur_size );
2812 2813
}

2814
static void dump_set_irp_result_request( const struct set_irp_result_request *req )
2815
{
2816
    fprintf( stderr, " handle=%04x", req->handle );
2817
    fprintf( stderr, ", status=%08x", req->status );
2818
    fprintf( stderr, ", size=%u", req->size );
2819 2820 2821
    dump_varargs_bytes( ", data=", cur_size );
}

2822 2823
static void dump_create_named_pipe_request( const struct create_named_pipe_request *req )
{
2824 2825
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", options=%08x", req->options );
2826
    fprintf( stderr, ", sharing=%08x", req->sharing );
2827 2828 2829 2830 2831
    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 );
2832
    dump_varargs_object_attributes( ", objattr=", cur_size );
2833 2834
}

2835
static void dump_create_named_pipe_reply( const struct create_named_pipe_reply *req )
2836
{
2837
    fprintf( stderr, " handle=%04x", req->handle );
2838 2839
}

2840 2841 2842 2843 2844 2845
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 );
}

2846 2847
static void dump_create_window_request( const struct create_window_request *req )
{
2848 2849 2850 2851
    fprintf( stderr, " parent=%08x", req->parent );
    fprintf( stderr, ", owner=%08x", req->owner );
    fprintf( stderr, ", atom=%04x", req->atom );
    dump_uint64( ", instance=", &req->instance );
2852
    fprintf( stderr, ", dpi=%d", req->dpi );
2853
    fprintf( stderr, ", awareness=%d", req->awareness );
2854 2855
    fprintf( stderr, ", style=%08x", req->style );
    fprintf( stderr, ", ex_style=%08x", req->ex_style );
2856
    dump_varargs_unicode_str( ", class=", cur_size );
2857 2858
}

2859
static void dump_create_window_reply( const struct create_window_reply *req )
2860
{
2861 2862 2863 2864 2865
    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 );
2866
    fprintf( stderr, ", dpi=%d", req->dpi );
2867
    fprintf( stderr, ", awareness=%d", req->awareness );
2868 2869 2870 2871
}

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

2875 2876
static void dump_get_desktop_window_request( const struct get_desktop_window_request *req )
{
2877
    fprintf( stderr, " force=%d", req->force );
2878 2879 2880 2881
}

static void dump_get_desktop_window_reply( const struct get_desktop_window_reply *req )
{
2882 2883
    fprintf( stderr, " top_window=%08x", req->top_window );
    fprintf( stderr, ", msg_window=%08x", req->msg_window );
2884 2885
}

2886 2887
static void dump_set_window_owner_request( const struct set_window_owner_request *req )
{
2888 2889
    fprintf( stderr, " handle=%08x", req->handle );
    fprintf( stderr, ", owner=%08x", req->owner );
2890 2891
}

2892
static void dump_set_window_owner_reply( const struct set_window_owner_reply *req )
2893
{
2894 2895
    fprintf( stderr, " full_owner=%08x", req->full_owner );
    fprintf( stderr, ", prev_owner=%08x", req->prev_owner );
2896 2897
}

2898 2899
static void dump_get_window_info_request( const struct get_window_info_request *req )
{
2900
    fprintf( stderr, " handle=%08x", req->handle );
2901 2902
}

2903
static void dump_get_window_info_reply( const struct get_window_info_reply *req )
2904
{
2905 2906 2907 2908 2909 2910
    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 );
2911
    fprintf( stderr, ", dpi=%d", req->dpi );
2912
    fprintf( stderr, ", awareness=%d", req->awareness );
2913 2914 2915 2916
}

static void dump_set_window_info_request( const struct set_window_info_request *req )
{
2917 2918 2919 2920 2921
    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 );
2922
    fprintf( stderr, ", extra_size=%u", req->extra_size );
2923 2924 2925
    dump_uint64( ", instance=", &req->instance );
    dump_uint64( ", user_data=", &req->user_data );
    dump_uint64( ", extra_value=", &req->extra_value );
2926
    fprintf( stderr, ", extra_offset=%d", req->extra_offset );
2927 2928
}

2929
static void dump_set_window_info_reply( const struct set_window_info_reply *req )
2930
{
2931 2932 2933 2934 2935
    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 );
2936
    dump_uint64( ", old_id=", &req->old_id );
2937 2938
}

2939 2940
static void dump_set_parent_request( const struct set_parent_request *req )
{
2941 2942
    fprintf( stderr, " handle=%08x", req->handle );
    fprintf( stderr, ", parent=%08x", req->parent );
2943 2944 2945 2946
}

static void dump_set_parent_reply( const struct set_parent_reply *req )
{
2947 2948
    fprintf( stderr, " old_parent=%08x", req->old_parent );
    fprintf( stderr, ", full_parent=%08x", req->full_parent );
2949
    fprintf( stderr, ", dpi=%d", req->dpi );
2950
    fprintf( stderr, ", awareness=%d", req->awareness );
2951 2952
}

2953 2954
static void dump_get_window_parents_request( const struct get_window_parents_request *req )
{
2955
    fprintf( stderr, " handle=%08x", req->handle );
2956 2957
}

2958
static void dump_get_window_parents_reply( const struct get_window_parents_reply *req )
2959
{
2960 2961
    fprintf( stderr, " count=%d", req->count );
    dump_varargs_user_handles( ", parents=", cur_size );
2962 2963 2964 2965
}

static void dump_get_window_children_request( const struct get_window_children_request *req )
{
2966 2967 2968 2969 2970
    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 );
2971 2972
}

2973
static void dump_get_window_children_reply( const struct get_window_children_reply *req )
2974
{
2975 2976
    fprintf( stderr, " count=%d", req->count );
    dump_varargs_user_handles( ", children=", cur_size );
2977 2978
}

2979 2980
static void dump_get_window_children_from_point_request( const struct get_window_children_from_point_request *req )
{
2981 2982 2983
    fprintf( stderr, " parent=%08x", req->parent );
    fprintf( stderr, ", x=%d", req->x );
    fprintf( stderr, ", y=%d", req->y );
2984
    fprintf( stderr, ", dpi=%d", req->dpi );
2985 2986 2987 2988
}

static void dump_get_window_children_from_point_reply( const struct get_window_children_from_point_reply *req )
{
2989 2990
    fprintf( stderr, " count=%d", req->count );
    dump_varargs_user_handles( ", children=", cur_size );
2991 2992
}

2993 2994
static void dump_get_window_tree_request( const struct get_window_tree_request *req )
{
2995
    fprintf( stderr, " handle=%08x", req->handle );
2996 2997
}

2998
static void dump_get_window_tree_reply( const struct get_window_tree_reply *req )
2999
{
3000 3001 3002 3003 3004 3005 3006 3007
    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 );
3008 3009
}

3010
static void dump_set_window_pos_request( const struct set_window_pos_request *req )
3011
{
3012 3013
    fprintf( stderr, " swp_flags=%04x", req->swp_flags );
    fprintf( stderr, ", paint_flags=%04x", req->paint_flags );
3014 3015 3016 3017 3018
    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 );
3019 3020
}

3021 3022
static void dump_set_window_pos_reply( const struct set_window_pos_reply *req )
{
3023 3024
    fprintf( stderr, " new_style=%08x", req->new_style );
    fprintf( stderr, ", new_ex_style=%08x", req->new_ex_style );
3025
    fprintf( stderr, ", surface_win=%08x", req->surface_win );
3026
    fprintf( stderr, ", needs_update=%d", req->needs_update );
3027 3028
}

3029 3030
static void dump_get_window_rectangles_request( const struct get_window_rectangles_request *req )
{
3031
    fprintf( stderr, " handle=%08x", req->handle );
3032
    fprintf( stderr, ", relative=%d", req->relative );
3033
    fprintf( stderr, ", dpi=%d", req->dpi );
3034 3035
}

3036
static void dump_get_window_rectangles_reply( const struct get_window_rectangles_reply *req )
3037
{
3038 3039
    dump_rectangle( " window=", &req->window );
    dump_rectangle( ", client=", &req->client );
3040 3041
}

3042 3043
static void dump_get_window_text_request( const struct get_window_text_request *req )
{
3044
    fprintf( stderr, " handle=%08x", req->handle );
3045 3046
}

3047
static void dump_get_window_text_reply( const struct get_window_text_reply *req )
3048
{
3049 3050
    fprintf( stderr, " length=%u", req->length );
    dump_varargs_unicode_str( ", text=", cur_size );
3051 3052 3053 3054
}

static void dump_set_window_text_request( const struct set_window_text_request *req )
{
3055 3056
    fprintf( stderr, " handle=%08x", req->handle );
    dump_varargs_unicode_str( ", text=", cur_size );
3057 3058
}

3059 3060
static void dump_get_windows_offset_request( const struct get_windows_offset_request *req )
{
3061 3062
    fprintf( stderr, " from=%08x", req->from );
    fprintf( stderr, ", to=%08x", req->to );
3063
    fprintf( stderr, ", dpi=%d", req->dpi );
3064 3065
}

3066
static void dump_get_windows_offset_reply( const struct get_windows_offset_reply *req )
3067
{
3068 3069
    fprintf( stderr, " x=%d", req->x );
    fprintf( stderr, ", y=%d", req->y );
3070
    fprintf( stderr, ", mirror=%d", req->mirror );
3071 3072
}

3073 3074
static void dump_get_visible_region_request( const struct get_visible_region_request *req )
{
3075 3076
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", flags=%08x", req->flags );
3077 3078 3079 3080
}

static void dump_get_visible_region_reply( const struct get_visible_region_reply *req )
{
3081 3082 3083
    fprintf( stderr, " top_win=%08x", req->top_win );
    dump_rectangle( ", top_rect=", &req->top_rect );
    dump_rectangle( ", win_rect=", &req->win_rect );
3084
    fprintf( stderr, ", paint_flags=%08x", req->paint_flags );
3085 3086
    fprintf( stderr, ", total_size=%u", req->total_size );
    dump_varargs_rectangles( ", region=", cur_size );
3087 3088
}

3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100
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 );
}

3101 3102
static void dump_get_window_region_request( const struct get_window_region_request *req )
{
3103
    fprintf( stderr, " window=%08x", req->window );
3104 3105 3106 3107
}

static void dump_get_window_region_reply( const struct get_window_region_reply *req )
{
3108 3109
    fprintf( stderr, " total_size=%u", req->total_size );
    dump_varargs_rectangles( ", region=", cur_size );
3110 3111 3112 3113
}

static void dump_set_window_region_request( const struct set_window_region_request *req )
{
3114 3115 3116
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", redraw=%d", req->redraw );
    dump_varargs_rectangles( ", region=", cur_size );
3117 3118
}

3119 3120
static void dump_get_update_region_request( const struct get_update_region_request *req )
{
3121 3122 3123
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", from_child=%08x", req->from_child );
    fprintf( stderr, ", flags=%08x", req->flags );
3124 3125 3126 3127
}

static void dump_get_update_region_reply( const struct get_update_region_reply *req )
{
3128 3129 3130 3131
    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 );
3132 3133
}

3134 3135
static void dump_update_window_zorder_request( const struct update_window_zorder_request *req )
{
3136 3137
    fprintf( stderr, " window=%08x", req->window );
    dump_rectangle( ", rect=", &req->rect );
3138 3139
}

3140 3141
static void dump_redraw_window_request( const struct redraw_window_request *req )
{
3142 3143 3144
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", flags=%08x", req->flags );
    dump_varargs_rectangles( ", region=", cur_size );
3145 3146
}

3147 3148
static void dump_set_window_property_request( const struct set_window_property_request *req )
{
3149 3150 3151 3152
    fprintf( stderr, " window=%08x", req->window );
    dump_uint64( ", data=", &req->data );
    fprintf( stderr, ", atom=%04x", req->atom );
    dump_varargs_unicode_str( ", name=", cur_size );
3153 3154 3155 3156
}

static void dump_remove_window_property_request( const struct remove_window_property_request *req )
{
3157 3158 3159
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", atom=%04x", req->atom );
    dump_varargs_unicode_str( ", name=", cur_size );
3160 3161
}

3162
static void dump_remove_window_property_reply( const struct remove_window_property_reply *req )
3163
{
3164
    dump_uint64( " data=", &req->data );
3165 3166 3167 3168
}

static void dump_get_window_property_request( const struct get_window_property_request *req )
{
3169 3170 3171
    fprintf( stderr, " window=%08x", req->window );
    fprintf( stderr, ", atom=%04x", req->atom );
    dump_varargs_unicode_str( ", name=", cur_size );
3172 3173
}

3174
static void dump_get_window_property_reply( const struct get_window_property_reply *req )
3175
{
3176
    dump_uint64( " data=", &req->data );
3177 3178 3179 3180
}

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

3184
static void dump_get_window_properties_reply( const struct get_window_properties_reply *req )
3185
{
3186 3187
    fprintf( stderr, " total=%d", req->total );
    dump_varargs_properties( ", props=", cur_size );
3188 3189
}

3190 3191
static void dump_create_winstation_request( const struct create_winstation_request *req )
{
3192 3193 3194
    fprintf( stderr, " flags=%08x", req->flags );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
3195
    fprintf( stderr, ", rootdir=%04x", req->rootdir );
3196
    dump_varargs_unicode_str( ", name=", cur_size );
3197 3198 3199 3200
}

static void dump_create_winstation_reply( const struct create_winstation_reply *req )
{
3201
    fprintf( stderr, " handle=%04x", req->handle );
3202 3203 3204 3205
}

static void dump_open_winstation_request( const struct open_winstation_request *req )
{
3206 3207
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
3208
    fprintf( stderr, ", rootdir=%04x", req->rootdir );
3209
    dump_varargs_unicode_str( ", name=", cur_size );
3210 3211 3212 3213
}

static void dump_open_winstation_reply( const struct open_winstation_reply *req )
{
3214
    fprintf( stderr, " handle=%04x", req->handle );
3215 3216 3217 3218
}

static void dump_close_winstation_request( const struct close_winstation_request *req )
{
3219
    fprintf( stderr, " handle=%04x", req->handle );
3220 3221 3222 3223 3224 3225 3226 3227
}

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 )
{
3228
    fprintf( stderr, " handle=%04x", req->handle );
3229 3230 3231 3232
}

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

3236 3237 3238 3239 3240 3241 3242
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 )
{
3243 3244
    fprintf( stderr, " next=%08x", req->next );
    dump_varargs_unicode_str( ", name=", cur_size );
3245 3246
}

3247 3248
static void dump_create_desktop_request( const struct create_desktop_request *req )
{
3249 3250 3251 3252
    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 );
3253 3254 3255 3256
}

static void dump_create_desktop_reply( const struct create_desktop_reply *req )
{
3257
    fprintf( stderr, " handle=%04x", req->handle );
3258 3259 3260 3261
}

static void dump_open_desktop_request( const struct open_desktop_request *req )
{
3262 3263 3264 3265 3266
    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 );
3267 3268 3269 3270
}

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

3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285
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 );
}

3286 3287
static void dump_close_desktop_request( const struct close_desktop_request *req )
{
3288
    fprintf( stderr, " handle=%04x", req->handle );
3289 3290 3291 3292 3293 3294 3295 3296 3297
}

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 )
{
3298
    fprintf( stderr, " handle=%04x", req->handle );
3299 3300 3301 3302
}

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

3306 3307
static void dump_enum_desktop_request( const struct enum_desktop_request *req )
{
3308 3309
    fprintf( stderr, " winstation=%04x", req->winstation );
    fprintf( stderr, ", index=%08x", req->index );
3310 3311 3312 3313
}

static void dump_enum_desktop_reply( const struct enum_desktop_reply *req )
{
3314 3315
    fprintf( stderr, " next=%08x", req->next );
    dump_varargs_unicode_str( ", name=", cur_size );
3316 3317
}

3318 3319
static void dump_set_user_object_info_request( const struct set_user_object_info_request *req )
{
3320 3321 3322
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", flags=%08x", req->flags );
    fprintf( stderr, ", obj_flags=%08x", req->obj_flags );
3323 3324 3325 3326
}

static void dump_set_user_object_info_reply( const struct set_user_object_info_reply *req )
{
3327 3328 3329
    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 );
3330 3331
}

3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358
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 );
}

3359 3360
static void dump_attach_thread_input_request( const struct attach_thread_input_request *req )
{
3361 3362 3363
    fprintf( stderr, " tid_from=%04x", req->tid_from );
    fprintf( stderr, ", tid_to=%04x", req->tid_to );
    fprintf( stderr, ", attach=%d", req->attach );
3364 3365 3366 3367
}

static void dump_get_thread_input_request( const struct get_thread_input_request *req )
{
3368
    fprintf( stderr, " tid=%04x", req->tid );
3369 3370 3371 3372
}

static void dump_get_thread_input_reply( const struct get_thread_input_reply *req )
{
3373 3374 3375 3376 3377 3378 3379
    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 );
3380 3381
    fprintf( stderr, ", cursor=%08x", req->cursor );
    fprintf( stderr, ", show_count=%d", req->show_count );
3382
    dump_rectangle( ", rect=", &req->rect );
3383 3384
}

3385 3386 3387 3388 3389 3390 3391 3392 3393
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 );
}

3394 3395
static void dump_get_key_state_request( const struct get_key_state_request *req )
{
3396
    fprintf( stderr, " async=%d", req->async );
3397
    fprintf( stderr, ", key=%d", req->key );
3398 3399 3400 3401
}

static void dump_get_key_state_reply( const struct get_key_state_reply *req )
{
3402 3403
    fprintf( stderr, " state=%02x", req->state );
    dump_varargs_bytes( ", keystate=", cur_size );
3404 3405 3406 3407
}

static void dump_set_key_state_request( const struct set_key_state_request *req )
{
3408
    fprintf( stderr, " async=%d", req->async );
3409
    dump_varargs_bytes( ", keystate=", cur_size );
3410 3411
}

3412 3413
static void dump_set_foreground_window_request( const struct set_foreground_window_request *req )
{
3414
    fprintf( stderr, " handle=%08x", req->handle );
3415 3416 3417 3418
}

static void dump_set_foreground_window_reply( const struct set_foreground_window_reply *req )
{
3419 3420 3421
    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 );
3422 3423 3424 3425
}

static void dump_set_focus_window_request( const struct set_focus_window_request *req )
{
3426
    fprintf( stderr, " handle=%08x", req->handle );
3427 3428 3429 3430
}

static void dump_set_focus_window_reply( const struct set_focus_window_reply *req )
{
3431
    fprintf( stderr, " previous=%08x", req->previous );
3432 3433 3434 3435
}

static void dump_set_active_window_request( const struct set_active_window_request *req )
{
3436
    fprintf( stderr, " handle=%08x", req->handle );
3437 3438 3439 3440
}

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

3444 3445
static void dump_set_capture_window_request( const struct set_capture_window_request *req )
{
3446 3447
    fprintf( stderr, " handle=%08x", req->handle );
    fprintf( stderr, ", flags=%08x", req->flags );
3448 3449 3450 3451
}

static void dump_set_capture_window_reply( const struct set_capture_window_reply *req )
{
3452 3453
    fprintf( stderr, " previous=%08x", req->previous );
    fprintf( stderr, ", full_handle=%08x", req->full_handle );
3454 3455
}

3456 3457
static void dump_set_caret_window_request( const struct set_caret_window_request *req )
{
3458 3459 3460
    fprintf( stderr, " handle=%08x", req->handle );
    fprintf( stderr, ", width=%d", req->width );
    fprintf( stderr, ", height=%d", req->height );
3461 3462 3463 3464
}

static void dump_set_caret_window_reply( const struct set_caret_window_reply *req )
{
3465 3466 3467 3468
    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 );
3469 3470 3471 3472
}

static void dump_set_caret_info_request( const struct set_caret_info_request *req )
{
3473 3474 3475 3476 3477 3478
    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 );
3479 3480 3481 3482
}

static void dump_set_caret_info_reply( const struct set_caret_info_reply *req )
{
3483 3484 3485 3486
    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 );
3487 3488
}

3489 3490
static void dump_set_hook_request( const struct set_hook_request *req )
{
3491 3492 3493 3494 3495 3496 3497 3498 3499
    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 );
3500 3501 3502 3503
}

static void dump_set_hook_reply( const struct set_hook_reply *req )
{
3504 3505
    fprintf( stderr, " handle=%08x", req->handle );
    fprintf( stderr, ", active_hooks=%08x", req->active_hooks );
3506 3507 3508 3509
}

static void dump_remove_hook_request( const struct remove_hook_request *req )
{
3510 3511 3512
    fprintf( stderr, " handle=%08x", req->handle );
    dump_uint64( ", proc=", &req->proc );
    fprintf( stderr, ", id=%d", req->id );
3513 3514
}

3515 3516 3517 3518 3519
static void dump_remove_hook_reply( const struct remove_hook_reply *req )
{
    fprintf( stderr, " active_hooks=%08x", req->active_hooks );
}

3520 3521
static void dump_start_hook_chain_request( const struct start_hook_chain_request *req )
{
3522 3523 3524 3525 3526
    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 );
3527 3528 3529 3530
}

static void dump_start_hook_chain_reply( const struct start_hook_chain_reply *req )
{
3531 3532 3533 3534 3535 3536 3537
    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 );
3538 3539 3540 3541 3542 3543 3544
}

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

3545
static void dump_get_hook_info_request( const struct get_hook_info_request *req )
3546
{
3547 3548 3549 3550 3551 3552
    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 );
3553 3554
}

3555
static void dump_get_hook_info_reply( const struct get_hook_info_reply *req )
3556
{
3557 3558 3559 3560 3561 3562 3563
    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 );
3564 3565
}

3566 3567
static void dump_create_class_request( const struct create_class_request *req )
{
3568 3569 3570 3571 3572 3573 3574
    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 );
3575
    fprintf( stderr, ", name_offset=%u", req->name_offset );
3576
    dump_varargs_unicode_str( ", name=", cur_size );
3577 3578 3579 3580 3581
}

static void dump_create_class_reply( const struct create_class_reply *req )
{
    fprintf( stderr, " atom=%04x", req->atom );
3582 3583 3584 3585
}

static void dump_destroy_class_request( const struct destroy_class_request *req )
{
3586 3587 3588
    fprintf( stderr, " atom=%04x", req->atom );
    dump_uint64( ", instance=", &req->instance );
    dump_varargs_unicode_str( ", name=", cur_size );
3589 3590
}

3591 3592
static void dump_destroy_class_reply( const struct destroy_class_reply *req )
{
3593
    dump_uint64( " client_ptr=", &req->client_ptr );
3594 3595
}

3596 3597
static void dump_set_class_info_request( const struct set_class_info_request *req )
{
3598 3599 3600 3601 3602 3603 3604 3605 3606
    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 );
3607 3608 3609 3610
}

static void dump_set_class_info_reply( const struct set_class_info_reply *req )
{
3611
    fprintf( stderr, " old_atom=%04x", req->old_atom );
3612 3613 3614
    fprintf( stderr, ", base_atom=%04x", req->base_atom );
    dump_uint64( ", old_instance=", &req->old_instance );
    dump_uint64( ", old_extra_value=", &req->old_extra_value );
3615 3616 3617
    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 );
3618 3619
}

3620 3621 3622 3623 3624 3625 3626
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 )
{
3627
    fprintf( stderr, " owner=%08x", req->owner );
3628 3629 3630 3631 3632 3633 3634 3635 3636
}

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 );
3637
    fprintf( stderr, ", owner=%08x", req->owner );
3638 3639
}

3640 3641 3642 3643
static void dump_empty_clipboard_request( const struct empty_clipboard_request *req )
{
}

3644 3645 3646
static void dump_set_clipboard_data_request( const struct set_clipboard_data_request *req )
{
    fprintf( stderr, " format=%08x", req->format );
3647
    fprintf( stderr, ", lcid=%08x", req->lcid );
3648 3649 3650
    dump_varargs_bytes( ", data=", cur_size );
}

3651 3652 3653 3654 3655
static void dump_set_clipboard_data_reply( const struct set_clipboard_data_reply *req )
{
    fprintf( stderr, " seqno=%08x", req->seqno );
}

3656 3657 3658
static void dump_get_clipboard_data_request( const struct get_clipboard_data_request *req )
{
    fprintf( stderr, " format=%08x", req->format );
3659
    fprintf( stderr, ", render=%d", req->render );
3660 3661
    fprintf( stderr, ", cached=%d", req->cached );
    fprintf( stderr, ", seqno=%08x", req->seqno );
3662 3663 3664 3665
}

static void dump_get_clipboard_data_reply( const struct get_clipboard_data_reply *req )
{
3666 3667
    fprintf( stderr, " from=%08x", req->from );
    fprintf( stderr, ", owner=%08x", req->owner );
3668
    fprintf( stderr, ", seqno=%08x", req->seqno );
3669 3670 3671 3672
    fprintf( stderr, ", total=%u", req->total );
    dump_varargs_bytes( ", data=", cur_size );
}

3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693
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 );
}

3694 3695 3696 3697 3698 3699 3700 3701
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 );
3702
    fprintf( stderr, ", owner=%08x", req->owner );
3703 3704
}

3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716
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 );
}

3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728
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 );
}

3729 3730 3731 3732 3733 3734 3735 3736 3737 3738
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 );
}

3739 3740
static void dump_open_token_request( const struct open_token_request *req )
{
3741 3742 3743 3744
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", flags=%08x", req->flags );
3745 3746 3747 3748
}

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

3752 3753
static void dump_set_global_windows_request( const struct set_global_windows_request *req )
{
3754 3755 3756 3757 3758
    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 );
3759 3760 3761 3762
}

static void dump_set_global_windows_reply( const struct set_global_windows_reply *req )
{
3763 3764 3765 3766
    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 );
3767 3768
}

3769 3770
static void dump_adjust_token_privileges_request( const struct adjust_token_privileges_request *req )
{
3771 3772 3773
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", disable_all=%d", req->disable_all );
    fprintf( stderr, ", get_modified_state=%d", req->get_modified_state );
3774
    dump_varargs_luid_attr( ", privileges=", cur_size );
3775 3776 3777 3778
}

static void dump_adjust_token_privileges_reply( const struct adjust_token_privileges_reply *req )
{
3779
    fprintf( stderr, " len=%08x", req->len );
3780
    dump_varargs_luid_attr( ", privileges=", cur_size );
3781 3782 3783 3784
}

static void dump_get_token_privileges_request( const struct get_token_privileges_request *req )
{
3785
    fprintf( stderr, " handle=%04x", req->handle );
3786 3787 3788 3789
}

static void dump_get_token_privileges_reply( const struct get_token_privileges_reply *req )
{
3790
    fprintf( stderr, " len=%08x", req->len );
3791
    dump_varargs_luid_attr( ", privileges=", cur_size );
3792 3793
}

3794 3795
static void dump_check_token_privileges_request( const struct check_token_privileges_request *req )
{
3796 3797
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", all_required=%d", req->all_required );
3798
    dump_varargs_luid_attr( ", privileges=", cur_size );
3799 3800 3801 3802
}

static void dump_check_token_privileges_reply( const struct check_token_privileges_reply *req )
{
3803
    fprintf( stderr, " has_privileges=%d", req->has_privileges );
3804
    dump_varargs_luid_attr( ", privileges=", cur_size );
3805 3806
}

3807 3808
static void dump_duplicate_token_request( const struct duplicate_token_request *req )
{
3809 3810 3811 3812
    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 );
3813
    dump_varargs_object_attributes( ", objattr=", cur_size );
3814 3815 3816 3817
}

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

3821 3822 3823 3824 3825
static void dump_filter_token_request( const struct filter_token_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", flags=%08x", req->flags );
    fprintf( stderr, ", privileges_size=%u", req->privileges_size );
3826
    dump_varargs_luid_attr( ", privileges=", min(cur_size,req->privileges_size) );
3827
    dump_varargs_sid( ", disable_sids=", cur_size );
3828 3829 3830 3831 3832 3833 3834
}

static void dump_filter_token_reply( const struct filter_token_reply *req )
{
    fprintf( stderr, " new_handle=%04x", req->new_handle );
}

3835 3836
static void dump_access_check_request( const struct access_check_request *req )
{
3837 3838
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", desired_access=%08x", req->desired_access );
3839
    dump_generic_map( ", mapping=", &req->mapping );
3840
    dump_varargs_security_descriptor( ", sd=", cur_size );
3841 3842 3843 3844
}

static void dump_access_check_reply( const struct access_check_reply *req )
{
3845 3846 3847
    fprintf( stderr, " access_granted=%08x", req->access_granted );
    fprintf( stderr, ", access_status=%08x", req->access_status );
    fprintf( stderr, ", privileges_len=%08x", req->privileges_len );
3848
    dump_varargs_luid_attr( ", privileges=", cur_size );
3849 3850
}

3851
static void dump_get_token_sid_request( const struct get_token_sid_request *req )
3852
{
3853
    fprintf( stderr, " handle=%04x", req->handle );
3854
    fprintf( stderr, ", which_sid=%08x", req->which_sid );
3855 3856
}

3857
static void dump_get_token_sid_reply( const struct get_token_sid_reply *req )
3858
{
3859
    fprintf( stderr, " sid_len=%u", req->sid_len );
3860
    dump_varargs_sid( ", sid=", cur_size );
3861 3862
}

3863 3864
static void dump_get_token_groups_request( const struct get_token_groups_request *req )
{
3865
    fprintf( stderr, " handle=%04x", req->handle );
3866 3867 3868 3869
}

static void dump_get_token_groups_reply( const struct get_token_groups_reply *req )
{
3870 3871 3872 3873
    fprintf( stderr, " attr_len=%u", req->attr_len );
    fprintf( stderr, ", sid_len=%u", req->sid_len );
    dump_varargs_uints( ", attrs=", min(cur_size,req->attr_len) );
    dump_varargs_sids( ", sids=", cur_size );
3874 3875
}

3876 3877 3878 3879 3880 3881 3882 3883
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 );
3884
    dump_varargs_acl( ", acl=", cur_size );
3885 3886 3887 3888 3889
}

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

3893 3894
static void dump_set_security_object_request( const struct set_security_object_request *req )
{
3895 3896 3897
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", security_info=%08x", req->security_info );
    dump_varargs_security_descriptor( ", sd=", cur_size );
3898 3899
}

3900 3901
static void dump_get_security_object_request( const struct get_security_object_request *req )
{
3902 3903
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", security_info=%08x", req->security_info );
3904 3905 3906 3907
}

static void dump_get_security_object_reply( const struct get_security_object_reply *req )
{
3908 3909
    fprintf( stderr, " sd_len=%08x", req->sd_len );
    dump_varargs_security_descriptor( ", sd=", cur_size );
3910 3911
}

3912 3913 3914 3915 3916 3917 3918 3919 3920 3921
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
3922 3923
static void dump_create_mailslot_request( const struct create_mailslot_request *req )
{
3924 3925 3926
    fprintf( stderr, " access=%08x", req->access );
    dump_timeout( ", read_timeout=", &req->read_timeout );
    fprintf( stderr, ", max_msgsize=%08x", req->max_msgsize );
3927
    dump_varargs_object_attributes( ", objattr=", cur_size );
Mike McCormack's avatar
Mike McCormack committed
3928 3929 3930 3931
}

static void dump_create_mailslot_reply( const struct create_mailslot_reply *req )
{
3932
    fprintf( stderr, " handle=%04x", req->handle );
Mike McCormack's avatar
Mike McCormack committed
3933 3934 3935 3936
}

static void dump_set_mailslot_info_request( const struct set_mailslot_info_request *req )
{
3937 3938 3939
    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
3940 3941 3942 3943
}

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

3948 3949
static void dump_create_directory_request( const struct create_directory_request *req )
{
3950
    fprintf( stderr, " access=%08x", req->access );
3951
    dump_varargs_object_attributes( ", objattr=", cur_size );
3952 3953 3954 3955
}

static void dump_create_directory_reply( const struct create_directory_reply *req )
{
3956
    fprintf( stderr, " handle=%04x", req->handle );
3957 3958 3959 3960
}

static void dump_open_directory_request( const struct open_directory_request *req )
{
3961 3962 3963 3964
    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 );
3965 3966 3967 3968
}

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

3972 3973
static void dump_get_directory_entry_request( const struct get_directory_entry_request *req )
{
3974 3975
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", index=%08x", req->index );
3976 3977 3978 3979
}

static void dump_get_directory_entry_reply( const struct get_directory_entry_reply *req )
{
3980 3981 3982
    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 );
3983 3984
}

3985 3986
static void dump_create_symlink_request( const struct create_symlink_request *req )
{
3987
    fprintf( stderr, " access=%08x", req->access );
3988
    dump_varargs_object_attributes( ", objattr=", cur_size );
3989
    dump_varargs_unicode_str( ", target_name=", cur_size );
3990 3991 3992 3993
}

static void dump_create_symlink_reply( const struct create_symlink_reply *req )
{
3994
    fprintf( stderr, " handle=%04x", req->handle );
3995 3996 3997 3998
}

static void dump_open_symlink_request( const struct open_symlink_request *req )
{
3999 4000 4001 4002
    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 );
4003 4004 4005 4006
}

static void dump_open_symlink_reply( const struct open_symlink_reply *req )
{
4007
    fprintf( stderr, " handle=%04x", req->handle );
4008 4009 4010 4011
}

static void dump_query_symlink_request( const struct query_symlink_request *req )
{
4012
    fprintf( stderr, " handle=%04x", req->handle );
4013 4014 4015 4016
}

static void dump_query_symlink_reply( const struct query_symlink_reply *req )
{
4017 4018
    fprintf( stderr, " total=%u", req->total );
    dump_varargs_unicode_str( ", target_name=", cur_size );
4019 4020
}

4021 4022
static void dump_get_object_info_request( const struct get_object_info_request *req )
{
4023
    fprintf( stderr, " handle=%04x", req->handle );
4024 4025 4026 4027
}

static void dump_get_object_info_reply( const struct get_object_info_reply *req )
{
4028 4029
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", ref_count=%08x", req->ref_count );
4030
    fprintf( stderr, ", handle_count=%08x", req->handle_count );
4031 4032 4033 4034 4035 4036 4037 4038 4039 4040
}

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

static void dump_get_object_name_reply( const struct get_object_name_reply *req )
{
    fprintf( stderr, " total=%u", req->total );
4041
    dump_varargs_unicode_str( ", name=", cur_size );
4042 4043
}

4044 4045 4046 4047 4048 4049 4050
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 )
{
4051
    dump_varargs_object_type_info( " info=", cur_size );
4052 4053
}

4054 4055 4056 4057 4058 4059 4060 4061 4062 4063
static void dump_get_object_types_request( const struct get_object_types_request *req )
{
}

static void dump_get_object_types_reply( const struct get_object_types_reply *req )
{
    fprintf( stderr, " count=%d", req->count );
    dump_varargs_object_types_info( ", info=", cur_size );
}

4064 4065 4066 4067 4068 4069
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 )
{
4070
    dump_luid( " luid=", &req->luid );
4071 4072
}

4073 4074
static void dump_create_device_manager_request( const struct create_device_manager_request *req )
{
4075 4076
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
4077 4078 4079 4080
}

static void dump_create_device_manager_reply( const struct create_device_manager_reply *req )
{
4081
    fprintf( stderr, " handle=%04x", req->handle );
4082 4083 4084 4085
}

static void dump_create_device_request( const struct create_device_request *req )
{
4086
    fprintf( stderr, " rootdir=%04x", req->rootdir );
4087 4088 4089
    dump_uint64( ", user_ptr=", &req->user_ptr );
    fprintf( stderr, ", manager=%04x", req->manager );
    dump_varargs_unicode_str( ", name=", cur_size );
4090 4091 4092 4093
}

static void dump_delete_device_request( const struct delete_device_request *req )
{
4094 4095
    fprintf( stderr, " manager=%04x", req->manager );
    dump_uint64( ", device=", &req->device );
4096 4097
}

4098 4099
static void dump_get_next_device_request_request( const struct get_next_device_request_request *req )
{
4100 4101 4102
    fprintf( stderr, " manager=%04x", req->manager );
    fprintf( stderr, ", prev=%04x", req->prev );
    fprintf( stderr, ", status=%08x", req->status );
4103
    dump_uint64( ", user_ptr=", &req->user_ptr );
4104
    fprintf( stderr, ", pending=%d", req->pending );
4105
    fprintf( stderr, ", iosb_status=%08x", req->iosb_status );
4106 4107
    fprintf( stderr, ", result=%u", req->result );
    dump_varargs_bytes( ", data=", cur_size );
4108 4109 4110 4111
}

static void dump_get_next_device_request_reply( const struct get_next_device_request_reply *req )
{
4112
    dump_irp_params( " params=", &req->params );
4113
    fprintf( stderr, ", next=%04x", req->next );
4114
    fprintf( stderr, ", client_tid=%04x", req->client_tid );
4115
    dump_uint64( ", client_thread=", &req->client_thread );
4116 4117
    fprintf( stderr, ", in_size=%u", req->in_size );
    dump_varargs_bytes( ", next_data=", cur_size );
4118 4119
}

4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137
static void dump_get_kernel_object_ptr_request( const struct get_kernel_object_ptr_request *req )
{
    fprintf( stderr, " manager=%04x", req->manager );
    fprintf( stderr, ", handle=%04x", req->handle );
}

static void dump_get_kernel_object_ptr_reply( const struct get_kernel_object_ptr_reply *req )
{
    dump_uint64( " user_ptr=", &req->user_ptr );
}

static void dump_set_kernel_object_ptr_request( const struct set_kernel_object_ptr_request *req )
{
    fprintf( stderr, " manager=%04x", req->manager );
    fprintf( stderr, ", handle=%04x", req->handle );
    dump_uint64( ", user_ptr=", &req->user_ptr );
}

4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149
static void dump_grab_kernel_object_request( const struct grab_kernel_object_request *req )
{
    fprintf( stderr, " manager=%04x", req->manager );
    dump_uint64( ", user_ptr=", &req->user_ptr );
}

static void dump_release_kernel_object_request( const struct release_kernel_object_request *req )
{
    fprintf( stderr, " manager=%04x", req->manager );
    dump_uint64( ", user_ptr=", &req->user_ptr );
}

4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161
static void dump_get_kernel_object_handle_request( const struct get_kernel_object_handle_request *req )
{
    fprintf( stderr, " manager=%04x", req->manager );
    dump_uint64( ", user_ptr=", &req->user_ptr );
    fprintf( stderr, ", access=%08x", req->access );
}

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

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

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

4172
static void dump_get_token_info_request( const struct get_token_info_request *req )
4173
{
4174
    fprintf( stderr, " handle=%04x", req->handle );
4175 4176
}

4177
static void dump_get_token_info_reply( const struct get_token_info_reply *req )
4178
{
4179 4180
    dump_luid( " token_id=", &req->token_id );
    dump_luid( ", modified_id=", &req->modified_id );
4181
    fprintf( stderr, ", session_id=%08x", req->session_id );
4182 4183
    fprintf( stderr, ", primary=%d", req->primary );
    fprintf( stderr, ", impersonation_level=%d", req->impersonation_level );
4184
    fprintf( stderr, ", elevation=%d", req->elevation );
4185 4186
    fprintf( stderr, ", group_count=%d", req->group_count );
    fprintf( stderr, ", privilege_count=%d", req->privilege_count );
4187 4188
}

4189 4190 4191 4192 4193 4194 4195 4196 4197 4198
static void dump_create_linked_token_request( const struct create_linked_token_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
}

static void dump_create_linked_token_reply( const struct create_linked_token_reply *req )
{
    fprintf( stderr, " linked=%04x", req->linked );
}

4199 4200
static void dump_create_completion_request( const struct create_completion_request *req )
{
4201 4202
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", concurrent=%08x", req->concurrent );
4203
    dump_varargs_object_attributes( ", objattr=", cur_size );
4204 4205 4206 4207
}

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

static void dump_open_completion_request( const struct open_completion_request *req )
{
4213 4214 4215
    fprintf( stderr, " access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", rootdir=%04x", req->rootdir );
4216
    dump_varargs_unicode_str( ", filename=", cur_size );
4217 4218 4219 4220
}

static void dump_open_completion_reply( const struct open_completion_reply *req )
{
4221
    fprintf( stderr, " handle=%04x", req->handle );
4222 4223 4224 4225
}

static void dump_add_completion_request( const struct add_completion_request *req )
{
4226 4227 4228
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", ckey=", &req->ckey );
    dump_uint64( ", cvalue=", &req->cvalue );
4229
    dump_uint64( ", information=", &req->information );
4230
    fprintf( stderr, ", status=%08x", req->status );
4231 4232 4233 4234
}

static void dump_remove_completion_request( const struct remove_completion_request *req )
{
4235
    fprintf( stderr, " handle=%04x", req->handle );
4236 4237 4238 4239
}

static void dump_remove_completion_reply( const struct remove_completion_reply *req )
{
4240 4241
    dump_uint64( " ckey=", &req->ckey );
    dump_uint64( ", cvalue=", &req->cvalue );
4242
    dump_uint64( ", information=", &req->information );
4243
    fprintf( stderr, ", status=%08x", req->status );
4244 4245 4246 4247
}

static void dump_query_completion_request( const struct query_completion_request *req )
{
4248
    fprintf( stderr, " handle=%04x", req->handle );
4249 4250 4251 4252 4253 4254 4255
}

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

4256 4257
static void dump_set_completion_info_request( const struct set_completion_info_request *req )
{
4258 4259 4260
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", ckey=", &req->ckey );
    fprintf( stderr, ", chandle=%04x", req->chandle );
4261 4262
}

4263 4264
static void dump_add_fd_completion_request( const struct add_fd_completion_request *req )
{
4265 4266
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", cvalue=", &req->cvalue );
4267
    dump_uint64( ", information=", &req->information );
4268
    fprintf( stderr, ", status=%08x", req->status );
4269
    fprintf( stderr, ", async=%d", req->async );
4270 4271
}

4272 4273 4274 4275 4276 4277
static void dump_set_fd_completion_mode_request( const struct set_fd_completion_mode_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", flags=%08x", req->flags );
}

4278
static void dump_set_fd_disp_info_request( const struct set_fd_disp_info_request *req )
4279 4280 4281 4282 4283
{
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", unlink=%d", req->unlink );
}

4284 4285 4286 4287
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 );
4288
    fprintf( stderr, ", namelen=%u", req->namelen );
4289
    fprintf( stderr, ", link=%d", req->link );
4290
    fprintf( stderr, ", replace=%d", req->replace );
4291
    dump_varargs_unicode_str( ", name=", min(cur_size,req->namelen) );
4292 4293 4294
    dump_varargs_string( ", filename=", cur_size );
}

4295 4296 4297 4298 4299 4300
static void dump_set_fd_eof_info_request( const struct set_fd_eof_info_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
    dump_uint64( ", eof=", &req->eof );
}

4301 4302
static void dump_get_window_layered_info_request( const struct get_window_layered_info_request *req )
{
4303
    fprintf( stderr, " handle=%08x", req->handle );
4304 4305 4306 4307
}

static void dump_get_window_layered_info_reply( const struct get_window_layered_info_reply *req )
{
4308 4309 4310
    fprintf( stderr, " color_key=%08x", req->color_key );
    fprintf( stderr, ", alpha=%08x", req->alpha );
    fprintf( stderr, ", flags=%08x", req->flags );
4311 4312 4313 4314
}

static void dump_set_window_layered_info_request( const struct set_window_layered_info_request *req )
{
4315 4316 4317 4318
    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 );
4319 4320
}

4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334
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 );
}

4335 4336 4337 4338 4339
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 );
4340 4341
    fprintf( stderr, ", x=%d", req->x );
    fprintf( stderr, ", y=%d", req->y );
4342
    dump_rectangle( ", clip=", &req->clip );
4343
    fprintf( stderr, ", clip_msg=%08x", req->clip_msg );
4344 4345 4346 4347 4348 4349
}

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 );
4350 4351
    fprintf( stderr, ", prev_x=%d", req->prev_x );
    fprintf( stderr, ", prev_y=%d", req->prev_y );
4352 4353
    fprintf( stderr, ", new_x=%d", req->new_x );
    fprintf( stderr, ", new_y=%d", req->new_y );
4354
    dump_rectangle( ", new_clip=", &req->new_clip );
4355
    fprintf( stderr, ", last_change=%08x", req->last_change );
4356 4357
}

4358 4359 4360 4361 4362 4363 4364 4365 4366
static void dump_get_cursor_history_request( const struct get_cursor_history_request *req )
{
}

static void dump_get_cursor_history_reply( const struct get_cursor_history_reply *req )
{
    dump_varargs_cursor_positions( " history=", cur_size );
}

4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379
static void dump_get_rawinput_buffer_request( const struct get_rawinput_buffer_request *req )
{
    fprintf( stderr, " rawinput_size=%u", req->rawinput_size );
    fprintf( stderr, ", buffer_size=%u", req->buffer_size );
}

static void dump_get_rawinput_buffer_reply( const struct get_rawinput_buffer_reply *req )
{
    fprintf( stderr, " next_size=%u", req->next_size );
    fprintf( stderr, ", count=%08x", req->count );
    dump_varargs_bytes( ", data=", cur_size );
}

4380 4381 4382 4383 4384
static void dump_update_rawinput_devices_request( const struct update_rawinput_devices_request *req )
{
    dump_varargs_rawinput_devices( " devices=", cur_size );
}

4385 4386 4387 4388 4389 4390 4391 4392 4393 4394
static void dump_get_rawinput_devices_request( const struct get_rawinput_devices_request *req )
{
}

static void dump_get_rawinput_devices_reply( const struct get_rawinput_devices_reply *req )
{
    fprintf( stderr, " device_count=%08x", req->device_count );
    dump_varargs_rawinput_devices( ", devices=", cur_size );
}

4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405
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 );
}

4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418
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 );
}

4419 4420 4421 4422 4423 4424
static void dump_assign_job_request( const struct assign_job_request *req )
{
    fprintf( stderr, " job=%04x", req->job );
    fprintf( stderr, ", process=%04x", req->process );
}

4425 4426 4427 4428 4429 4430
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 );
}

4431 4432 4433 4434 4435 4436
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 );
}

4437 4438 4439 4440 4441 4442 4443
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 );
}

4444 4445 4446 4447 4448 4449 4450 4451 4452
static void dump_get_job_info_request( const struct get_job_info_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
}

static void dump_get_job_info_reply( const struct get_job_info_reply *req )
{
    fprintf( stderr, " total_processes=%d", req->total_processes );
    fprintf( stderr, ", active_processes=%d", req->active_processes );
4453
    dump_varargs_uints( ", pids=", cur_size );
4454 4455
}

4456 4457 4458 4459 4460 4461
static void dump_terminate_job_request( const struct terminate_job_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
    fprintf( stderr, ", status=%d", req->status );
}

4462 4463 4464 4465 4466 4467 4468 4469 4470 4471
static void dump_suspend_process_request( const struct suspend_process_request *req )
{
    fprintf( stderr, " handle=%04x", req->handle );
}

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

4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485
static void dump_get_next_thread_request( const struct get_next_thread_request *req )
{
    fprintf( stderr, " process=%04x", req->process );
    fprintf( stderr, ", last=%04x", req->last );
    fprintf( stderr, ", access=%08x", req->access );
    fprintf( stderr, ", attributes=%08x", req->attributes );
    fprintf( stderr, ", flags=%08x", req->flags );
}

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

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

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

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

5320 5321 5322 5323 5324 5325
static const struct
{
    const char  *name;
    unsigned int value;
} status_names[] =
{
5326
    { "ABANDONED_WAIT_0",            STATUS_ABANDONED_WAIT_0 },
5327 5328
    { "ACCESS_DENIED",               STATUS_ACCESS_DENIED },
    { "ACCESS_VIOLATION",            STATUS_ACCESS_VIOLATION },
5329
    { "ADDRESS_ALREADY_ASSOCIATED",  STATUS_ADDRESS_ALREADY_ASSOCIATED },
5330
    { "ALERTED",                     STATUS_ALERTED },
5331
    { "BAD_DEVICE_TYPE",             STATUS_BAD_DEVICE_TYPE },
5332
    { "BAD_IMPERSONATION_LEVEL",     STATUS_BAD_IMPERSONATION_LEVEL },
5333 5334
    { "BUFFER_OVERFLOW",             STATUS_BUFFER_OVERFLOW },
    { "BUFFER_TOO_SMALL",            STATUS_BUFFER_TOO_SMALL },
5335
    { "CANCELLED",                   STATUS_CANCELLED },
5336
    { "CANNOT_DELETE",               STATUS_CANNOT_DELETE },
5337
    { "CANT_OPEN_ANONYMOUS",         STATUS_CANT_OPEN_ANONYMOUS },
5338
    { "CHILD_MUST_BE_VOLATILE",      STATUS_CHILD_MUST_BE_VOLATILE },
5339
    { "CONNECTION_ABORTED",          STATUS_CONNECTION_ABORTED },
5340
    { "CONNECTION_ACTIVE",           STATUS_CONNECTION_ACTIVE },
5341 5342
    { "CONNECTION_REFUSED",          STATUS_CONNECTION_REFUSED },
    { "CONNECTION_RESET",            STATUS_CONNECTION_RESET },
5343
    { "DEBUGGER_INACTIVE",           STATUS_DEBUGGER_INACTIVE },
5344
    { "DEVICE_BUSY",                 STATUS_DEVICE_BUSY },
5345
    { "DEVICE_NOT_READY",            STATUS_DEVICE_NOT_READY },
5346 5347 5348 5349 5350 5351 5352
    { "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 },
5353 5354
    { "ERROR_HOTKEY_ALREADY_REGISTERED", 0xc0010000 | ERROR_HOTKEY_ALREADY_REGISTERED },
    { "ERROR_HOTKEY_NOT_REGISTERED", 0xc0010000 | ERROR_HOTKEY_NOT_REGISTERED },
5355
    { "ERROR_INVALID_CURSOR_HANDLE", 0xc0010000 | ERROR_INVALID_CURSOR_HANDLE },
5356
    { "ERROR_INVALID_INDEX",         0xc0010000 | ERROR_INVALID_INDEX },
5357
    { "ERROR_INVALID_WINDOW_HANDLE", 0xc0010000 | ERROR_INVALID_WINDOW_HANDLE },
5358
    { "ERROR_NO_MORE_USER_HANDLES",  0xc0010000 | ERROR_NO_MORE_USER_HANDLES },
5359
    { "ERROR_WINDOW_OF_OTHER_THREAD", 0xc0010000 | ERROR_WINDOW_OF_OTHER_THREAD },
5360
    { "FILE_DELETED",                STATUS_FILE_DELETED },
5361
    { "FILE_INVALID",                STATUS_FILE_INVALID },
5362 5363
    { "FILE_IS_A_DIRECTORY",         STATUS_FILE_IS_A_DIRECTORY },
    { "FILE_LOCK_CONFLICT",          STATUS_FILE_LOCK_CONFLICT },
5364
    { "GENERIC_NOT_MAPPED",          STATUS_GENERIC_NOT_MAPPED },
5365
    { "HANDLES_CLOSED",              STATUS_HANDLES_CLOSED },
5366
    { "HANDLE_NOT_CLOSABLE",         STATUS_HANDLE_NOT_CLOSABLE },
5367
    { "HOST_UNREACHABLE",            STATUS_HOST_UNREACHABLE },
5368
    { "ILLEGAL_FUNCTION",            STATUS_ILLEGAL_FUNCTION },
5369
    { "IMAGE_NOT_AT_BASE",           STATUS_IMAGE_NOT_AT_BASE },
5370
    { "INFO_LENGTH_MISMATCH",        STATUS_INFO_LENGTH_MISMATCH },
5371
    { "INSTANCE_NOT_AVAILABLE",      STATUS_INSTANCE_NOT_AVAILABLE },
5372
    { "INSUFFICIENT_RESOURCES",      STATUS_INSUFFICIENT_RESOURCES },
5373
    { "INVALID_ACL",                 STATUS_INVALID_ACL },
5374
    { "INVALID_ADDRESS",             STATUS_INVALID_ADDRESS },
5375
    { "INVALID_ADDRESS_COMPONENT",   STATUS_INVALID_ADDRESS_COMPONENT },
5376
    { "INVALID_CID",                 STATUS_INVALID_CID },
5377
    { "INVALID_CONNECTION",          STATUS_INVALID_CONNECTION },
5378
    { "INVALID_DEVICE_REQUEST",      STATUS_INVALID_DEVICE_REQUEST },
5379 5380
    { "INVALID_FILE_FOR_SECTION",    STATUS_INVALID_FILE_FOR_SECTION },
    { "INVALID_HANDLE",              STATUS_INVALID_HANDLE },
5381 5382 5383 5384
    { "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 },
5385
    { "INVALID_IMAGE_WIN_16",        STATUS_INVALID_IMAGE_WIN_16 },
5386
    { "INVALID_IMAGE_WIN_64",        STATUS_INVALID_IMAGE_WIN_64 },
5387
    { "INVALID_LOCK_SEQUENCE",       STATUS_INVALID_LOCK_SEQUENCE },
5388
    { "INVALID_OWNER",               STATUS_INVALID_OWNER },
5389
    { "INVALID_PARAMETER",           STATUS_INVALID_PARAMETER },
5390
    { "INVALID_PIPE_STATE",          STATUS_INVALID_PIPE_STATE },
5391
    { "INVALID_READ_MODE",           STATUS_INVALID_READ_MODE },
5392
    { "INVALID_SECURITY_DESCR",      STATUS_INVALID_SECURITY_DESCR },
5393
    { "IO_TIMEOUT",                  STATUS_IO_TIMEOUT },
5394
    { "KERNEL_APC",                  STATUS_KERNEL_APC },
5395
    { "KEY_DELETED",                 STATUS_KEY_DELETED },
5396
    { "MAPPED_FILE_SIZE_ZERO",       STATUS_MAPPED_FILE_SIZE_ZERO },
5397
    { "MUTANT_NOT_OWNED",            STATUS_MUTANT_NOT_OWNED },
5398
    { "NAME_TOO_LONG",               STATUS_NAME_TOO_LONG },
5399 5400
    { "NETWORK_BUSY",                STATUS_NETWORK_BUSY },
    { "NETWORK_UNREACHABLE",         STATUS_NETWORK_UNREACHABLE },
5401 5402
    { "NOT_ALL_ASSIGNED",            STATUS_NOT_ALL_ASSIGNED },
    { "NOT_A_DIRECTORY",             STATUS_NOT_A_DIRECTORY },
5403
    { "NOT_FOUND",                   STATUS_NOT_FOUND },
5404
    { "NOT_IMPLEMENTED",             STATUS_NOT_IMPLEMENTED },
5405
    { "NOT_MAPPED_VIEW",             STATUS_NOT_MAPPED_VIEW },
5406
    { "NOT_REGISTRY_FILE",           STATUS_NOT_REGISTRY_FILE },
5407
    { "NOT_SAME_DEVICE",             STATUS_NOT_SAME_DEVICE },
5408
    { "NOT_SAME_OBJECT",             STATUS_NOT_SAME_OBJECT },
5409
    { "NOT_SUPPORTED",               STATUS_NOT_SUPPORTED },
5410 5411 5412 5413 5414 5415 5416 5417
    { "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_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 },
5418
    { "OBJECT_NAME_EXISTS",          STATUS_OBJECT_NAME_EXISTS },
5419 5420 5421
    { "OBJECT_NAME_INVALID",         STATUS_OBJECT_NAME_INVALID },
    { "OBJECT_NAME_NOT_FOUND",       STATUS_OBJECT_NAME_NOT_FOUND },
    { "OBJECT_PATH_INVALID",         STATUS_OBJECT_PATH_INVALID },
5422 5423
    { "OBJECT_PATH_NOT_FOUND",       STATUS_OBJECT_PATH_NOT_FOUND },
    { "OBJECT_PATH_SYNTAX_BAD",      STATUS_OBJECT_PATH_SYNTAX_BAD },
5424 5425
    { "OBJECT_TYPE_MISMATCH",        STATUS_OBJECT_TYPE_MISMATCH },
    { "PENDING",                     STATUS_PENDING },
5426
    { "PIPE_BROKEN",                 STATUS_PIPE_BROKEN },
5427
    { "PIPE_BUSY",                   STATUS_PIPE_BUSY },
5428
    { "PIPE_CLOSING",                STATUS_PIPE_CLOSING },
5429 5430
    { "PIPE_CONNECTED",              STATUS_PIPE_CONNECTED },
    { "PIPE_DISCONNECTED",           STATUS_PIPE_DISCONNECTED },
5431
    { "PIPE_EMPTY",                  STATUS_PIPE_EMPTY },
5432 5433
    { "PIPE_LISTENING",              STATUS_PIPE_LISTENING },
    { "PIPE_NOT_AVAILABLE",          STATUS_PIPE_NOT_AVAILABLE },
5434
    { "PORT_NOT_SET",                STATUS_PORT_NOT_SET },
5435
    { "PREDEFINED_HANDLE",           STATUS_PREDEFINED_HANDLE },
5436
    { "PRIVILEGE_NOT_HELD",          STATUS_PRIVILEGE_NOT_HELD },
5437
    { "PROCESS_IN_JOB",              STATUS_PROCESS_IN_JOB },
5438
    { "PROCESS_IS_TERMINATING",      STATUS_PROCESS_IS_TERMINATING },
5439
    { "PROCESS_NOT_IN_JOB",          STATUS_PROCESS_NOT_IN_JOB },
5440
    { "REPARSE_POINT_NOT_RESOLVED",  STATUS_REPARSE_POINT_NOT_RESOLVED },
5441 5442 5443
    { "SECTION_TOO_BIG",             STATUS_SECTION_TOO_BIG },
    { "SEMAPHORE_LIMIT_EXCEEDED",    STATUS_SEMAPHORE_LIMIT_EXCEEDED },
    { "SHARING_VIOLATION",           STATUS_SHARING_VIOLATION },
5444
    { "SHUTDOWN_IN_PROGRESS",        STATUS_SHUTDOWN_IN_PROGRESS },
5445
    { "SUSPEND_COUNT_EXCEEDED",      STATUS_SUSPEND_COUNT_EXCEEDED },
5446
    { "THREAD_IS_TERMINATING",       STATUS_THREAD_IS_TERMINATING },
5447
    { "TIMEOUT",                     STATUS_TIMEOUT },
5448
    { "TOO_MANY_OPENED_FILES",       STATUS_TOO_MANY_OPENED_FILES },
5449
    { "UNSUCCESSFUL",                STATUS_UNSUCCESSFUL },
5450
    { "USER_APC",                    STATUS_USER_APC },
5451
    { "USER_MAPPED_FILE",            STATUS_USER_MAPPED_FILE },
5452
    { "VOLUME_DISMOUNTED",           STATUS_VOLUME_DISMOUNTED },
5453
    { "WAS_LOCKED",                  STATUS_WAS_LOCKED },
5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495
    { "WSAEACCES",                   0xc0010000 | WSAEACCES },
    { "WSAEADDRINUSE",               0xc0010000 | WSAEADDRINUSE },
    { "WSAEADDRNOTAVAIL",            0xc0010000 | WSAEADDRNOTAVAIL },
    { "WSAEAFNOSUPPORT",             0xc0010000 | WSAEAFNOSUPPORT },
    { "WSAEALREADY",                 0xc0010000 | WSAEALREADY },
    { "WSAEBADF",                    0xc0010000 | WSAEBADF },
    { "WSAECONNABORTED",             0xc0010000 | WSAECONNABORTED },
    { "WSAECONNREFUSED",             0xc0010000 | WSAECONNREFUSED },
    { "WSAECONNRESET",               0xc0010000 | WSAECONNRESET },
    { "WSAEDESTADDRREQ",             0xc0010000 | WSAEDESTADDRREQ },
    { "WSAEDQUOT",                   0xc0010000 | WSAEDQUOT },
    { "WSAEFAULT",                   0xc0010000 | WSAEFAULT },
    { "WSAEHOSTDOWN",                0xc0010000 | WSAEHOSTDOWN },
    { "WSAEHOSTUNREACH",             0xc0010000 | WSAEHOSTUNREACH },
    { "WSAEINTR",                    0xc0010000 | WSAEINTR },
    { "WSAEINVAL",                   0xc0010000 | WSAEINVAL },
    { "WSAEISCONN",                  0xc0010000 | WSAEISCONN },
    { "WSAELOOP",                    0xc0010000 | WSAELOOP },
    { "WSAEMFILE",                   0xc0010000 | WSAEMFILE },
    { "WSAEMSGSIZE",                 0xc0010000 | WSAEMSGSIZE },
    { "WSAENAMETOOLONG",             0xc0010000 | WSAENAMETOOLONG },
    { "WSAENETDOWN",                 0xc0010000 | WSAENETDOWN },
    { "WSAENETRESET",                0xc0010000 | WSAENETRESET },
    { "WSAENETUNREACH",              0xc0010000 | WSAENETUNREACH },
    { "WSAENOBUFS",                  0xc0010000 | WSAENOBUFS },
    { "WSAENOPROTOOPT",              0xc0010000 | WSAENOPROTOOPT },
    { "WSAENOTCONN",                 0xc0010000 | WSAENOTCONN },
    { "WSAENOTEMPTY",                0xc0010000 | WSAENOTEMPTY },
    { "WSAENOTSOCK",                 0xc0010000 | WSAENOTSOCK },
    { "WSAEOPNOTSUPP",               0xc0010000 | WSAEOPNOTSUPP },
    { "WSAEPFNOSUPPORT",             0xc0010000 | WSAEPFNOSUPPORT },
    { "WSAEPROCLIM",                 0xc0010000 | WSAEPROCLIM },
    { "WSAEPROTONOSUPPORT",          0xc0010000 | WSAEPROTONOSUPPORT },
    { "WSAEPROTOTYPE",               0xc0010000 | WSAEPROTOTYPE },
    { "WSAEREMOTE",                  0xc0010000 | WSAEREMOTE },
    { "WSAESHUTDOWN",                0xc0010000 | WSAESHUTDOWN },
    { "WSAESOCKTNOSUPPORT",          0xc0010000 | WSAESOCKTNOSUPPORT },
    { "WSAESTALE",                   0xc0010000 | WSAESTALE },
    { "WSAETIMEDOUT",                0xc0010000 | WSAETIMEDOUT },
    { "WSAETOOMANYREFS",             0xc0010000 | WSAETOOMANYREFS },
    { "WSAEUSERS",                   0xc0010000 | WSAEUSERS },
    { "WSAEWOULDBLOCK",              0xc0010000 | WSAEWOULDBLOCK },
5496 5497 5498
    { NULL, 0 }
};

5499 5500 5501
/* ### make_requests end ### */
/* Everything above this line is generated automatically by tools/make_requests */

5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515
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;
}

5516
void trace_request(void)
Alexandre Julliard's avatar
Alexandre Julliard committed
5517
{
5518
    enum request req = current->req.request_header.req;
5519
    if (req < REQ_NB_REQUESTS)
Alexandre Julliard's avatar
Alexandre Julliard committed
5520
    {
5521
        fprintf( stderr, "%04x: %s(", current->id, req_names[req] );
5522 5523 5524 5525 5526 5527
        if (req_dumpers[req])
        {
            cur_data = get_req_data();
            cur_size = get_req_data_size();
            req_dumpers[req]( &current->req );
        }
5528
        fprintf( stderr, " )\n" );
Alexandre Julliard's avatar
Alexandre Julliard committed
5529
    }
5530
    else fprintf( stderr, "%04x: %d(?)\n", current->id, req );
Alexandre Julliard's avatar
Alexandre Julliard committed
5531 5532
}

5533
void trace_reply( enum request req, const union generic_reply *reply )
Alexandre Julliard's avatar
Alexandre Julliard committed
5534
{
5535
    if (req < REQ_NB_REQUESTS)
Alexandre Julliard's avatar
Alexandre Julliard committed
5536
    {
5537 5538
        fprintf( stderr, "%04x: %s() = %s",
                 current->id, req_names[req], get_status_name(current->error) );
5539 5540 5541
        if (reply_dumpers[req])
        {
            fprintf( stderr, " {" );
5542 5543 5544
            cur_data = current->reply_data;
            cur_size = reply->reply_header.reply_size;
            reply_dumpers[req]( reply );
5545 5546 5547
            fprintf( stderr, " }" );
        }
        fputc( '\n', stderr );
Alexandre Julliard's avatar
Alexandre Julliard committed
5548
    }
5549 5550
    else fprintf( stderr, "%04x: %d() = %s\n",
                  current->id, req, get_status_name(current->error) );
Alexandre Julliard's avatar
Alexandre Julliard committed
5551
}