| 1 | /* $Id: server.h,v 1.1 1999-05-24 20:19:18 ktk Exp $ */ | 
|---|
| 2 |  | 
|---|
| 3 | /* | 
|---|
| 4 | * Wine server definitions | 
|---|
| 5 | * | 
|---|
| 6 | * Copyright (C) 1998 Alexandre Julliard | 
|---|
| 7 | */ | 
|---|
| 8 |  | 
|---|
| 9 | #ifndef __WINE_SERVER_H | 
|---|
| 10 | #define __WINE_SERVER_H | 
|---|
| 11 |  | 
|---|
| 12 | #include <stdlib.h> | 
|---|
| 13 | #include <time.h> | 
|---|
| 14 |  | 
|---|
| 15 | /* message header as sent on the wire */ | 
|---|
| 16 | struct header | 
|---|
| 17 | { | 
|---|
| 18 | unsigned int  len;     /* total msg length (including this header) */ | 
|---|
| 19 | unsigned int  type;    /* msg type */ | 
|---|
| 20 | unsigned int  seq;     /* sequence number */ | 
|---|
| 21 | }; | 
|---|
| 22 |  | 
|---|
| 23 | /* max msg length (not including the header) */ | 
|---|
| 24 | #define MAX_MSG_LENGTH (16384 - sizeof(struct header)) | 
|---|
| 25 |  | 
|---|
| 26 | /* data structure used to pass an fd with sendmsg/recvmsg */ | 
|---|
| 27 | struct cmsg_fd | 
|---|
| 28 | { | 
|---|
| 29 | int len;   /* sizeof structure */ | 
|---|
| 30 | int level; /* SOL_SOCKET */ | 
|---|
| 31 | int type;  /* SCM_RIGHTS */ | 
|---|
| 32 | int fd;    /* fd to pass */ | 
|---|
| 33 | }; | 
|---|
| 34 |  | 
|---|
| 35 |  | 
|---|
| 36 | /* Request structures */ | 
|---|
| 37 |  | 
|---|
| 38 | /* following are the definitions of all the client<->server  */ | 
|---|
| 39 | /* communication format; requests are from client to server, */ | 
|---|
| 40 | /* replies are from server to client. All requests must have */ | 
|---|
| 41 | /* a corresponding structure; the replies can be empty in    */ | 
|---|
| 42 | /* which case it isn't necessary to define a structure.      */ | 
|---|
| 43 |  | 
|---|
| 44 |  | 
|---|
| 45 | /* Create a new process from the context of the parent */ | 
|---|
| 46 | struct new_process_request | 
|---|
| 47 | { | 
|---|
| 48 | int          inherit;      /* inherit flag */ | 
|---|
| 49 | int          inherit_all;  /* inherit all handles from parent */ | 
|---|
| 50 | int          start_flags;  /* flags from startup info */ | 
|---|
| 51 | int          hstdin;       /* handle for stdin */ | 
|---|
| 52 | int          hstdout;      /* handle for stdout */ | 
|---|
| 53 | int          hstderr;      /* handle for stderr */ | 
|---|
| 54 | void*        env_ptr;      /* pointer to environment (FIXME: hack) */ | 
|---|
| 55 | char         cmd_line[0];  /* command line */ | 
|---|
| 56 | }; | 
|---|
| 57 | struct new_process_reply | 
|---|
| 58 | { | 
|---|
| 59 | void*        pid;          /* process id */ | 
|---|
| 60 | int          handle;       /* process handle (in the current process) */ | 
|---|
| 61 | }; | 
|---|
| 62 |  | 
|---|
| 63 |  | 
|---|
| 64 | /* Create a new thread from the context of the parent */ | 
|---|
| 65 | struct new_thread_request | 
|---|
| 66 | { | 
|---|
| 67 | void*        pid;          /* process id for the new thread */ | 
|---|
| 68 | int          suspend;      /* new thread should be suspended on creation */ | 
|---|
| 69 | int          inherit;      /* inherit flag */ | 
|---|
| 70 | }; | 
|---|
| 71 | struct new_thread_reply | 
|---|
| 72 | { | 
|---|
| 73 | void*        tid;          /* thread id */ | 
|---|
| 74 | int          handle;       /* thread handle (in the current process) */ | 
|---|
| 75 | }; | 
|---|
| 76 |  | 
|---|
| 77 |  | 
|---|
| 78 | /* Set the server debug level */ | 
|---|
| 79 | struct set_debug_request | 
|---|
| 80 | { | 
|---|
| 81 | int          level;        /* New debug level */ | 
|---|
| 82 | }; | 
|---|
| 83 |  | 
|---|
| 84 |  | 
|---|
| 85 | /* Initialize a process; called from the new process context */ | 
|---|
| 86 | struct init_process_request | 
|---|
| 87 | { | 
|---|
| 88 | int          dummy; | 
|---|
| 89 | }; | 
|---|
| 90 | struct init_process_reply | 
|---|
| 91 | { | 
|---|
| 92 | int          start_flags;  /* flags from startup info */ | 
|---|
| 93 | int          hstdin;       /* handle for stdin */ | 
|---|
| 94 | int          hstdout;      /* handle for stdout */ | 
|---|
| 95 | int          hstderr;      /* handle for stderr */ | 
|---|
| 96 | void*        env_ptr;      /* pointer to environment (FIXME: hack) */ | 
|---|
| 97 | }; | 
|---|
| 98 |  | 
|---|
| 99 |  | 
|---|
| 100 | /* Initialize a thread; called from the child after fork()/clone() */ | 
|---|
| 101 | struct init_thread_request | 
|---|
| 102 | { | 
|---|
| 103 | int          unix_pid;     /* Unix pid of new thread */ | 
|---|
| 104 | }; | 
|---|
| 105 | struct init_thread_reply | 
|---|
| 106 | { | 
|---|
| 107 | void*        pid;          /* process id of the new thread's process */ | 
|---|
| 108 | void*        tid;          /* thread id of the new thread */ | 
|---|
| 109 | }; | 
|---|
| 110 |  | 
|---|
| 111 |  | 
|---|
| 112 | /* Terminate a process */ | 
|---|
| 113 | struct terminate_process_request | 
|---|
| 114 | { | 
|---|
| 115 | int          handle;       /* process handle to terminate */ | 
|---|
| 116 | int          exit_code;    /* process exit code */ | 
|---|
| 117 | }; | 
|---|
| 118 |  | 
|---|
| 119 |  | 
|---|
| 120 | /* Terminate a thread */ | 
|---|
| 121 | struct terminate_thread_request | 
|---|
| 122 | { | 
|---|
| 123 | int          handle;       /* thread handle to terminate */ | 
|---|
| 124 | int          exit_code;    /* thread exit code */ | 
|---|
| 125 | }; | 
|---|
| 126 |  | 
|---|
| 127 |  | 
|---|
| 128 | /* Retrieve information about a process */ | 
|---|
| 129 | struct get_process_info_request | 
|---|
| 130 | { | 
|---|
| 131 | int          handle;       /* process handle */ | 
|---|
| 132 | }; | 
|---|
| 133 | struct get_process_info_reply | 
|---|
| 134 | { | 
|---|
| 135 | void*        pid;              /* server process id */ | 
|---|
| 136 | int          exit_code;        /* process exit code */ | 
|---|
| 137 | int          priority;         /* priority class */ | 
|---|
| 138 | int          process_affinity; /* process affinity mask */ | 
|---|
| 139 | int          system_affinity;  /* system affinity mask */ | 
|---|
| 140 | }; | 
|---|
| 141 |  | 
|---|
| 142 |  | 
|---|
| 143 | /* Set a process informations */ | 
|---|
| 144 | struct set_process_info_request | 
|---|
| 145 | { | 
|---|
| 146 | int          handle;       /* process handle */ | 
|---|
| 147 | int          mask;         /* setting mask (see below) */ | 
|---|
| 148 | int          priority;     /* priority class */ | 
|---|
| 149 | int          affinity;     /* affinity mask */ | 
|---|
| 150 | }; | 
|---|
| 151 | #define SET_PROCESS_INFO_PRIORITY 0x01 | 
|---|
| 152 | #define SET_PROCESS_INFO_AFFINITY 0x02 | 
|---|
| 153 |  | 
|---|
| 154 |  | 
|---|
| 155 | /* Retrieve information about a thread */ | 
|---|
| 156 | struct get_thread_info_request | 
|---|
| 157 | { | 
|---|
| 158 | int          handle;       /* thread handle */ | 
|---|
| 159 | }; | 
|---|
| 160 | struct get_thread_info_reply | 
|---|
| 161 | { | 
|---|
| 162 | void*        tid;          /* server thread id */ | 
|---|
| 163 | int          exit_code;    /* thread exit code */ | 
|---|
| 164 | int          priority;     /* thread priority level */ | 
|---|
| 165 | }; | 
|---|
| 166 |  | 
|---|
| 167 |  | 
|---|
| 168 | /* Set a thread informations */ | 
|---|
| 169 | struct set_thread_info_request | 
|---|
| 170 | { | 
|---|
| 171 | int          handle;       /* thread handle */ | 
|---|
| 172 | int          mask;         /* setting mask (see below) */ | 
|---|
| 173 | int          priority;     /* priority class */ | 
|---|
| 174 | int          affinity;     /* affinity mask */ | 
|---|
| 175 | }; | 
|---|
| 176 | #define SET_THREAD_INFO_PRIORITY 0x01 | 
|---|
| 177 | #define SET_THREAD_INFO_AFFINITY 0x02 | 
|---|
| 178 |  | 
|---|
| 179 |  | 
|---|
| 180 | /* Suspend a thread */ | 
|---|
| 181 | struct suspend_thread_request | 
|---|
| 182 | { | 
|---|
| 183 | int          handle;       /* thread handle */ | 
|---|
| 184 | }; | 
|---|
| 185 | struct suspend_thread_reply | 
|---|
| 186 | { | 
|---|
| 187 | int          count;        /* new suspend count */ | 
|---|
| 188 | }; | 
|---|
| 189 |  | 
|---|
| 190 |  | 
|---|
| 191 | /* Resume a thread */ | 
|---|
| 192 | struct resume_thread_request | 
|---|
| 193 | { | 
|---|
| 194 | int          handle;       /* thread handle */ | 
|---|
| 195 | }; | 
|---|
| 196 | struct resume_thread_reply | 
|---|
| 197 | { | 
|---|
| 198 | int          count;        /* new suspend count */ | 
|---|
| 199 | }; | 
|---|
| 200 |  | 
|---|
| 201 |  | 
|---|
| 202 | /* Debugger support: freeze / unfreeze */ | 
|---|
| 203 | struct debugger_request | 
|---|
| 204 | { | 
|---|
| 205 | int          op;           /* operation type */ | 
|---|
| 206 | }; | 
|---|
| 207 |  | 
|---|
| 208 | enum debugger_op { DEBUGGER_FREEZE_ALL, DEBUGGER_UNFREEZE_ALL }; | 
|---|
| 209 |  | 
|---|
| 210 |  | 
|---|
| 211 | /* Queue an APC for a thread */ | 
|---|
| 212 | struct queue_apc_request | 
|---|
| 213 | { | 
|---|
| 214 | int          handle;       /* thread handle */ | 
|---|
| 215 | void*        func;         /* function to call */ | 
|---|
| 216 | void*        param;        /* param for function to call */ | 
|---|
| 217 | }; | 
|---|
| 218 |  | 
|---|
| 219 |  | 
|---|
| 220 | /* Close a handle for the current process */ | 
|---|
| 221 | struct close_handle_request | 
|---|
| 222 | { | 
|---|
| 223 | int          handle;       /* handle to close */ | 
|---|
| 224 | }; | 
|---|
| 225 |  | 
|---|
| 226 |  | 
|---|
| 227 | /* Get information about a handle */ | 
|---|
| 228 | struct get_handle_info_request | 
|---|
| 229 | { | 
|---|
| 230 | int          handle;       /* handle we are interested in */ | 
|---|
| 231 | }; | 
|---|
| 232 | struct get_handle_info_reply | 
|---|
| 233 | { | 
|---|
| 234 | int          flags;        /* handle flags */ | 
|---|
| 235 | }; | 
|---|
| 236 |  | 
|---|
| 237 |  | 
|---|
| 238 | /* Set a handle information */ | 
|---|
| 239 | struct set_handle_info_request | 
|---|
| 240 | { | 
|---|
| 241 | int          handle;       /* handle we are interested in */ | 
|---|
| 242 | int          flags;        /* new handle flags */ | 
|---|
| 243 | int          mask;         /* mask for flags to set */ | 
|---|
| 244 | }; | 
|---|
| 245 |  | 
|---|
| 246 |  | 
|---|
| 247 | /* Duplicate a handle */ | 
|---|
| 248 | struct dup_handle_request | 
|---|
| 249 | { | 
|---|
| 250 | int          src_process;  /* src process handle */ | 
|---|
| 251 | int          src_handle;   /* src handle to duplicate */ | 
|---|
| 252 | int          dst_process;  /* dst process handle */ | 
|---|
| 253 | unsigned int access;       /* wanted access rights */ | 
|---|
| 254 | int          inherit;      /* inherit flag */ | 
|---|
| 255 | int          options;      /* duplicate options (see below) */ | 
|---|
| 256 | }; | 
|---|
| 257 | #define DUP_HANDLE_CLOSE_SOURCE  DUPLICATE_CLOSE_SOURCE | 
|---|
| 258 | #define DUP_HANDLE_SAME_ACCESS   DUPLICATE_SAME_ACCESS | 
|---|
| 259 | #define DUP_HANDLE_MAKE_GLOBAL   0x80000000  /* Not a Windows flag */ | 
|---|
| 260 | struct dup_handle_reply | 
|---|
| 261 | { | 
|---|
| 262 | int          handle;       /* duplicated handle in dst process */ | 
|---|
| 263 | }; | 
|---|
| 264 |  | 
|---|
| 265 |  | 
|---|
| 266 | /* Open a handle to a process */ | 
|---|
| 267 | struct open_process_request | 
|---|
| 268 | { | 
|---|
| 269 | void*        pid;          /* process id to open */ | 
|---|
| 270 | unsigned int access;       /* wanted access rights */ | 
|---|
| 271 | int          inherit;      /* inherit flag */ | 
|---|
| 272 | }; | 
|---|
| 273 | struct open_process_reply | 
|---|
| 274 | { | 
|---|
| 275 | int          handle;       /* handle to the process */ | 
|---|
| 276 | }; | 
|---|
| 277 |  | 
|---|
| 278 |  | 
|---|
| 279 | /* Wait for handles */ | 
|---|
| 280 | struct select_request | 
|---|
| 281 | { | 
|---|
| 282 | int          count;        /* handles count */ | 
|---|
| 283 | int          flags;        /* wait flags (see below) */ | 
|---|
| 284 | int          timeout;      /* timeout in ms */ | 
|---|
| 285 | /* int handles[] */ | 
|---|
| 286 | }; | 
|---|
| 287 | struct select_reply | 
|---|
| 288 | { | 
|---|
| 289 | int          signaled;     /* signaled handle */ | 
|---|
| 290 | /*  void*        apcs[]; */    /* async procedures to call */ | 
|---|
| 291 | }; | 
|---|
| 292 | #define SELECT_ALL       1 | 
|---|
| 293 | #define SELECT_ALERTABLE 2 | 
|---|
| 294 | #define SELECT_TIMEOUT   4 | 
|---|
| 295 |  | 
|---|
| 296 |  | 
|---|
| 297 | /* Create an event */ | 
|---|
| 298 | struct create_event_request | 
|---|
| 299 | { | 
|---|
| 300 | int          manual_reset;  /* manual reset event */ | 
|---|
| 301 | int          initial_state; /* initial state of the event */ | 
|---|
| 302 | int          inherit;       /* inherit flag */ | 
|---|
| 303 | char         name[0];       /* event name */ | 
|---|
| 304 | }; | 
|---|
| 305 | struct create_event_reply | 
|---|
| 306 | { | 
|---|
| 307 | int          handle;        /* handle to the event */ | 
|---|
| 308 | }; | 
|---|
| 309 |  | 
|---|
| 310 | /* Event operation */ | 
|---|
| 311 | struct event_op_request | 
|---|
| 312 | { | 
|---|
| 313 | int           handle;       /* handle to event */ | 
|---|
| 314 | int           op;           /* event operation (see below) */ | 
|---|
| 315 | }; | 
|---|
| 316 | enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT }; | 
|---|
| 317 |  | 
|---|
| 318 |  | 
|---|
| 319 | /* Create a mutex */ | 
|---|
| 320 | struct create_mutex_request | 
|---|
| 321 | { | 
|---|
| 322 | int          owned;         /* initially owned? */ | 
|---|
| 323 | int          inherit;       /* inherit flag */ | 
|---|
| 324 | char         name[0];       /* mutex name */ | 
|---|
| 325 | }; | 
|---|
| 326 | struct create_mutex_reply | 
|---|
| 327 | { | 
|---|
| 328 | int          handle;        /* handle to the mutex */ | 
|---|
| 329 | }; | 
|---|
| 330 |  | 
|---|
| 331 |  | 
|---|
| 332 | /* Release a mutex */ | 
|---|
| 333 | struct release_mutex_request | 
|---|
| 334 | { | 
|---|
| 335 | int          handle;        /* handle to the mutex */ | 
|---|
| 336 | }; | 
|---|
| 337 |  | 
|---|
| 338 |  | 
|---|
| 339 | /* Create a semaphore */ | 
|---|
| 340 | struct create_semaphore_request | 
|---|
| 341 | { | 
|---|
| 342 | unsigned int initial;       /* initial count */ | 
|---|
| 343 | unsigned int max;           /* maximum count */ | 
|---|
| 344 | int          inherit;       /* inherit flag */ | 
|---|
| 345 | char         name[0];       /* semaphore name */ | 
|---|
| 346 | }; | 
|---|
| 347 | struct create_semaphore_reply | 
|---|
| 348 | { | 
|---|
| 349 | int          handle;        /* handle to the semaphore */ | 
|---|
| 350 | }; | 
|---|
| 351 |  | 
|---|
| 352 |  | 
|---|
| 353 | /* Release a semaphore */ | 
|---|
| 354 | struct release_semaphore_request | 
|---|
| 355 | { | 
|---|
| 356 | int          handle;        /* handle to the semaphore */ | 
|---|
| 357 | unsigned int count;         /* count to add to semaphore */ | 
|---|
| 358 | }; | 
|---|
| 359 | struct release_semaphore_reply | 
|---|
| 360 | { | 
|---|
| 361 | unsigned int prev_count;    /* previous semaphore count */ | 
|---|
| 362 | }; | 
|---|
| 363 |  | 
|---|
| 364 |  | 
|---|
| 365 | /* Open a named object (event, mutex, semaphore) */ | 
|---|
| 366 | struct open_named_obj_request | 
|---|
| 367 | { | 
|---|
| 368 | int          type;          /* object type (see below) */ | 
|---|
| 369 | unsigned int access;        /* wanted access rights */ | 
|---|
| 370 | int          inherit;       /* inherit flag */ | 
|---|
| 371 | char         name[0];       /* object name */ | 
|---|
| 372 | }; | 
|---|
| 373 | enum open_named_obj { OPEN_EVENT, OPEN_MUTEX, OPEN_SEMAPHORE, OPEN_MAPPING }; | 
|---|
| 374 |  | 
|---|
| 375 | struct open_named_obj_reply | 
|---|
| 376 | { | 
|---|
| 377 | int          handle;        /* handle to the object */ | 
|---|
| 378 | }; | 
|---|
| 379 |  | 
|---|
| 380 |  | 
|---|
| 381 | /* Create a file */ | 
|---|
| 382 | struct create_file_request | 
|---|
| 383 | { | 
|---|
| 384 | unsigned int access;        /* wanted access rights */ | 
|---|
| 385 | int          inherit;       /* inherit flag */ | 
|---|
| 386 | unsigned int sharing;       /* sharing flags */ | 
|---|
| 387 | int          create;        /* file create action */ | 
|---|
| 388 | unsigned int attrs;         /* file attributes for creation */ | 
|---|
| 389 | char         name[0];       /* file name */ | 
|---|
| 390 | }; | 
|---|
| 391 | struct create_file_reply | 
|---|
| 392 | { | 
|---|
| 393 | int          handle;        /* handle to the file */ | 
|---|
| 394 | }; | 
|---|
| 395 |  | 
|---|
| 396 |  | 
|---|
| 397 | /* Get a Unix fd to read from a file */ | 
|---|
| 398 | struct get_read_fd_request | 
|---|
| 399 | { | 
|---|
| 400 | int          handle;        /* handle to the file */ | 
|---|
| 401 | }; | 
|---|
| 402 |  | 
|---|
| 403 |  | 
|---|
| 404 | /* Get a Unix fd to write to a file */ | 
|---|
| 405 | struct get_write_fd_request | 
|---|
| 406 | { | 
|---|
| 407 | int          handle;        /* handle to the file */ | 
|---|
| 408 | }; | 
|---|
| 409 |  | 
|---|
| 410 |  | 
|---|
| 411 | /* Set a file current position */ | 
|---|
| 412 | struct set_file_pointer_request | 
|---|
| 413 | { | 
|---|
| 414 | int          handle;        /* handle to the file */ | 
|---|
| 415 | int          low;           /* position low word */ | 
|---|
| 416 | int          high;          /* position high word */ | 
|---|
| 417 | int          whence;        /* whence to seek */ | 
|---|
| 418 | }; | 
|---|
| 419 | struct set_file_pointer_reply | 
|---|
| 420 | { | 
|---|
| 421 | int          low;           /* new position low word */ | 
|---|
| 422 | int          high;          /* new position high word */ | 
|---|
| 423 | }; | 
|---|
| 424 |  | 
|---|
| 425 |  | 
|---|
| 426 | /* Truncate (or extend) a file */ | 
|---|
| 427 | struct truncate_file_request | 
|---|
| 428 | { | 
|---|
| 429 | int          handle;        /* handle to the file */ | 
|---|
| 430 | }; | 
|---|
| 431 |  | 
|---|
| 432 |  | 
|---|
| 433 | /* Set a file access and modification times */ | 
|---|
| 434 | struct set_file_time_request | 
|---|
| 435 | { | 
|---|
| 436 | int          handle;        /* handle to the file */ | 
|---|
| 437 | time_t       access_time;   /* last access time */ | 
|---|
| 438 | time_t       write_time;    /* last write time */ | 
|---|
| 439 | }; | 
|---|
| 440 |  | 
|---|
| 441 |  | 
|---|
| 442 | /* Flush a file buffers */ | 
|---|
| 443 | struct flush_file_request | 
|---|
| 444 | { | 
|---|
| 445 | int          handle;        /* handle to the file */ | 
|---|
| 446 | }; | 
|---|
| 447 |  | 
|---|
| 448 |  | 
|---|
| 449 | /* Get information about a file */ | 
|---|
| 450 | struct get_file_info_request | 
|---|
| 451 | { | 
|---|
| 452 | int          handle;        /* handle to the file */ | 
|---|
| 453 | }; | 
|---|
| 454 | struct get_file_info_reply | 
|---|
| 455 | { | 
|---|
| 456 | int          type;          /* file type */ | 
|---|
| 457 | int          attr;          /* file attributes */ | 
|---|
| 458 | time_t       access_time;   /* last access time */ | 
|---|
| 459 | time_t       write_time;    /* last write time */ | 
|---|
| 460 | int          size_high;     /* file size */ | 
|---|
| 461 | int          size_low;      /* file size */ | 
|---|
| 462 | int          links;         /* number of links */ | 
|---|
| 463 | int          index_high;    /* unique index */ | 
|---|
| 464 | int          index_low;     /* unique index */ | 
|---|
| 465 | unsigned int serial;        /* volume serial number */ | 
|---|
| 466 | }; | 
|---|
| 467 |  | 
|---|
| 468 |  | 
|---|
| 469 | /* Lock a region of a file */ | 
|---|
| 470 | struct lock_file_request | 
|---|
| 471 | { | 
|---|
| 472 | int          handle;        /* handle to the file */ | 
|---|
| 473 | unsigned int offset_low;    /* offset of start of lock */ | 
|---|
| 474 | unsigned int offset_high;   /* offset of start of lock */ | 
|---|
| 475 | unsigned int count_low;     /* count of bytes to lock */ | 
|---|
| 476 | unsigned int count_high;    /* count of bytes to lock */ | 
|---|
| 477 | }; | 
|---|
| 478 |  | 
|---|
| 479 |  | 
|---|
| 480 | /* Unlock a region of a file */ | 
|---|
| 481 | struct unlock_file_request | 
|---|
| 482 | { | 
|---|
| 483 | int          handle;        /* handle to the file */ | 
|---|
| 484 | unsigned int offset_low;    /* offset of start of unlock */ | 
|---|
| 485 | unsigned int offset_high;   /* offset of start of unlock */ | 
|---|
| 486 | unsigned int count_low;     /* count of bytes to unlock */ | 
|---|
| 487 | unsigned int count_high;    /* count of bytes to unlock */ | 
|---|
| 488 | }; | 
|---|
| 489 |  | 
|---|
| 490 |  | 
|---|
| 491 | /* Create an anonymous pipe */ | 
|---|
| 492 | struct create_pipe_request | 
|---|
| 493 | { | 
|---|
| 494 | int          inherit;       /* inherit flag */ | 
|---|
| 495 | }; | 
|---|
| 496 | struct create_pipe_reply | 
|---|
| 497 | { | 
|---|
| 498 | int          handle_read;   /* handle to the read-side of the pipe */ | 
|---|
| 499 | int          handle_write;  /* handle to the write-side of the pipe */ | 
|---|
| 500 | }; | 
|---|
| 501 |  | 
|---|
| 502 |  | 
|---|
| 503 | /* Allocate a console for the current process */ | 
|---|
| 504 | struct alloc_console_request | 
|---|
| 505 | { | 
|---|
| 506 | }; | 
|---|
| 507 |  | 
|---|
| 508 |  | 
|---|
| 509 | /* Free the console of the current process */ | 
|---|
| 510 | struct free_console_request | 
|---|
| 511 | { | 
|---|
| 512 | }; | 
|---|
| 513 |  | 
|---|
| 514 |  | 
|---|
| 515 | /* Open a handle to the process console */ | 
|---|
| 516 | struct open_console_request | 
|---|
| 517 | { | 
|---|
| 518 | int          output;        /* input or output? */ | 
|---|
| 519 | unsigned int access;        /* wanted access rights */ | 
|---|
| 520 | int          inherit;       /* inherit flag */ | 
|---|
| 521 | }; | 
|---|
| 522 | struct open_console_reply | 
|---|
| 523 | { | 
|---|
| 524 | int          handle;        /* handle to the console */ | 
|---|
| 525 | }; | 
|---|
| 526 |  | 
|---|
| 527 |  | 
|---|
| 528 | /* Set a console file descriptor */ | 
|---|
| 529 | struct set_console_fd_request | 
|---|
| 530 | { | 
|---|
| 531 | int          handle;        /* handle to the console */ | 
|---|
| 532 | int          pid;           /* pid of xterm (hack) */ | 
|---|
| 533 | }; | 
|---|
| 534 |  | 
|---|
| 535 |  | 
|---|
| 536 | /* Get a console mode (input or output) */ | 
|---|
| 537 | struct get_console_mode_request | 
|---|
| 538 | { | 
|---|
| 539 | int          handle;        /* handle to the console */ | 
|---|
| 540 | }; | 
|---|
| 541 | struct get_console_mode_reply | 
|---|
| 542 | { | 
|---|
| 543 | int          mode;          /* console mode */ | 
|---|
| 544 | }; | 
|---|
| 545 |  | 
|---|
| 546 |  | 
|---|
| 547 | /* Set a console mode (input or output) */ | 
|---|
| 548 | struct set_console_mode_request | 
|---|
| 549 | { | 
|---|
| 550 | int          handle;        /* handle to the console */ | 
|---|
| 551 | int          mode;          /* console mode */ | 
|---|
| 552 | }; | 
|---|
| 553 |  | 
|---|
| 554 |  | 
|---|
| 555 | /* Set info about a console (output only) */ | 
|---|
| 556 | struct set_console_info_request | 
|---|
| 557 | { | 
|---|
| 558 | int          handle;        /* handle to the console */ | 
|---|
| 559 | int          mask;          /* setting mask (see below) */ | 
|---|
| 560 | int          cursor_size;   /* size of cursor (percentage filled) */ | 
|---|
| 561 | int          cursor_visible;/* cursor visibility flag */ | 
|---|
| 562 | char         title[0];      /* console title */ | 
|---|
| 563 | }; | 
|---|
| 564 | #define SET_CONSOLE_INFO_CURSOR 0x01 | 
|---|
| 565 | #define SET_CONSOLE_INFO_TITLE  0x02 | 
|---|
| 566 |  | 
|---|
| 567 | /* Get info about a console (output only) */ | 
|---|
| 568 | struct get_console_info_request | 
|---|
| 569 | { | 
|---|
| 570 | int          handle;        /* handle to the console */ | 
|---|
| 571 | }; | 
|---|
| 572 | struct get_console_info_reply | 
|---|
| 573 | { | 
|---|
| 574 | int          cursor_size;   /* size of cursor (percentage filled) */ | 
|---|
| 575 | int          cursor_visible;/* cursor visibility flag */ | 
|---|
| 576 | int          pid;           /* pid of xterm (hack) */ | 
|---|
| 577 | /*  char         title[0]; */   /* console title */ | 
|---|
| 578 | }; | 
|---|
| 579 |  | 
|---|
| 580 |  | 
|---|
| 581 | /* Add input records to a console input queue */ | 
|---|
| 582 | struct write_console_input_request | 
|---|
| 583 | { | 
|---|
| 584 | int          handle;        /* handle to the console input */ | 
|---|
| 585 | int          count;         /* number of input records */ | 
|---|
| 586 | /*  INPUT_RECORD records[0]; */ /* input records */ | 
|---|
| 587 | }; | 
|---|
| 588 | struct write_console_input_reply | 
|---|
| 589 | { | 
|---|
| 590 | int          written;       /* number of records written */ | 
|---|
| 591 | }; | 
|---|
| 592 |  | 
|---|
| 593 | /* Fetch input records from a console input queue */ | 
|---|
| 594 | struct read_console_input_request | 
|---|
| 595 | { | 
|---|
| 596 | int          handle;        /* handle to the console input */ | 
|---|
| 597 | int          count;         /* max number of records to retrieve */ | 
|---|
| 598 | int          flush;         /* flush the retrieved records from the queue? */ | 
|---|
| 599 | }; | 
|---|
| 600 | struct read_console_input_reply | 
|---|
| 601 | { | 
|---|
| 602 | /*  INPUT_RECORD records[0]; */ /* input records */ | 
|---|
| 603 | }; | 
|---|
| 604 |  | 
|---|
| 605 |  | 
|---|
| 606 | /* Create a change notification */ | 
|---|
| 607 | struct create_change_notification_request | 
|---|
| 608 | { | 
|---|
| 609 | int          subtree;       /* watch all the subtree */ | 
|---|
| 610 | int          filter;        /* notification filter */ | 
|---|
| 611 | }; | 
|---|
| 612 | struct create_change_notification_reply | 
|---|
| 613 | { | 
|---|
| 614 | int          handle;        /* handle to the change notification */ | 
|---|
| 615 | }; | 
|---|
| 616 |  | 
|---|
| 617 |  | 
|---|
| 618 | /* Create a file mapping */ | 
|---|
| 619 | struct create_mapping_request | 
|---|
| 620 | { | 
|---|
| 621 | int          size_high;     /* mapping size */ | 
|---|
| 622 | int          size_low;      /* mapping size */ | 
|---|
| 623 | int          protect;       /* protection flags (see below) */ | 
|---|
| 624 | int          inherit;       /* inherit flag */ | 
|---|
| 625 | int          handle;        /* file handle */ | 
|---|
| 626 | char         name[0];       /* object name */ | 
|---|
| 627 | }; | 
|---|
| 628 | struct create_mapping_reply | 
|---|
| 629 | { | 
|---|
| 630 | int          handle;        /* handle to the mapping */ | 
|---|
| 631 | }; | 
|---|
| 632 | /* protection flags */ | 
|---|
| 633 | #define VPROT_READ       0x01 | 
|---|
| 634 | #define VPROT_WRITE      0x02 | 
|---|
| 635 | #define VPROT_EXEC       0x04 | 
|---|
| 636 | #define VPROT_WRITECOPY  0x08 | 
|---|
| 637 | #define VPROT_GUARD      0x10 | 
|---|
| 638 | #define VPROT_NOCACHE    0x20 | 
|---|
| 639 | #define VPROT_COMMITTED  0x40 | 
|---|
| 640 |  | 
|---|
| 641 |  | 
|---|
| 642 | /* Get information about a file mapping */ | 
|---|
| 643 | struct get_mapping_info_request | 
|---|
| 644 | { | 
|---|
| 645 | int          handle;        /* handle to the mapping */ | 
|---|
| 646 | }; | 
|---|
| 647 | struct get_mapping_info_reply | 
|---|
| 648 | { | 
|---|
| 649 | int          size_high;     /* mapping size */ | 
|---|
| 650 | int          size_low;      /* mapping size */ | 
|---|
| 651 | int          protect;       /* protection flags */ | 
|---|
| 652 | }; | 
|---|
| 653 |  | 
|---|
| 654 |  | 
|---|
| 655 | /* Create a device */ | 
|---|
| 656 | struct create_device_request | 
|---|
| 657 | { | 
|---|
| 658 | unsigned int access;        /* wanted access rights */ | 
|---|
| 659 | int          inherit;       /* inherit flag */ | 
|---|
| 660 | int          id;            /* client private id */ | 
|---|
| 661 | }; | 
|---|
| 662 | struct create_device_reply | 
|---|
| 663 | { | 
|---|
| 664 | int          handle;        /* handle to the device */ | 
|---|
| 665 | }; | 
|---|
| 666 |  | 
|---|
| 667 |  | 
|---|
| 668 | /* Create a snapshot */ | 
|---|
| 669 | struct create_snapshot_request | 
|---|
| 670 | { | 
|---|
| 671 | int          inherit;       /* inherit flag */ | 
|---|
| 672 | int          flags;         /* snapshot flags (TH32CS_*) */ | 
|---|
| 673 | }; | 
|---|
| 674 | struct create_snapshot_reply | 
|---|
| 675 | { | 
|---|
| 676 | int          handle;        /* handle to the snapshot */ | 
|---|
| 677 | }; | 
|---|
| 678 |  | 
|---|
| 679 |  | 
|---|
| 680 | /* Get the next process from a snapshot */ | 
|---|
| 681 | struct next_process_request | 
|---|
| 682 | { | 
|---|
| 683 | int          handle;        /* handle to the snapshot */ | 
|---|
| 684 | int          reset;         /* reset snapshot position? */ | 
|---|
| 685 | }; | 
|---|
| 686 | struct next_process_reply | 
|---|
| 687 | { | 
|---|
| 688 | void*        pid;          /* process id */ | 
|---|
| 689 | int          threads;      /* number of threads */ | 
|---|
| 690 | int          priority;     /* process priority */ | 
|---|
| 691 | }; | 
|---|
| 692 |  | 
|---|
| 693 |  | 
|---|
| 694 | /* client-side functions */ | 
|---|
| 695 |  | 
|---|
| 696 | #ifndef __WINE_SERVER__ | 
|---|
| 697 |  | 
|---|
| 698 | #include "server/request.h" | 
|---|
| 699 |  | 
|---|
| 700 | /* client communication functions */ | 
|---|
| 701 | extern void CLIENT_SendRequest( enum request req, int pass_fd, | 
|---|
| 702 | int n, ... /* arg_1, len_1, etc. */ ); | 
|---|
| 703 | extern unsigned int CLIENT_WaitReply( int *len, int *passed_fd, | 
|---|
| 704 | int n, ... /* arg_1, len_1, etc. */ ); | 
|---|
| 705 | extern unsigned int CLIENT_WaitSimpleReply( void *reply, int len, int *passed_fd ); | 
|---|
| 706 | extern int CLIENT_InitServer(void); | 
|---|
| 707 |  | 
|---|
| 708 | struct _THDB; | 
|---|
| 709 | extern int CLIENT_SetDebug( int level ); | 
|---|
| 710 | extern int CLIENT_DebuggerRequest( int op ); | 
|---|
| 711 | extern int CLIENT_InitThread(void); | 
|---|
| 712 | #endif  /* __WINE_SERVER__ */ | 
|---|
| 713 |  | 
|---|
| 714 | #endif  /* __WINE_SERVER_H */ | 
|---|