Alexandre Julliard | 37ec927 | 2001-07-19 00:35:37 +0000 | [diff] [blame] | 1 | /* -*- C -*- |
| 2 | * |
| 3 | * Wine server protocol definition |
| 4 | * |
| 5 | * Copyright (C) 2001 Alexandre Julliard |
| 6 | * |
| 7 | * This file is used by tools/make_requests to build the |
| 8 | * protocol structures in include/wine/server_protocol.h |
| 9 | */ |
| 10 | |
| 11 | @HEADER /* start of C declarations */ |
| 12 | |
| 13 | #include <stdlib.h> |
| 14 | #include <time.h> |
| 15 | #include "winbase.h" |
| 16 | |
| 17 | struct request_header |
| 18 | { |
| 19 | int req; /* request code */ |
| 20 | unsigned short var_offset; /* offset of the variable part of the request */ |
| 21 | unsigned short var_size; /* size of the variable part of the request */ |
| 22 | unsigned int error; /* error result */ |
| 23 | }; |
| 24 | |
| 25 | struct reply_header |
| 26 | { |
| 27 | unsigned int error; /* error result */ |
| 28 | unsigned short var_offset; /* offset of the variable part of the request */ |
| 29 | unsigned short var_size; /* size of the variable part of the request */ |
| 30 | }; |
| 31 | |
| 32 | /* placeholder structure for the maximum allowed request size */ |
| 33 | /* this is used to construct the generic_request union */ |
| 34 | struct request_max_size |
| 35 | { |
| 36 | int pad[16]; /* the max request size is 16 ints */ |
| 37 | }; |
| 38 | |
| 39 | /* max size of the variable part of a request */ |
| 40 | #define REQUEST_MAX_VAR_SIZE 1024 |
| 41 | |
| 42 | typedef int handle_t; |
| 43 | |
| 44 | /* definitions of the event data depending on the event code */ |
| 45 | struct debug_event_exception |
| 46 | { |
| 47 | EXCEPTION_RECORD record; /* exception record */ |
| 48 | int first; /* first chance exception? */ |
| 49 | }; |
| 50 | struct debug_event_create_thread |
| 51 | { |
| 52 | handle_t handle; /* handle to the new thread */ |
| 53 | void *teb; /* thread teb (in debugged process address space) */ |
| 54 | void *start; /* thread startup routine */ |
| 55 | }; |
| 56 | struct debug_event_create_process |
| 57 | { |
| 58 | handle_t file; /* handle to the process exe file */ |
| 59 | handle_t process; /* handle to the new process */ |
| 60 | handle_t thread; /* handle to the new thread */ |
| 61 | void *base; /* base of executable image */ |
| 62 | int dbg_offset; /* offset of debug info in file */ |
| 63 | int dbg_size; /* size of debug info */ |
| 64 | void *teb; /* thread teb (in debugged process address space) */ |
| 65 | void *start; /* thread startup routine */ |
| 66 | void *name; /* image name (optional) */ |
| 67 | int unicode; /* is it Unicode? */ |
| 68 | }; |
| 69 | struct debug_event_exit |
| 70 | { |
| 71 | int exit_code; /* thread or process exit code */ |
| 72 | }; |
| 73 | struct debug_event_load_dll |
| 74 | { |
| 75 | handle_t handle; /* file handle for the dll */ |
| 76 | void *base; /* base address of the dll */ |
| 77 | int dbg_offset; /* offset of debug info in file */ |
| 78 | int dbg_size; /* size of debug info */ |
| 79 | void *name; /* image name (optional) */ |
| 80 | int unicode; /* is it Unicode? */ |
| 81 | }; |
| 82 | struct debug_event_unload_dll |
| 83 | { |
| 84 | void *base; /* base address of the dll */ |
| 85 | }; |
| 86 | struct debug_event_output_string |
| 87 | { |
| 88 | void *string; /* string to display (in debugged process address space) */ |
| 89 | int unicode; /* is it Unicode? */ |
| 90 | int length; /* string length */ |
| 91 | }; |
| 92 | struct debug_event_rip_info |
| 93 | { |
| 94 | int error; /* ??? */ |
| 95 | int type; /* ??? */ |
| 96 | }; |
| 97 | union debug_event_data |
| 98 | { |
| 99 | struct debug_event_exception exception; |
| 100 | struct debug_event_create_thread create_thread; |
| 101 | struct debug_event_create_process create_process; |
| 102 | struct debug_event_exit exit; |
| 103 | struct debug_event_load_dll load_dll; |
| 104 | struct debug_event_unload_dll unload_dll; |
| 105 | struct debug_event_output_string output_string; |
| 106 | struct debug_event_rip_info rip_info; |
| 107 | }; |
| 108 | |
| 109 | /* debug event data */ |
| 110 | typedef struct |
| 111 | { |
| 112 | int code; /* event code */ |
| 113 | union debug_event_data info; /* event information */ |
| 114 | } debug_event_t; |
| 115 | |
| 116 | /* structure used in sending an fd from client to server */ |
| 117 | struct send_fd |
| 118 | { |
| 119 | void *tid; /* thread id */ |
| 120 | int fd; /* file descriptor on client-side */ |
| 121 | }; |
| 122 | |
| 123 | /* structure sent by the server on the wait fifo */ |
| 124 | struct wake_up_reply |
| 125 | { |
| 126 | void *cookie; /* magic cookie that was passed in select_request */ |
| 127 | int signaled; /* wait result */ |
| 128 | }; |
| 129 | |
| 130 | /****************************************************************/ |
| 131 | /* Request declarations */ |
| 132 | |
| 133 | /* Create a new process from the context of the parent */ |
| 134 | @REQ(new_process) |
| 135 | int inherit_all; /* inherit all handles from parent */ |
| 136 | int create_flags; /* creation flags */ |
| 137 | int start_flags; /* flags from startup info */ |
| 138 | handle_t exe_file; /* file handle for main exe */ |
| 139 | handle_t hstdin; /* handle for stdin */ |
| 140 | handle_t hstdout; /* handle for stdout */ |
| 141 | handle_t hstderr; /* handle for stderr */ |
| 142 | int cmd_show; /* main window show mode */ |
| 143 | VARARG(filename,string); /* file name of main exe */ |
| 144 | @REPLY |
| 145 | handle_t info; /* new process info handle */ |
| 146 | @END |
| 147 | |
| 148 | |
| 149 | /* Retrieve information about a newly started process */ |
| 150 | @REQ(get_new_process_info) |
| 151 | handle_t info; /* info handle returned from new_process_request */ |
| 152 | int pinherit; /* process handle inherit flag */ |
| 153 | int tinherit; /* thread handle inherit flag */ |
| 154 | @REPLY |
| 155 | void* pid; /* process id */ |
| 156 | handle_t phandle; /* process handle (in the current process) */ |
| 157 | void* tid; /* thread id */ |
| 158 | handle_t thandle; /* thread handle (in the current process) */ |
| 159 | handle_t event; /* event handle to signal startup */ |
| 160 | @END |
| 161 | |
| 162 | |
| 163 | /* Create a new thread from the context of the parent */ |
| 164 | @REQ(new_thread) |
| 165 | int suspend; /* new thread should be suspended on creation */ |
| 166 | int inherit; /* inherit flag */ |
| 167 | int request_fd; /* fd for request pipe */ |
| 168 | @REPLY |
| 169 | void* tid; /* thread id */ |
| 170 | handle_t handle; /* thread handle (in the current process) */ |
| 171 | @END |
| 172 | |
| 173 | |
| 174 | /* Signal that we are finished booting on the client side */ |
| 175 | @REQ(boot_done) |
| 176 | int debug_level; /* new debug level */ |
| 177 | @END |
| 178 | |
| 179 | |
| 180 | /* Initialize a process; called from the new process context */ |
| 181 | @REQ(init_process) |
| 182 | void* ldt_copy; /* addr of LDT copy */ |
| 183 | int ppid; /* parent Unix pid */ |
| 184 | @REPLY |
| 185 | int create_flags; /* creation flags */ |
| 186 | int start_flags; /* flags from startup info */ |
| 187 | unsigned int server_start; /* server start time (GetTickCount) */ |
| 188 | handle_t exe_file; /* file handle for main exe */ |
| 189 | handle_t hstdin; /* handle for stdin */ |
| 190 | handle_t hstdout; /* handle for stdout */ |
| 191 | handle_t hstderr; /* handle for stderr */ |
| 192 | int cmd_show; /* main window show mode */ |
| 193 | VARARG(filename,string); /* file name of main exe */ |
| 194 | @END |
| 195 | |
| 196 | |
| 197 | /* Signal the end of the process initialization */ |
| 198 | @REQ(init_process_done) |
| 199 | void* module; /* main module base address */ |
| 200 | void* entry; /* process entry point */ |
| 201 | void* name; /* ptr to ptr to name (in process addr space) */ |
| 202 | handle_t exe_file; /* file handle for main exe */ |
| 203 | int gui; /* is it a GUI process? */ |
| 204 | @REPLY |
| 205 | int debugged; /* being debugged? */ |
| 206 | @END |
| 207 | |
| 208 | |
| 209 | /* Initialize a thread; called from the child after fork()/clone() */ |
| 210 | @REQ(init_thread) |
| 211 | int unix_pid; /* Unix pid of new thread */ |
| 212 | void* teb; /* TEB of new thread (in thread address space) */ |
| 213 | void* entry; /* thread entry point (in thread address space) */ |
| 214 | int reply_fd; /* fd for reply pipe */ |
| 215 | int wait_fd; /* fd for blocking calls pipe */ |
| 216 | @REPLY |
| 217 | void* pid; /* process id of the new thread's process */ |
| 218 | void* tid; /* thread id of the new thread */ |
| 219 | int boot; /* is this the boot thread? */ |
| 220 | int version; /* protocol version */ |
| 221 | @END |
| 222 | |
| 223 | |
| 224 | /* Set the shared buffer for a thread */ |
| 225 | @REQ(set_thread_buffer) |
| 226 | int fd; /* fd to mmap as shared buffer */ |
| 227 | @REPLY |
| 228 | unsigned int offset; /* offset of buffer in file */ |
| 229 | unsigned int size; /* size of buffer */ |
| 230 | @END |
| 231 | |
| 232 | |
| 233 | /* Terminate a process */ |
| 234 | @REQ(terminate_process) |
| 235 | handle_t handle; /* process handle to terminate */ |
| 236 | int exit_code; /* process exit code */ |
| 237 | @REPLY |
| 238 | int self; /* suicide? */ |
| 239 | @END |
| 240 | |
| 241 | |
| 242 | /* Terminate a thread */ |
| 243 | @REQ(terminate_thread) |
| 244 | handle_t handle; /* thread handle to terminate */ |
| 245 | int exit_code; /* thread exit code */ |
| 246 | @REPLY |
| 247 | int self; /* suicide? */ |
| 248 | int last; /* last thread in this process? */ |
| 249 | @END |
| 250 | |
| 251 | |
| 252 | /* Retrieve information about a process */ |
| 253 | @REQ(get_process_info) |
| 254 | handle_t handle; /* process handle */ |
| 255 | @REPLY |
| 256 | void* pid; /* server process id */ |
| 257 | int debugged; /* debugged? */ |
| 258 | int exit_code; /* process exit code */ |
| 259 | int priority; /* priority class */ |
| 260 | int process_affinity; /* process affinity mask */ |
| 261 | int system_affinity; /* system affinity mask */ |
| 262 | @END |
| 263 | |
| 264 | |
| 265 | /* Set a process informations */ |
| 266 | @REQ(set_process_info) |
| 267 | handle_t handle; /* process handle */ |
| 268 | int mask; /* setting mask (see below) */ |
| 269 | int priority; /* priority class */ |
| 270 | int affinity; /* affinity mask */ |
| 271 | @END |
| 272 | #define SET_PROCESS_INFO_PRIORITY 0x01 |
| 273 | #define SET_PROCESS_INFO_AFFINITY 0x02 |
| 274 | |
| 275 | |
| 276 | /* Retrieve information about a thread */ |
| 277 | @REQ(get_thread_info) |
| 278 | handle_t handle; /* thread handle */ |
| 279 | void* tid_in; /* thread id (optional) */ |
| 280 | @REPLY |
| 281 | void* tid; /* server thread id */ |
| 282 | void* teb; /* thread teb pointer */ |
| 283 | int exit_code; /* thread exit code */ |
| 284 | int priority; /* thread priority level */ |
| 285 | @END |
| 286 | |
| 287 | |
| 288 | /* Set a thread informations */ |
| 289 | @REQ(set_thread_info) |
| 290 | handle_t handle; /* thread handle */ |
| 291 | int mask; /* setting mask (see below) */ |
| 292 | int priority; /* priority class */ |
| 293 | int affinity; /* affinity mask */ |
| 294 | @END |
| 295 | #define SET_THREAD_INFO_PRIORITY 0x01 |
| 296 | #define SET_THREAD_INFO_AFFINITY 0x02 |
| 297 | |
| 298 | |
| 299 | /* Suspend a thread */ |
| 300 | @REQ(suspend_thread) |
| 301 | handle_t handle; /* thread handle */ |
| 302 | @REPLY |
| 303 | int count; /* new suspend count */ |
| 304 | @END |
| 305 | |
| 306 | |
| 307 | /* Resume a thread */ |
| 308 | @REQ(resume_thread) |
| 309 | handle_t handle; /* thread handle */ |
| 310 | @REPLY |
| 311 | int count; /* new suspend count */ |
| 312 | @END |
| 313 | |
| 314 | |
| 315 | /* Notify the server that a dll has been loaded */ |
| 316 | @REQ(load_dll) |
| 317 | handle_t handle; /* file handle */ |
| 318 | void* base; /* base address */ |
| 319 | int dbg_offset; /* debug info offset */ |
| 320 | int dbg_size; /* debug info size */ |
| 321 | void* name; /* ptr to ptr to name (in process addr space) */ |
| 322 | @END |
| 323 | |
| 324 | |
| 325 | /* Notify the server that a dll is being unloaded */ |
| 326 | @REQ(unload_dll) |
| 327 | void* base; /* base address */ |
| 328 | @END |
| 329 | |
| 330 | |
| 331 | /* Queue an APC for a thread */ |
| 332 | @REQ(queue_apc) |
| 333 | handle_t handle; /* thread handle */ |
| 334 | int user; /* user or system apc? */ |
| 335 | void* func; /* function to call */ |
| 336 | void* param; /* param for function to call */ |
| 337 | @END |
| 338 | |
| 339 | |
| 340 | /* Get next APC to call */ |
| 341 | @REQ(get_apc) |
| 342 | int alertable; /* is thread alertable? */ |
| 343 | @REPLY |
| 344 | void* func; /* function to call */ |
| 345 | int type; /* function type */ |
| 346 | VARARG(args,ptrs); /* function arguments */ |
| 347 | @END |
| 348 | enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC }; |
| 349 | |
| 350 | |
| 351 | /* Close a handle for the current process */ |
| 352 | @REQ(close_handle) |
| 353 | handle_t handle; /* handle to close */ |
| 354 | @REPLY |
| 355 | int fd; /* associated fd to close */ |
| 356 | @END |
| 357 | |
| 358 | |
| 359 | /* Set a handle information */ |
| 360 | @REQ(set_handle_info) |
| 361 | handle_t handle; /* handle we are interested in */ |
| 362 | int flags; /* new handle flags */ |
| 363 | int mask; /* mask for flags to set */ |
| 364 | int fd; /* file descriptor or -1 */ |
| 365 | @REPLY |
| 366 | int old_flags; /* old flag value */ |
| 367 | int cur_fd; /* current file descriptor */ |
| 368 | @END |
| 369 | |
| 370 | |
| 371 | /* Duplicate a handle */ |
| 372 | @REQ(dup_handle) |
| 373 | handle_t src_process; /* src process handle */ |
| 374 | handle_t src_handle; /* src handle to duplicate */ |
| 375 | handle_t dst_process; /* dst process handle */ |
| 376 | unsigned int access; /* wanted access rights */ |
| 377 | int inherit; /* inherit flag */ |
| 378 | int options; /* duplicate options (see below) */ |
| 379 | @REPLY |
| 380 | handle_t handle; /* duplicated handle in dst process */ |
| 381 | int fd; /* associated fd to close */ |
| 382 | @END |
| 383 | #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE |
| 384 | #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS |
| 385 | #define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */ |
| 386 | |
| 387 | |
| 388 | /* Open a handle to a process */ |
| 389 | @REQ(open_process) |
| 390 | void* pid; /* process id to open */ |
| 391 | unsigned int access; /* wanted access rights */ |
| 392 | int inherit; /* inherit flag */ |
| 393 | @REPLY |
| 394 | handle_t handle; /* handle to the process */ |
| 395 | @END |
| 396 | |
| 397 | |
| 398 | /* Wait for handles */ |
| 399 | @REQ(select) |
| 400 | int flags; /* wait flags (see below) */ |
| 401 | void* cookie; /* magic cookie to return to client */ |
| 402 | int sec; /* absolute timeout */ |
| 403 | int usec; /* absolute timeout */ |
| 404 | VARARG(handles,handles); /* handles to select on */ |
| 405 | @END |
| 406 | #define SELECT_ALL 1 |
| 407 | #define SELECT_ALERTABLE 2 |
| 408 | #define SELECT_INTERRUPTIBLE 4 |
| 409 | #define SELECT_TIMEOUT 8 |
| 410 | |
| 411 | |
| 412 | /* Create an event */ |
| 413 | @REQ(create_event) |
| 414 | int manual_reset; /* manual reset event */ |
| 415 | int initial_state; /* initial state of the event */ |
| 416 | int inherit; /* inherit flag */ |
| 417 | VARARG(name,unicode_str); /* object name */ |
| 418 | @REPLY |
| 419 | handle_t handle; /* handle to the event */ |
| 420 | @END |
| 421 | |
| 422 | /* Event operation */ |
| 423 | @REQ(event_op) |
| 424 | handle_t handle; /* handle to event */ |
| 425 | int op; /* event operation (see below) */ |
| 426 | @END |
| 427 | enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT }; |
| 428 | |
| 429 | |
| 430 | /* Open an event */ |
| 431 | @REQ(open_event) |
| 432 | unsigned int access; /* wanted access rights */ |
| 433 | int inherit; /* inherit flag */ |
| 434 | VARARG(name,unicode_str); /* object name */ |
| 435 | @REPLY |
| 436 | handle_t handle; /* handle to the event */ |
| 437 | @END |
| 438 | |
| 439 | |
| 440 | /* Create a mutex */ |
| 441 | @REQ(create_mutex) |
| 442 | int owned; /* initially owned? */ |
| 443 | int inherit; /* inherit flag */ |
| 444 | VARARG(name,unicode_str); /* object name */ |
| 445 | @REPLY |
| 446 | handle_t handle; /* handle to the mutex */ |
| 447 | @END |
| 448 | |
| 449 | |
| 450 | /* Release a mutex */ |
| 451 | @REQ(release_mutex) |
| 452 | handle_t handle; /* handle to the mutex */ |
| 453 | @END |
| 454 | |
| 455 | |
| 456 | /* Open a mutex */ |
| 457 | @REQ(open_mutex) |
| 458 | unsigned int access; /* wanted access rights */ |
| 459 | int inherit; /* inherit flag */ |
| 460 | VARARG(name,unicode_str); /* object name */ |
| 461 | @REPLY |
| 462 | handle_t handle; /* handle to the mutex */ |
| 463 | @END |
| 464 | |
| 465 | |
| 466 | /* Create a semaphore */ |
| 467 | @REQ(create_semaphore) |
| 468 | unsigned int initial; /* initial count */ |
| 469 | unsigned int max; /* maximum count */ |
| 470 | int inherit; /* inherit flag */ |
| 471 | VARARG(name,unicode_str); /* object name */ |
| 472 | @REPLY |
| 473 | handle_t handle; /* handle to the semaphore */ |
| 474 | @END |
| 475 | |
| 476 | |
| 477 | /* Release a semaphore */ |
| 478 | @REQ(release_semaphore) |
| 479 | handle_t handle; /* handle to the semaphore */ |
| 480 | unsigned int count; /* count to add to semaphore */ |
| 481 | @REPLY |
| 482 | unsigned int prev_count; /* previous semaphore count */ |
| 483 | @END |
| 484 | |
| 485 | |
| 486 | /* Open a semaphore */ |
| 487 | @REQ(open_semaphore) |
| 488 | unsigned int access; /* wanted access rights */ |
| 489 | int inherit; /* inherit flag */ |
| 490 | VARARG(name,unicode_str); /* object name */ |
| 491 | @REPLY |
| 492 | handle_t handle; /* handle to the semaphore */ |
| 493 | @END |
| 494 | |
| 495 | |
| 496 | /* Create a file */ |
| 497 | @REQ(create_file) |
| 498 | unsigned int access; /* wanted access rights */ |
| 499 | int inherit; /* inherit flag */ |
| 500 | unsigned int sharing; /* sharing flags */ |
| 501 | int create; /* file create action */ |
| 502 | unsigned int attrs; /* file attributes for creation */ |
| 503 | VARARG(filename,string); /* file name */ |
| 504 | @REPLY |
| 505 | handle_t handle; /* handle to the file */ |
| 506 | @END |
| 507 | |
| 508 | |
| 509 | /* Allocate a file handle for a Unix fd */ |
| 510 | @REQ(alloc_file_handle) |
| 511 | unsigned int access; /* wanted access rights */ |
| 512 | int fd; /* file descriptor on the client side */ |
| 513 | @REPLY |
| 514 | handle_t handle; /* handle to the file */ |
| 515 | @END |
| 516 | |
| 517 | |
| 518 | /* Get a Unix fd to access a file */ |
| 519 | @REQ(get_handle_fd) |
| 520 | handle_t handle; /* handle to the file */ |
| 521 | unsigned int access; /* wanted access rights */ |
| 522 | @REPLY |
| 523 | int fd; /* file descriptor */ |
| 524 | @END |
| 525 | |
| 526 | |
| 527 | /* Set a file current position */ |
| 528 | @REQ(set_file_pointer) |
| 529 | handle_t handle; /* handle to the file */ |
| 530 | int low; /* position low word */ |
| 531 | int high; /* position high word */ |
| 532 | int whence; /* whence to seek */ |
| 533 | @REPLY |
| 534 | int new_low; /* new position low word */ |
| 535 | int new_high; /* new position high word */ |
| 536 | @END |
| 537 | |
| 538 | |
| 539 | /* Truncate (or extend) a file */ |
| 540 | @REQ(truncate_file) |
| 541 | handle_t handle; /* handle to the file */ |
| 542 | @END |
| 543 | |
| 544 | |
| 545 | /* Set a file access and modification times */ |
| 546 | @REQ(set_file_time) |
| 547 | handle_t handle; /* handle to the file */ |
| 548 | time_t access_time; /* last access time */ |
| 549 | time_t write_time; /* last write time */ |
| 550 | @END |
| 551 | |
| 552 | |
| 553 | /* Flush a file buffers */ |
| 554 | @REQ(flush_file) |
| 555 | handle_t handle; /* handle to the file */ |
| 556 | @END |
| 557 | |
| 558 | |
| 559 | /* Get information about a file */ |
| 560 | @REQ(get_file_info) |
| 561 | handle_t handle; /* handle to the file */ |
| 562 | @REPLY |
| 563 | int type; /* file type */ |
| 564 | int attr; /* file attributes */ |
| 565 | time_t access_time; /* last access time */ |
| 566 | time_t write_time; /* last write time */ |
| 567 | int size_high; /* file size */ |
| 568 | int size_low; /* file size */ |
| 569 | int links; /* number of links */ |
| 570 | int index_high; /* unique index */ |
| 571 | int index_low; /* unique index */ |
| 572 | unsigned int serial; /* volume serial number */ |
| 573 | @END |
| 574 | |
| 575 | |
| 576 | /* Lock a region of a file */ |
| 577 | @REQ(lock_file) |
| 578 | handle_t handle; /* handle to the file */ |
| 579 | unsigned int offset_low; /* offset of start of lock */ |
| 580 | unsigned int offset_high; /* offset of start of lock */ |
| 581 | unsigned int count_low; /* count of bytes to lock */ |
| 582 | unsigned int count_high; /* count of bytes to lock */ |
| 583 | @END |
| 584 | |
| 585 | |
| 586 | /* Unlock a region of a file */ |
| 587 | @REQ(unlock_file) |
| 588 | handle_t handle; /* handle to the file */ |
| 589 | unsigned int offset_low; /* offset of start of unlock */ |
| 590 | unsigned int offset_high; /* offset of start of unlock */ |
| 591 | unsigned int count_low; /* count of bytes to unlock */ |
| 592 | unsigned int count_high; /* count of bytes to unlock */ |
| 593 | @END |
| 594 | |
| 595 | |
| 596 | /* Create an anonymous pipe */ |
| 597 | @REQ(create_pipe) |
| 598 | int inherit; /* inherit flag */ |
| 599 | @REPLY |
| 600 | handle_t handle_read; /* handle to the read-side of the pipe */ |
| 601 | handle_t handle_write; /* handle to the write-side of the pipe */ |
| 602 | @END |
| 603 | |
| 604 | |
| 605 | /* Create a socket */ |
| 606 | @REQ(create_socket) |
| 607 | unsigned int access; /* wanted access rights */ |
| 608 | int inherit; /* inherit flag */ |
| 609 | int family; /* family, see socket manpage */ |
| 610 | int type; /* type, see socket manpage */ |
| 611 | int protocol; /* protocol, see socket manpage */ |
| 612 | @REPLY |
| 613 | handle_t handle; /* handle to the new socket */ |
| 614 | @END |
| 615 | |
| 616 | |
| 617 | /* Accept a socket */ |
| 618 | @REQ(accept_socket) |
| 619 | handle_t lhandle; /* handle to the listening socket */ |
| 620 | unsigned int access; /* wanted access rights */ |
| 621 | int inherit; /* inherit flag */ |
| 622 | @REPLY |
| 623 | handle_t handle; /* handle to the new socket */ |
| 624 | @END |
| 625 | |
| 626 | |
| 627 | /* Set socket event parameters */ |
| 628 | @REQ(set_socket_event) |
| 629 | handle_t handle; /* handle to the socket */ |
| 630 | unsigned int mask; /* event mask */ |
| 631 | handle_t event; /* event object */ |
| 632 | @END |
| 633 | |
| 634 | |
| 635 | /* Get socket event parameters */ |
| 636 | @REQ(get_socket_event) |
| 637 | handle_t handle; /* handle to the socket */ |
| 638 | int service; /* clear pending? */ |
| 639 | handle_t s_event; /* "expected" event object */ |
| 640 | handle_t c_event; /* event to clear */ |
| 641 | @REPLY |
| 642 | unsigned int mask; /* event mask */ |
| 643 | unsigned int pmask; /* pending events */ |
| 644 | unsigned int state; /* status bits */ |
| 645 | VARARG(errors,ints); /* event errors */ |
| 646 | @END |
| 647 | |
| 648 | |
| 649 | /* Reenable pending socket events */ |
| 650 | @REQ(enable_socket_event) |
| 651 | handle_t handle; /* handle to the socket */ |
| 652 | unsigned int mask; /* events to re-enable */ |
| 653 | unsigned int sstate; /* status bits to set */ |
| 654 | unsigned int cstate; /* status bits to clear */ |
| 655 | @END |
| 656 | |
| 657 | |
| 658 | /* Allocate a console for the current process */ |
| 659 | @REQ(alloc_console) |
| 660 | unsigned int access; /* wanted access rights */ |
| 661 | int inherit; /* inherit flag */ |
| 662 | @REPLY |
| 663 | handle_t handle_in; /* handle to console input */ |
| 664 | handle_t handle_out; /* handle to console output */ |
| 665 | @END |
| 666 | |
| 667 | |
| 668 | /* Free the console of the current process */ |
| 669 | @REQ(free_console) |
| 670 | @END |
| 671 | |
| 672 | |
| 673 | /* Open a handle to the process console */ |
| 674 | @REQ(open_console) |
| 675 | int output; /* input or output? */ |
| 676 | unsigned int access; /* wanted access rights */ |
| 677 | int inherit; /* inherit flag */ |
| 678 | @REPLY |
| 679 | handle_t handle; /* handle to the console */ |
| 680 | @END |
| 681 | |
| 682 | |
| 683 | /* Set a console file descriptor */ |
| 684 | @REQ(set_console_fd) |
| 685 | handle_t handle; /* handle to the console */ |
| 686 | int fd_in; /* file descriptor to use as input */ |
| 687 | int fd_out; /* file descriptor to use as output */ |
| 688 | int pid; /* pid of xterm (hack) */ |
| 689 | @END |
| 690 | |
| 691 | |
| 692 | /* Get a console mode (input or output) */ |
| 693 | @REQ(get_console_mode) |
| 694 | handle_t handle; /* handle to the console */ |
| 695 | @REPLY |
| 696 | int mode; /* console mode */ |
| 697 | @END |
| 698 | |
| 699 | |
| 700 | /* Set a console mode (input or output) */ |
| 701 | @REQ(set_console_mode) |
| 702 | handle_t handle; /* handle to the console */ |
| 703 | int mode; /* console mode */ |
| 704 | @END |
| 705 | |
| 706 | |
| 707 | /* Set info about a console (output only) */ |
| 708 | @REQ(set_console_info) |
| 709 | handle_t handle; /* handle to the console */ |
| 710 | int mask; /* setting mask (see below) */ |
| 711 | int cursor_size; /* size of cursor (percentage filled) */ |
| 712 | int cursor_visible;/* cursor visibility flag */ |
| 713 | VARARG(title,string); /* console title */ |
| 714 | @END |
| 715 | #define SET_CONSOLE_INFO_CURSOR 0x01 |
| 716 | #define SET_CONSOLE_INFO_TITLE 0x02 |
| 717 | |
| 718 | /* Get info about a console (output only) */ |
| 719 | @REQ(get_console_info) |
| 720 | handle_t handle; /* handle to the console */ |
| 721 | @REPLY |
| 722 | int cursor_size; /* size of cursor (percentage filled) */ |
| 723 | int cursor_visible;/* cursor visibility flag */ |
| 724 | int pid; /* pid of xterm (hack) */ |
| 725 | VARARG(title,string); /* console title */ |
| 726 | @END |
| 727 | |
| 728 | |
| 729 | /* Add input records to a console input queue */ |
| 730 | @REQ(write_console_input) |
| 731 | handle_t handle; /* handle to the console input */ |
| 732 | VARARG(rec,input_records); /* input records */ |
| 733 | @REPLY |
| 734 | int written; /* number of records written */ |
| 735 | @END |
| 736 | |
| 737 | /* Fetch input records from a console input queue */ |
| 738 | @REQ(read_console_input) |
| 739 | handle_t handle; /* handle to the console input */ |
| 740 | int flush; /* flush the retrieved records from the queue? */ |
| 741 | @REPLY |
| 742 | int read; /* number of records read */ |
| 743 | VARARG(rec,input_records); /* input records */ |
| 744 | @END |
| 745 | |
| 746 | |
| 747 | /* Create a change notification */ |
| 748 | @REQ(create_change_notification) |
| 749 | int subtree; /* watch all the subtree */ |
| 750 | int filter; /* notification filter */ |
| 751 | @REPLY |
| 752 | handle_t handle; /* handle to the change notification */ |
| 753 | @END |
| 754 | |
| 755 | |
| 756 | /* Create a file mapping */ |
| 757 | @REQ(create_mapping) |
| 758 | int size_high; /* mapping size */ |
| 759 | int size_low; /* mapping size */ |
| 760 | int protect; /* protection flags (see below) */ |
| 761 | int inherit; /* inherit flag */ |
| 762 | handle_t file_handle; /* file handle */ |
| 763 | VARARG(name,unicode_str); /* object name */ |
| 764 | @REPLY |
| 765 | handle_t handle; /* handle to the mapping */ |
| 766 | @END |
| 767 | /* protection flags */ |
| 768 | #define VPROT_READ 0x01 |
| 769 | #define VPROT_WRITE 0x02 |
| 770 | #define VPROT_EXEC 0x04 |
| 771 | #define VPROT_WRITECOPY 0x08 |
| 772 | #define VPROT_GUARD 0x10 |
| 773 | #define VPROT_NOCACHE 0x20 |
| 774 | #define VPROT_COMMITTED 0x40 |
| 775 | #define VPROT_IMAGE 0x80 |
| 776 | |
| 777 | |
| 778 | /* Open a mapping */ |
| 779 | @REQ(open_mapping) |
| 780 | unsigned int access; /* wanted access rights */ |
| 781 | int inherit; /* inherit flag */ |
| 782 | VARARG(name,unicode_str); /* object name */ |
| 783 | @REPLY |
| 784 | handle_t handle; /* handle to the mapping */ |
| 785 | @END |
| 786 | |
| 787 | |
| 788 | /* Get information about a file mapping */ |
| 789 | @REQ(get_mapping_info) |
| 790 | handle_t handle; /* handle to the mapping */ |
| 791 | @REPLY |
| 792 | int size_high; /* mapping size */ |
| 793 | int size_low; /* mapping size */ |
| 794 | int protect; /* protection flags */ |
| 795 | int header_size; /* header size (for VPROT_IMAGE mapping) */ |
| 796 | void* base; /* default base addr (for VPROT_IMAGE mapping) */ |
| 797 | handle_t shared_file; /* shared mapping file handle */ |
| 798 | int shared_size; /* shared mapping size */ |
| 799 | @END |
| 800 | |
| 801 | |
| 802 | /* Create a device */ |
| 803 | @REQ(create_device) |
| 804 | unsigned int access; /* wanted access rights */ |
| 805 | int inherit; /* inherit flag */ |
| 806 | int id; /* client private id */ |
| 807 | @REPLY |
| 808 | handle_t handle; /* handle to the device */ |
| 809 | @END |
| 810 | |
| 811 | |
| 812 | /* Create a snapshot */ |
| 813 | @REQ(create_snapshot) |
| 814 | int inherit; /* inherit flag */ |
| 815 | int flags; /* snapshot flags (TH32CS_*) */ |
| 816 | void* pid; /* process id */ |
| 817 | @REPLY |
| 818 | handle_t handle; /* handle to the snapshot */ |
| 819 | @END |
| 820 | |
| 821 | |
| 822 | /* Get the next process from a snapshot */ |
| 823 | @REQ(next_process) |
| 824 | handle_t handle; /* handle to the snapshot */ |
| 825 | int reset; /* reset snapshot position? */ |
| 826 | @REPLY |
| 827 | int count; /* process usage count */ |
| 828 | void* pid; /* process id */ |
| 829 | int threads; /* number of threads */ |
| 830 | int priority; /* process priority */ |
| 831 | @END |
| 832 | |
| 833 | |
| 834 | /* Get the next thread from a snapshot */ |
| 835 | @REQ(next_thread) |
| 836 | handle_t handle; /* handle to the snapshot */ |
| 837 | int reset; /* reset snapshot position? */ |
| 838 | @REPLY |
| 839 | int count; /* thread usage count */ |
| 840 | void* pid; /* process id */ |
| 841 | void* tid; /* thread id */ |
| 842 | int base_pri; /* base priority */ |
| 843 | int delta_pri; /* delta priority */ |
| 844 | @END |
| 845 | |
| 846 | |
| 847 | /* Get the next module from a snapshot */ |
| 848 | @REQ(next_module) |
| 849 | handle_t handle; /* handle to the snapshot */ |
| 850 | int reset; /* reset snapshot position? */ |
| 851 | @REPLY |
| 852 | void* pid; /* process id */ |
| 853 | void* base; /* module base address */ |
| 854 | @END |
| 855 | |
| 856 | |
| 857 | /* Wait for a debug event */ |
| 858 | @REQ(wait_debug_event) |
| 859 | int get_handle; /* should we alloc a handle for waiting? */ |
| 860 | @REPLY |
| 861 | void* pid; /* process id */ |
| 862 | void* tid; /* thread id */ |
| 863 | handle_t wait; /* wait handle if no event ready */ |
| 864 | VARARG(event,debug_event); /* debug event data */ |
| 865 | @END |
| 866 | |
| 867 | |
| 868 | /* Queue an exception event */ |
| 869 | @REQ(queue_exception_event) |
| 870 | int first; /* first chance exception? */ |
| 871 | VARARG(record,exc_event); /* thread context followed by exception record */ |
| 872 | @REPLY |
| 873 | handle_t handle; /* handle to the queued event */ |
| 874 | @END |
| 875 | |
| 876 | |
| 877 | /* Retrieve the status of an exception event */ |
| 878 | @REQ(get_exception_status) |
| 879 | @REPLY |
| 880 | handle_t handle; /* handle to the queued event */ |
| 881 | int status; /* event continuation status */ |
| 882 | VARARG(context,context); /* modified thread context */ |
| 883 | @END |
| 884 | |
| 885 | |
| 886 | /* Send an output string to the debugger */ |
| 887 | @REQ(output_debug_string) |
| 888 | void* string; /* string to display (in debugged process address space) */ |
| 889 | int unicode; /* is it Unicode? */ |
| 890 | int length; /* string length */ |
| 891 | @END |
| 892 | |
| 893 | |
| 894 | /* Continue a debug event */ |
| 895 | @REQ(continue_debug_event) |
| 896 | void* pid; /* process id to continue */ |
| 897 | void* tid; /* thread id to continue */ |
| 898 | int status; /* continuation status */ |
| 899 | @END |
| 900 | |
| 901 | |
| 902 | /* Start debugging an existing process */ |
| 903 | @REQ(debug_process) |
| 904 | void* pid; /* id of the process to debug */ |
| 905 | @END |
| 906 | |
| 907 | |
| 908 | /* Read data from a process address space */ |
| 909 | @REQ(read_process_memory) |
| 910 | handle_t handle; /* process handle */ |
| 911 | void* addr; /* addr to read from (must be int-aligned) */ |
| 912 | int len; /* number of ints to read */ |
| 913 | @REPLY |
| 914 | VARARG(data,bytes); /* result data */ |
| 915 | @END |
| 916 | |
| 917 | |
| 918 | /* Write data to a process address space */ |
| 919 | @REQ(write_process_memory) |
| 920 | handle_t handle; /* process handle */ |
| 921 | void* addr; /* addr to write to (must be int-aligned) */ |
| 922 | int len; /* number of ints to write */ |
| 923 | unsigned int first_mask; /* mask for first word */ |
| 924 | unsigned int last_mask; /* mask for last word */ |
| 925 | VARARG(data,bytes); /* result data */ |
| 926 | @END |
| 927 | |
| 928 | |
| 929 | /* Create a registry key */ |
| 930 | @REQ(create_key) |
| 931 | handle_t parent; /* handle to the parent key */ |
| 932 | unsigned int access; /* desired access rights */ |
| 933 | unsigned int options; /* creation options */ |
| 934 | time_t modif; /* last modification time */ |
| 935 | VARARG(name,unicode_len_str); /* key name */ |
| 936 | VARARG(class,unicode_str); /* class name */ |
| 937 | @REPLY |
| 938 | handle_t hkey; /* handle to the created key */ |
| 939 | int created; /* has it been newly created? */ |
| 940 | @END |
| 941 | |
| 942 | /* Open a registry key */ |
| 943 | @REQ(open_key) |
| 944 | handle_t parent; /* handle to the parent key */ |
| 945 | unsigned int access; /* desired access rights */ |
| 946 | VARARG(name,unicode_str); /* key name */ |
| 947 | @REPLY |
| 948 | handle_t hkey; /* handle to the open key */ |
| 949 | @END |
| 950 | |
| 951 | |
| 952 | /* Delete a registry key */ |
| 953 | @REQ(delete_key) |
| 954 | handle_t hkey; /* handle to the key */ |
| 955 | @END |
| 956 | |
| 957 | |
| 958 | /* Enumerate registry subkeys */ |
| 959 | @REQ(enum_key) |
| 960 | handle_t hkey; /* handle to registry key */ |
| 961 | int index; /* index of subkey (or -1 for current key) */ |
| 962 | int full; /* return the full info? */ |
| 963 | @REPLY |
| 964 | int subkeys; /* number of subkeys */ |
| 965 | int max_subkey; /* longest subkey name */ |
| 966 | int max_class; /* longest class name */ |
| 967 | int values; /* number of values */ |
| 968 | int max_value; /* longest value name */ |
| 969 | int max_data; /* longest value data */ |
| 970 | time_t modif; /* last modification time */ |
| 971 | VARARG(name,unicode_len_str); /* key name */ |
| 972 | VARARG(class,unicode_str); /* class name */ |
| 973 | @END |
| 974 | |
| 975 | |
| 976 | /* Set a value of a registry key */ |
| 977 | @REQ(set_key_value) |
| 978 | handle_t hkey; /* handle to registry key */ |
| 979 | int type; /* value type */ |
| 980 | unsigned int total; /* total value len */ |
| 981 | unsigned int offset; /* offset for setting data */ |
| 982 | VARARG(name,unicode_len_str); /* value name */ |
| 983 | VARARG(data,bytes); /* value data */ |
| 984 | @END |
| 985 | |
| 986 | |
| 987 | /* Retrieve the value of a registry key */ |
| 988 | @REQ(get_key_value) |
| 989 | handle_t hkey; /* handle to registry key */ |
| 990 | unsigned int offset; /* offset for getting data */ |
| 991 | VARARG(name,unicode_len_str); /* value name */ |
| 992 | @REPLY |
| 993 | int type; /* value type */ |
| 994 | int len; /* value data len */ |
| 995 | VARARG(data,bytes); /* value data */ |
| 996 | @END |
| 997 | |
| 998 | |
| 999 | /* Enumerate a value of a registry key */ |
| 1000 | @REQ(enum_key_value) |
| 1001 | handle_t hkey; /* handle to registry key */ |
| 1002 | int index; /* value index */ |
| 1003 | unsigned int offset; /* offset for getting data */ |
| 1004 | @REPLY |
| 1005 | int type; /* value type */ |
| 1006 | int len; /* value data len */ |
| 1007 | VARARG(name,unicode_len_str); /* value name */ |
| 1008 | VARARG(data,bytes); /* value data */ |
| 1009 | @END |
| 1010 | |
| 1011 | |
| 1012 | /* Delete a value of a registry key */ |
| 1013 | @REQ(delete_key_value) |
| 1014 | handle_t hkey; /* handle to registry key */ |
| 1015 | VARARG(name,unicode_str); /* value name */ |
| 1016 | @END |
| 1017 | |
| 1018 | |
| 1019 | /* Load a registry branch from a file */ |
| 1020 | @REQ(load_registry) |
| 1021 | handle_t hkey; /* root key to load to */ |
| 1022 | handle_t file; /* file to load from */ |
| 1023 | VARARG(name,unicode_str); /* subkey name */ |
| 1024 | @END |
| 1025 | |
| 1026 | |
| 1027 | /* Save a registry branch to a file */ |
| 1028 | @REQ(save_registry) |
| 1029 | handle_t hkey; /* key to save */ |
| 1030 | handle_t file; /* file to save to */ |
| 1031 | @END |
| 1032 | |
| 1033 | |
| 1034 | /* Save a registry branch at server exit */ |
| 1035 | @REQ(save_registry_atexit) |
| 1036 | handle_t hkey; /* key to save */ |
| 1037 | VARARG(file,string); /* file to save to */ |
| 1038 | @END |
| 1039 | |
| 1040 | |
| 1041 | /* Set the current and saving level for the registry */ |
| 1042 | @REQ(set_registry_levels) |
| 1043 | int current; /* new current level */ |
| 1044 | int saving; /* new saving level */ |
| 1045 | int period; /* duration between periodic saves (milliseconds) */ |
| 1046 | @END |
| 1047 | |
| 1048 | |
| 1049 | /* Create a waitable timer */ |
| 1050 | @REQ(create_timer) |
| 1051 | int inherit; /* inherit flag */ |
| 1052 | int manual; /* manual reset */ |
| 1053 | VARARG(name,unicode_str); /* object name */ |
| 1054 | @REPLY |
| 1055 | handle_t handle; /* handle to the timer */ |
| 1056 | @END |
| 1057 | |
| 1058 | |
| 1059 | /* Open a waitable timer */ |
| 1060 | @REQ(open_timer) |
| 1061 | unsigned int access; /* wanted access rights */ |
| 1062 | int inherit; /* inherit flag */ |
| 1063 | VARARG(name,unicode_str); /* object name */ |
| 1064 | @REPLY |
| 1065 | handle_t handle; /* handle to the timer */ |
| 1066 | @END |
| 1067 | |
| 1068 | /* Set a waitable timer */ |
| 1069 | @REQ(set_timer) |
| 1070 | handle_t handle; /* handle to the timer */ |
| 1071 | int sec; /* next expiration absolute time */ |
| 1072 | int usec; /* next expiration absolute time */ |
| 1073 | int period; /* timer period in ms */ |
| 1074 | void* callback; /* callback function */ |
| 1075 | void* arg; /* callback argument */ |
| 1076 | @END |
| 1077 | |
| 1078 | /* Cancel a waitable timer */ |
| 1079 | @REQ(cancel_timer) |
| 1080 | handle_t handle; /* handle to the timer */ |
| 1081 | @END |
| 1082 | |
| 1083 | |
| 1084 | /* Retrieve the current context of a thread */ |
| 1085 | @REQ(get_thread_context) |
| 1086 | handle_t handle; /* thread handle */ |
| 1087 | unsigned int flags; /* context flags */ |
| 1088 | @REPLY |
| 1089 | VARARG(context,context); /* thread context */ |
| 1090 | @END |
| 1091 | |
| 1092 | |
| 1093 | /* Set the current context of a thread */ |
| 1094 | @REQ(set_thread_context) |
| 1095 | handle_t handle; /* thread handle */ |
| 1096 | unsigned int flags; /* context flags */ |
| 1097 | VARARG(context,context); /* thread context */ |
| 1098 | @END |
| 1099 | |
| 1100 | |
| 1101 | /* Fetch a selector entry for a thread */ |
| 1102 | @REQ(get_selector_entry) |
| 1103 | handle_t handle; /* thread handle */ |
| 1104 | int entry; /* LDT entry */ |
| 1105 | @REPLY |
| 1106 | unsigned int base; /* selector base */ |
| 1107 | unsigned int limit; /* selector limit */ |
| 1108 | unsigned char flags; /* selector flags */ |
| 1109 | @END |
| 1110 | |
| 1111 | |
| 1112 | /* Add an atom */ |
| 1113 | @REQ(add_atom) |
| 1114 | int local; /* is atom in local process table? */ |
| 1115 | VARARG(name,unicode_str); /* atom name */ |
| 1116 | @REPLY |
| 1117 | int atom; /* resulting atom */ |
| 1118 | @END |
| 1119 | |
| 1120 | |
| 1121 | /* Delete an atom */ |
| 1122 | @REQ(delete_atom) |
| 1123 | int atom; /* atom handle */ |
| 1124 | int local; /* is atom in local process table? */ |
| 1125 | @END |
| 1126 | |
| 1127 | |
| 1128 | /* Find an atom */ |
| 1129 | @REQ(find_atom) |
| 1130 | int local; /* is atom in local process table? */ |
| 1131 | VARARG(name,unicode_str); /* atom name */ |
| 1132 | @REPLY |
| 1133 | int atom; /* atom handle */ |
| 1134 | @END |
| 1135 | |
| 1136 | |
| 1137 | /* Get an atom name */ |
| 1138 | @REQ(get_atom_name) |
| 1139 | int atom; /* atom handle */ |
| 1140 | int local; /* is atom in local process table? */ |
| 1141 | @REPLY |
| 1142 | int count; /* atom lock count */ |
| 1143 | VARARG(name,unicode_str); /* atom name */ |
| 1144 | @END |
| 1145 | |
| 1146 | |
| 1147 | /* Init the process atom table */ |
| 1148 | @REQ(init_atom_table) |
| 1149 | int entries; /* number of entries */ |
| 1150 | @END |
| 1151 | |
| 1152 | |
| 1153 | /* Get the message queue of the current thread */ |
| 1154 | @REQ(get_msg_queue) |
| 1155 | @REPLY |
| 1156 | handle_t handle; /* handle to the queue */ |
| 1157 | @END |
| 1158 | |
| 1159 | |
| 1160 | /* Increment the message queue paint count */ |
| 1161 | @REQ(inc_queue_paint_count) |
| 1162 | void* id; /* thread id */ |
| 1163 | int incr; /* increment (can be negative) */ |
| 1164 | @END |
| 1165 | |
| 1166 | |
| 1167 | /* Set the current message queue wakeup mask */ |
| 1168 | @REQ(set_queue_mask) |
| 1169 | unsigned int wake_mask; /* wakeup bits mask */ |
| 1170 | unsigned int changed_mask; /* changed bits mask */ |
| 1171 | int skip_wait; /* will we skip waiting if signaled? */ |
| 1172 | @REPLY |
| 1173 | unsigned int wake_bits; /* current wake bits */ |
| 1174 | unsigned int changed_bits; /* current changed bits */ |
| 1175 | @END |
| 1176 | |
| 1177 | |
| 1178 | /* Get the current message queue status */ |
| 1179 | @REQ(get_queue_status) |
| 1180 | int clear; /* should we clear the change bits? */ |
| 1181 | @REPLY |
| 1182 | unsigned int wake_bits; /* wake bits */ |
| 1183 | unsigned int changed_bits; /* changed bits since last time */ |
| 1184 | @END |
| 1185 | |
| 1186 | |
| 1187 | /* Wait for a process to start waiting on input */ |
| 1188 | @REQ(wait_input_idle) |
| 1189 | handle_t handle; /* process handle */ |
| 1190 | int timeout; /* timeout */ |
| 1191 | @REPLY |
| 1192 | handle_t event; /* handle to idle event */ |
| 1193 | @END |
| 1194 | |
| 1195 | |
| 1196 | /* Send a message to a thread queue */ |
| 1197 | @REQ(send_message) |
| 1198 | int kind; /* message kind (see below) */ |
| 1199 | void* id; /* thread id */ |
| 1200 | int type; /* message type */ |
| 1201 | handle_t win; /* window handle */ |
| 1202 | unsigned int msg; /* message code */ |
| 1203 | unsigned int wparam; /* parameters */ |
| 1204 | unsigned int lparam; /* parameters */ |
| 1205 | unsigned short x; /* x position */ |
| 1206 | unsigned short y; /* y position */ |
| 1207 | unsigned int time; /* message time */ |
| 1208 | unsigned int info; /* extra info */ |
| 1209 | @END |
| 1210 | enum message_kind { SEND_MESSAGE, POST_MESSAGE, COOKED_HW_MESSAGE, RAW_HW_MESSAGE }; |
| 1211 | #define NB_MSG_KINDS (RAW_HW_MESSAGE+1) |
| 1212 | |
| 1213 | |
| 1214 | /* Get a message from the current queue */ |
| 1215 | @REQ(get_message) |
| 1216 | int flags; /* see below */ |
| 1217 | handle_t get_win; /* window handle to get */ |
| 1218 | unsigned int get_first; /* first message code to get */ |
| 1219 | unsigned int get_last; /* last message code to get */ |
| 1220 | @REPLY |
| 1221 | int kind; /* message kind */ |
| 1222 | int type; /* message type */ |
| 1223 | handle_t win; /* window handle */ |
| 1224 | unsigned int msg; /* message code */ |
| 1225 | unsigned int wparam; /* parameters */ |
| 1226 | unsigned int lparam; /* parameters */ |
| 1227 | unsigned short x; /* x position */ |
| 1228 | unsigned short y; /* y position */ |
| 1229 | unsigned int time; /* message time */ |
| 1230 | unsigned int info; /* extra info */ |
| 1231 | @END |
| 1232 | #define GET_MSG_REMOVE 1 /* remove the message */ |
| 1233 | #define GET_MSG_SENT_ONLY 2 /* only get sent messages */ |
| 1234 | #define GET_MSG_REMOVE_LAST 4 /* remove last message returned before checking for a new one */ |
| 1235 | |
| 1236 | /* Reply to a sent message */ |
| 1237 | @REQ(reply_message) |
| 1238 | unsigned int result; /* message result */ |
| 1239 | int remove; /* should we remove the message? */ |
| 1240 | @END |
| 1241 | |
| 1242 | |
| 1243 | /* Retrieve the reply for the last message sent */ |
| 1244 | @REQ(get_message_reply) |
| 1245 | int cancel; /* cancel message if not ready? */ |
| 1246 | @REPLY |
| 1247 | unsigned int result; /* message result */ |
| 1248 | @END |
| 1249 | |
| 1250 | |
| 1251 | /* Check if we are processing a sent message */ |
| 1252 | @REQ(in_send_message) |
| 1253 | @REPLY |
| 1254 | int flags; /* ISMEX_* flags */ |
| 1255 | @END |
| 1256 | |
| 1257 | |
| 1258 | /* Cleanup a queue when a window is deleted */ |
| 1259 | @REQ(cleanup_window_queue) |
| 1260 | handle_t win; /* window handle */ |
| 1261 | @END |
| 1262 | |
| 1263 | |
| 1264 | /* Set a window timer */ |
| 1265 | @REQ(set_win_timer) |
| 1266 | handle_t win; /* window handle */ |
| 1267 | unsigned int msg; /* message to post */ |
| 1268 | unsigned int id; /* timer id */ |
| 1269 | unsigned int rate; /* timer rate in ms */ |
| 1270 | unsigned int lparam; /* message lparam (callback proc) */ |
| 1271 | @END |
| 1272 | |
| 1273 | |
| 1274 | /* Kill a window timer */ |
| 1275 | @REQ(kill_win_timer) |
| 1276 | handle_t win; /* window handle */ |
| 1277 | unsigned int msg; /* message to post */ |
| 1278 | unsigned int id; /* timer id */ |
| 1279 | @END |
| 1280 | |
| 1281 | |
| 1282 | /* Open a serial port */ |
| 1283 | @REQ(create_serial) |
| 1284 | unsigned int access; /* wanted access rights */ |
| 1285 | int inherit; /* inherit flag */ |
| 1286 | unsigned int sharing; /* sharing flags */ |
| 1287 | VARARG(name,string); /* file name */ |
| 1288 | @REPLY |
| 1289 | handle_t handle; /* handle to the port */ |
| 1290 | @END |
| 1291 | |
| 1292 | |
| 1293 | /* Retrieve info about a serial port */ |
| 1294 | @REQ(get_serial_info) |
| 1295 | handle_t handle; /* handle to comm port */ |
| 1296 | @REPLY |
| 1297 | unsigned int readinterval; |
| 1298 | unsigned int readconst; |
| 1299 | unsigned int readmult; |
| 1300 | unsigned int writeconst; |
| 1301 | unsigned int writemult; |
| 1302 | unsigned int eventmask; |
| 1303 | unsigned int commerror; |
| 1304 | @END |
| 1305 | |
| 1306 | |
| 1307 | /* Set info about a serial port */ |
| 1308 | @REQ(set_serial_info) |
| 1309 | handle_t handle; /* handle to comm port */ |
| 1310 | int flags; /* bitmask to set values (see below) */ |
| 1311 | unsigned int readinterval; |
| 1312 | unsigned int readconst; |
| 1313 | unsigned int readmult; |
| 1314 | unsigned int writeconst; |
| 1315 | unsigned int writemult; |
| 1316 | unsigned int eventmask; |
| 1317 | unsigned int commerror; |
| 1318 | @END |
| 1319 | #define SERIALINFO_SET_TIMEOUTS 0x01 |
| 1320 | #define SERIALINFO_SET_MASK 0x02 |
| 1321 | #define SERIALINFO_SET_ERROR 0x04 |
| 1322 | |
| 1323 | |
| 1324 | /* Create an async I/O */ |
| 1325 | @REQ(create_async) |
| 1326 | handle_t file_handle; /* handle to comm port, socket or file */ |
| 1327 | int count; |
| 1328 | int type; |
| 1329 | @REPLY |
| 1330 | int timeout; |
| 1331 | @END |
| 1332 | #define ASYNC_TYPE_READ 0x01 |
| 1333 | #define ASYNC_TYPE_WRITE 0x02 |
| 1334 | #define ASYNC_TYPE_WAIT 0x03 |
| 1335 | |
| 1336 | |
| 1337 | /* Create a named pipe */ |
| 1338 | @REQ(create_named_pipe) |
| 1339 | unsigned int openmode; |
| 1340 | unsigned int pipemode; |
| 1341 | unsigned int maxinstances; |
| 1342 | unsigned int outsize; |
| 1343 | unsigned int insize; |
| 1344 | unsigned int timeout; |
| 1345 | VARARG(filename,string); /* pipe name */ |
| 1346 | @REPLY |
| 1347 | handle_t handle; /* handle to the pipe */ |
| 1348 | @END |
| 1349 | |
| 1350 | |
| 1351 | /* Open an existing named pipe */ |
| 1352 | @REQ(open_named_pipe) |
| 1353 | unsigned int access; |
| 1354 | VARARG(filename,string); /* pipe name */ |
| 1355 | @REPLY |
| 1356 | handle_t handle; /* handle to the pipe */ |
| 1357 | @END |
| 1358 | |
| 1359 | |
| 1360 | /* Connect to a named pipe */ |
| 1361 | @REQ(connect_named_pipe) |
| 1362 | handle_t handle; |
| 1363 | handle_t event; /* set this event when it's ready */ |
| 1364 | @END |