Replace "Linux dll" with "GNU style ELF dll".
[wine.git] / server / request.h
blob8d24e76482e78bdddcfb7a9070bd5dc8a32ee775
1 /*
2 * Wine server requests
4 * Copyright (C) 1999 Alexandre Julliard
5 */
7 #ifndef __WINE_SERVER_REQUEST_H
8 #define __WINE_SERVER_REQUEST_H
10 #ifndef __WINE_SERVER__
11 #error This file can only be used in the Wine server
12 #endif
14 #include "thread.h"
16 /* max request length */
17 #define MAX_REQUEST_LENGTH 8192
19 /* request handler definition */
20 #define DECL_HANDLER(name) void req_##name( struct name##_request *req )
22 /* request functions */
24 #ifdef __GNUC__
25 extern void fatal_protocol_error( struct thread *thread,
26 const char *err, ... ) __attribute__((format (printf,2,3)));
27 extern void fatal_protocol_perror( struct thread *thread,
28 const char *err, ... ) __attribute__((format (printf,2,3)));
29 extern void fatal_error( const char *err, ... ) __attribute__((noreturn,format(printf,1,2)));
30 extern void fatal_perror( const char *err, ... ) __attribute__((noreturn,format(printf,1,2)));
31 #else
32 extern void fatal_protocol_error( struct thread *thread, const char *err, ... );
33 extern void fatal_protocol_perror( struct thread *thread, const char *err, ... );
34 extern void fatal_error( const char *err, ... );
35 extern void fatal_perror( const char *err, ... );
36 #endif
38 extern const char *get_config_dir(void);
39 extern int receive_fd( struct process *process );
40 extern int send_client_fd( struct process *process, int fd, handle_t handle );
41 extern void read_request( struct thread *thread );
42 extern void send_reply( struct thread *thread, union generic_request *request );
43 extern void open_master_socket(void);
44 extern void close_master_socket(void);
45 extern void lock_master_socket( int locked );
47 extern void trace_request( struct thread *thread, const union generic_request *request );
48 extern void trace_reply( struct thread *thread, const union generic_request *request );
50 /* get the request vararg data */
51 inline static void *get_req_data( const void *req )
53 return (char *)current->buffer + ((struct request_header *)req)->var_offset;
56 /* get the request vararg size */
57 inline static size_t get_req_data_size( const void *req )
59 return ((struct request_header *)req)->var_size;
62 /* set the request vararg size */
63 inline static void set_req_data_size( const void *req, size_t size )
65 ((struct request_header *)req)->var_size = size;
68 /* Everything below this line is generated automatically by tools/make_requests */
69 /* ### make_requests begin ### */
71 DECL_HANDLER(new_process);
72 DECL_HANDLER(get_new_process_info);
73 DECL_HANDLER(new_thread);
74 DECL_HANDLER(boot_done);
75 DECL_HANDLER(init_process);
76 DECL_HANDLER(init_process_done);
77 DECL_HANDLER(init_thread);
78 DECL_HANDLER(set_thread_buffer);
79 DECL_HANDLER(terminate_process);
80 DECL_HANDLER(terminate_thread);
81 DECL_HANDLER(get_process_info);
82 DECL_HANDLER(set_process_info);
83 DECL_HANDLER(get_thread_info);
84 DECL_HANDLER(set_thread_info);
85 DECL_HANDLER(suspend_thread);
86 DECL_HANDLER(resume_thread);
87 DECL_HANDLER(load_dll);
88 DECL_HANDLER(unload_dll);
89 DECL_HANDLER(queue_apc);
90 DECL_HANDLER(get_apc);
91 DECL_HANDLER(close_handle);
92 DECL_HANDLER(set_handle_info);
93 DECL_HANDLER(dup_handle);
94 DECL_HANDLER(open_process);
95 DECL_HANDLER(select);
96 DECL_HANDLER(create_event);
97 DECL_HANDLER(event_op);
98 DECL_HANDLER(open_event);
99 DECL_HANDLER(create_mutex);
100 DECL_HANDLER(release_mutex);
101 DECL_HANDLER(open_mutex);
102 DECL_HANDLER(create_semaphore);
103 DECL_HANDLER(release_semaphore);
104 DECL_HANDLER(open_semaphore);
105 DECL_HANDLER(create_file);
106 DECL_HANDLER(alloc_file_handle);
107 DECL_HANDLER(get_handle_fd);
108 DECL_HANDLER(set_file_pointer);
109 DECL_HANDLER(truncate_file);
110 DECL_HANDLER(set_file_time);
111 DECL_HANDLER(flush_file);
112 DECL_HANDLER(get_file_info);
113 DECL_HANDLER(lock_file);
114 DECL_HANDLER(unlock_file);
115 DECL_HANDLER(create_pipe);
116 DECL_HANDLER(create_socket);
117 DECL_HANDLER(accept_socket);
118 DECL_HANDLER(set_socket_event);
119 DECL_HANDLER(get_socket_event);
120 DECL_HANDLER(enable_socket_event);
121 DECL_HANDLER(alloc_console);
122 DECL_HANDLER(free_console);
123 DECL_HANDLER(open_console);
124 DECL_HANDLER(set_console_fd);
125 DECL_HANDLER(get_console_mode);
126 DECL_HANDLER(set_console_mode);
127 DECL_HANDLER(set_console_info);
128 DECL_HANDLER(get_console_info);
129 DECL_HANDLER(write_console_input);
130 DECL_HANDLER(read_console_input);
131 DECL_HANDLER(create_change_notification);
132 DECL_HANDLER(create_mapping);
133 DECL_HANDLER(open_mapping);
134 DECL_HANDLER(get_mapping_info);
135 DECL_HANDLER(create_device);
136 DECL_HANDLER(create_snapshot);
137 DECL_HANDLER(next_process);
138 DECL_HANDLER(next_thread);
139 DECL_HANDLER(next_module);
140 DECL_HANDLER(wait_debug_event);
141 DECL_HANDLER(queue_exception_event);
142 DECL_HANDLER(get_exception_status);
143 DECL_HANDLER(output_debug_string);
144 DECL_HANDLER(continue_debug_event);
145 DECL_HANDLER(debug_process);
146 DECL_HANDLER(read_process_memory);
147 DECL_HANDLER(write_process_memory);
148 DECL_HANDLER(create_key);
149 DECL_HANDLER(open_key);
150 DECL_HANDLER(delete_key);
151 DECL_HANDLER(enum_key);
152 DECL_HANDLER(set_key_value);
153 DECL_HANDLER(get_key_value);
154 DECL_HANDLER(enum_key_value);
155 DECL_HANDLER(delete_key_value);
156 DECL_HANDLER(load_registry);
157 DECL_HANDLER(save_registry);
158 DECL_HANDLER(save_registry_atexit);
159 DECL_HANDLER(set_registry_levels);
160 DECL_HANDLER(create_timer);
161 DECL_HANDLER(open_timer);
162 DECL_HANDLER(set_timer);
163 DECL_HANDLER(cancel_timer);
164 DECL_HANDLER(get_thread_context);
165 DECL_HANDLER(set_thread_context);
166 DECL_HANDLER(get_selector_entry);
167 DECL_HANDLER(add_atom);
168 DECL_HANDLER(delete_atom);
169 DECL_HANDLER(find_atom);
170 DECL_HANDLER(get_atom_name);
171 DECL_HANDLER(init_atom_table);
172 DECL_HANDLER(get_msg_queue);
173 DECL_HANDLER(set_queue_bits);
174 DECL_HANDLER(set_queue_mask);
175 DECL_HANDLER(get_queue_status);
176 DECL_HANDLER(wait_input_idle);
177 DECL_HANDLER(send_message);
178 DECL_HANDLER(get_message);
179 DECL_HANDLER(reply_message);
180 DECL_HANDLER(get_message_reply);
181 DECL_HANDLER(in_send_message);
182 DECL_HANDLER(cleanup_window_queue);
183 DECL_HANDLER(set_win_timer);
184 DECL_HANDLER(kill_win_timer);
185 DECL_HANDLER(create_serial);
186 DECL_HANDLER(get_serial_info);
187 DECL_HANDLER(set_serial_info);
188 DECL_HANDLER(create_async);
190 #ifdef WANT_REQUEST_HANDLERS
192 typedef void (*req_handler)( void *req );
193 static const req_handler req_handlers[REQ_NB_REQUESTS] =
195 (req_handler)req_new_process,
196 (req_handler)req_get_new_process_info,
197 (req_handler)req_new_thread,
198 (req_handler)req_boot_done,
199 (req_handler)req_init_process,
200 (req_handler)req_init_process_done,
201 (req_handler)req_init_thread,
202 (req_handler)req_set_thread_buffer,
203 (req_handler)req_terminate_process,
204 (req_handler)req_terminate_thread,
205 (req_handler)req_get_process_info,
206 (req_handler)req_set_process_info,
207 (req_handler)req_get_thread_info,
208 (req_handler)req_set_thread_info,
209 (req_handler)req_suspend_thread,
210 (req_handler)req_resume_thread,
211 (req_handler)req_load_dll,
212 (req_handler)req_unload_dll,
213 (req_handler)req_queue_apc,
214 (req_handler)req_get_apc,
215 (req_handler)req_close_handle,
216 (req_handler)req_set_handle_info,
217 (req_handler)req_dup_handle,
218 (req_handler)req_open_process,
219 (req_handler)req_select,
220 (req_handler)req_create_event,
221 (req_handler)req_event_op,
222 (req_handler)req_open_event,
223 (req_handler)req_create_mutex,
224 (req_handler)req_release_mutex,
225 (req_handler)req_open_mutex,
226 (req_handler)req_create_semaphore,
227 (req_handler)req_release_semaphore,
228 (req_handler)req_open_semaphore,
229 (req_handler)req_create_file,
230 (req_handler)req_alloc_file_handle,
231 (req_handler)req_get_handle_fd,
232 (req_handler)req_set_file_pointer,
233 (req_handler)req_truncate_file,
234 (req_handler)req_set_file_time,
235 (req_handler)req_flush_file,
236 (req_handler)req_get_file_info,
237 (req_handler)req_lock_file,
238 (req_handler)req_unlock_file,
239 (req_handler)req_create_pipe,
240 (req_handler)req_create_socket,
241 (req_handler)req_accept_socket,
242 (req_handler)req_set_socket_event,
243 (req_handler)req_get_socket_event,
244 (req_handler)req_enable_socket_event,
245 (req_handler)req_alloc_console,
246 (req_handler)req_free_console,
247 (req_handler)req_open_console,
248 (req_handler)req_set_console_fd,
249 (req_handler)req_get_console_mode,
250 (req_handler)req_set_console_mode,
251 (req_handler)req_set_console_info,
252 (req_handler)req_get_console_info,
253 (req_handler)req_write_console_input,
254 (req_handler)req_read_console_input,
255 (req_handler)req_create_change_notification,
256 (req_handler)req_create_mapping,
257 (req_handler)req_open_mapping,
258 (req_handler)req_get_mapping_info,
259 (req_handler)req_create_device,
260 (req_handler)req_create_snapshot,
261 (req_handler)req_next_process,
262 (req_handler)req_next_thread,
263 (req_handler)req_next_module,
264 (req_handler)req_wait_debug_event,
265 (req_handler)req_queue_exception_event,
266 (req_handler)req_get_exception_status,
267 (req_handler)req_output_debug_string,
268 (req_handler)req_continue_debug_event,
269 (req_handler)req_debug_process,
270 (req_handler)req_read_process_memory,
271 (req_handler)req_write_process_memory,
272 (req_handler)req_create_key,
273 (req_handler)req_open_key,
274 (req_handler)req_delete_key,
275 (req_handler)req_enum_key,
276 (req_handler)req_set_key_value,
277 (req_handler)req_get_key_value,
278 (req_handler)req_enum_key_value,
279 (req_handler)req_delete_key_value,
280 (req_handler)req_load_registry,
281 (req_handler)req_save_registry,
282 (req_handler)req_save_registry_atexit,
283 (req_handler)req_set_registry_levels,
284 (req_handler)req_create_timer,
285 (req_handler)req_open_timer,
286 (req_handler)req_set_timer,
287 (req_handler)req_cancel_timer,
288 (req_handler)req_get_thread_context,
289 (req_handler)req_set_thread_context,
290 (req_handler)req_get_selector_entry,
291 (req_handler)req_add_atom,
292 (req_handler)req_delete_atom,
293 (req_handler)req_find_atom,
294 (req_handler)req_get_atom_name,
295 (req_handler)req_init_atom_table,
296 (req_handler)req_get_msg_queue,
297 (req_handler)req_set_queue_bits,
298 (req_handler)req_set_queue_mask,
299 (req_handler)req_get_queue_status,
300 (req_handler)req_wait_input_idle,
301 (req_handler)req_send_message,
302 (req_handler)req_get_message,
303 (req_handler)req_reply_message,
304 (req_handler)req_get_message_reply,
305 (req_handler)req_in_send_message,
306 (req_handler)req_cleanup_window_queue,
307 (req_handler)req_set_win_timer,
308 (req_handler)req_kill_win_timer,
309 (req_handler)req_create_serial,
310 (req_handler)req_get_serial_info,
311 (req_handler)req_set_serial_info,
312 (req_handler)req_create_async,
314 #endif /* WANT_REQUEST_HANDLERS */
316 /* ### make_requests end ### */
317 /* Everything above this line is generated automatically by tools/make_requests */
319 #endif /* __WINE_SERVER_REQUEST_H */