1 /*
2 * Wine server protocol definitions
3 *
4 * This file is automatically generated; DO NO EDIT!
5 * Edit server/protocol.def instead and re-run tools/make_requests
6 */
7
8 #ifndef __WINE_WINE_SERVER_PROTOCOL_H
9 #define __WINE_WINE_SERVER_PROTOCOL_H
10
11 #include <stdarg.h>
12 #include <stdlib.h>
13 #include <time.h>
14
15 #include <windef.h>
16 #include <winbase.h>
17
18 typedef void *obj_handle_t;
19 typedef void *user_handle_t;
20 typedef unsigned short atom_t;
21 typedef unsigned int process_id_t;
22 typedef unsigned int thread_id_t;
23 typedef unsigned int data_size_t;
24 typedef unsigned int ioctl_code_t;
25 typedef unsigned __int64 file_pos_t;
26
27 struct request_header
28 {
29 int req;
30 data_size_t request_size;
31 data_size_t reply_size;
32 };
33
34 struct reply_header
35 {
36 unsigned int error;
37 data_size_t reply_size;
38 };
39
40
41
42 struct request_max_size
43 {
44 int pad[16];
45 };
46
47 #define FIRST_USER_HANDLE 0x0020
48 #define LAST_USER_HANDLE 0xffef
49
50
51
52 struct debug_event_exception
53 {
54 EXCEPTION_RECORD record;
55 int first;
56 };
57 struct debug_event_create_thread
58 {
59 obj_handle_t handle;
60 void *teb;
61 void *start;
62 };
63 struct debug_event_create_process
64 {
65 obj_handle_t file;
66 obj_handle_t process;
67 obj_handle_t thread;
68 void *base;
69 int dbg_offset;
70 int dbg_size;
71 void *teb;
72 void *start;
73 void *name;
74 int unicode;
75 };
76 struct debug_event_exit
77 {
78 int exit_code;
79 };
80 struct debug_event_load_dll
81 {
82 obj_handle_t handle;
83 void *base;
84 int dbg_offset;
85 int dbg_size;
86 void *name;
87 int unicode;
88 };
89 struct debug_event_unload_dll
90 {
91 void *base;
92 };
93 struct debug_event_output_string
94 {
95 void *string;
96 int unicode;
97 int length;
98 };
99 struct debug_event_rip_info
100 {
101 int error;
102 int type;
103 };
104 union 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
117 typedef struct
118 {
119 int code;
120 union debug_event_data info;
121 } debug_event_t;
122
123
124 struct send_fd
125 {
126 thread_id_t tid;
127 int fd;
128 };
129
130
131 struct wake_up_reply
132 {
133 void *cookie;
134 int signaled;
135 };
136
137
138 typedef __int64 timeout_t;
139 #define TIMEOUT_INFINITE (((timeout_t)0x7fffffff) << 32 | 0xffffffff)
140
141
142 typedef struct
143 {
144 atom_t atom;
145 short string;
146 obj_handle_t handle;
147 } property_data_t;
148
149
150 typedef struct
151 {
152 int left;
153 int top;
154 int right;
155 int bottom;
156 } rectangle_t;
157
158
159 typedef struct
160 {
161 void *callback;
162 void *iosb;
163 void *arg;
164 void *apc;
165 obj_handle_t event;
166 unsigned long cvalue;
167 } async_data_t;
168
169
170
171 struct callback_msg_data
172 {
173 void *callback;
174 unsigned long data;
175 unsigned long result;
176 };
177
178 struct winevent_msg_data
179 {
180 user_handle_t hook;
181 thread_id_t tid;
182 void *hook_proc;
183
184 };
185
186 typedef union
187 {
188 unsigned char bytes[1];
189 struct callback_msg_data callback;
190 struct winevent_msg_data winevent;
191 } message_data_t;
192
193
194 typedef struct
195 {
196 WCHAR ch;
197 unsigned short attr;
198 } char_info_t;
199
200 typedef struct
201 {
202 unsigned int low_part;
203 int high_part;
204 } luid_t;
205
206 #define MAX_ACL_LEN 65535
207
208 struct security_descriptor
209 {
210 unsigned int control;
211 data_size_t owner_len;
212 data_size_t group_len;
213 data_size_t sacl_len;
214 data_size_t dacl_len;
215
216
217
218
219 };
220
221 struct object_attributes
222 {
223 obj_handle_t rootdir;
224 data_size_t sd_len;
225 data_size_t name_len;
226
227
228 };
229
230 struct token_groups
231 {
232 unsigned int count;
233
234
235 };
236
237 enum apc_type
238 {
239 APC_NONE,
240 APC_USER,
241 APC_TIMER,
242 APC_ASYNC_IO,
243 APC_VIRTUAL_ALLOC,
244 APC_VIRTUAL_FREE,
245 APC_VIRTUAL_QUERY,
246 APC_VIRTUAL_PROTECT,
247 APC_VIRTUAL_FLUSH,
248 APC_VIRTUAL_LOCK,
249 APC_VIRTUAL_UNLOCK,
250 APC_MAP_VIEW,
251 APC_UNMAP_VIEW,
252 APC_CREATE_THREAD
253 };
254
255 typedef union
256 {
257 enum apc_type type;
258 struct
259 {
260 enum apc_type type;
261 void (__stdcall *func)(unsigned long,unsigned long,unsigned long);
262 unsigned long args[3];
263 } user;
264 struct
265 {
266 enum apc_type type;
267 void (__stdcall *func)(void*, unsigned int, unsigned int);
268 timeout_t time;
269 void *arg;
270 } timer;
271 struct
272 {
273 enum apc_type type;
274 unsigned int (*func)(void*, void*, unsigned int, unsigned long *);
275 void *user;
276 void *sb;
277 unsigned int status;
278 } async_io;
279 struct
280 {
281 enum apc_type type;
282 void *addr;
283 unsigned long size;
284 unsigned int zero_bits;
285 unsigned int op_type;
286 unsigned int prot;
287 } virtual_alloc;
288 struct
289 {
290 enum apc_type type;
291 void *addr;
292 unsigned long size;
293 unsigned int op_type;
294 } virtual_free;
295 struct
296 {
297 enum apc_type type;
298 const void *addr;
299 } virtual_query;
300 struct
301 {
302 enum apc_type type;
303 void *addr;
304 unsigned long size;
305 unsigned int prot;
306 } virtual_protect;
307 struct
308 {
309 enum apc_type type;
310 const void *addr;
311 unsigned long size;
312 } virtual_flush;
313 struct
314 {
315 enum apc_type type;
316 void *addr;
317 unsigned long size;
318 } virtual_lock;
319 struct
320 {
321 enum apc_type type;
322 void *addr;
323 unsigned long size;
324 } virtual_unlock;
325 struct
326 {
327 enum apc_type type;
328 obj_handle_t handle;
329 void *addr;
330 unsigned long size;
331 file_pos_t offset;
332 unsigned int zero_bits;
333 unsigned int alloc_type;
334 unsigned int prot;
335 } map_view;
336 struct
337 {
338 enum apc_type type;
339 void *addr;
340 } unmap_view;
341 struct
342 {
343 enum apc_type type;
344 void (__stdcall *func)(void*);
345 void *arg;
346 unsigned long reserve;
347 unsigned long commit;
348 int suspend;
349 } create_thread;
350 } apc_call_t;
351
352 typedef union
353 {
354 enum apc_type type;
355 struct
356 {
357 enum apc_type type;
358 unsigned int status;
359 unsigned long total;
360 } async_io;
361 struct
362 {
363 enum apc_type type;
364 unsigned int status;
365 void *addr;
366 unsigned long size;
367 } virtual_alloc;
368 struct
369 {
370 enum apc_type type;
371 unsigned int status;
372 void *addr;
373 unsigned long size;
374 } virtual_free;
375 struct
376 {
377 enum apc_type type;
378 unsigned int status;
379 void *base;
380 void *alloc_base;
381 unsigned long size;
382 unsigned int state;
383 unsigned int prot;
384 unsigned int alloc_prot;
385 unsigned int alloc_type;
386 } virtual_query;
387 struct
388 {
389 enum apc_type type;
390 unsigned int status;
391 void *addr;
392 unsigned long size;
393 unsigned int prot;
394 } virtual_protect;
395 struct
396 {
397 enum apc_type type;
398 unsigned int status;
399 const void *addr;
400 unsigned long size;
401 } virtual_flush;
402 struct
403 {
404 enum apc_type type;
405 unsigned int status;
406 void *addr;
407 unsigned long size;
408 } virtual_lock;
409 struct
410 {
411 enum apc_type type;
412 unsigned int status;
413 void *addr;
414 unsigned long size;
415 } virtual_unlock;
416 struct
417 {
418 enum apc_type type;
419 unsigned int status;
420 void *addr;
421 unsigned long size;
422 } map_view;
423 struct
424 {
425 enum apc_type type;
426 unsigned int status;
427 } unmap_view;
428 struct
429 {
430 enum apc_type type;
431 unsigned int status;
432 thread_id_t tid;
433 obj_handle_t handle;
434 } create_thread;
435 } apc_result_t;
436
437
438
439
440
441 struct new_process_request
442 {
443 struct request_header __header;
444 int inherit_all;
445 unsigned int create_flags;
446 int socket_fd;
447 obj_handle_t exe_file;
448 obj_handle_t hstdin;
449 obj_handle_t hstdout;
450 obj_handle_t hstderr;
451 unsigned int process_access;
452 unsigned int process_attr;
453 unsigned int thread_access;
454 unsigned int thread_attr;
455 /* VARARG(info,startup_info); */
456 /* VARARG(env,unicode_str); */
457 };
458 struct new_process_reply
459 {
460 struct reply_header __header;
461 obj_handle_t info;
462 process_id_t pid;
463 obj_handle_t phandle;
464 thread_id_t tid;
465 obj_handle_t thandle;
466 };
467
468
469
470 struct get_new_process_info_request
471 {
472 struct request_header __header;
473 obj_handle_t info;
474 };
475 struct get_new_process_info_reply
476 {
477 struct reply_header __header;
478 int success;
479 int exit_code;
480 };
481
482
483
484 struct new_thread_request
485 {
486 struct request_header __header;
487 unsigned int access;
488 unsigned int attributes;
489 int suspend;
490 int request_fd;
491 };
492 struct new_thread_reply
493 {
494 struct reply_header __header;
495 thread_id_t tid;
496 obj_handle_t handle;
497 };
498
499
500
501 struct get_startup_info_request
502 {
503 struct request_header __header;
504 };
505 struct get_startup_info_reply
506 {
507 struct reply_header __header;
508 obj_handle_t exe_file;
509 obj_handle_t hstdin;
510 obj_handle_t hstdout;
511 obj_handle_t hstderr;
512 /* VARARG(info,startup_info); */
513 /* VARARG(env,unicode_str); */
514 };
515
516
517
518 struct init_process_done_request
519 {
520 struct request_header __header;
521 void* module;
522 void* entry;
523 int gui;
524 };
525 struct init_process_done_reply
526 {
527 struct reply_header __header;
528 };
529
530
531
532 struct init_thread_request
533 {
534 struct request_header __header;
535 int unix_pid;
536 int unix_tid;
537 int debug_level;
538 void* teb;
539 void* peb;
540 void* entry;
541 void* ldt_copy;
542 int reply_fd;
543 int wait_fd;
544 };
545 struct init_thread_reply
546 {
547 struct reply_header __header;
548 process_id_t pid;
549 thread_id_t tid;
550 data_size_t info_size;
551 timeout_t server_start;
552 int version;
553 };
554
555
556
557 struct terminate_process_request
558 {
559 struct request_header __header;
560 obj_handle_t handle;
561 int exit_code;
562 };
563 struct terminate_process_reply
564 {
565 struct reply_header __header;
566 int self;
567 };
568
569
570
571 struct terminate_thread_request
572 {
573 struct request_header __header;
574 obj_handle_t handle;
575 int exit_code;
576 };
577 struct terminate_thread_reply
578 {
579 struct reply_header __header;
580 int self;
581 int last;
582 };
583
584
585
586 struct get_process_info_request
587 {
588 struct request_header __header;
589 obj_handle_t handle;
590 };
591 struct get_process_info_reply
592 {
593 struct reply_header __header;
594 process_id_t pid;
595 process_id_t ppid;
596 int exit_code;
597 int priority;
598 unsigned int affinity;
599 void* peb;
600 timeout_t start_time;
601 timeout_t end_time;
602 };
603
604
605
606 struct set_process_info_request
607 {
608 struct request_header __header;
609 obj_handle_t handle;
610 int mask;
611 int priority;
612 unsigned int affinity;
613 };
614 struct set_process_info_reply
615 {
616 struct reply_header __header;
617 };
618 #define SET_PROCESS_INFO_PRIORITY 0x01
619 #define SET_PROCESS_INFO_AFFINITY 0x02
620
621
622
623 struct get_thread_info_request
624 {
625 struct request_header __header;
626 obj_handle_t handle;
627 thread_id_t tid_in;
628 };
629 struct get_thread_info_reply
630 {
631 struct reply_header __header;
632 process_id_t pid;
633 thread_id_t tid;
634 void* teb;
635 int exit_code;
636 int priority;
637 unsigned int affinity;
638 timeout_t creation_time;
639 timeout_t exit_time;
640 int last;
641 };
642
643
644
645 struct set_thread_info_request
646 {
647 struct request_header __header;
648 obj_handle_t handle;
649 int mask;
650 int priority;
651 unsigned int affinity;
652 obj_handle_t token;
653 };
654 struct set_thread_info_reply
655 {
656 struct reply_header __header;
657 };
658 #define SET_THREAD_INFO_PRIORITY 0x01
659 #define SET_THREAD_INFO_AFFINITY 0x02
660 #define SET_THREAD_INFO_TOKEN 0x04
661
662
663
664 struct get_dll_info_request
665 {
666 struct request_header __header;
667 obj_handle_t handle;
668 void* base_address;
669 };
670 struct get_dll_info_reply
671 {
672 struct reply_header __header;
673 size_t size;
674 void* entry_point;
675 data_size_t filename_len;
676 /* VARARG(filename,unicode_str); */
677 };
678
679
680
681 struct suspend_thread_request
682 {
683 struct request_header __header;
684 obj_handle_t handle;
685 };
686 struct suspend_thread_reply
687 {
688 struct reply_header __header;
689 int count;
690 };
691
692
693
694 struct resume_thread_request
695 {
696 struct request_header __header;
697 obj_handle_t handle;
698 };
699 struct resume_thread_reply
700 {
701 struct reply_header __header;
702 int count;
703 };
704
705
706
707 struct load_dll_request
708 {
709 struct request_header __header;
710 obj_handle_t handle;
711 void* base;
712 size_t size;
713 int dbg_offset;
714 int dbg_size;
715 void* name;
716 /* VARARG(filename,unicode_str); */
717 };
718 struct load_dll_reply
719 {
720 struct reply_header __header;
721 };
722
723
724
725 struct unload_dll_request
726 {
727 struct request_header __header;
728 void* base;
729 };
730 struct unload_dll_reply
731 {
732 struct reply_header __header;
733 };
734
735
736
737 struct queue_apc_request
738 {
739 struct request_header __header;
740 obj_handle_t thread;
741 obj_handle_t process;
742 apc_call_t call;
743 };
744 struct queue_apc_reply
745 {
746 struct reply_header __header;
747 obj_handle_t handle;
748 int self;
749 };
750
751
752
753 struct get_apc_result_request
754 {
755 struct request_header __header;
756 obj_handle_t handle;
757 };
758 struct get_apc_result_reply
759 {
760 struct reply_header __header;
761 apc_result_t result;
762 };
763
764
765
766 struct close_handle_request
767 {
768 struct request_header __header;
769 obj_handle_t handle;
770 };
771 struct close_handle_reply
772 {
773 struct reply_header __header;
774 };
775
776
777
778 struct set_handle_info_request
779 {
780 struct request_header __header;
781 obj_handle_t handle;
782 int flags;
783 int mask;
784 };
785 struct set_handle_info_reply
786 {
787 struct reply_header __header;
788 int old_flags;
789 };
790
791
792
793 struct dup_handle_request
794 {
795 struct request_header __header;
796 obj_handle_t src_process;
797 obj_handle_t src_handle;
798 obj_handle_t dst_process;
799 unsigned int access;
800 unsigned int attributes;
801 unsigned int options;
802 };
803 struct dup_handle_reply
804 {
805 struct reply_header __header;
806 obj_handle_t handle;
807 int self;
808 int closed;
809 };
810 #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
811 #define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
812 #define DUP_HANDLE_MAKE_GLOBAL 0x80000000
813
814
815
816 struct open_process_request
817 {
818 struct request_header __header;
819 process_id_t pid;
820 unsigned int access;
821 unsigned int attributes;
822 };
823 struct open_process_reply
824 {
825 struct reply_header __header;
826 obj_handle_t handle;
827 };
828
829
830
831 struct open_thread_request
832 {
833 struct request_header __header;
834 thread_id_t tid;
835 unsigned int access;
836 unsigned int attributes;
837 };
838 struct open_thread_reply
839 {
840 struct reply_header __header;
841 obj_handle_t handle;
842 };
843
844
845
846 struct select_request
847 {
848 struct request_header __header;
849 int flags;
850 void* cookie;
851 obj_handle_t signal;
852 obj_handle_t prev_apc;
853 timeout_t timeout;
854 /* VARARG(result,apc_result); */
855 /* VARARG(handles,handles); */
856 };
857 struct select_reply
858 {
859 struct reply_header __header;
860 obj_handle_t apc_handle;
861 timeout_t timeout;
862 apc_call_t call;
863 };
864 #define SELECT_ALL 1
865 #define SELECT_ALERTABLE 2
866 #define SELECT_INTERRUPTIBLE 4
867
868
869
870 struct create_event_request
871 {
872 struct request_header __header;
873 unsigned int access;
874 unsigned int attributes;
875 int manual_reset;
876 int initial_state;
877 /* VARARG(objattr,object_attributes); */
878 };
879 struct create_event_reply
880 {
881 struct reply_header __header;
882 obj_handle_t handle;
883 };
884
885
886 struct event_op_request
887 {
888 struct request_header __header;
889 obj_handle_t handle;
890 int op;
891 };
892 struct event_op_reply
893 {
894 struct reply_header __header;
895 };
896 enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
897
898
899
900 struct open_event_request
901 {
902 struct request_header __header;
903 unsigned int access;
904 unsigned int attributes;
905 obj_handle_t rootdir;
906 /* VARARG(name,unicode_str); */
907 };
908 struct open_event_reply
909 {
910 struct reply_header __header;
911 obj_handle_t handle;
912 };
913
914
915
916 struct create_mutex_request
917 {
918 struct request_header __header;
919 unsigned int access;
920 unsigned int attributes;
921 int owned;
922 /* VARARG(objattr,object_attributes); */
923 };
924 struct create_mutex_reply
925 {
926 struct reply_header __header;
927 obj_handle_t handle;
928 };
929
930
931
932 struct release_mutex_request
933 {
934 struct request_header __header;
935 obj_handle_t handle;
936 };
937 struct release_mutex_reply
938 {
939 struct reply_header __header;
940 unsigned int prev_count;
941 };
942
943
944
945 struct open_mutex_request
946 {
947 struct request_header __header;
948 unsigned int access;
949 unsigned int attributes;
950 obj_handle_t rootdir;
951 /* VARARG(name,unicode_str); */
952 };
953 struct open_mutex_reply
954 {
955 struct reply_header __header;
956 obj_handle_t handle;
957 };
958
959
960
961 struct create_semaphore_request
962 {
963 struct request_header __header;
964 unsigned int access;
965 unsigned int attributes;
966 unsigned int initial;
967 unsigned int max;
968 /* VARARG(objattr,object_attributes); */
969 };
970 struct create_semaphore_reply
971 {
972 struct reply_header __header;
973 obj_handle_t handle;
974 };
975
976
977
978 struct release_semaphore_request
979 {
980 struct request_header __header;
981 obj_handle_t handle;
982 unsigned int count;
983 };
984 struct release_semaphore_reply
985 {
986 struct reply_header __header;
987 unsigned int prev_count;
988 };
989
990
991
992 struct open_semaphore_request
993 {
994 struct request_header __header;
995 unsigned int access;
996 unsigned int attributes;
997 obj_handle_t rootdir;
998 /* VARARG(name,unicode_str); */
999 };
1000 struct open_semaphore_reply
1001 {
1002 struct reply_header __header;
1003 obj_handle_t handle;
1004 };
1005
1006
1007
1008 struct create_file_request
1009 {
1010 struct request_header __header;
1011 unsigned int access;
1012 unsigned int attributes;
1013 unsigned int sharing;
1014 int create;
1015 unsigned int options;
1016 unsigned int attrs;
1017 /* VARARG(objattr,object_attributes); */
1018 /* VARARG(filename,string); */
1019 };
1020 struct create_file_reply
1021 {
1022 struct reply_header __header;
1023 obj_handle_t handle;
1024 };
1025
1026
1027
1028 struct open_file_object_request
1029 {
1030 struct request_header __header;
1031 unsigned int access;
1032 unsigned int attributes;
1033 obj_handle_t rootdir;
1034 unsigned int sharing;
1035 unsigned int options;
1036 /* VARARG(filename,unicode_str); */
1037 };
1038 struct open_file_object_reply
1039 {
1040 struct reply_header __header;
1041 obj_handle_t handle;
1042 };
1043
1044
1045
1046 struct alloc_file_handle_request
1047 {
1048 struct request_header __header;
1049 unsigned int access;
1050 unsigned int attributes;
1051 int fd;
1052 };
1053 struct alloc_file_handle_reply
1054 {
1055 struct reply_header __header;
1056 obj_handle_t handle;
1057 };
1058
1059
1060
1061 struct get_handle_fd_request
1062 {
1063 struct request_header __header;
1064 obj_handle_t handle;
1065 };
1066 struct get_handle_fd_reply
1067 {
1068 struct reply_header __header;
1069 int type;
1070 int removable;
1071 unsigned int access;
1072 unsigned int options;
1073 };
1074 enum server_fd_type
1075 {
1076 FD_TYPE_INVALID,
1077<