blob: c543e85912a340a9f15f57f9706a7c9378689d0c [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>
Alexandre Julliard1d2ba521999-11-24 01:24:50 +000012#include "winbase.h"
Alexandre Julliard338e7571998-12-27 15:28:54 +000013
Alexandre Julliard767e6f61998-08-09 12:47:43 +000014/* Request structures */
Alexandre Julliard642d3131998-07-12 19:29:36 +000015
Alexandre Julliardebe29ef1999-06-26 08:43:26 +000016/* Following are the definitions of all the client<->server */
17/* communication format; if you make any change in this file, */
18/* you must run tools/make_requests again. */
19
20
21/* These empty macros are used by tools/make_requests */
22/* to generate the request/reply tracing functions */
23#define IN /*nothing*/
24#define OUT /*nothing*/
Alexandre Julliard86113532000-08-29 03:54:30 +000025#define VARARG(name,func) /*nothing*/
Alexandre Julliard642d3131998-07-12 19:29:36 +000026
Alexandre Julliard86113532000-08-29 03:54:30 +000027struct request_header
28{
29 IN int req; /* request code */
30 IN unsigned short fixed_size; /* size of the fixed part of the request */
31 IN unsigned short var_size; /* size of the variable part of the request */
32 OUT unsigned int error; /* error result */
33};
34#define REQUEST_HEADER struct request_header header
35
36
37/* placeholder structure for the maximum allowed request size */
38/* this is used to construct the generic_request union */
39struct request_max_size
40{
41 int pad[16]; /* the max request size is 16 ints */
42};
Alexandre Julliard767e6f61998-08-09 12:47:43 +000043
Alexandre Julliard92643002000-08-31 01:59:51 +000044/* max size of the variable part of a request */
45#define REQUEST_MAX_VAR_SIZE 1024
46
Alexandre Julliardd7e85d61999-11-23 19:39:11 +000047/* a path name for server requests (Unicode) */
48typedef WCHAR path_t[MAX_PATH+1];
49
Alexandre Julliard3e2517c2000-01-20 18:59:03 +000050
51/* definitions of the event data depending on the event code */
52struct debug_event_exception
53{
Alexandre Julliardea0d0282000-03-10 22:16:10 +000054 EXCEPTION_RECORD record; /* exception record */
55 int first; /* first chance exception? */
Alexandre Julliard3e2517c2000-01-20 18:59:03 +000056};
57struct debug_event_create_thread
58{
59 int handle; /* handle to the new thread */
60 void *teb; /* thread teb (in debugged process address space) */
61 void *start; /* thread startup routine */
62};
63struct debug_event_create_process
64{
65 int file; /* handle to the process exe file */
66 int process; /* handle to the new process */
67 int thread; /* handle to the new thread */
68 void *base; /* base of executable image */
69 int dbg_offset; /* offset of debug info in file */
70 int dbg_size; /* size of debug info */
71 void *teb; /* thread teb (in debugged process address space) */
72 void *start; /* thread startup routine */
73 void *name; /* image name (optional) */
74 int unicode; /* is it Unicode? */
75};
76struct debug_event_exit
77{
78 int exit_code; /* thread or process exit code */
79};
80struct debug_event_load_dll
81{
82 int handle; /* file handle for the dll */
83 void *base; /* base address of the dll */
84 int dbg_offset; /* offset of debug info in file */
85 int dbg_size; /* size of debug info */
86 void *name; /* image name (optional) */
87 int unicode; /* is it Unicode? */
88};
89struct debug_event_unload_dll
90{
91 void *base; /* base address of the dll */
92};
93struct debug_event_output_string
94{
95 void *string; /* string to display (in debugged process address space) */
96 int unicode; /* is it Unicode? */
97 int length; /* string length */
98};
99struct debug_event_rip_info
100{
101 int error; /* ??? */
102 int type; /* ??? */
103};
104union debug_event_data
105{
106 struct debug_event_exception exception;
107 struct debug_event_create_thread create_thread;
108 struct debug_event_create_process create_process;
109 struct debug_event_exit exit;
110 struct debug_event_load_dll load_dll;
111 struct debug_event_unload_dll unload_dll;
112 struct debug_event_output_string output_string;
113 struct debug_event_rip_info rip_info;
114};
115
116/* debug event data */
117typedef struct
118{
119 int code; /* event code */
120 union debug_event_data info; /* event information */
121} debug_event_t;
122
123
Alexandre Julliardf692d441999-03-21 19:23:54 +0000124/* Create a new process from the context of the parent */
125struct new_process_request
126{
Alexandre Julliard86113532000-08-29 03:54:30 +0000127 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000128 IN int inherit_all; /* inherit all handles from parent */
129 IN int create_flags; /* creation flags */
130 IN int start_flags; /* flags from startup info */
Alexandre Julliard67a24c82000-02-18 21:54:32 +0000131 IN int exe_file; /* file handle for main exe */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000132 IN int hstdin; /* handle for stdin */
133 IN int hstdout; /* handle for stdout */
134 IN int hstderr; /* handle for stderr */
135 IN int cmd_show; /* main window show mode */
Alexandre Julliard5b4f3e82000-05-01 16:24:22 +0000136 IN int alloc_fd; /* create the fd pair right now? */
Alexandre Julliard92643002000-08-31 01:59:51 +0000137 IN VARARG(filename,string); /* file name of main exe */
Alexandre Julliard5b4f3e82000-05-01 16:24:22 +0000138};
139
140
141/* Wait for the new process to start */
142struct wait_process_request
143{
Alexandre Julliard86113532000-08-29 03:54:30 +0000144 REQUEST_HEADER; /* request header */
Alexandre Julliard5b4f3e82000-05-01 16:24:22 +0000145 IN int pinherit; /* process handle inherit flag */
146 IN int tinherit; /* thread handle inherit flag */
147 IN int timeout; /* wait timeout */
148 IN int cancel; /* cancel the process creation? */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000149 OUT void* pid; /* process id */
Alexandre Julliard2fe57772000-01-25 01:40:27 +0000150 OUT int phandle; /* process handle (in the current process) */
151 OUT void* tid; /* thread id */
152 OUT int thandle; /* thread handle (in the current process) */
Alexandre Julliard6a72dc52000-04-14 13:42:00 +0000153 OUT int event; /* event handle to signal startup */
Alexandre Julliardf692d441999-03-21 19:23:54 +0000154};
155
156
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000157/* Create a new thread from the context of the parent */
Alexandre Julliard642d3131998-07-12 19:29:36 +0000158struct new_thread_request
159{
Alexandre Julliard86113532000-08-29 03:54:30 +0000160 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000161 IN int suspend; /* new thread should be suspended on creation */
162 IN int inherit; /* inherit flag */
163 OUT void* tid; /* thread id */
164 OUT int handle; /* thread handle (in the current process) */
Alexandre Julliard642d3131998-07-12 19:29:36 +0000165};
166
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000167
Alexandre Julliard2fe57772000-01-25 01:40:27 +0000168/* Signal that we are finished booting on the client side */
169struct boot_done_request
Alexandre Julliard338e7571998-12-27 15:28:54 +0000170{
Alexandre Julliard86113532000-08-29 03:54:30 +0000171 REQUEST_HEADER; /* request header */
Alexandre Julliard2fe57772000-01-25 01:40:27 +0000172 IN int debug_level; /* new debug level */
Alexandre Julliard338e7571998-12-27 15:28:54 +0000173};
174
175
Alexandre Julliardf692d441999-03-21 19:23:54 +0000176/* Initialize a process; called from the new process context */
177struct init_process_request
178{
Alexandre Julliard86113532000-08-29 03:54:30 +0000179 REQUEST_HEADER; /* request header */
Alexandre Julliard0a7c1f62000-01-27 02:54:17 +0000180 IN void* ldt_copy; /* addr of LDT copy */
Alexandre Julliard5b4f3e82000-05-01 16:24:22 +0000181 IN int ppid; /* parent Unix pid */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000182 OUT int start_flags; /* flags from startup info */
Andreas Mohrc941eff2000-09-22 22:37:56 +0000183 OUT unsigned int server_start; /* server start time (GetTickCount) */
Alexandre Julliard67a24c82000-02-18 21:54:32 +0000184 OUT int exe_file; /* file handle for main exe */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000185 OUT int hstdin; /* handle for stdin */
186 OUT int hstdout; /* handle for stdout */
187 OUT int hstderr; /* handle for stderr */
188 OUT int cmd_show; /* main window show mode */
Alexandre Julliard92643002000-08-31 01:59:51 +0000189 OUT VARARG(filename,string); /* file name of main exe */
Alexandre Julliardf692d441999-03-21 19:23:54 +0000190};
191
192
Alexandre Julliardec7bb231999-11-12 03:35:25 +0000193/* Signal the end of the process initialization */
194struct init_process_done_request
195{
Alexandre Julliard86113532000-08-29 03:54:30 +0000196 REQUEST_HEADER; /* request header */
Alexandre Julliardff81d782000-03-08 12:01:30 +0000197 IN void* module; /* main module base address */
198 IN void* entry; /* process entry point */
Alexandre Julliarda37dec02000-06-08 00:57:24 +0000199 IN void* name; /* ptr to ptr to name (in process addr space) */
Alexandre Julliardc5e433a2000-05-30 19:48:18 +0000200 IN int gui; /* is it a GUI process? */
Alexandre Julliard00641d52000-03-08 16:41:37 +0000201 OUT int debugged; /* being debugged? */
Alexandre Julliardec7bb231999-11-12 03:35:25 +0000202};
203
204
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000205/* Initialize a thread; called from the child after fork()/clone() */
Alexandre Julliard642d3131998-07-12 19:29:36 +0000206struct init_thread_request
207{
Alexandre Julliard86113532000-08-29 03:54:30 +0000208 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000209 IN int unix_pid; /* Unix pid of new thread */
210 IN void* teb; /* TEB of new thread (in thread address space) */
Alexandre Julliardff81d782000-03-08 12:01:30 +0000211 IN void* entry; /* thread entry point (in thread address space) */
Alexandre Julliard642d3131998-07-12 19:29:36 +0000212};
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000213
214
215/* Retrieve the thread buffer file descriptor */
216/* The reply to this request is the first thing a newly */
217/* created thread gets (without having to request it) */
218struct get_thread_buffer_request
Alexandre Julliard875c4b31999-03-23 14:09:41 +0000219{
Alexandre Julliard86113532000-08-29 03:54:30 +0000220 REQUEST_HEADER; /* request header */
Alexandre Julliardff81d782000-03-08 12:01:30 +0000221 OUT void* pid; /* process id of the new thread's process */
222 OUT void* tid; /* thread id of the new thread */
223 OUT int boot; /* is this the boot thread? */
Alexandre Julliard5fb54562000-03-08 22:01:02 +0000224 OUT int version; /* protocol version */
Alexandre Julliard875c4b31999-03-23 14:09:41 +0000225};
Alexandre Julliard642d3131998-07-12 19:29:36 +0000226
Alexandre Julliard642d3131998-07-12 19:29:36 +0000227
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000228/* Terminate a process */
229struct terminate_process_request
230{
Alexandre Julliard86113532000-08-29 03:54:30 +0000231 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000232 IN int handle; /* process handle to terminate */
233 IN int exit_code; /* process exit code */
Alexandre Julliard12f29b52000-03-17 15:16:57 +0000234 OUT int self; /* suicide? */
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000235};
236
237
238/* Terminate a thread */
239struct terminate_thread_request
240{
Alexandre Julliard86113532000-08-29 03:54:30 +0000241 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000242 IN int handle; /* thread handle to terminate */
243 IN int exit_code; /* thread exit code */
Alexandre Julliard12f29b52000-03-17 15:16:57 +0000244 OUT int self; /* suicide? */
245 OUT int last; /* last thread in this process? */
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000246};
247
248
249/* Retrieve information about a process */
250struct get_process_info_request
251{
Alexandre Julliard86113532000-08-29 03:54:30 +0000252 REQUEST_HEADER; /* request header */
Alexandre Julliard00641d52000-03-08 16:41:37 +0000253 IN int handle; /* process handle */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000254 OUT void* pid; /* server process id */
Alexandre Julliard00641d52000-03-08 16:41:37 +0000255 OUT int debugged; /* debugged? */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000256 OUT int exit_code; /* process exit code */
257 OUT int priority; /* priority class */
258 OUT int process_affinity; /* process affinity mask */
259 OUT int system_affinity; /* system affinity mask */
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000260};
261
262
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000263/* Set a process informations */
264struct set_process_info_request
265{
Alexandre Julliard86113532000-08-29 03:54:30 +0000266 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000267 IN int handle; /* process handle */
268 IN int mask; /* setting mask (see below) */
269 IN int priority; /* priority class */
270 IN int affinity; /* affinity mask */
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000271};
272#define SET_PROCESS_INFO_PRIORITY 0x01
273#define SET_PROCESS_INFO_AFFINITY 0x02
274
275
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000276/* Retrieve information about a thread */
277struct get_thread_info_request
278{
Alexandre Julliard86113532000-08-29 03:54:30 +0000279 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000280 IN int handle; /* thread handle */
Alexandre Julliard9a0e28f2000-03-25 19:14:37 +0000281 IN void* tid_in; /* thread id (optional) */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000282 OUT void* tid; /* server thread id */
Alexandre Julliard9a0e28f2000-03-25 19:14:37 +0000283 OUT void* teb; /* thread teb pointer */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000284 OUT int exit_code; /* thread exit code */
285 OUT int priority; /* thread priority level */
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000286};
287
288
289/* Set a thread informations */
290struct set_thread_info_request
291{
Alexandre Julliard86113532000-08-29 03:54:30 +0000292 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000293 IN int handle; /* thread handle */
294 IN int mask; /* setting mask (see below) */
295 IN int priority; /* priority class */
296 IN int affinity; /* affinity mask */
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000297};
298#define SET_THREAD_INFO_PRIORITY 0x01
299#define SET_THREAD_INFO_AFFINITY 0x02
300
301
302/* Suspend a thread */
303struct suspend_thread_request
304{
Alexandre Julliard86113532000-08-29 03:54:30 +0000305 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000306 IN int handle; /* thread handle */
307 OUT int count; /* new suspend count */
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000308};
309
310
311/* Resume a thread */
312struct resume_thread_request
313{
Alexandre Julliard86113532000-08-29 03:54:30 +0000314 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000315 IN int handle; /* thread handle */
316 OUT int count; /* new suspend count */
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000317};
318
319
Alexandre Julliard05f0b712000-03-09 18:18:41 +0000320/* Notify the server that a dll has been loaded */
321struct load_dll_request
Ulrich Weigand371fd751999-04-11 17:13:03 +0000322{
Alexandre Julliard86113532000-08-29 03:54:30 +0000323 REQUEST_HEADER; /* request header */
Alexandre Julliard05f0b712000-03-09 18:18:41 +0000324 IN int handle; /* file handle */
325 IN void* base; /* base address */
326 IN int dbg_offset; /* debug info offset */
327 IN int dbg_size; /* debug info size */
328 IN void* name; /* ptr to ptr to name (in process addr space) */
Ulrich Weigand371fd751999-04-11 17:13:03 +0000329};
330
Alexandre Julliard05f0b712000-03-09 18:18:41 +0000331
332/* Notify the server that a dll is being unloaded */
333struct unload_dll_request
334{
Alexandre Julliard86113532000-08-29 03:54:30 +0000335 REQUEST_HEADER; /* request header */
Alexandre Julliard05f0b712000-03-09 18:18:41 +0000336 IN void* base; /* base address */
337};
Ulrich Weigand371fd751999-04-11 17:13:03 +0000338
339
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000340/* Queue an APC for a thread */
341struct queue_apc_request
342{
Alexandre Julliard86113532000-08-29 03:54:30 +0000343 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000344 IN int handle; /* thread handle */
345 IN void* func; /* function to call */
346 IN void* param; /* param for function to call */
347};
348
349
Alexandre Julliardea1afce2000-08-22 20:08:37 +0000350/* Get next APC to call */
351struct get_apc_request
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000352{
Alexandre Julliard86113532000-08-29 03:54:30 +0000353 REQUEST_HEADER; /* request header */
Alexandre Julliardea1afce2000-08-22 20:08:37 +0000354 OUT void* func; /* function to call */
355 OUT int type; /* function type */
Alexandre Julliard9c2370b2000-08-30 00:00:48 +0000356 OUT VARARG(args,ptrs); /* function arguments */
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000357};
Mike McCormack1eac1912000-11-13 19:27:21 +0000358enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC };
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000359
360
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000361/* Close a handle for the current process */
362struct close_handle_request
363{
Alexandre Julliard86113532000-08-29 03:54:30 +0000364 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000365 IN int handle; /* handle to close */
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000366};
367
368
Alexandre Julliard6d4ee731999-02-20 16:13:28 +0000369/* Get information about a handle */
370struct get_handle_info_request
371{
Alexandre Julliard86113532000-08-29 03:54:30 +0000372 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000373 IN int handle; /* handle we are interested in */
374 OUT int flags; /* handle flags */
Alexandre Julliard6d4ee731999-02-20 16:13:28 +0000375};
376
377
378/* Set a handle information */
379struct set_handle_info_request
380{
Alexandre Julliard86113532000-08-29 03:54:30 +0000381 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000382 IN int handle; /* handle we are interested in */
383 IN int flags; /* new handle flags */
384 IN int mask; /* mask for flags to set */
Alexandre Julliard6d4ee731999-02-20 16:13:28 +0000385};
386
387
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000388/* Duplicate a handle */
389struct dup_handle_request
390{
Alexandre Julliard86113532000-08-29 03:54:30 +0000391 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000392 IN int src_process; /* src process handle */
393 IN int src_handle; /* src handle to duplicate */
394 IN int dst_process; /* dst process handle */
395 IN unsigned int access; /* wanted access rights */
396 IN int inherit; /* inherit flag */
397 IN int options; /* duplicate options (see below) */
398 OUT int handle; /* duplicated handle in dst process */
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000399};
Alexandre Julliard63cb0f81998-12-31 15:43:48 +0000400#define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
401#define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
402#define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000403
404
405/* Open a handle to a process */
406struct open_process_request
407{
Alexandre Julliard86113532000-08-29 03:54:30 +0000408 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000409 IN void* pid; /* process id to open */
410 IN unsigned int access; /* wanted access rights */
411 IN int inherit; /* inherit flag */
412 OUT int handle; /* handle to the process */
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000413};
Alexandre Julliard642d3131998-07-12 19:29:36 +0000414
415
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000416/* Wait for handles */
417struct select_request
418{
Alexandre Julliard86113532000-08-29 03:54:30 +0000419 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000420 IN int flags; /* wait flags (see below) */
421 IN int timeout; /* timeout in ms */
422 OUT int signaled; /* signaled handle */
Alexandre Julliard9c2370b2000-08-30 00:00:48 +0000423 IN VARARG(handles,ints); /* handles to select on */
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000424};
425#define SELECT_ALL 1
Alexandre Julliarda8b8d9c1999-01-01 16:59:27 +0000426#define SELECT_ALERTABLE 2
427#define SELECT_TIMEOUT 4
Alexandre Julliard85ed45e1998-08-22 19:03:56 +0000428
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000429
430/* Create an event */
431struct create_event_request
432{
Alexandre Julliard86113532000-08-29 03:54:30 +0000433 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000434 IN int manual_reset; /* manual reset event */
435 IN int initial_state; /* initial state of the event */
436 IN int inherit; /* inherit flag */
437 OUT int handle; /* handle to the event */
Alexandre Julliard9c2370b2000-08-30 00:00:48 +0000438 IN VARARG(name,unicode_str); /* object name */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000439};
440
441/* Event operation */
442struct event_op_request
443{
Alexandre Julliard86113532000-08-29 03:54:30 +0000444 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000445 IN int handle; /* handle to event */
446 IN int op; /* event operation (see below) */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000447};
448enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
449
450
Alexandre Julliard43c190e1999-05-15 10:48:19 +0000451/* Open an event */
452struct open_event_request
453{
Alexandre Julliard86113532000-08-29 03:54:30 +0000454 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000455 IN unsigned int access; /* wanted access rights */
456 IN int inherit; /* inherit flag */
457 OUT int handle; /* handle to the event */
Alexandre Julliard9c2370b2000-08-30 00:00:48 +0000458 IN VARARG(name,unicode_str); /* object name */
Alexandre Julliard43c190e1999-05-15 10:48:19 +0000459};
460
461
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000462/* Create a mutex */
463struct create_mutex_request
464{
Alexandre Julliard86113532000-08-29 03:54:30 +0000465 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000466 IN int owned; /* initially owned? */
467 IN int inherit; /* inherit flag */
468 OUT int handle; /* handle to the mutex */
Alexandre Julliard9c2370b2000-08-30 00:00:48 +0000469 IN VARARG(name,unicode_str); /* object name */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000470};
471
472
473/* Release a mutex */
474struct release_mutex_request
475{
Alexandre Julliard86113532000-08-29 03:54:30 +0000476 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000477 IN int handle; /* handle to the mutex */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000478};
479
480
Alexandre Julliard43c190e1999-05-15 10:48:19 +0000481/* Open a mutex */
482struct open_mutex_request
483{
Alexandre Julliard86113532000-08-29 03:54:30 +0000484 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000485 IN unsigned int access; /* wanted access rights */
486 IN int inherit; /* inherit flag */
487 OUT int handle; /* handle to the mutex */
Alexandre Julliard9c2370b2000-08-30 00:00:48 +0000488 IN VARARG(name,unicode_str); /* object name */
Alexandre Julliard43c190e1999-05-15 10:48:19 +0000489};
490
491
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000492/* Create a semaphore */
493struct create_semaphore_request
494{
Alexandre Julliard86113532000-08-29 03:54:30 +0000495 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000496 IN unsigned int initial; /* initial count */
497 IN unsigned int max; /* maximum count */
498 IN int inherit; /* inherit flag */
499 OUT int handle; /* handle to the semaphore */
Alexandre Julliard9c2370b2000-08-30 00:00:48 +0000500 IN VARARG(name,unicode_str); /* object name */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000501};
502
503
504/* Release a semaphore */
505struct release_semaphore_request
506{
Alexandre Julliard86113532000-08-29 03:54:30 +0000507 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000508 IN int handle; /* handle to the semaphore */
509 IN unsigned int count; /* count to add to semaphore */
510 OUT unsigned int prev_count; /* previous semaphore count */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000511};
512
Alexandre Julliard338e7571998-12-27 15:28:54 +0000513
Alexandre Julliard43c190e1999-05-15 10:48:19 +0000514/* Open a semaphore */
515struct open_semaphore_request
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000516{
Alexandre Julliard86113532000-08-29 03:54:30 +0000517 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000518 IN unsigned int access; /* wanted access rights */
519 IN int inherit; /* inherit flag */
520 OUT int handle; /* handle to the semaphore */
Alexandre Julliard9c2370b2000-08-30 00:00:48 +0000521 IN VARARG(name,unicode_str); /* object name */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000522};
523
524
Alexandre Julliard338e7571998-12-27 15:28:54 +0000525/* Create a file */
526struct create_file_request
527{
Alexandre Julliard86113532000-08-29 03:54:30 +0000528 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000529 IN unsigned int access; /* wanted access rights */
530 IN int inherit; /* inherit flag */
531 IN unsigned int sharing; /* sharing flags */
532 IN int create; /* file create action */
533 IN unsigned int attrs; /* file attributes for creation */
534 OUT int handle; /* handle to the file */
Alexandre Julliard92643002000-08-31 01:59:51 +0000535 IN VARARG(filename,string); /* file name */
Alexandre Julliard338e7571998-12-27 15:28:54 +0000536};
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000537
538
539/* Allocate a file handle for a Unix fd */
540struct alloc_file_handle_request
Alexandre Julliard338e7571998-12-27 15:28:54 +0000541{
Alexandre Julliard86113532000-08-29 03:54:30 +0000542 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000543 IN unsigned int access; /* wanted access rights */
544 OUT int handle; /* handle to the file */
Alexandre Julliard338e7571998-12-27 15:28:54 +0000545};
546
547
Alexandre Julliardaa0ebd01998-12-30 12:06:45 +0000548/* Get a Unix fd to read from a file */
549struct get_read_fd_request
550{
Alexandre Julliard86113532000-08-29 03:54:30 +0000551 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000552 IN int handle; /* handle to the file */
Alexandre Julliardaa0ebd01998-12-30 12:06:45 +0000553};
554
555
556/* Get a Unix fd to write to a file */
557struct get_write_fd_request
558{
Alexandre Julliard86113532000-08-29 03:54:30 +0000559 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000560 IN int handle; /* handle to the file */
Alexandre Julliardaa0ebd01998-12-30 12:06:45 +0000561};
562
563
564/* Set a file current position */
565struct set_file_pointer_request
566{
Alexandre Julliard86113532000-08-29 03:54:30 +0000567 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000568 IN int handle; /* handle to the file */
569 IN int low; /* position low word */
570 IN int high; /* position high word */
571 IN int whence; /* whence to seek */
572 OUT int new_low; /* new position low word */
573 OUT int new_high; /* new position high word */
Alexandre Julliardaa0ebd01998-12-30 12:06:45 +0000574};
575
576
577/* Truncate (or extend) a file */
578struct truncate_file_request
579{
Alexandre Julliard86113532000-08-29 03:54:30 +0000580 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000581 IN int handle; /* handle to the file */
Alexandre Julliardaa0ebd01998-12-30 12:06:45 +0000582};
583
584
Alexandre Julliard05625391999-01-03 11:55:56 +0000585/* Set a file access and modification times */
586struct set_file_time_request
587{
Alexandre Julliard86113532000-08-29 03:54:30 +0000588 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000589 IN int handle; /* handle to the file */
590 IN time_t access_time; /* last access time */
591 IN time_t write_time; /* last write time */
Alexandre Julliard05625391999-01-03 11:55:56 +0000592};
593
594
Alexandre Julliardaa0ebd01998-12-30 12:06:45 +0000595/* Flush a file buffers */
596struct flush_file_request
597{
Alexandre Julliard86113532000-08-29 03:54:30 +0000598 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000599 IN int handle; /* handle to the file */
Alexandre Julliardaa0ebd01998-12-30 12:06:45 +0000600};
601
602
603/* Get information about a file */
Alexandre Julliard338e7571998-12-27 15:28:54 +0000604struct get_file_info_request
605{
Alexandre Julliard86113532000-08-29 03:54:30 +0000606 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000607 IN int handle; /* handle to the file */
608 OUT int type; /* file type */
609 OUT int attr; /* file attributes */
610 OUT time_t access_time; /* last access time */
611 OUT time_t write_time; /* last write time */
612 OUT int size_high; /* file size */
613 OUT int size_low; /* file size */
614 OUT int links; /* number of links */
615 OUT int index_high; /* unique index */
616 OUT int index_low; /* unique index */
617 OUT unsigned int serial; /* volume serial number */
Alexandre Julliard338e7571998-12-27 15:28:54 +0000618};
619
Alexandre Julliardaa0ebd01998-12-30 12:06:45 +0000620
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000621/* Lock a region of a file */
622struct lock_file_request
623{
Alexandre Julliard86113532000-08-29 03:54:30 +0000624 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000625 IN int handle; /* handle to the file */
626 IN unsigned int offset_low; /* offset of start of lock */
627 IN unsigned int offset_high; /* offset of start of lock */
628 IN unsigned int count_low; /* count of bytes to lock */
629 IN unsigned int count_high; /* count of bytes to lock */
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000630};
631
632
633/* Unlock a region of a file */
634struct unlock_file_request
635{
Alexandre Julliard86113532000-08-29 03:54:30 +0000636 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000637 IN int handle; /* handle to the file */
638 IN unsigned int offset_low; /* offset of start of unlock */
639 IN unsigned int offset_high; /* offset of start of unlock */
640 IN unsigned int count_low; /* count of bytes to unlock */
641 IN unsigned int count_high; /* count of bytes to unlock */
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000642};
643
644
Alexandre Julliardaa0ebd01998-12-30 12:06:45 +0000645/* Create an anonymous pipe */
646struct create_pipe_request
647{
Alexandre Julliard86113532000-08-29 03:54:30 +0000648 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000649 IN int inherit; /* inherit flag */
650 OUT int handle_read; /* handle to the read-side of the pipe */
651 OUT int handle_write; /* handle to the write-side of the pipe */
Alexandre Julliardaa0ebd01998-12-30 12:06:45 +0000652};
653
654
Ove Kaaven019211f1999-10-13 16:05:37 +0000655/* Create a socket */
656struct create_socket_request
657{
Alexandre Julliard86113532000-08-29 03:54:30 +0000658 REQUEST_HEADER; /* request header */
Ove Kaaven019211f1999-10-13 16:05:37 +0000659 IN unsigned int access; /* wanted access rights */
660 IN int inherit; /* inherit flag */
661 IN int family; /* family, see socket manpage */
662 IN int type; /* type, see socket manpage */
663 IN int protocol; /* protocol, see socket manpage */
664 OUT int handle; /* handle to the new socket */
665};
666
667
668/* Accept a socket */
669struct accept_socket_request
670{
Alexandre Julliard86113532000-08-29 03:54:30 +0000671 REQUEST_HEADER; /* request header */
Ove Kaaven019211f1999-10-13 16:05:37 +0000672 IN int lhandle; /* handle to the listening socket */
673 IN unsigned int access; /* wanted access rights */
674 IN int inherit; /* inherit flag */
675 OUT int handle; /* handle to the new socket */
676};
677
678
679/* Set socket event parameters */
680struct set_socket_event_request
681{
Alexandre Julliard86113532000-08-29 03:54:30 +0000682 REQUEST_HEADER; /* request header */
Ove Kaaven019211f1999-10-13 16:05:37 +0000683 IN int handle; /* handle to the socket */
684 IN unsigned int mask; /* event mask */
685 IN int event; /* event object */
686};
687
688
689/* Get socket event parameters */
690struct get_socket_event_request
691{
Alexandre Julliard86113532000-08-29 03:54:30 +0000692 REQUEST_HEADER; /* request header */
Ove Kaaven019211f1999-10-13 16:05:37 +0000693 IN int handle; /* handle to the socket */
694 IN int service; /* clear pending? */
695 IN int s_event; /* "expected" event object */
Ove Kaavencb98a6e2000-03-26 18:21:16 +0000696 IN int c_event; /* event to clear */
Ove Kaaven019211f1999-10-13 16:05:37 +0000697 OUT unsigned int mask; /* event mask */
698 OUT unsigned int pmask; /* pending events */
699 OUT unsigned int state; /* status bits */
Alexandre Julliard92643002000-08-31 01:59:51 +0000700 OUT VARARG(errors,ints); /* event errors */
Ove Kaaven019211f1999-10-13 16:05:37 +0000701};
702
703
704/* Reenable pending socket events */
705struct enable_socket_event_request
706{
Alexandre Julliard86113532000-08-29 03:54:30 +0000707 REQUEST_HEADER; /* request header */
Ove Kaaven019211f1999-10-13 16:05:37 +0000708 IN int handle; /* handle to the socket */
709 IN unsigned int mask; /* events to re-enable */
710 IN unsigned int sstate; /* status bits to set */
711 IN unsigned int cstate; /* status bits to clear */
712};
713
714
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000715/* Allocate a console for the current process */
716struct alloc_console_request
Alexandre Julliardaa0ebd01998-12-30 12:06:45 +0000717{
Alexandre Julliard86113532000-08-29 03:54:30 +0000718 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000719 IN unsigned int access; /* wanted access rights */
720 IN int inherit; /* inherit flag */
721 OUT int handle_in; /* handle to console input */
722 OUT int handle_out; /* handle to console output */
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000723};
724
725
726/* Free the console of the current process */
727struct free_console_request
728{
Alexandre Julliard86113532000-08-29 03:54:30 +0000729 REQUEST_HEADER; /* request header */
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000730};
731
732
733/* Open a handle to the process console */
734struct open_console_request
735{
Alexandre Julliard86113532000-08-29 03:54:30 +0000736 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000737 IN int output; /* input or output? */
738 IN unsigned int access; /* wanted access rights */
739 IN int inherit; /* inherit flag */
740 OUT int handle; /* handle to the console */
Alexandre Julliardaa0ebd01998-12-30 12:06:45 +0000741};
742
743
744/* Set a console file descriptor */
745struct set_console_fd_request
746{
Alexandre Julliard86113532000-08-29 03:54:30 +0000747 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000748 IN int handle; /* handle to the console */
749 IN int file_handle; /* handle of file to use as file descriptor */
750 IN int pid; /* pid of xterm (hack) */
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000751};
752
753
754/* Get a console mode (input or output) */
755struct get_console_mode_request
756{
Alexandre Julliard86113532000-08-29 03:54:30 +0000757 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000758 IN int handle; /* handle to the console */
759 OUT int mode; /* console mode */
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000760};
761
762
763/* Set a console mode (input or output) */
764struct set_console_mode_request
765{
Alexandre Julliard86113532000-08-29 03:54:30 +0000766 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000767 IN int handle; /* handle to the console */
768 IN int mode; /* console mode */
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000769};
770
771
772/* Set info about a console (output only) */
773struct set_console_info_request
774{
Alexandre Julliard86113532000-08-29 03:54:30 +0000775 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000776 IN int handle; /* handle to the console */
777 IN int mask; /* setting mask (see below) */
778 IN int cursor_size; /* size of cursor (percentage filled) */
779 IN int cursor_visible;/* cursor visibility flag */
Alexandre Julliard92643002000-08-31 01:59:51 +0000780 IN VARARG(title,string); /* console title */
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000781};
782#define SET_CONSOLE_INFO_CURSOR 0x01
783#define SET_CONSOLE_INFO_TITLE 0x02
784
785/* Get info about a console (output only) */
786struct get_console_info_request
787{
Alexandre Julliard86113532000-08-29 03:54:30 +0000788 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000789 IN int handle; /* handle to the console */
790 OUT int cursor_size; /* size of cursor (percentage filled) */
791 OUT int cursor_visible;/* cursor visibility flag */
792 OUT int pid; /* pid of xterm (hack) */
Alexandre Julliard92643002000-08-31 01:59:51 +0000793 OUT VARARG(title,string); /* console title */
Alexandre Julliardaa0ebd01998-12-30 12:06:45 +0000794};
795
796
Alexandre Julliard4b461121999-01-31 19:04:30 +0000797/* Add input records to a console input queue */
798struct write_console_input_request
799{
Alexandre Julliard86113532000-08-29 03:54:30 +0000800 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000801 IN int handle; /* handle to the console input */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000802 OUT int written; /* number of records written */
Alexandre Julliard92643002000-08-31 01:59:51 +0000803 IN VARARG(rec,input_records); /* input records */
Alexandre Julliard4b461121999-01-31 19:04:30 +0000804};
805
806/* Fetch input records from a console input queue */
807struct read_console_input_request
808{
Alexandre Julliard86113532000-08-29 03:54:30 +0000809 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000810 IN int handle; /* handle to the console input */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000811 IN int flush; /* flush the retrieved records from the queue? */
812 OUT int read; /* number of records read */
Alexandre Julliard92643002000-08-31 01:59:51 +0000813 OUT VARARG(rec,input_records); /* input records */
Alexandre Julliard4b461121999-01-31 19:04:30 +0000814};
815
816
Alexandre Julliarda8b8d9c1999-01-01 16:59:27 +0000817/* Create a change notification */
Alexandre Julliard63cb0f81998-12-31 15:43:48 +0000818struct create_change_notification_request
819{
Alexandre Julliard86113532000-08-29 03:54:30 +0000820 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000821 IN int subtree; /* watch all the subtree */
822 IN int filter; /* notification filter */
823 OUT int handle; /* handle to the change notification */
Alexandre Julliard63cb0f81998-12-31 15:43:48 +0000824};
825
826
Alexandre Julliarda8b8d9c1999-01-01 16:59:27 +0000827/* Create a file mapping */
828struct create_mapping_request
829{
Alexandre Julliard86113532000-08-29 03:54:30 +0000830 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000831 IN int size_high; /* mapping size */
832 IN int size_low; /* mapping size */
833 IN int protect; /* protection flags (see below) */
834 IN int inherit; /* inherit flag */
835 IN int file_handle; /* file handle */
836 OUT int handle; /* handle to the mapping */
Alexandre Julliard9c2370b2000-08-30 00:00:48 +0000837 IN VARARG(name,unicode_str); /* object name */
Alexandre Julliarda8b8d9c1999-01-01 16:59:27 +0000838};
839/* protection flags */
840#define VPROT_READ 0x01
841#define VPROT_WRITE 0x02
842#define VPROT_EXEC 0x04
843#define VPROT_WRITECOPY 0x08
844#define VPROT_GUARD 0x10
845#define VPROT_NOCACHE 0x20
846#define VPROT_COMMITTED 0x40
Alexandre Julliardc19e1a72000-08-14 20:20:01 +0000847#define VPROT_IMAGE 0x80
Alexandre Julliarda8b8d9c1999-01-01 16:59:27 +0000848
849
Alexandre Julliard43c190e1999-05-15 10:48:19 +0000850/* Open a mapping */
851struct open_mapping_request
852{
Alexandre Julliard86113532000-08-29 03:54:30 +0000853 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000854 IN unsigned int access; /* wanted access rights */
855 IN int inherit; /* inherit flag */
856 OUT int handle; /* handle to the mapping */
Alexandre Julliard9c2370b2000-08-30 00:00:48 +0000857 IN VARARG(name,unicode_str); /* object name */
Alexandre Julliard43c190e1999-05-15 10:48:19 +0000858};
859
860
Alexandre Julliarda8b8d9c1999-01-01 16:59:27 +0000861/* Get information about a file mapping */
862struct get_mapping_info_request
863{
Alexandre Julliard86113532000-08-29 03:54:30 +0000864 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000865 IN int handle; /* handle to the mapping */
866 OUT int size_high; /* mapping size */
867 OUT int size_low; /* mapping size */
868 OUT int protect; /* protection flags */
Alexandre Julliardc19e1a72000-08-14 20:20:01 +0000869 OUT int header_size; /* header size (for VPROT_IMAGE mapping) */
870 OUT void* base; /* default base addr (for VPROT_IMAGE mapping) */
871 OUT int shared_file; /* shared mapping file handle */
872 OUT int shared_size; /* shared mapping size */
Alexandre Julliarda8b8d9c1999-01-01 16:59:27 +0000873};
874
875
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000876/* Create a device */
877struct create_device_request
878{
Alexandre Julliard86113532000-08-29 03:54:30 +0000879 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000880 IN unsigned int access; /* wanted access rights */
881 IN int inherit; /* inherit flag */
882 IN int id; /* client private id */
883 OUT int handle; /* handle to the device */
Alexandre Julliard62a8b431999-01-19 17:48:23 +0000884};
885
886
Alexandre Julliardfdc92ba1999-02-14 18:03:15 +0000887/* Create a snapshot */
888struct create_snapshot_request
889{
Alexandre Julliard86113532000-08-29 03:54:30 +0000890 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000891 IN int inherit; /* inherit flag */
892 IN int flags; /* snapshot flags (TH32CS_*) */
Alexandre Julliard07d84462000-04-16 19:45:05 +0000893 IN void* pid; /* process id */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000894 OUT int handle; /* handle to the snapshot */
Alexandre Julliardfdc92ba1999-02-14 18:03:15 +0000895};
896
897
898/* Get the next process from a snapshot */
899struct next_process_request
900{
Alexandre Julliard86113532000-08-29 03:54:30 +0000901 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000902 IN int handle; /* handle to the snapshot */
903 IN int reset; /* reset snapshot position? */
Alexandre Julliard07d84462000-04-16 19:45:05 +0000904 OUT int count; /* process usage count */
905 OUT void* pid; /* process id */
906 OUT int threads; /* number of threads */
907 OUT int priority; /* process priority */
908};
909
910
911/* Get the next thread from a snapshot */
912struct next_thread_request
913{
Alexandre Julliard86113532000-08-29 03:54:30 +0000914 REQUEST_HEADER; /* request header */
Alexandre Julliard07d84462000-04-16 19:45:05 +0000915 IN int handle; /* handle to the snapshot */
916 IN int reset; /* reset snapshot position? */
917 OUT int count; /* thread usage count */
918 OUT void* pid; /* process id */
919 OUT void* tid; /* thread id */
920 OUT int base_pri; /* base priority */
921 OUT int delta_pri; /* delta priority */
922};
923
924
925/* Get the next module from a snapshot */
926struct next_module_request
927{
Alexandre Julliard86113532000-08-29 03:54:30 +0000928 REQUEST_HEADER; /* request header */
Alexandre Julliard07d84462000-04-16 19:45:05 +0000929 IN int handle; /* handle to the snapshot */
930 IN int reset; /* reset snapshot position? */
931 OUT void* pid; /* process id */
932 OUT void* base; /* module base address */
Alexandre Julliardfdc92ba1999-02-14 18:03:15 +0000933};
934
935
Alexandre Julliarde712e071999-05-23 19:53:30 +0000936/* Wait for a debug event */
937struct wait_debug_event_request
938{
Alexandre Julliard86113532000-08-29 03:54:30 +0000939 REQUEST_HEADER; /* request header */
Alexandre Julliard3e2517c2000-01-20 18:59:03 +0000940 IN int timeout; /* timeout in ms */
941 OUT void* pid; /* process id */
942 OUT void* tid; /* thread id */
Alexandre Julliard9c2370b2000-08-30 00:00:48 +0000943 OUT VARARG(event,debug_event); /* debug event data */
Alexandre Julliarde712e071999-05-23 19:53:30 +0000944};
945
946
Alexandre Julliardea0d0282000-03-10 22:16:10 +0000947/* Send an exception event */
948struct exception_event_request
Alexandre Julliarde712e071999-05-23 19:53:30 +0000949{
Alexandre Julliard86113532000-08-29 03:54:30 +0000950 REQUEST_HEADER; /* request header */
Alexandre Julliardea0d0282000-03-10 22:16:10 +0000951 IN int first; /* first chance exception? */
Alexandre Julliardea0d0282000-03-10 22:16:10 +0000952 OUT int status; /* event continuation status */
Alexandre Julliard92643002000-08-31 01:59:51 +0000953 IN VARARG(record,exc_event); /* thread context followed by exception record */
954 OUT VARARG(context,context); /* modified thread context */
Alexandre Julliardea0d0282000-03-10 22:16:10 +0000955};
956
957
958/* Send an output string to the debugger */
959struct output_debug_string_request
960{
Alexandre Julliard86113532000-08-29 03:54:30 +0000961 REQUEST_HEADER; /* request header */
Alexandre Julliardea0d0282000-03-10 22:16:10 +0000962 IN void* string; /* string to display (in debugged process address space) */
963 IN int unicode; /* is it Unicode? */
964 IN int length; /* string length */
Alexandre Julliarde712e071999-05-23 19:53:30 +0000965};
966
967
968/* Continue a debug event */
969struct continue_debug_event_request
970{
Alexandre Julliard86113532000-08-29 03:54:30 +0000971 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000972 IN void* pid; /* process id to continue */
973 IN void* tid; /* thread id to continue */
974 IN int status; /* continuation status */
Alexandre Julliarde712e071999-05-23 19:53:30 +0000975};
976
977
978/* Start debugging an existing process */
979struct debug_process_request
980{
Alexandre Julliard86113532000-08-29 03:54:30 +0000981 REQUEST_HEADER; /* request header */
Alexandre Julliardebe29ef1999-06-26 08:43:26 +0000982 IN void* pid; /* id of the process to debug */
Alexandre Julliarde712e071999-05-23 19:53:30 +0000983};
984
985
Alexandre Julliard8b8828f1999-11-12 21:39:14 +0000986/* Read data from a process address space */
987struct read_process_memory_request
988{
Alexandre Julliard86113532000-08-29 03:54:30 +0000989 REQUEST_HEADER; /* request header */
Alexandre Julliard8b8828f1999-11-12 21:39:14 +0000990 IN int handle; /* process handle */
991 IN void* addr; /* addr to read from (must be int-aligned) */
992 IN int len; /* number of ints to read */
Alexandre Julliard57f05e12000-10-15 00:40:25 +0000993 OUT VARARG(data,bytes); /* result data */
Alexandre Julliard8b8828f1999-11-12 21:39:14 +0000994};
995
996
Alexandre Julliardeef70251999-11-13 19:54:54 +0000997/* Write data to a process address space */
998struct write_process_memory_request
999{
Alexandre Julliard86113532000-08-29 03:54:30 +00001000 REQUEST_HEADER; /* request header */
Alexandre Julliardeef70251999-11-13 19:54:54 +00001001 IN int handle; /* process handle */
1002 IN void* addr; /* addr to write to (must be int-aligned) */
1003 IN int len; /* number of ints to write */
1004 IN unsigned int first_mask; /* mask for first word */
1005 IN unsigned int last_mask; /* mask for last word */
Alexandre Julliard57f05e12000-10-15 00:40:25 +00001006 IN VARARG(data,bytes); /* result data */
Alexandre Julliardeef70251999-11-13 19:54:54 +00001007};
1008
1009
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001010/* Create a registry key */
1011struct create_key_request
1012{
Alexandre Julliard86113532000-08-29 03:54:30 +00001013 REQUEST_HEADER; /* request header */
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001014 IN int parent; /* handle to the parent key */
1015 IN unsigned int access; /* desired access rights */
1016 IN unsigned int options; /* creation options */
1017 IN time_t modif; /* last modification time */
1018 OUT int hkey; /* handle to the created key */
1019 OUT int created; /* has it been newly created? */
Alexandre Julliardbcf393a2000-10-01 01:44:50 +00001020 IN VARARG(name,unicode_len_str); /* key name */
1021 IN VARARG(class,unicode_str); /* class name */
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001022};
1023
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001024/* Open a registry key */
1025struct open_key_request
1026{
Alexandre Julliard86113532000-08-29 03:54:30 +00001027 REQUEST_HEADER; /* request header */
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001028 IN int parent; /* handle to the parent key */
1029 IN unsigned int access; /* desired access rights */
1030 OUT int hkey; /* handle to the open key */
Alexandre Julliardbcf393a2000-10-01 01:44:50 +00001031 IN VARARG(name,unicode_str); /* key name */
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001032};
1033
1034
1035/* Delete a registry key */
1036struct delete_key_request
1037{
Alexandre Julliard86113532000-08-29 03:54:30 +00001038 REQUEST_HEADER; /* request header */
Alexandre Julliardbcf393a2000-10-01 01:44:50 +00001039 IN int hkey; /* handle to the key */
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001040};
1041
1042
1043/* Enumerate registry subkeys */
1044struct enum_key_request
1045{
Alexandre Julliard86113532000-08-29 03:54:30 +00001046 REQUEST_HEADER; /* request header */
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001047 IN int hkey; /* handle to registry key */
Alexandre Julliard454355e2000-10-02 03:46:58 +00001048 IN int index; /* index of subkey (or -1 for current key) */
1049 IN int full; /* return the full info? */
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001050 OUT int subkeys; /* number of subkeys */
1051 OUT int max_subkey; /* longest subkey name */
1052 OUT int max_class; /* longest class name */
1053 OUT int values; /* number of values */
1054 OUT int max_value; /* longest value name */
1055 OUT int max_data; /* longest value data */
1056 OUT time_t modif; /* last modification time */
Alexandre Julliard454355e2000-10-02 03:46:58 +00001057 OUT VARARG(name,unicode_len_str); /* key name */
1058 OUT VARARG(class,unicode_str); /* class name */
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001059};
1060
1061
1062/* Set a value of a registry key */
1063struct set_key_value_request
1064{
Alexandre Julliard86113532000-08-29 03:54:30 +00001065 REQUEST_HEADER; /* request header */
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001066 IN int hkey; /* handle to registry key */
1067 IN int type; /* value type */
Alexandre Julliarda01004d2000-05-14 22:57:57 +00001068 IN unsigned int total; /* total value len */
1069 IN unsigned int offset; /* offset for setting data */
Alexandre Julliardbcf393a2000-10-01 01:44:50 +00001070 IN VARARG(name,unicode_len_str); /* value name */
1071 IN VARARG(data,bytes); /* value data */
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001072};
1073
1074
1075/* Retrieve the value of a registry key */
1076struct get_key_value_request
1077{
Alexandre Julliard86113532000-08-29 03:54:30 +00001078 REQUEST_HEADER; /* request header */
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001079 IN int hkey; /* handle to registry key */
Alexandre Julliarda01004d2000-05-14 22:57:57 +00001080 IN unsigned int offset; /* offset for getting data */
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001081 OUT int type; /* value type */
1082 OUT int len; /* value data len */
Alexandre Julliardbcf393a2000-10-01 01:44:50 +00001083 IN VARARG(name,unicode_len_str); /* value name */
1084 OUT VARARG(data,bytes); /* value data */
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001085};
1086
1087
1088/* Enumerate a value of a registry key */
1089struct enum_key_value_request
1090{
Alexandre Julliard86113532000-08-29 03:54:30 +00001091 REQUEST_HEADER; /* request header */
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001092 IN int hkey; /* handle to registry key */
1093 IN int index; /* value index */
Alexandre Julliarda01004d2000-05-14 22:57:57 +00001094 IN unsigned int offset; /* offset for getting data */
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001095 OUT int type; /* value type */
1096 OUT int len; /* value data len */
1097 OUT path_t name; /* value name */
1098 OUT unsigned char data[1]; /* value data */
1099};
1100
1101
1102/* Delete a value of a registry key */
1103struct delete_key_value_request
1104{
Alexandre Julliard86113532000-08-29 03:54:30 +00001105 REQUEST_HEADER; /* request header */
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001106 IN int hkey; /* handle to registry key */
Alexandre Julliardbcf393a2000-10-01 01:44:50 +00001107 IN VARARG(name,unicode_str); /* value name */
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001108};
1109
1110
1111/* Load a registry branch from a file */
1112struct load_registry_request
1113{
Alexandre Julliard86113532000-08-29 03:54:30 +00001114 REQUEST_HEADER; /* request header */
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001115 IN int hkey; /* root key to load to */
1116 IN int file; /* file to load from */
Alexandre Julliard57f05e12000-10-15 00:40:25 +00001117 IN VARARG(name,unicode_str); /* subkey name */
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001118};
1119
1120
1121/* Save a registry branch to a file */
1122struct save_registry_request
1123{
Alexandre Julliard86113532000-08-29 03:54:30 +00001124 REQUEST_HEADER; /* request header */
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001125 IN int hkey; /* key to save */
1126 IN int file; /* file to save to */
1127};
1128
1129
Alexandre Julliardc9709042000-04-16 17:21:13 +00001130/* Save a registry branch at server exit */
1131struct save_registry_atexit_request
1132{
Alexandre Julliard86113532000-08-29 03:54:30 +00001133 REQUEST_HEADER; /* request header */
Alexandre Julliardc9709042000-04-16 17:21:13 +00001134 IN int hkey; /* key to save */
Alexandre Julliard57f05e12000-10-15 00:40:25 +00001135 IN VARARG(file,string); /* file to save to */
Alexandre Julliardc9709042000-04-16 17:21:13 +00001136};
1137
1138
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001139/* Set the current and saving level for the registry */
1140struct set_registry_levels_request
1141{
Alexandre Julliard86113532000-08-29 03:54:30 +00001142 REQUEST_HEADER; /* request header */
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001143 IN int current; /* new current level */
1144 IN int saving; /* new saving level */
Alexandre Julliardc9709042000-04-16 17:21:13 +00001145 IN int period; /* duration between periodic saves (milliseconds) */
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001146};
1147
1148
Alexandre Julliardad47a301999-11-29 01:58:35 +00001149/* Create a waitable timer */
1150struct create_timer_request
1151{
Alexandre Julliard86113532000-08-29 03:54:30 +00001152 REQUEST_HEADER; /* request header */
Alexandre Julliardad47a301999-11-29 01:58:35 +00001153 IN int inherit; /* inherit flag */
1154 IN int manual; /* manual reset */
1155 OUT int handle; /* handle to the timer */
Alexandre Julliard9c2370b2000-08-30 00:00:48 +00001156 IN VARARG(name,unicode_str); /* object name */
Alexandre Julliardad47a301999-11-29 01:58:35 +00001157};
1158
1159
1160/* Open a waitable timer */
1161struct open_timer_request
1162{
Alexandre Julliard86113532000-08-29 03:54:30 +00001163 REQUEST_HEADER; /* request header */
Alexandre Julliardad47a301999-11-29 01:58:35 +00001164 IN unsigned int access; /* wanted access rights */
1165 IN int inherit; /* inherit flag */
1166 OUT int handle; /* handle to the timer */
Alexandre Julliard9c2370b2000-08-30 00:00:48 +00001167 IN VARARG(name,unicode_str); /* object name */
Alexandre Julliardad47a301999-11-29 01:58:35 +00001168};
1169
1170/* Set a waitable timer */
1171struct set_timer_request
1172{
Alexandre Julliard86113532000-08-29 03:54:30 +00001173 REQUEST_HEADER; /* request header */
Alexandre Julliardad47a301999-11-29 01:58:35 +00001174 IN int handle; /* handle to the timer */
1175 IN int sec; /* next expiration absolute time */
1176 IN int usec; /* next expiration absolute time */
1177 IN int period; /* timer period in ms */
1178 IN void* callback; /* callback function */
1179 IN void* arg; /* callback argument */
1180};
1181
1182/* Cancel a waitable timer */
1183struct cancel_timer_request
1184{
Alexandre Julliard86113532000-08-29 03:54:30 +00001185 REQUEST_HEADER; /* request header */
Alexandre Julliardad47a301999-11-29 01:58:35 +00001186 IN int handle; /* handle to the timer */
1187};
1188
1189
Alexandre Julliard3e2517c2000-01-20 18:59:03 +00001190/* Retrieve the current context of a thread */
1191struct get_thread_context_request
1192{
Alexandre Julliard86113532000-08-29 03:54:30 +00001193 REQUEST_HEADER; /* request header */
Alexandre Julliard3e2517c2000-01-20 18:59:03 +00001194 IN int handle; /* thread handle */
1195 IN unsigned int flags; /* context flags */
Alexandre Julliard92643002000-08-31 01:59:51 +00001196 OUT VARARG(context,context); /* thread context */
Alexandre Julliard3e2517c2000-01-20 18:59:03 +00001197};
1198
1199
1200/* Set the current context of a thread */
1201struct set_thread_context_request
1202{
Alexandre Julliard86113532000-08-29 03:54:30 +00001203 REQUEST_HEADER; /* request header */
Alexandre Julliard3e2517c2000-01-20 18:59:03 +00001204 IN int handle; /* thread handle */
1205 IN unsigned int flags; /* context flags */
Alexandre Julliard92643002000-08-31 01:59:51 +00001206 IN VARARG(context,context); /* thread context */
Alexandre Julliard3e2517c2000-01-20 18:59:03 +00001207};
1208
1209
Alexandre Julliard0a7c1f62000-01-27 02:54:17 +00001210/* Fetch a selector entry for a thread */
1211struct get_selector_entry_request
1212{
Alexandre Julliard86113532000-08-29 03:54:30 +00001213 REQUEST_HEADER; /* request header */
Alexandre Julliard0a7c1f62000-01-27 02:54:17 +00001214 IN int handle; /* thread handle */
1215 IN int entry; /* LDT entry */
1216 OUT unsigned int base; /* selector base */
1217 OUT unsigned int limit; /* selector limit */
1218 OUT unsigned char flags; /* selector flags */
1219};
1220
1221
Turchanov Sergei43a27e32000-05-30 20:32:06 +00001222/* Add an atom */
Alexandre Julliardb849d792000-02-13 13:56:13 +00001223struct add_atom_request
1224{
Alexandre Julliard86113532000-08-29 03:54:30 +00001225 REQUEST_HEADER; /* request header */
Turchanov Sergei43a27e32000-05-30 20:32:06 +00001226 IN int local; /* is atom in local process table? */
Alexandre Julliardb849d792000-02-13 13:56:13 +00001227 OUT int atom; /* resulting atom */
Alexandre Julliard9c2370b2000-08-30 00:00:48 +00001228 IN VARARG(name,unicode_str); /* atom name */
Alexandre Julliardb849d792000-02-13 13:56:13 +00001229};
1230
1231
Turchanov Sergei43a27e32000-05-30 20:32:06 +00001232/* Delete an atom */
Alexandre Julliardb849d792000-02-13 13:56:13 +00001233struct delete_atom_request
1234{
Alexandre Julliard86113532000-08-29 03:54:30 +00001235 REQUEST_HEADER; /* request header */
Alexandre Julliardb849d792000-02-13 13:56:13 +00001236 IN int atom; /* atom handle */
Turchanov Sergei43a27e32000-05-30 20:32:06 +00001237 IN int local; /* is atom in local process table? */
Alexandre Julliardb849d792000-02-13 13:56:13 +00001238};
1239
1240
Turchanov Sergei43a27e32000-05-30 20:32:06 +00001241/* Find an atom */
Alexandre Julliardb849d792000-02-13 13:56:13 +00001242struct find_atom_request
1243{
Alexandre Julliard86113532000-08-29 03:54:30 +00001244 REQUEST_HEADER; /* request header */
Turchanov Sergei43a27e32000-05-30 20:32:06 +00001245 IN int local; /* is atom in local process table? */
Alexandre Julliardb849d792000-02-13 13:56:13 +00001246 OUT int atom; /* atom handle */
Alexandre Julliard9c2370b2000-08-30 00:00:48 +00001247 IN VARARG(name,unicode_str); /* atom name */
Alexandre Julliardb849d792000-02-13 13:56:13 +00001248};
1249
1250
Turchanov Sergei43a27e32000-05-30 20:32:06 +00001251/* Get an atom name */
Alexandre Julliardb849d792000-02-13 13:56:13 +00001252struct get_atom_name_request
1253{
Alexandre Julliard86113532000-08-29 03:54:30 +00001254 REQUEST_HEADER; /* request header */
Alexandre Julliardb849d792000-02-13 13:56:13 +00001255 IN int atom; /* atom handle */
Turchanov Sergei43a27e32000-05-30 20:32:06 +00001256 IN int local; /* is atom in local process table? */
Alexandre Julliardb849d792000-02-13 13:56:13 +00001257 OUT int count; /* atom lock count */
Alexandre Julliard9c2370b2000-08-30 00:00:48 +00001258 OUT VARARG(name,unicode_str); /* atom name */
Alexandre Julliardb849d792000-02-13 13:56:13 +00001259};
1260
Alexandre Julliardc5e433a2000-05-30 19:48:18 +00001261
Turchanov Sergei43a27e32000-05-30 20:32:06 +00001262/* Init the process atom table */
1263struct init_atom_table_request
1264{
Alexandre Julliard86113532000-08-29 03:54:30 +00001265 REQUEST_HEADER; /* request header */
Turchanov Sergei43a27e32000-05-30 20:32:06 +00001266 IN int entries; /* number of entries */
1267};
1268
1269
Alexandre Julliardc5e433a2000-05-30 19:48:18 +00001270/* Get the message queue of the current thread */
1271struct get_msg_queue_request
1272{
Alexandre Julliard86113532000-08-29 03:54:30 +00001273 REQUEST_HEADER; /* request header */
Alexandre Julliardc5e433a2000-05-30 19:48:18 +00001274 OUT int handle; /* handle to the queue */
1275};
1276
1277/* Wake up a message queue */
1278struct wake_queue_request
1279{
Alexandre Julliard86113532000-08-29 03:54:30 +00001280 REQUEST_HEADER; /* request header */
Alexandre Julliardc5e433a2000-05-30 19:48:18 +00001281 IN int handle; /* handle to the queue */
1282 IN unsigned int bits; /* wake bits */
1283};
1284
1285/* Wait for a process to start waiting on input */
1286struct wait_input_idle_request
1287{
Alexandre Julliard86113532000-08-29 03:54:30 +00001288 REQUEST_HEADER; /* request header */
Alexandre Julliardc5e433a2000-05-30 19:48:18 +00001289 IN int handle; /* process handle */
1290 IN int timeout; /* timeout */
1291 OUT int event; /* handle to idle event */
1292};
1293
Mike McCormack44b5bf52000-09-07 18:39:51 +00001294struct create_serial_request
1295{
1296 REQUEST_HEADER; /* request header */
1297 IN unsigned int access; /* wanted access rights */
1298 IN int inherit; /* inherit flag */
1299 IN unsigned int sharing; /* sharing flags */
1300 OUT int handle; /* handle to the port */
Alexandre Julliard57f05e12000-10-15 00:40:25 +00001301 IN VARARG(name,string); /* file name */
Mike McCormack44b5bf52000-09-07 18:39:51 +00001302};
Alexandre Julliardc5e433a2000-05-30 19:48:18 +00001303
Mike McCormack654fcc72000-09-16 20:55:12 +00001304struct get_serial_info_request
1305{
1306 REQUEST_HEADER; /* request header */
1307 IN int handle; /* handle to comm port */
1308 OUT unsigned int readinterval;
1309 OUT unsigned int readconst;
1310 OUT unsigned int readmult;
1311 OUT unsigned int writeconst;
1312 OUT unsigned int writemult;
1313 OUT unsigned int eventmask;
1314 OUT unsigned int commerror;
1315};
1316
1317struct set_serial_info_request
1318{
1319 REQUEST_HEADER; /* request header */
1320 IN int handle; /* handle to comm port */
1321 IN int flags; /* bitmask to set values (see below) */
1322 IN unsigned int readinterval;
1323 IN unsigned int readconst;
1324 IN unsigned int readmult;
1325 IN unsigned int writeconst;
1326 IN unsigned int writemult;
1327 IN unsigned int eventmask;
1328 IN unsigned int commerror;
1329};
1330#define SERIALINFO_SET_TIMEOUTS 0x01
1331#define SERIALINFO_SET_MASK 0x02
1332#define SERIALINFO_SET_ERROR 0x04
1333
Mike McCormack1eac1912000-11-13 19:27:21 +00001334struct create_async_request
1335{
1336 REQUEST_HEADER; /* request header */
1337 IN int file_handle; /* handle to comm port */
1338 IN void* overlapped;
1339 IN void* buffer;
1340 IN int count;
1341 IN void* func;
1342 IN int type;
1343 OUT int ov_handle;
1344};
1345#define ASYNC_TYPE_READ 0x01
1346#define ASYNC_TYPE_WRITE 0x02
1347#define ASYNC_TYPE_WAIT 0x03
1348
1349/*
1350 * Used by service thread to tell the server that the current
1351 * operation has completed
1352 */
1353struct async_result_request
1354{
1355 REQUEST_HEADER; /* request header */
1356 IN int ov_handle;
1357 IN int result; /* NT status code */
1358};
1359
Alexandre Julliard5bc78081999-06-22 17:26:53 +00001360/* Everything below this line is generated automatically by tools/make_requests */
1361/* ### make_requests begin ### */
1362
1363enum request
1364{
1365 REQ_NEW_PROCESS,
Alexandre Julliard5b4f3e82000-05-01 16:24:22 +00001366 REQ_WAIT_PROCESS,
Alexandre Julliard5bc78081999-06-22 17:26:53 +00001367 REQ_NEW_THREAD,
Alexandre Julliard2fe57772000-01-25 01:40:27 +00001368 REQ_BOOT_DONE,
Alexandre Julliard5bc78081999-06-22 17:26:53 +00001369 REQ_INIT_PROCESS,
Alexandre Julliardec7bb231999-11-12 03:35:25 +00001370 REQ_INIT_PROCESS_DONE,
Alexandre Julliard5bc78081999-06-22 17:26:53 +00001371 REQ_INIT_THREAD,
Alexandre Julliardebe29ef1999-06-26 08:43:26 +00001372 REQ_GET_THREAD_BUFFER,
Alexandre Julliard5bc78081999-06-22 17:26:53 +00001373 REQ_TERMINATE_PROCESS,
1374 REQ_TERMINATE_THREAD,
1375 REQ_GET_PROCESS_INFO,
1376 REQ_SET_PROCESS_INFO,
1377 REQ_GET_THREAD_INFO,
1378 REQ_SET_THREAD_INFO,
1379 REQ_SUSPEND_THREAD,
1380 REQ_RESUME_THREAD,
Alexandre Julliard05f0b712000-03-09 18:18:41 +00001381 REQ_LOAD_DLL,
1382 REQ_UNLOAD_DLL,
Alexandre Julliard5bc78081999-06-22 17:26:53 +00001383 REQ_QUEUE_APC,
Alexandre Julliardea1afce2000-08-22 20:08:37 +00001384 REQ_GET_APC,
Alexandre Julliard5bc78081999-06-22 17:26:53 +00001385 REQ_CLOSE_HANDLE,
1386 REQ_GET_HANDLE_INFO,
1387 REQ_SET_HANDLE_INFO,
1388 REQ_DUP_HANDLE,
1389 REQ_OPEN_PROCESS,
1390 REQ_SELECT,
1391 REQ_CREATE_EVENT,
1392 REQ_EVENT_OP,
1393 REQ_OPEN_EVENT,
1394 REQ_CREATE_MUTEX,
1395 REQ_RELEASE_MUTEX,
1396 REQ_OPEN_MUTEX,
1397 REQ_CREATE_SEMAPHORE,
1398 REQ_RELEASE_SEMAPHORE,
1399 REQ_OPEN_SEMAPHORE,
1400 REQ_CREATE_FILE,
Alexandre Julliardebe29ef1999-06-26 08:43:26 +00001401 REQ_ALLOC_FILE_HANDLE,
Alexandre Julliard5bc78081999-06-22 17:26:53 +00001402 REQ_GET_READ_FD,
1403 REQ_GET_WRITE_FD,
1404 REQ_SET_FILE_POINTER,
1405 REQ_TRUNCATE_FILE,
1406 REQ_SET_FILE_TIME,
1407 REQ_FLUSH_FILE,
1408 REQ_GET_FILE_INFO,
1409 REQ_LOCK_FILE,
1410 REQ_UNLOCK_FILE,
1411 REQ_CREATE_PIPE,
Ove Kaaven019211f1999-10-13 16:05:37 +00001412 REQ_CREATE_SOCKET,
1413 REQ_ACCEPT_SOCKET,
1414 REQ_SET_SOCKET_EVENT,
1415 REQ_GET_SOCKET_EVENT,
1416 REQ_ENABLE_SOCKET_EVENT,
Alexandre Julliard5bc78081999-06-22 17:26:53 +00001417 REQ_ALLOC_CONSOLE,
1418 REQ_FREE_CONSOLE,
1419 REQ_OPEN_CONSOLE,
1420 REQ_SET_CONSOLE_FD,
1421 REQ_GET_CONSOLE_MODE,
1422 REQ_SET_CONSOLE_MODE,
1423 REQ_SET_CONSOLE_INFO,
1424 REQ_GET_CONSOLE_INFO,
1425 REQ_WRITE_CONSOLE_INPUT,
1426 REQ_READ_CONSOLE_INPUT,
1427 REQ_CREATE_CHANGE_NOTIFICATION,
1428 REQ_CREATE_MAPPING,
1429 REQ_OPEN_MAPPING,
1430 REQ_GET_MAPPING_INFO,
1431 REQ_CREATE_DEVICE,
1432 REQ_CREATE_SNAPSHOT,
1433 REQ_NEXT_PROCESS,
Alexandre Julliard07d84462000-04-16 19:45:05 +00001434 REQ_NEXT_THREAD,
1435 REQ_NEXT_MODULE,
Alexandre Julliard5bc78081999-06-22 17:26:53 +00001436 REQ_WAIT_DEBUG_EVENT,
Alexandre Julliardea0d0282000-03-10 22:16:10 +00001437 REQ_EXCEPTION_EVENT,
1438 REQ_OUTPUT_DEBUG_STRING,
Alexandre Julliard5bc78081999-06-22 17:26:53 +00001439 REQ_CONTINUE_DEBUG_EVENT,
1440 REQ_DEBUG_PROCESS,
Alexandre Julliard8b8828f1999-11-12 21:39:14 +00001441 REQ_READ_PROCESS_MEMORY,
Alexandre Julliardeef70251999-11-13 19:54:54 +00001442 REQ_WRITE_PROCESS_MEMORY,
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001443 REQ_CREATE_KEY,
1444 REQ_OPEN_KEY,
1445 REQ_DELETE_KEY,
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001446 REQ_ENUM_KEY,
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001447 REQ_SET_KEY_VALUE,
1448 REQ_GET_KEY_VALUE,
1449 REQ_ENUM_KEY_VALUE,
1450 REQ_DELETE_KEY_VALUE,
1451 REQ_LOAD_REGISTRY,
1452 REQ_SAVE_REGISTRY,
Alexandre Julliardc9709042000-04-16 17:21:13 +00001453 REQ_SAVE_REGISTRY_ATEXIT,
Alexandre Julliardd7e85d61999-11-23 19:39:11 +00001454 REQ_SET_REGISTRY_LEVELS,
Alexandre Julliardad47a301999-11-29 01:58:35 +00001455 REQ_CREATE_TIMER,
1456 REQ_OPEN_TIMER,
1457 REQ_SET_TIMER,
1458 REQ_CANCEL_TIMER,
Alexandre Julliard3e2517c2000-01-20 18:59:03 +00001459 REQ_GET_THREAD_CONTEXT,
1460 REQ_SET_THREAD_CONTEXT,
Alexandre Julliard0a7c1f62000-01-27 02:54:17 +00001461 REQ_GET_SELECTOR_ENTRY,
Alexandre Julliardb849d792000-02-13 13:56:13 +00001462 REQ_ADD_ATOM,
1463 REQ_DELETE_ATOM,
1464 REQ_FIND_ATOM,
1465 REQ_GET_ATOM_NAME,
Turchanov Sergei43a27e32000-05-30 20:32:06 +00001466 REQ_INIT_ATOM_TABLE,
Alexandre Julliardc5e433a2000-05-30 19:48:18 +00001467 REQ_GET_MSG_QUEUE,
1468 REQ_WAKE_QUEUE,
1469 REQ_WAIT_INPUT_IDLE,
Mike McCormack44b5bf52000-09-07 18:39:51 +00001470 REQ_CREATE_SERIAL,
Mike McCormack654fcc72000-09-16 20:55:12 +00001471 REQ_GET_SERIAL_INFO,
1472 REQ_SET_SERIAL_INFO,
Mike McCormack1eac1912000-11-13 19:27:21 +00001473 REQ_CREATE_ASYNC,
1474 REQ_ASYNC_RESULT,
Alexandre Julliard5bc78081999-06-22 17:26:53 +00001475 REQ_NB_REQUESTS
1476};
1477
Alexandre Julliard86113532000-08-29 03:54:30 +00001478union generic_request
1479{
1480 struct request_max_size max_size;
1481 struct request_header header;
1482 struct new_process_request new_process;
1483 struct wait_process_request wait_process;
1484 struct new_thread_request new_thread;
1485 struct boot_done_request boot_done;
1486 struct init_process_request init_process;
1487 struct init_process_done_request init_process_done;
1488 struct init_thread_request init_thread;
1489 struct get_thread_buffer_request get_thread_buffer;
1490 struct terminate_process_request terminate_process;
1491 struct terminate_thread_request terminate_thread;
1492 struct get_process_info_request get_process_info;
1493 struct set_process_info_request set_process_info;
1494 struct get_thread_info_request get_thread_info;
1495 struct set_thread_info_request set_thread_info;
1496 struct suspend_thread_request suspend_thread;
1497 struct resume_thread_request resume_thread;
1498 struct load_dll_request load_dll;
1499 struct unload_dll_request unload_dll;
1500 struct queue_apc_request queue_apc;
1501 struct get_apc_request get_apc;
1502 struct close_handle_request close_handle;
1503 struct get_handle_info_request get_handle_info;
1504 struct set_handle_info_request set_handle_info;
1505 struct dup_handle_request dup_handle;
1506 struct open_process_request open_process;
1507 struct select_request select;
1508 struct create_event_request create_event;
1509 struct event_op_request event_op;
1510 struct open_event_request open_event;
1511 struct create_mutex_request create_mutex;
1512 struct release_mutex_request release_mutex;
1513 struct open_mutex_request open_mutex;
1514 struct create_semaphore_request create_semaphore;
1515 struct release_semaphore_request release_semaphore;
1516 struct open_semaphore_request open_semaphore;
1517 struct create_file_request create_file;
1518 struct alloc_file_handle_request alloc_file_handle;
1519 struct get_read_fd_request get_read_fd;
1520 struct get_write_fd_request get_write_fd;
1521 struct set_file_pointer_request set_file_pointer;
1522 struct truncate_file_request truncate_file;
1523 struct set_file_time_request set_file_time;
1524 struct flush_file_request flush_file;
1525 struct get_file_info_request get_file_info;
1526 struct lock_file_request lock_file;
1527 struct unlock_file_request unlock_file;
1528 struct create_pipe_request create_pipe;
1529 struct create_socket_request create_socket;
1530 struct accept_socket_request accept_socket;
1531 struct set_socket_event_request set_socket_event;
1532 struct get_socket_event_request get_socket_event;
1533 struct enable_socket_event_request enable_socket_event;
1534 struct alloc_console_request alloc_console;
1535 struct free_console_request free_console;
1536 struct open_console_request open_console;
1537 struct set_console_fd_request set_console_fd;
1538 struct get_console_mode_request get_console_mode;
1539 struct set_console_mode_request set_console_mode;
1540 struct set_console_info_request set_console_info;
1541 struct get_console_info_request get_console_info;
1542 struct write_console_input_request write_console_input;
1543 struct read_console_input_request read_console_input;
1544 struct create_change_notification_request create_change_notification;
1545 struct create_mapping_request create_mapping;
1546 struct open_mapping_request open_mapping;
1547 struct get_mapping_info_request get_mapping_info;
1548 struct create_device_request create_device;
1549 struct create_snapshot_request create_snapshot;
1550 struct next_process_request next_process;
1551 struct next_thread_request next_thread;
1552 struct next_module_request next_module;
1553 struct wait_debug_event_request wait_debug_event;
1554 struct exception_event_request exception_event;
1555 struct output_debug_string_request output_debug_string;
1556 struct continue_debug_event_request continue_debug_event;
1557 struct debug_process_request debug_process;
1558 struct read_process_memory_request read_process_memory;
1559 struct write_process_memory_request write_process_memory;
1560 struct create_key_request create_key;
1561 struct open_key_request open_key;
1562 struct delete_key_request delete_key;
Alexandre Julliard86113532000-08-29 03:54:30 +00001563 struct enum_key_request enum_key;
Alexandre Julliard86113532000-08-29 03:54:30 +00001564 struct set_key_value_request set_key_value;
1565 struct get_key_value_request get_key_value;
1566 struct enum_key_value_request enum_key_value;
1567 struct delete_key_value_request delete_key_value;
1568 struct load_registry_request load_registry;
1569 struct save_registry_request save_registry;
1570 struct save_registry_atexit_request save_registry_atexit;
1571 struct set_registry_levels_request set_registry_levels;
1572 struct create_timer_request create_timer;
1573 struct open_timer_request open_timer;
1574 struct set_timer_request set_timer;
1575 struct cancel_timer_request cancel_timer;
1576 struct get_thread_context_request get_thread_context;
1577 struct set_thread_context_request set_thread_context;
1578 struct get_selector_entry_request get_selector_entry;
1579 struct add_atom_request add_atom;
1580 struct delete_atom_request delete_atom;
1581 struct find_atom_request find_atom;
1582 struct get_atom_name_request get_atom_name;
1583 struct init_atom_table_request init_atom_table;
1584 struct get_msg_queue_request get_msg_queue;
1585 struct wake_queue_request wake_queue;
1586 struct wait_input_idle_request wait_input_idle;
Mike McCormack44b5bf52000-09-07 18:39:51 +00001587 struct create_serial_request create_serial;
Mike McCormack654fcc72000-09-16 20:55:12 +00001588 struct get_serial_info_request get_serial_info;
1589 struct set_serial_info_request set_serial_info;
Mike McCormack1eac1912000-11-13 19:27:21 +00001590 struct create_async_request create_async;
1591 struct async_result_request async_result;
Alexandre Julliard86113532000-08-29 03:54:30 +00001592};
1593
Alexandre Julliard914406f2000-11-14 01:54:49 +00001594#define SERVER_PROTOCOL_VERSION 28
Alexandre Julliard5fb54562000-03-08 22:01:02 +00001595
Alexandre Julliard5bc78081999-06-22 17:26:53 +00001596/* ### make_requests end ### */
1597/* Everything above this line is generated automatically by tools/make_requests */
1598
Alexandre Julliard86113532000-08-29 03:54:30 +00001599#undef REQUEST_HEADER
1600#undef VARARG
1601
1602/* format of the server buffer */
1603struct server_buffer_info
1604{
1605 volatile unsigned int cur_req; /* offset of the current request */
1606 volatile unsigned int cur_pos; /* first available position in buffer */
1607};
Alexandre Julliard43c190e1999-05-15 10:48:19 +00001608
Alexandre Julliard642d3131998-07-12 19:29:36 +00001609/* client-side functions */
1610
1611#ifndef __WINE_SERVER__
Alexandre Julliardd30dfd21998-09-27 18:28:36 +00001612
Alexandre Julliard5bc78081999-06-22 17:26:53 +00001613#include "thread.h"
Alexandre Julliardcb1fc732000-01-24 21:58:06 +00001614#include "ntddk.h"
Alexandre Julliard86113532000-08-29 03:54:30 +00001615#include "wine/exception.h"
Alexandre Julliard5bc78081999-06-22 17:26:53 +00001616
Alexandre Julliardebe29ef1999-06-26 08:43:26 +00001617/* client communication functions */
1618
Alexandre Julliardaf04ebe1999-11-21 21:02:06 +00001619extern unsigned int server_call_noerr( enum request req );
1620extern unsigned int server_call_fd( enum request req, int fd_out, int *fd_in );
Alexandre Julliard12f29b52000-03-17 15:16:57 +00001621extern void server_protocol_error( const char *err, ... ) WINE_NORETURN;
Alexandre Julliard86113532000-08-29 03:54:30 +00001622extern void *server_alloc_req( size_t fixed_size, size_t var_size );
Alexandre Julliardde1d5ad2000-04-06 20:36:17 +00001623extern const char *get_config_dir(void);
Alexandre Julliardaf04ebe1999-11-21 21:02:06 +00001624
Alexandre Julliardebe29ef1999-06-26 08:43:26 +00001625/* get a pointer to the request buffer */
Francois Gougetae41e8c2000-06-11 20:07:58 +00001626static inline void WINE_UNUSED *get_req_buffer(void)
Alexandre Julliard5bc78081999-06-22 17:26:53 +00001627{
Alexandre Julliardebe29ef1999-06-26 08:43:26 +00001628 return NtCurrentTeb()->buffer;
Alexandre Julliard5bc78081999-06-22 17:26:53 +00001629}
1630
Alexandre Julliardebe29ef1999-06-26 08:43:26 +00001631/* maximum remaining size in the server buffer */
Lionel Ulmer3b8a7241999-07-24 12:08:20 +00001632static inline int WINE_UNUSED server_remaining( const void *ptr )
Alexandre Julliard5bc78081999-06-22 17:26:53 +00001633{
Alexandre Julliard86113532000-08-29 03:54:30 +00001634 return (char *)NtCurrentTeb()->buffer_info - (char *)ptr;
Alexandre Julliard5bc78081999-06-22 17:26:53 +00001635}
1636
Alexandre Julliardaf04ebe1999-11-21 21:02:06 +00001637/* do a server call and set the last error code */
1638static inline int server_call( enum request req )
1639{
1640 unsigned int res = server_call_noerr( req );
Alexandre Julliardcb1fc732000-01-24 21:58:06 +00001641 if (res) SetLastError( RtlNtStatusToDosError(res) );
Alexandre Julliardaf04ebe1999-11-21 21:02:06 +00001642 return res;
1643}
Alexandre Julliard5bc78081999-06-22 17:26:53 +00001644
Alexandre Julliardd16319c1999-11-25 21:30:24 +00001645/* copy a Unicode string to the server buffer */
1646static inline void server_strcpyW( WCHAR *dst, const WCHAR *src )
1647{
1648 if (src)
1649 {
Alexandre Julliard86113532000-08-29 03:54:30 +00001650 WCHAR *end = (WCHAR *)NtCurrentTeb()->buffer_info - 1;
Alexandre Julliardd16319c1999-11-25 21:30:24 +00001651 while ((dst < end) && *src) *dst++ = *src++;
1652 }
1653 *dst = 0;
1654}
1655
1656/* copy and convert an ASCII string to the server buffer */
1657static inline void server_strcpyAtoW( WCHAR *dst, const char *src )
1658{
1659 if (src)
1660 {
Alexandre Julliard86113532000-08-29 03:54:30 +00001661 WCHAR *end = (WCHAR *)NtCurrentTeb()->buffer_info - 1;
Alexandre Julliardd16319c1999-11-25 21:30:24 +00001662 while ((dst < end) && *src) *dst++ = (WCHAR)(unsigned char)*src++;
1663 }
1664 *dst = 0;
1665}
1666
Alexandre Julliard86113532000-08-29 03:54:30 +00001667/* get a pointer to the variable part of the request */
Alexandre Julliard454355e2000-10-02 03:46:58 +00001668inline static void *server_data_ptr( const void *req )
Alexandre Julliard86113532000-08-29 03:54:30 +00001669{
1670 return (union generic_request *)req + 1;
1671}
1672
Alexandre Julliard9c2370b2000-08-30 00:00:48 +00001673/* get the size of the variable part of the request */
Alexandre Julliard454355e2000-10-02 03:46:58 +00001674inline static size_t server_data_size( const void *req )
Alexandre Julliard9c2370b2000-08-30 00:00:48 +00001675{
1676 return ((struct request_header *)req)->var_size;
1677}
1678
Alexandre Julliard86113532000-08-29 03:54:30 +00001679
1680/* exception support for server calls */
1681
1682extern DWORD server_exception_handler( PEXCEPTION_RECORD record, EXCEPTION_FRAME *frame,
1683 CONTEXT *context, EXCEPTION_FRAME **pdispatcher );
1684
1685struct __server_exception_frame
1686{
1687 EXCEPTION_FRAME frame;
1688 struct server_buffer_info info; /* saved buffer information */
1689};
1690
1691#define SERVER_START_REQ \
1692 do { \
1693 struct __server_exception_frame __f; \
1694 __f.frame.Handler = server_exception_handler; \
1695 __f.info = *NtCurrentTeb()->buffer_info; \
1696 __wine_push_frame( &__f.frame ); \
1697 do {
1698
1699#define SERVER_END_REQ \
1700 } while(0); \
1701 *NtCurrentTeb()->buffer_info = __f.info; \
1702 __wine_pop_frame( &__f.frame ); \
1703 } while(0);
1704
Alexandre Julliardf692d441999-03-21 19:23:54 +00001705extern int CLIENT_InitServer(void);
Alexandre Julliard2fe57772000-01-25 01:40:27 +00001706extern int CLIENT_BootDone( int debug_level );
1707extern int CLIENT_IsBootThread(void);
Alexandre Julliard642d3131998-07-12 19:29:36 +00001708extern int CLIENT_InitThread(void);
Alexandre Julliard642d3131998-07-12 19:29:36 +00001709#endif /* __WINE_SERVER__ */
1710
1711#endif /* __WINE_SERVER_H */