blob: f70847681881072af0437ea4b808df9a215f9e77 [file] [log] [blame]
Alexandre Julliard642d3131998-07-12 19:29:36 +00001/*
2 * Wine server definitions
3 *
4 * Copyright (C) 1998 Alexandre Julliard
5 */
6
7#ifndef __WINE_SERVER_H
8#define __WINE_SERVER_H
9
Alexandre Julliard338e7571998-12-27 15:28:54 +000010#include <stdlib.h>
11#include <time.h>
12
Alexandre Julliard767e6f61998-08-09 12:47:43 +000013/* Request structures */
Alexandre Julliard642d3131998-07-12 19:29:36 +000014
Alexandre Julliardebe29ef1999-06-26 08:43:26 +000015/* Following are the definitions of all the client<->server */
16/* communication format; if you make any change in this file, */
17/* you must run tools/make_requests again. */
18
19
20/* These empty macros are used by tools/make_requests */
21/* to generate the request/reply tracing functions */
22#define IN /*nothing*/
23#define OUT /*nothing*/
Alexandre Julliard642d3131998-07-12 19:29:36 +000024
Alexandre Julliard767e6f61998-08-09 12:47:43 +000025
Alexandre Julliardf692d441999-03-21 19:23:54 +000026/* Create a new process from the context of the parent */
27struct new_process_request
28{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +000029 IN int inherit; /* inherit flag */
30 IN int inherit_all; /* inherit all handles from parent */
31 IN int create_flags; /* creation flags */
32 IN int start_flags; /* flags from startup info */
33 IN int hstdin; /* handle for stdin */
34 IN int hstdout; /* handle for stdout */
35 IN int hstderr; /* handle for stderr */
36 IN int cmd_show; /* main window show mode */
37 IN void* env_ptr; /* pointer to environment (FIXME: hack) */
38 OUT void* pid; /* process id */
39 OUT int handle; /* process handle (in the current process) */
40 IN char cmdline[1]; /* command line */
Alexandre Julliardf692d441999-03-21 19:23:54 +000041};
42
43
Alexandre Julliard767e6f61998-08-09 12:47:43 +000044/* Create a new thread from the context of the parent */
Alexandre Julliard642d3131998-07-12 19:29:36 +000045struct new_thread_request
46{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +000047 IN void* pid; /* process id for the new thread */
48 IN int suspend; /* new thread should be suspended on creation */
49 IN int inherit; /* inherit flag */
50 OUT void* tid; /* thread id */
51 OUT int handle; /* thread handle (in the current process) */
Alexandre Julliard642d3131998-07-12 19:29:36 +000052};
53
Alexandre Julliard767e6f61998-08-09 12:47:43 +000054
Alexandre Julliard338e7571998-12-27 15:28:54 +000055/* Set the server debug level */
56struct set_debug_request
57{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +000058 IN int level; /* New debug level */
Alexandre Julliard338e7571998-12-27 15:28:54 +000059};
60
61
Alexandre Julliardf692d441999-03-21 19:23:54 +000062/* Initialize a process; called from the new process context */
63struct init_process_request
64{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +000065 OUT int start_flags; /* flags from startup info */
66 OUT int hstdin; /* handle for stdin */
67 OUT int hstdout; /* handle for stdout */
68 OUT int hstderr; /* handle for stderr */
69 OUT int cmd_show; /* main window show mode */
70 OUT void* env_ptr; /* pointer to environment (FIXME: hack) */
71 OUT char cmdline[1]; /* command line */
Alexandre Julliardf692d441999-03-21 19:23:54 +000072};
73
74
Alexandre Julliard767e6f61998-08-09 12:47:43 +000075/* Initialize a thread; called from the child after fork()/clone() */
Alexandre Julliard642d3131998-07-12 19:29:36 +000076struct init_thread_request
77{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +000078 IN int unix_pid; /* Unix pid of new thread */
79 IN void* teb; /* TEB of new thread (in thread address space) */
80 OUT void* pid; /* process id of the new thread's process */
81 OUT void* tid; /* thread id of the new thread */
Alexandre Julliard642d3131998-07-12 19:29:36 +000082};
Alexandre Julliardebe29ef1999-06-26 08:43:26 +000083
84
85/* Retrieve the thread buffer file descriptor */
86/* The reply to this request is the first thing a newly */
87/* created thread gets (without having to request it) */
88struct get_thread_buffer_request
Alexandre Julliard875c4b31999-03-23 14:09:41 +000089{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +000090 IN int dummy;
Alexandre Julliard875c4b31999-03-23 14:09:41 +000091};
Alexandre Julliard642d3131998-07-12 19:29:36 +000092
Alexandre Julliard642d3131998-07-12 19:29:36 +000093
Alexandre Julliard767e6f61998-08-09 12:47:43 +000094/* Terminate a process */
95struct terminate_process_request
96{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +000097 IN int handle; /* process handle to terminate */
98 IN int exit_code; /* process exit code */
Alexandre Julliard767e6f61998-08-09 12:47:43 +000099};
100
101
102/* Terminate a thread */
103struct terminate_thread_request
104{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000105 IN int handle; /* thread handle to terminate */
106 IN int exit_code; /* thread exit code */
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000107};
108
109
110/* Retrieve information about a process */
111struct get_process_info_request
112{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000113 IN int handle; /* process handle */
114 OUT void* pid; /* server process id */
115 OUT int exit_code; /* process exit code */
116 OUT int priority; /* priority class */
117 OUT int process_affinity; /* process affinity mask */
118 OUT int system_affinity; /* system affinity mask */
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000119};
120
121
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000122/* Set a process informations */
123struct set_process_info_request
124{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000125 IN int handle; /* process handle */
126 IN int mask; /* setting mask (see below) */
127 IN int priority; /* priority class */
128 IN int affinity; /* affinity mask */
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000129};
130#define SET_PROCESS_INFO_PRIORITY 0x01
131#define SET_PROCESS_INFO_AFFINITY 0x02
132
133
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000134/* Retrieve information about a thread */
135struct get_thread_info_request
136{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000137 IN int handle; /* thread handle */
138 OUT void* tid; /* server thread id */
139 OUT int exit_code; /* thread exit code */
140 OUT int priority; /* thread priority level */
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000141};
142
143
144/* Set a thread informations */
145struct set_thread_info_request
146{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000147 IN int handle; /* thread handle */
148 IN int mask; /* setting mask (see below) */
149 IN int priority; /* priority class */
150 IN int affinity; /* affinity mask */
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000151};
152#define SET_THREAD_INFO_PRIORITY 0x01
153#define SET_THREAD_INFO_AFFINITY 0x02
154
155
156/* Suspend a thread */
157struct suspend_thread_request
158{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000159 IN int handle; /* thread handle */
160 OUT int count; /* new suspend count */
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000161};
162
163
164/* Resume a thread */
165struct resume_thread_request
166{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000167 IN int handle; /* thread handle */
168 OUT int count; /* new suspend count */
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000169};
170
171
Ulrich Weigand371fd751999-04-11 17:13:03 +0000172/* Debugger support: freeze / unfreeze */
173struct debugger_request
174{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000175 IN int op; /* operation type */
Ulrich Weigand371fd751999-04-11 17:13:03 +0000176};
177
178enum debugger_op { DEBUGGER_FREEZE_ALL, DEBUGGER_UNFREEZE_ALL };
179
180
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000181/* Queue an APC for a thread */
182struct queue_apc_request
183{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000184 IN int handle; /* thread handle */
185 IN void* func; /* function to call */
186 IN void* param; /* param for function to call */
187};
188
189
190/* Get list of APC to call */
191struct get_apcs_request
192{
193 OUT int count; /* number of apcs */
194 OUT void* apcs[1]; /* async procedures to call */
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000195};
196
197
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000198/* Close a handle for the current process */
199struct close_handle_request
200{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000201 IN int handle; /* handle to close */
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000202};
203
204
Alexandre Julliard6d4ee731999-02-20 16:13:28 +0000205/* Get information about a handle */
206struct get_handle_info_request
207{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000208 IN int handle; /* handle we are interested in */
209 OUT int flags; /* handle flags */
Alexandre Julliard6d4ee731999-02-20 16:13:28 +0000210};
211
212
213/* Set a handle information */
214struct set_handle_info_request
215{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000216 IN int handle; /* handle we are interested in */
217 IN int flags; /* new handle flags */
218 IN int mask; /* mask for flags to set */
Alexandre Julliard6d4ee731999-02-20 16:13:28 +0000219};
220
221
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000222/* Duplicate a handle */
223struct dup_handle_request
224{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000225 IN int src_process; /* src process handle */
226 IN int src_handle; /* src handle to duplicate */
227 IN int dst_process; /* dst process handle */
228 IN unsigned int access; /* wanted access rights */
229 IN int inherit; /* inherit flag */
230 IN int options; /* duplicate options (see below) */
231 OUT int handle; /* duplicated handle in dst process */
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000232};
Alexandre Julliard63cb0f81998-12-31 15:43:48 +0000233#define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
234#define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
235#define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000236
237
238/* Open a handle to a process */
239struct open_process_request
240{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000241 IN void* pid; /* process id to open */
242 IN unsigned int access; /* wanted access rights */
243 IN int inherit; /* inherit flag */
244 OUT int handle; /* handle to the process */
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000245};
Alexandre Julliard642d3131998-07-12 19:29:36 +0000246
247
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000248/* Wait for handles */
249struct select_request
250{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000251 IN int count; /* handles count */
252 IN int flags; /* wait flags (see below) */
253 IN int timeout; /* timeout in ms */
254 OUT int signaled; /* signaled handle */
255 IN int handles[1]; /* handles to select on */
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000256};
257#define SELECT_ALL 1
Alexandre Julliarda8b8d9c1999-01-01 16:59:27 +0000258#define SELECT_ALERTABLE 2
259#define SELECT_TIMEOUT 4
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000260
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000261
262/* Create an event */
263struct create_event_request
264{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000265 IN int manual_reset; /* manual reset event */
266 IN int initial_state; /* initial state of the event */
267 IN int inherit; /* inherit flag */
268 OUT int handle; /* handle to the event */
269 IN char name[1]; /* event name */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000270};
271
272/* Event operation */
273struct event_op_request
274{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000275 IN int handle; /* handle to event */
276 IN int op; /* event operation (see below) */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000277};
278enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
279
280
Alexandre Julliard43c190e1999-05-15 10:48:19 +0000281/* Open an event */
282struct open_event_request
283{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000284 IN unsigned int access; /* wanted access rights */
285 IN int inherit; /* inherit flag */
286 OUT int handle; /* handle to the event */
287 IN char name[1]; /* object name */
Alexandre Julliard43c190e1999-05-15 10:48:19 +0000288};
289
290
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000291/* Create a mutex */
292struct create_mutex_request
293{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000294 IN int owned; /* initially owned? */
295 IN int inherit; /* inherit flag */
296 OUT int handle; /* handle to the mutex */
297 IN char name[1]; /* mutex name */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000298};
299
300
301/* Release a mutex */
302struct release_mutex_request
303{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000304 IN int handle; /* handle to the mutex */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000305};
306
307
Alexandre Julliard43c190e1999-05-15 10:48:19 +0000308/* Open a mutex */
309struct open_mutex_request
310{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000311 IN unsigned int access; /* wanted access rights */
312 IN int inherit; /* inherit flag */
313 OUT int handle; /* handle to the mutex */
314 IN char name[1]; /* object name */
Alexandre Julliard43c190e1999-05-15 10:48:19 +0000315};
316
317
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000318/* Create a semaphore */
319struct create_semaphore_request
320{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000321 IN unsigned int initial; /* initial count */
322 IN unsigned int max; /* maximum count */
323 IN int inherit; /* inherit flag */
324 OUT int handle; /* handle to the semaphore */
325 IN char name[1]; /* semaphore name */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000326};
327
328
329/* Release a semaphore */
330struct release_semaphore_request
331{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000332 IN int handle; /* handle to the semaphore */
333 IN unsigned int count; /* count to add to semaphore */
334 OUT unsigned int prev_count; /* previous semaphore count */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000335};
336
Alexandre Julliard338e7571998-12-27 15:28:54 +0000337
Alexandre Julliard43c190e1999-05-15 10:48:19 +0000338/* Open a semaphore */
339struct open_semaphore_request
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000340{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000341 IN unsigned int access; /* wanted access rights */
342 IN int inherit; /* inherit flag */
343 OUT int handle; /* handle to the semaphore */
344 IN char name[1]; /* object name */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000345};
346
347
Alexandre Julliard338e7571998-12-27 15:28:54 +0000348/* Create a file */
349struct create_file_request
350{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000351 IN unsigned int access; /* wanted access rights */
352 IN int inherit; /* inherit flag */
353 IN unsigned int sharing; /* sharing flags */
354 IN int create; /* file create action */
355 IN unsigned int attrs; /* file attributes for creation */
356 OUT int handle; /* handle to the file */
357 IN char name[1]; /* file name */
Alexandre Julliard338e7571998-12-27 15:28:54 +0000358};
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000359
360
361/* Allocate a file handle for a Unix fd */
362struct alloc_file_handle_request
Alexandre Julliard338e7571998-12-27 15:28:54 +0000363{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000364 IN unsigned int access; /* wanted access rights */
365 OUT int handle; /* handle to the file */
Alexandre Julliard338e7571998-12-27 15:28:54 +0000366};
367
368
Alexandre Julliardaa0ebd01998-12-30 12:06:45 +0000369/* Get a Unix fd to read from a file */
370struct get_read_fd_request
371{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000372 IN int handle; /* handle to the file */
Alexandre Julliardaa0ebd01998-12-30 12:06:45 +0000373};
374
375
376/* Get a Unix fd to write to a file */
377struct get_write_fd_request
378{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000379 IN int handle; /* handle to the file */
Alexandre Julliardaa0ebd01998-12-30 12:06:45 +0000380};
381
382
383/* Set a file current position */
384struct set_file_pointer_request
385{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000386 IN int handle; /* handle to the file */
387 IN int low; /* position low word */
388 IN int high; /* position high word */
389 IN int whence; /* whence to seek */
390 OUT int new_low; /* new position low word */
391 OUT int new_high; /* new position high word */
Alexandre Julliardaa0ebd01998-12-30 12:06:45 +0000392};
393
394
395/* Truncate (or extend) a file */
396struct truncate_file_request
397{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000398 IN int handle; /* handle to the file */
Alexandre Julliardaa0ebd01998-12-30 12:06:45 +0000399};
400
401
Alexandre Julliard05625391999-01-03 11:55:56 +0000402/* Set a file access and modification times */
403struct set_file_time_request
404{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000405 IN int handle; /* handle to the file */
406 IN time_t access_time; /* last access time */
407 IN time_t write_time; /* last write time */
Alexandre Julliard05625391999-01-03 11:55:56 +0000408};
409
410
Alexandre Julliardaa0ebd01998-12-30 12:06:45 +0000411/* Flush a file buffers */
412struct flush_file_request
413{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000414 IN int handle; /* handle to the file */
Alexandre Julliardaa0ebd01998-12-30 12:06:45 +0000415};
416
417
418/* Get information about a file */
Alexandre Julliard338e7571998-12-27 15:28:54 +0000419struct get_file_info_request
420{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000421 IN int handle; /* handle to the file */
422 OUT int type; /* file type */
423 OUT int attr; /* file attributes */
424 OUT time_t access_time; /* last access time */
425 OUT time_t write_time; /* last write time */
426 OUT int size_high; /* file size */
427 OUT int size_low; /* file size */
428 OUT int links; /* number of links */
429 OUT int index_high; /* unique index */
430 OUT int index_low; /* unique index */
431 OUT unsigned int serial; /* volume serial number */
Alexandre Julliard338e7571998-12-27 15:28:54 +0000432};
433
Alexandre Julliardaa0ebd01998-12-30 12:06:45 +0000434
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000435/* Lock a region of a file */
436struct lock_file_request
437{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000438 IN int handle; /* handle to the file */
439 IN unsigned int offset_low; /* offset of start of lock */
440 IN unsigned int offset_high; /* offset of start of lock */
441 IN unsigned int count_low; /* count of bytes to lock */
442 IN unsigned int count_high; /* count of bytes to lock */
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000443};
444
445
446/* Unlock a region of a file */
447struct unlock_file_request
448{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000449 IN int handle; /* handle to the file */
450 IN unsigned int offset_low; /* offset of start of unlock */
451 IN unsigned int offset_high; /* offset of start of unlock */
452 IN unsigned int count_low; /* count of bytes to unlock */
453 IN unsigned int count_high; /* count of bytes to unlock */
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000454};
455
456
Alexandre Julliardaa0ebd01998-12-30 12:06:45 +0000457/* Create an anonymous pipe */
458struct create_pipe_request
459{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000460 IN int inherit; /* inherit flag */
461 OUT int handle_read; /* handle to the read-side of the pipe */
462 OUT int handle_write; /* handle to the write-side of the pipe */
Alexandre Julliardaa0ebd01998-12-30 12:06:45 +0000463};
464
465
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000466/* Allocate a console for the current process */
467struct alloc_console_request
Alexandre Julliardaa0ebd01998-12-30 12:06:45 +0000468{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000469 IN unsigned int access; /* wanted access rights */
470 IN int inherit; /* inherit flag */
471 OUT int handle_in; /* handle to console input */
472 OUT int handle_out; /* handle to console output */
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000473};
474
475
476/* Free the console of the current process */
477struct free_console_request
478{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000479 IN int dummy;
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000480};
481
482
483/* Open a handle to the process console */
484struct open_console_request
485{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000486 IN int output; /* input or output? */
487 IN unsigned int access; /* wanted access rights */
488 IN int inherit; /* inherit flag */
489 OUT int handle; /* handle to the console */
Alexandre Julliardaa0ebd01998-12-30 12:06:45 +0000490};
491
492
493/* Set a console file descriptor */
494struct set_console_fd_request
495{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000496 IN int handle; /* handle to the console */
497 IN int file_handle; /* handle of file to use as file descriptor */
498 IN int pid; /* pid of xterm (hack) */
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000499};
500
501
502/* Get a console mode (input or output) */
503struct get_console_mode_request
504{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000505 IN int handle; /* handle to the console */
506 OUT int mode; /* console mode */
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000507};
508
509
510/* Set a console mode (input or output) */
511struct set_console_mode_request
512{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000513 IN int handle; /* handle to the console */
514 IN int mode; /* console mode */
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000515};
516
517
518/* Set info about a console (output only) */
519struct set_console_info_request
520{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000521 IN int handle; /* handle to the console */
522 IN int mask; /* setting mask (see below) */
523 IN int cursor_size; /* size of cursor (percentage filled) */
524 IN int cursor_visible;/* cursor visibility flag */
525 IN char title[1]; /* console title */
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000526};
527#define SET_CONSOLE_INFO_CURSOR 0x01
528#define SET_CONSOLE_INFO_TITLE 0x02
529
530/* Get info about a console (output only) */
531struct get_console_info_request
532{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000533 IN int handle; /* handle to the console */
534 OUT int cursor_size; /* size of cursor (percentage filled) */
535 OUT int cursor_visible;/* cursor visibility flag */
536 OUT int pid; /* pid of xterm (hack) */
537 OUT char title[1]; /* console title */
Alexandre Julliardaa0ebd01998-12-30 12:06:45 +0000538};
539
540
Alexandre Julliard4b461121999-01-31 19:04:30 +0000541/* Add input records to a console input queue */
542struct write_console_input_request
543{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000544 IN int handle; /* handle to the console input */
545 IN int count; /* number of input records */
546 OUT int written; /* number of records written */
547 /* INPUT_RECORD records[0]; */ /* input records */
Alexandre Julliard4b461121999-01-31 19:04:30 +0000548};
549
550/* Fetch input records from a console input queue */
551struct read_console_input_request
552{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000553 IN int handle; /* handle to the console input */
554 IN int count; /* max number of records to retrieve */
555 IN int flush; /* flush the retrieved records from the queue? */
556 OUT int read; /* number of records read */
557 /* INPUT_RECORD records[0]; */ /* input records */
Alexandre Julliard4b461121999-01-31 19:04:30 +0000558};
559
560
Alexandre Julliarda8b8d9c1999-01-01 16:59:27 +0000561/* Create a change notification */
Alexandre Julliard63cb0f81998-12-31 15:43:48 +0000562struct create_change_notification_request
563{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000564 IN int subtree; /* watch all the subtree */
565 IN int filter; /* notification filter */
566 OUT int handle; /* handle to the change notification */
Alexandre Julliard63cb0f81998-12-31 15:43:48 +0000567};
568
569
Alexandre Julliarda8b8d9c1999-01-01 16:59:27 +0000570/* Create a file mapping */
571struct create_mapping_request
572{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000573 IN int size_high; /* mapping size */
574 IN int size_low; /* mapping size */
575 IN int protect; /* protection flags (see below) */
576 IN int inherit; /* inherit flag */
577 IN int file_handle; /* file handle */
578 OUT int handle; /* handle to the mapping */
579 IN char name[1]; /* object name */
Alexandre Julliarda8b8d9c1999-01-01 16:59:27 +0000580};
581/* protection flags */
582#define VPROT_READ 0x01
583#define VPROT_WRITE 0x02
584#define VPROT_EXEC 0x04
585#define VPROT_WRITECOPY 0x08
586#define VPROT_GUARD 0x10
587#define VPROT_NOCACHE 0x20
588#define VPROT_COMMITTED 0x40
589
590
Alexandre Julliard43c190e1999-05-15 10:48:19 +0000591/* Open a mapping */
592struct open_mapping_request
593{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000594 IN unsigned int access; /* wanted access rights */
595 IN int inherit; /* inherit flag */
596 OUT int handle; /* handle to the mapping */
597 IN char name[1]; /* object name */
Alexandre Julliard43c190e1999-05-15 10:48:19 +0000598};
599
600
Alexandre Julliarda8b8d9c1999-01-01 16:59:27 +0000601/* Get information about a file mapping */
602struct get_mapping_info_request
603{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000604 IN int handle; /* handle to the mapping */
605 OUT int size_high; /* mapping size */
606 OUT int size_low; /* mapping size */
607 OUT int protect; /* protection flags */
Alexandre Julliarda8b8d9c1999-01-01 16:59:27 +0000608};
609
610
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000611/* Create a device */
612struct create_device_request
613{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000614 IN unsigned int access; /* wanted access rights */
615 IN int inherit; /* inherit flag */
616 IN int id; /* client private id */
617 OUT int handle; /* handle to the device */
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000618};
619
620
Alexandre Julliardfdc92ba1999-02-14 18:03:15 +0000621/* Create a snapshot */
622struct create_snapshot_request
623{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000624 IN int inherit; /* inherit flag */
625 IN int flags; /* snapshot flags (TH32CS_*) */
626 OUT int handle; /* handle to the snapshot */
Alexandre Julliardfdc92ba1999-02-14 18:03:15 +0000627};
628
629
630/* Get the next process from a snapshot */
631struct next_process_request
632{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000633 IN int handle; /* handle to the snapshot */
634 IN int reset; /* reset snapshot position? */
635 OUT void* pid; /* process id */
636 OUT int threads; /* number of threads */
637 OUT int priority; /* process priority */
Alexandre Julliardfdc92ba1999-02-14 18:03:15 +0000638};
639
640
Alexandre Julliarde712e071999-05-23 19:53:30 +0000641/* Wait for a debug event */
642struct wait_debug_event_request
643{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000644 IN int timeout; /* timeout in ms */
645 OUT int code; /* event code */
646 OUT void* pid; /* process id */
647 OUT void* tid; /* thread id */
648/* OUT union debug_event_data data; */
Alexandre Julliarde712e071999-05-23 19:53:30 +0000649};
650
651
652/* Send a debug event */
653struct send_debug_event_request
654{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000655 IN int code; /* event code */
656 OUT int status; /* event continuation status */
657/* IN union debug_event_data data; */
Alexandre Julliarde712e071999-05-23 19:53:30 +0000658};
659
660
661/* definitions of the event data depending on the event code */
662struct debug_event_exception
663{
664 int code; /* exception code */
665 int flags; /* exception flags */
666 void *record; /* exception record ptr */
667 void *addr; /* exception address */
668 int nb_params; /* exceptions parameters */
669 int params[15];
670 int first_chance; /* first chance to handle it? */
671};
672struct debug_event_create_thread
673{
674 int handle; /* handle to the new thread */
675 void *teb; /* thread teb (in debugged process address space) */
676 void *start; /* thread startup routine */
677};
678struct debug_event_create_process
679{
680 int file; /* handle to the process exe file */
681 int process; /* handle to the new process */
682 int thread; /* handle to the new thread */
683 void *base; /* base of executable image */
684 int dbg_offset; /* offset of debug info in file */
685 int dbg_size; /* size of debug info */
686 void *teb; /* thread teb (in debugged process address space) */
687 void *start; /* thread startup routine */
688 void *name; /* image name (optional) */
689 int unicode; /* is it Unicode? */
690};
691struct debug_event_exit
692{
693 int exit_code; /* thread or process exit code */
694};
695struct debug_event_load_dll
696{
697 int handle; /* file handle for the dll */
698 void *base; /* base address of the dll */
699 int dbg_offset; /* offset of debug info in file */
700 int dbg_size; /* size of debug info */
701 void *name; /* image name (optional) */
702 int unicode; /* is it Unicode? */
703};
704struct debug_event_unload_dll
705{
706 void *base; /* base address of the dll */
707};
708struct debug_event_output_string
709{
710 void *string; /* string to display (in debugged process address space) */
711 int unicode; /* is it Unicode? */
712 int length; /* string length */
713};
714struct debug_event_rip_info
715{
716 int error; /* ??? */
717 int type; /* ??? */
718};
719union debug_event_data
720{
721 struct debug_event_exception exception;
722 struct debug_event_create_thread create_thread;
723 struct debug_event_create_process create_process;
724 struct debug_event_exit exit;
725 struct debug_event_load_dll load_dll;
726 struct debug_event_unload_dll unload_dll;
727 struct debug_event_output_string output_string;
728 struct debug_event_rip_info rip_info;
729};
730
731
732/* Continue a debug event */
733struct continue_debug_event_request
734{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000735 IN void* pid; /* process id to continue */
736 IN void* tid; /* thread id to continue */
737 IN int status; /* continuation status */
Alexandre Julliarde712e071999-05-23 19:53:30 +0000738};
739
740
741/* Start debugging an existing process */
742struct debug_process_request
743{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000744 IN void* pid; /* id of the process to debug */
Alexandre Julliarde712e071999-05-23 19:53:30 +0000745};
746
747
Alexandre Julliard5bc78081999-06-22 17:26:53 +0000748/* Everything below this line is generated automatically by tools/make_requests */
749/* ### make_requests begin ### */
750
751enum request
752{
753 REQ_NEW_PROCESS,
754 REQ_NEW_THREAD,
755 REQ_SET_DEBUG,
756 REQ_INIT_PROCESS,
757 REQ_INIT_THREAD,
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000758 REQ_GET_THREAD_BUFFER,
Alexandre Julliard5bc78081999-06-22 17:26:53 +0000759 REQ_TERMINATE_PROCESS,
760 REQ_TERMINATE_THREAD,
761 REQ_GET_PROCESS_INFO,
762 REQ_SET_PROCESS_INFO,
763 REQ_GET_THREAD_INFO,
764 REQ_SET_THREAD_INFO,
765 REQ_SUSPEND_THREAD,
766 REQ_RESUME_THREAD,
767 REQ_DEBUGGER,
768 REQ_QUEUE_APC,
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000769 REQ_GET_APCS,
Alexandre Julliard5bc78081999-06-22 17:26:53 +0000770 REQ_CLOSE_HANDLE,
771 REQ_GET_HANDLE_INFO,
772 REQ_SET_HANDLE_INFO,
773 REQ_DUP_HANDLE,
774 REQ_OPEN_PROCESS,
775 REQ_SELECT,
776 REQ_CREATE_EVENT,
777 REQ_EVENT_OP,
778 REQ_OPEN_EVENT,
779 REQ_CREATE_MUTEX,
780 REQ_RELEASE_MUTEX,
781 REQ_OPEN_MUTEX,
782 REQ_CREATE_SEMAPHORE,
783 REQ_RELEASE_SEMAPHORE,
784 REQ_OPEN_SEMAPHORE,
785 REQ_CREATE_FILE,
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000786 REQ_ALLOC_FILE_HANDLE,
Alexandre Julliard5bc78081999-06-22 17:26:53 +0000787 REQ_GET_READ_FD,
788 REQ_GET_WRITE_FD,
789 REQ_SET_FILE_POINTER,
790 REQ_TRUNCATE_FILE,
791 REQ_SET_FILE_TIME,
792 REQ_FLUSH_FILE,
793 REQ_GET_FILE_INFO,
794 REQ_LOCK_FILE,
795 REQ_UNLOCK_FILE,
796 REQ_CREATE_PIPE,
797 REQ_ALLOC_CONSOLE,
798 REQ_FREE_CONSOLE,
799 REQ_OPEN_CONSOLE,
800 REQ_SET_CONSOLE_FD,
801 REQ_GET_CONSOLE_MODE,
802 REQ_SET_CONSOLE_MODE,
803 REQ_SET_CONSOLE_INFO,
804 REQ_GET_CONSOLE_INFO,
805 REQ_WRITE_CONSOLE_INPUT,
806 REQ_READ_CONSOLE_INPUT,
807 REQ_CREATE_CHANGE_NOTIFICATION,
808 REQ_CREATE_MAPPING,
809 REQ_OPEN_MAPPING,
810 REQ_GET_MAPPING_INFO,
811 REQ_CREATE_DEVICE,
812 REQ_CREATE_SNAPSHOT,
813 REQ_NEXT_PROCESS,
814 REQ_WAIT_DEBUG_EVENT,
815 REQ_SEND_DEBUG_EVENT,
816 REQ_CONTINUE_DEBUG_EVENT,
817 REQ_DEBUG_PROCESS,
818 REQ_NB_REQUESTS
819};
820
821/* ### make_requests end ### */
822/* Everything above this line is generated automatically by tools/make_requests */
823
Alexandre Julliard43c190e1999-05-15 10:48:19 +0000824
Alexandre Julliard642d3131998-07-12 19:29:36 +0000825/* client-side functions */
826
827#ifndef __WINE_SERVER__
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000828
Alexandre Julliard5bc78081999-06-22 17:26:53 +0000829#include "thread.h"
830
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000831/* client communication functions */
832
833/* get a pointer to the request buffer */
834static inline void *get_req_buffer(void)
Alexandre Julliard5bc78081999-06-22 17:26:53 +0000835{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000836 return NtCurrentTeb()->buffer;
Alexandre Julliard5bc78081999-06-22 17:26:53 +0000837}
838
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000839/* maximum remaining size in the server buffer */
840static inline int server_remaining( const void *ptr )
Alexandre Julliard5bc78081999-06-22 17:26:53 +0000841{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000842 return (char *)NtCurrentTeb()->buffer + NtCurrentTeb()->buffer_size - (char *)ptr;
Alexandre Julliard5bc78081999-06-22 17:26:53 +0000843}
844
845extern unsigned int server_call( enum request req );
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000846extern unsigned int server_call_fd( enum request req, int fd_out, int *fd_in );
847extern void server_protocol_error( const char *err, ... );
Alexandre Julliard5bc78081999-06-22 17:26:53 +0000848
Alexandre Julliardf692d441999-03-21 19:23:54 +0000849extern int CLIENT_InitServer(void);
Alexandre Julliard338e7571998-12-27 15:28:54 +0000850extern int CLIENT_SetDebug( int level );
Ulrich Weigand371fd751999-04-11 17:13:03 +0000851extern int CLIENT_DebuggerRequest( int op );
Alexandre Julliard642d3131998-07-12 19:29:36 +0000852extern int CLIENT_InitThread(void);
Alexandre Julliard642d3131998-07-12 19:29:36 +0000853#endif /* __WINE_SERVER__ */
854
855#endif /* __WINE_SERVER_H */