diff --git a/include/wine/server.h b/include/wine/server.h index 45ae2271af1..16a9767e8ed 100644 --- a/include/wine/server.h +++ b/include/wine/server.h @@ -51,7 +51,7 @@ struct __server_request_info extern unsigned int wine_server_call( void *req_ptr ); extern void wine_server_send_fd( int fd ); -extern int wine_server_handle_to_fd( handle_t handle, unsigned int access, int *unix_fd, +extern int wine_server_handle_to_fd( obj_handle_t handle, unsigned int access, int *unix_fd, enum fd_type *type, int *flags ); /* do a server call and set the last error code */ diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index 1f4445245aa..a769789f2dd 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -32,10 +32,7 @@ struct request_max_size int pad[16]; }; - -#define REQUEST_MAX_VAR_SIZE 1024 - -typedef int handle_t; +typedef int obj_handle_t; typedef unsigned short atom_t; typedef unsigned int user_handle_t; @@ -51,35 +48,35 @@ struct debug_event_exception }; struct debug_event_create_thread { - handle_t handle; - void *teb; - void *start; + obj_handle_t handle; + void *teb; + void *start; }; struct debug_event_create_process { - handle_t file; - handle_t process; - handle_t thread; - void *base; - int dbg_offset; - int dbg_size; - void *teb; - void *start; - void *name; - int unicode; + obj_handle_t file; + obj_handle_t process; + obj_handle_t thread; + void *base; + int dbg_offset; + int dbg_size; + void *teb; + void *start; + void *name; + int unicode; }; struct debug_event_exit { - int exit_code; + int exit_code; }; struct debug_event_load_dll { - handle_t handle; - void *base; - int dbg_offset; - int dbg_size; - void *name; - int unicode; + obj_handle_t handle; + void *base; + int dbg_offset; + int dbg_size; + void *name; + int unicode; }; struct debug_event_unload_dll { @@ -157,7 +154,7 @@ typedef struct { atom_t atom; short string; - handle_t handle; + obj_handle_t handle; } property_data_t; @@ -186,16 +183,16 @@ struct new_process_request int inherit_all; int use_handles; int create_flags; - handle_t exe_file; - handle_t hstdin; - handle_t hstdout; - handle_t hstderr; + obj_handle_t exe_file; + obj_handle_t hstdin; + obj_handle_t hstdout; + obj_handle_t hstderr; /* VARARG(info,startup_info); */ }; struct new_process_reply { struct reply_header __header; - handle_t info; + obj_handle_t info; }; @@ -203,7 +200,7 @@ struct new_process_reply struct get_new_process_info_request { struct request_header __header; - handle_t info; + obj_handle_t info; int pinherit; int tinherit; }; @@ -211,9 +208,9 @@ struct get_new_process_info_reply { struct reply_header __header; void* pid; - handle_t phandle; + obj_handle_t phandle; void* tid; - handle_t thandle; + obj_handle_t thandle; int success; }; @@ -230,7 +227,7 @@ struct new_thread_reply { struct reply_header __header; void* tid; - handle_t handle; + obj_handle_t handle; }; @@ -259,10 +256,10 @@ struct init_process_reply int create_flags; unsigned int server_start; size_t info_size; - handle_t exe_file; - handle_t hstdin; - handle_t hstdout; - handle_t hstderr; + obj_handle_t exe_file; + obj_handle_t hstdin; + obj_handle_t hstdout; + obj_handle_t hstderr; }; @@ -286,7 +283,7 @@ struct init_process_done_request size_t module_size; void* entry; void* name; - handle_t exe_file; + obj_handle_t exe_file; int gui; /* VARARG(filename,string); */ }; @@ -321,7 +318,7 @@ struct init_thread_reply struct terminate_process_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; int exit_code; }; struct terminate_process_reply @@ -335,7 +332,7 @@ struct terminate_process_reply struct terminate_thread_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; int exit_code; }; struct terminate_thread_reply @@ -350,7 +347,7 @@ struct terminate_thread_reply struct get_process_info_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; }; struct get_process_info_reply { @@ -368,7 +365,7 @@ struct get_process_info_reply struct set_process_info_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; int mask; int priority; int affinity; @@ -385,7 +382,7 @@ struct set_process_info_reply struct get_thread_info_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; void* tid_in; }; struct get_thread_info_reply @@ -402,7 +399,7 @@ struct get_thread_info_reply struct set_thread_info_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; int mask; int priority; int affinity; @@ -419,7 +416,7 @@ struct set_thread_info_reply struct suspend_thread_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; }; struct suspend_thread_reply { @@ -432,7 +429,7 @@ struct suspend_thread_reply struct resume_thread_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; }; struct resume_thread_reply { @@ -445,7 +442,7 @@ struct resume_thread_reply struct load_dll_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; void* base; size_t size; int dbg_offset; @@ -475,7 +472,7 @@ struct unload_dll_reply struct queue_apc_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; int user; void* func; void* param; @@ -506,7 +503,7 @@ enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC, APC_ASYNC_IO }; struct close_handle_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; }; struct close_handle_reply { @@ -519,7 +516,7 @@ struct close_handle_reply struct set_handle_info_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; int flags; int mask; int fd; @@ -536,9 +533,9 @@ struct set_handle_info_reply struct dup_handle_request { struct request_header __header; - handle_t src_process; - handle_t src_handle; - handle_t dst_process; + obj_handle_t src_process; + obj_handle_t src_handle; + obj_handle_t dst_process; unsigned int access; int inherit; int options; @@ -546,7 +543,7 @@ struct dup_handle_request struct dup_handle_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; int fd; }; #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE @@ -565,7 +562,7 @@ struct open_process_request struct open_process_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; @@ -580,7 +577,7 @@ struct open_thread_request struct open_thread_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; @@ -616,14 +613,14 @@ struct create_event_request struct create_event_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; struct event_op_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; int op; }; struct event_op_reply @@ -644,7 +641,7 @@ struct open_event_request struct open_event_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; @@ -659,7 +656,7 @@ struct create_mutex_request struct create_mutex_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; @@ -667,7 +664,7 @@ struct create_mutex_reply struct release_mutex_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; }; struct release_mutex_reply { @@ -686,7 +683,7 @@ struct open_mutex_request struct open_mutex_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; @@ -702,7 +699,7 @@ struct create_semaphore_request struct create_semaphore_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; @@ -710,7 +707,7 @@ struct create_semaphore_reply struct release_semaphore_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; unsigned int count; }; struct release_semaphore_reply @@ -731,7 +728,7 @@ struct open_semaphore_request struct open_semaphore_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; @@ -750,7 +747,7 @@ struct create_file_request struct create_file_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; @@ -765,7 +762,7 @@ struct alloc_file_handle_request struct alloc_file_handle_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; @@ -773,7 +770,7 @@ struct alloc_file_handle_reply struct get_handle_fd_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; unsigned int access; }; struct get_handle_fd_reply @@ -800,7 +797,7 @@ enum fd_type struct set_file_pointer_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; int low; int high; int whence; @@ -817,7 +814,7 @@ struct set_file_pointer_reply struct truncate_file_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; }; struct truncate_file_reply { @@ -829,7 +826,7 @@ struct truncate_file_reply struct set_file_time_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; time_t access_time; time_t write_time; }; @@ -843,7 +840,7 @@ struct set_file_time_reply struct flush_file_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; }; struct flush_file_reply { @@ -855,7 +852,7 @@ struct flush_file_reply struct get_file_info_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; }; struct get_file_info_reply { @@ -877,7 +874,7 @@ struct get_file_info_reply struct lock_file_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; unsigned int offset_low; unsigned int offset_high; unsigned int count_low; @@ -893,7 +890,7 @@ struct lock_file_reply struct unlock_file_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; unsigned int offset_low; unsigned int offset_high; unsigned int count_low; @@ -914,8 +911,8 @@ struct create_pipe_request struct create_pipe_reply { struct reply_header __header; - handle_t handle_read; - handle_t handle_write; + obj_handle_t handle_read; + obj_handle_t handle_write; }; @@ -933,7 +930,7 @@ struct create_socket_request struct create_socket_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; @@ -941,14 +938,14 @@ struct create_socket_reply struct accept_socket_request { struct request_header __header; - handle_t lhandle; + obj_handle_t lhandle; unsigned int access; int inherit; }; struct accept_socket_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; @@ -956,9 +953,9 @@ struct accept_socket_reply struct set_socket_event_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; unsigned int mask; - handle_t event; + obj_handle_t event; user_handle_t window; unsigned int msg; }; @@ -972,9 +969,9 @@ struct set_socket_event_reply struct get_socket_event_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; int service; - handle_t c_event; + obj_handle_t c_event; }; struct get_socket_event_reply { @@ -990,7 +987,7 @@ struct get_socket_event_reply struct enable_socket_event_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; unsigned int mask; unsigned int sstate; unsigned int cstate; @@ -1003,8 +1000,8 @@ struct enable_socket_event_reply struct set_socket_deferred_request { struct request_header __header; - handle_t handle; - handle_t deferred; + obj_handle_t handle; + obj_handle_t deferred; }; struct set_socket_deferred_reply { @@ -1022,8 +1019,8 @@ struct alloc_console_request struct alloc_console_reply { struct reply_header __header; - handle_t handle_in; - handle_t event; + obj_handle_t handle_in; + obj_handle_t event; }; @@ -1086,7 +1083,7 @@ struct console_renderer_event struct get_console_renderer_events_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; }; struct get_console_renderer_events_reply { @@ -1108,7 +1105,7 @@ struct open_console_request struct open_console_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; @@ -1116,7 +1113,7 @@ struct open_console_reply struct get_console_mode_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; }; struct get_console_mode_reply { @@ -1129,7 +1126,7 @@ struct get_console_mode_reply struct set_console_mode_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; int mode; }; struct set_console_mode_reply @@ -1142,9 +1139,9 @@ struct set_console_mode_reply struct set_console_input_info_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; int mask; - handle_t active_sb; + obj_handle_t active_sb; int history_mode; int history_size; /* VARARG(title,unicode_str); */ @@ -1163,7 +1160,7 @@ struct set_console_input_info_reply struct get_console_input_info_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; }; struct get_console_input_info_reply { @@ -1179,7 +1176,7 @@ struct get_console_input_info_reply struct append_console_input_history_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; /* VARARG(line,unicode_str); */ }; struct append_console_input_history_reply @@ -1192,7 +1189,7 @@ struct append_console_input_history_reply struct get_console_input_history_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; int index; }; struct get_console_input_history_reply @@ -1207,7 +1204,7 @@ struct get_console_input_history_reply struct create_console_output_request { struct request_header __header; - handle_t handle_in; + obj_handle_t handle_in; int access; int share; int inherit; @@ -1215,7 +1212,7 @@ struct create_console_output_request struct create_console_output_reply { struct reply_header __header; - handle_t handle_out; + obj_handle_t handle_out; }; @@ -1223,7 +1220,7 @@ struct create_console_output_reply struct set_console_output_info_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; int mask; short int cursor_size; short int cursor_visible; @@ -1255,7 +1252,7 @@ struct set_console_output_info_reply struct get_console_output_info_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; }; struct get_console_output_info_reply { @@ -1279,7 +1276,7 @@ struct get_console_output_info_reply struct write_console_input_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; /* VARARG(rec,input_records); */ }; struct write_console_input_reply @@ -1293,7 +1290,7 @@ struct write_console_input_reply struct read_console_input_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; int flush; }; struct read_console_input_reply @@ -1308,7 +1305,7 @@ struct read_console_input_reply struct write_console_output_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; int x; int y; int mode; @@ -1335,7 +1332,7 @@ enum char_info_mode struct fill_console_output_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; int x; int y; int mode; @@ -1354,7 +1351,7 @@ struct fill_console_output_reply struct read_console_output_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; int x; int y; int mode; @@ -1372,7 +1369,7 @@ struct read_console_output_reply struct move_console_output_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; short int x_src; short int y_src; short int x_dst; @@ -1396,7 +1393,7 @@ struct create_change_notification_request struct create_change_notification_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; @@ -1408,13 +1405,13 @@ struct create_mapping_request int size_low; int protect; int inherit; - handle_t file_handle; + obj_handle_t file_handle; /* VARARG(name,unicode_str); */ }; struct create_mapping_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; #define VPROT_READ 0x01 @@ -1438,7 +1435,7 @@ struct open_mapping_request struct open_mapping_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; @@ -1446,7 +1443,7 @@ struct open_mapping_reply struct get_mapping_info_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; }; struct get_mapping_info_reply { @@ -1456,7 +1453,7 @@ struct get_mapping_info_reply int protect; int header_size; void* base; - handle_t shared_file; + obj_handle_t shared_file; int shared_size; int drive_type; }; @@ -1473,7 +1470,7 @@ struct create_device_request struct create_device_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; @@ -1488,7 +1485,7 @@ struct create_snapshot_request struct create_snapshot_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; @@ -1496,7 +1493,7 @@ struct create_snapshot_reply struct next_process_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; int reset; }; struct next_process_reply @@ -1517,7 +1514,7 @@ struct next_process_reply struct next_thread_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; int reset; }; struct next_thread_reply @@ -1535,7 +1532,7 @@ struct next_thread_reply struct next_module_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; int reset; }; struct next_module_reply @@ -1559,7 +1556,7 @@ struct wait_debug_event_reply struct reply_header __header; void* pid; void* tid; - handle_t wait; + obj_handle_t wait; /* VARARG(event,debug_event); */ }; @@ -1574,7 +1571,7 @@ struct queue_exception_event_request struct queue_exception_event_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; @@ -1582,7 +1579,7 @@ struct queue_exception_event_reply struct get_exception_status_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; }; struct get_exception_status_reply { @@ -1637,7 +1634,7 @@ struct debug_process_reply struct debug_break_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; }; struct debug_break_reply { @@ -1662,7 +1659,7 @@ struct set_debugger_kill_on_exit_reply struct read_process_memory_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; void* addr; }; struct read_process_memory_reply @@ -1676,7 +1673,7 @@ struct read_process_memory_reply struct write_process_memory_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; void* addr; unsigned int first_mask; unsigned int last_mask; @@ -1692,7 +1689,7 @@ struct write_process_memory_reply struct create_key_request { struct request_header __header; - handle_t parent; + obj_handle_t parent; unsigned int access; unsigned int options; time_t modif; @@ -1703,7 +1700,7 @@ struct create_key_request struct create_key_reply { struct reply_header __header; - handle_t hkey; + obj_handle_t hkey; int created; }; @@ -1711,14 +1708,14 @@ struct create_key_reply struct open_key_request { struct request_header __header; - handle_t parent; + obj_handle_t parent; unsigned int access; /* VARARG(name,unicode_str); */ }; struct open_key_reply { struct reply_header __header; - handle_t hkey; + obj_handle_t hkey; }; @@ -1726,7 +1723,7 @@ struct open_key_reply struct delete_key_request { struct request_header __header; - handle_t hkey; + obj_handle_t hkey; }; struct delete_key_reply { @@ -1738,7 +1735,7 @@ struct delete_key_reply struct enum_key_request { struct request_header __header; - handle_t hkey; + obj_handle_t hkey; int index; int info_class; }; @@ -1763,7 +1760,7 @@ struct enum_key_reply struct set_key_value_request { struct request_header __header; - handle_t hkey; + obj_handle_t hkey; int type; size_t namelen; /* VARARG(name,unicode_str,namelen); */ @@ -1779,7 +1776,7 @@ struct set_key_value_reply struct get_key_value_request { struct request_header __header; - handle_t hkey; + obj_handle_t hkey; /* VARARG(name,unicode_str); */ }; struct get_key_value_reply @@ -1795,7 +1792,7 @@ struct get_key_value_reply struct enum_key_value_request { struct request_header __header; - handle_t hkey; + obj_handle_t hkey; int index; int info_class; }; @@ -1814,7 +1811,7 @@ struct enum_key_value_reply struct delete_key_value_request { struct request_header __header; - handle_t hkey; + obj_handle_t hkey; /* VARARG(name,unicode_str); */ }; struct delete_key_value_reply @@ -1827,8 +1824,8 @@ struct delete_key_value_reply struct load_registry_request { struct request_header __header; - handle_t hkey; - handle_t file; + obj_handle_t hkey; + obj_handle_t file; /* VARARG(name,unicode_str); */ }; struct load_registry_reply @@ -1841,8 +1838,8 @@ struct load_registry_reply struct save_registry_request { struct request_header __header; - handle_t hkey; - handle_t file; + obj_handle_t hkey; + obj_handle_t file; }; struct save_registry_reply { @@ -1854,7 +1851,7 @@ struct save_registry_reply struct save_registry_atexit_request { struct request_header __header; - handle_t hkey; + obj_handle_t hkey; /* VARARG(file,string); */ }; struct save_registry_atexit_reply @@ -1888,7 +1885,7 @@ struct create_timer_request struct create_timer_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; @@ -1903,14 +1900,14 @@ struct open_timer_request struct open_timer_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; struct set_timer_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; int sec; int usec; int period; @@ -1926,7 +1923,7 @@ struct set_timer_reply struct cancel_timer_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; }; struct cancel_timer_reply { @@ -1938,7 +1935,7 @@ struct cancel_timer_reply struct get_thread_context_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; unsigned int flags; }; struct get_thread_context_reply @@ -1952,7 +1949,7 @@ struct get_thread_context_reply struct set_thread_context_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; unsigned int flags; /* VARARG(context,context); */ }; @@ -1966,7 +1963,7 @@ struct set_thread_context_reply struct get_selector_entry_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; int entry; }; struct get_selector_entry_reply @@ -2054,7 +2051,7 @@ struct get_msg_queue_request struct get_msg_queue_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; @@ -2092,13 +2089,13 @@ struct get_queue_status_reply struct wait_input_idle_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; int timeout; }; struct wait_input_idle_reply { struct reply_header __header; - handle_t event; + obj_handle_t event; }; @@ -2236,7 +2233,7 @@ struct create_serial_request struct create_serial_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; @@ -2244,7 +2241,7 @@ struct create_serial_reply struct get_serial_info_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; }; struct get_serial_info_reply { @@ -2263,7 +2260,7 @@ struct get_serial_info_reply struct set_serial_info_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; int flags; unsigned int readinterval; unsigned int readconst; @@ -2286,7 +2283,7 @@ struct set_serial_info_reply struct register_async_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; int type; void* overlapped; int count; @@ -2317,7 +2314,7 @@ struct create_named_pipe_request struct create_named_pipe_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; @@ -2331,7 +2328,7 @@ struct open_named_pipe_request struct open_named_pipe_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; @@ -2339,7 +2336,7 @@ struct open_named_pipe_reply struct connect_named_pipe_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; void* overlapped; void* func; }; @@ -2368,7 +2365,7 @@ struct wait_named_pipe_reply struct disconnect_named_pipe_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; }; struct disconnect_named_pipe_reply { @@ -2379,7 +2376,7 @@ struct disconnect_named_pipe_reply struct get_named_pipe_info_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; }; struct get_named_pipe_info_reply { @@ -2403,14 +2400,14 @@ struct create_smb_request struct create_smb_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; struct get_smb_info_request { struct request_header __header; - handle_t handle; + obj_handle_t handle; unsigned int flags; unsigned int offset; }; @@ -2664,7 +2661,7 @@ struct set_window_property_request user_handle_t window; atom_t atom; int string; - handle_t handle; + obj_handle_t handle; }; struct set_window_property_reply { @@ -2682,7 +2679,7 @@ struct remove_window_property_request struct remove_window_property_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; @@ -2696,7 +2693,7 @@ struct get_window_property_request struct get_window_property_reply { struct reply_header __header; - handle_t handle; + obj_handle_t handle; }; diff --git a/programs/wineconsole/wineconsole.c b/programs/wineconsole/wineconsole.c index c6bd2c3ad60..7f2a87d3a93 100644 --- a/programs/wineconsole/wineconsole.c +++ b/programs/wineconsole/wineconsole.c @@ -39,7 +39,7 @@ void WINECON_FetchCells(struct inner_data* data, int upd_tp, int upd_bm) { SERVER_START_REQ( read_console_output ) { - req->handle = (handle_t)data->hConOut; + req->handle = (obj_handle_t)data->hConOut; req->x = 0; req->y = upd_tp; req->mode = CHAR_INFO_MODE_TEXTATTR; @@ -61,7 +61,7 @@ void WINECON_NotifyWindowChange(struct inner_data* data) { SERVER_START_REQ( set_console_output_info ) { - req->handle = (handle_t)data->hConOut; + req->handle = (obj_handle_t)data->hConOut; req->win_left = data->curcfg.win_pos.X; req->win_top = data->curcfg.win_pos.Y; req->win_right = data->curcfg.win_pos.X + data->curcfg.win_width - 1; @@ -83,7 +83,7 @@ int WINECON_GetHistorySize(HANDLE hConIn) SERVER_START_REQ(get_console_input_info) { - req->handle = (handle_t)hConIn; + req->handle = (obj_handle_t)hConIn; if (!wine_server_call_err( req )) ret = reply->history_size; } SERVER_END_REQ; @@ -101,7 +101,7 @@ BOOL WINECON_SetHistorySize(HANDLE hConIn, int size) SERVER_START_REQ(set_console_input_info) { - req->handle = (handle_t)hConIn; + req->handle = (obj_handle_t)hConIn; req->mask = SET_CONSOLE_INPUT_INFO_HISTORY_SIZE; req->history_size = size; ret = !wine_server_call_err( req ); @@ -122,7 +122,7 @@ int WINECON_GetHistoryMode(HANDLE hConIn) SERVER_START_REQ(get_console_input_info) { - req->handle = (handle_t)hConIn; + req->handle = (obj_handle_t)hConIn; if (!wine_server_call_err( req )) ret = reply->history_mode; } SERVER_END_REQ; @@ -140,7 +140,7 @@ BOOL WINECON_SetHistoryMode(HANDLE hConIn, int mode) SERVER_START_REQ(set_console_input_info) { - req->handle = (handle_t)hConIn; + req->handle = (obj_handle_t)hConIn; req->mask = SET_CONSOLE_INPUT_INFO_HISTORY_MODE; req->history_mode = mode; ret = !wine_server_call_err( req ); @@ -162,7 +162,7 @@ BOOL WINECON_GetConsoleTitle(HANDLE hConIn, WCHAR* buffer, size_t len) SERVER_START_REQ( get_console_input_info ) { - req->handle = (handle_t)hConIn; + req->handle = (obj_handle_t)hConIn; wine_server_set_reply( req, buffer, len - sizeof(WCHAR) ); if ((ret = !wine_server_call_err( req ))) { @@ -188,7 +188,7 @@ int WINECON_GrabChanges(struct inner_data* data) SERVER_START_REQ( get_console_renderer_events ) { wine_server_set_reply( req, evts, sizeof(evts) ); - req->handle = (handle_t)data->hSynchro; + req->handle = (obj_handle_t)data->hSynchro; if (!wine_server_call_err( req )) num = wine_server_reply_size(reply) / sizeof(evts[0]); else num = 0; } @@ -393,7 +393,7 @@ static struct inner_data* WINECON_Init(HINSTANCE hInst, void* pid) SERVER_START_REQ( set_console_input_info ) { - req->handle = (handle_t)data->hConIn; + req->handle = (obj_handle_t)data->hConIn; req->mask = SET_CONSOLE_INPUT_INFO_TITLE; wine_server_add_data( req, szTitle, strlenW(szTitle) * sizeof(WCHAR) ); ret = !wine_server_call_err( req ); @@ -403,7 +403,7 @@ static struct inner_data* WINECON_Init(HINSTANCE hInst, void* pid) SERVER_START_REQ(create_console_output) { - req->handle_in = (handle_t)data->hConIn; + req->handle_in = (obj_handle_t)data->hConIn; req->access = GENERIC_WRITE|GENERIC_READ; req->share = FILE_SHARE_READ|FILE_SHARE_WRITE; req->inherit = FALSE; diff --git a/scheduler/client.c b/scheduler/client.c index aabae962050..2c6ca68f396 100644 --- a/scheduler/client.c +++ b/scheduler/client.c @@ -277,7 +277,7 @@ void wine_server_send_fd( int fd ) * * Receive a file descriptor passed from the server. */ -static int receive_fd( handle_t *handle ) +static int receive_fd( obj_handle_t *handle ) { struct iovec vec; int ret, fd; @@ -336,7 +336,7 @@ static int receive_fd( handle_t *handle ) * Returns the new fd, which can be different if there was already an * fd in the cache for that handle. */ -inline static int store_cached_fd( int fd, handle_t handle ) +inline static int store_cached_fd( int fd, obj_handle_t handle ) { SERVER_START_REQ( set_handle_info ) { @@ -369,10 +369,10 @@ inline static int store_cached_fd( int fd, handle_t handle ) * * Retrieve the Unix fd corresponding to a file handle. */ -int wine_server_handle_to_fd( handle_t handle, unsigned int access, int *unix_fd, +int wine_server_handle_to_fd( obj_handle_t handle, unsigned int access, int *unix_fd, enum fd_type *type, int *flags ) { - handle_t fd_handle; + obj_handle_t fd_handle; int ret, fd = -1; *unix_fd = -1; @@ -580,7 +580,7 @@ void CLIENT_InitServer(void) char hostname[64]; char *oldcwd, *serverdir; const char *configdir; - handle_t dummy_handle; + obj_handle_t dummy_handle; /* retrieve the current directory */ for (size = 512; ; size *= 2) diff --git a/server/console.c b/server/console.c index fac9960643b..66787f88f8d 100644 --- a/server/console.c +++ b/server/console.c @@ -328,7 +328,7 @@ int free_console( struct process *process ) * 2/ parent is a renderer which launches process, and process should attach to the console * renderered by parent */ -void inherit_console(struct thread *parent_thread, struct process *process, handle_t hconin) +void inherit_console(struct thread *parent_thread, struct process *process, obj_handle_t hconin) { int done = 0; struct process* parent = parent_thread->process; @@ -360,7 +360,7 @@ void inherit_console(struct thread *parent_thread, struct process *process, hand } } -static struct console_input* console_input_get( handle_t handle, unsigned access ) +static struct console_input* console_input_get( obj_handle_t handle, unsigned access ) { struct console_input* console = 0; @@ -385,7 +385,7 @@ static int console_input_signaled( struct object *obj, struct thread *thread ) return console->recnum ? 1 : 0; } -static int get_console_mode( handle_t handle ) +static int get_console_mode( obj_handle_t handle ) { struct object *obj; int ret = 0; @@ -404,7 +404,7 @@ static int get_console_mode( handle_t handle ) } /* changes the mode of either a console input or a screen buffer */ -static int set_console_mode( handle_t handle, int mode ) +static int set_console_mode( obj_handle_t handle, int mode ) { struct object *obj; int ret = 0; @@ -451,7 +451,7 @@ static int write_console_input( struct console_input* console, int count, } /* retrieve a pointer to the console input records */ -static int read_console_input( handle_t handle, int count, int flush ) +static int read_console_input( obj_handle_t handle, int count, int flush ) { struct console_input *console; @@ -1038,7 +1038,7 @@ static void read_console_output( struct screen_buffer *screen_buffer, int x, int } /* scroll parts of a screen buffer */ -static void scroll_console_output( handle_t handle, int xsrc, int ysrc, int xdst, int ydst, +static void scroll_console_output( obj_handle_t handle, int xsrc, int ysrc, int xdst, int ydst, int w, int h ) { struct screen_buffer *screen_buffer; @@ -1101,8 +1101,8 @@ static void scroll_console_output( handle_t handle, int xsrc, int ysrc, int xdst /* allocate a console for the renderer */ DECL_HANDLER(alloc_console) { - handle_t in = 0; - handle_t evt = 0; + obj_handle_t in = 0; + obj_handle_t evt = 0; struct process *process; struct process *renderer = current->process; struct console_input *console; @@ -1180,7 +1180,7 @@ DECL_HANDLER(open_console) obj = grab_object( (struct object*)current->process->console->active ); break; default: - if ((obj = get_handle_obj( current->process, (handle_t)req->from, + if ((obj = get_handle_obj( current->process, (obj_handle_t)req->from, GENERIC_READ|GENERIC_WRITE, &console_input_ops ))) { struct console_input* console = (struct console_input*)obj; diff --git a/server/console.h b/server/console.h index 69b4c1ca0b9..7ac1ea3cb16 100644 --- a/server/console.h +++ b/server/console.h @@ -45,7 +45,7 @@ struct console_input /* console functions */ -extern void inherit_console(struct thread *parent_thread, struct process *process, handle_t hconin); +extern void inherit_console(struct thread *parent_thread, struct process *process, obj_handle_t hconin); extern int free_console( struct process *process ); #endif /* __WINE_SERVER_CONSOLE_H */ diff --git a/server/debugger.c b/server/debugger.c index dcf7e0ffe2a..409adc3d1bf 100644 --- a/server/debugger.c +++ b/server/debugger.c @@ -115,7 +115,7 @@ static int fill_create_thread_event( struct debug_event *event, void *arg ) { struct process *debugger = event->debugger->process; struct thread *thread = event->sender; - handle_t handle; + obj_handle_t handle; /* documented: THREAD_GET_CONTEXT | THREAD_SET_CONTEXT | THREAD_SUSPEND_RESUME */ if (!(handle = alloc_handle( debugger, thread, THREAD_ALL_ACCESS, FALSE ))) return 0; @@ -130,7 +130,7 @@ static int fill_create_process_event( struct debug_event *event, void *arg ) struct process *debugger = event->debugger->process; struct thread *thread = event->sender; struct process *process = thread->process; - handle_t handle; + obj_handle_t handle; /* documented: PROCESS_VM_READ | PROCESS_VM_WRITE */ if (!(handle = alloc_handle( debugger, process, PROCESS_ALL_ACCESS, FALSE ))) return 0; @@ -182,7 +182,7 @@ static int fill_load_dll_event( struct debug_event *event, void *arg ) { struct process *debugger = event->debugger->process; struct process_dll *dll = arg; - handle_t handle = 0; + obj_handle_t handle = 0; if (dll->file && !(handle = alloc_handle( debugger, dll->file, GENERIC_READ, FALSE ))) return 0; diff --git a/server/event.c b/server/event.c index 34509334ab0..020c70ca535 100644 --- a/server/event.c +++ b/server/event.c @@ -77,7 +77,7 @@ struct event *create_event( const WCHAR *name, size_t len, return event; } -struct event *get_event_obj( struct process *process, handle_t handle, unsigned int access ) +struct event *get_event_obj( struct process *process, obj_handle_t handle, unsigned int access ) { return (struct event *)get_handle_obj( process, handle, access, &event_ops ); } diff --git a/server/file.c b/server/file.c index cdfb58030c2..d8da51724d3 100644 --- a/server/file.c +++ b/server/file.c @@ -463,12 +463,12 @@ void file_set_error(void) } } -struct file *get_file_obj( struct process *process, handle_t handle, unsigned int access ) +struct file *get_file_obj( struct process *process, obj_handle_t handle, unsigned int access ) { return (struct file *)get_handle_obj( process, handle, access, &file_ops ); } -static int set_file_pointer( handle_t handle, unsigned int *low, int *high, int whence ) +static int set_file_pointer( obj_handle_t handle, unsigned int *low, int *high, int whence ) { struct file *file; off_t result,xto; @@ -548,7 +548,7 @@ int grow_file( struct file *file, int size_high, int size_low ) return ret; } -static int set_file_time( handle_t handle, time_t access_time, time_t write_time ) +static int set_file_time( obj_handle_t handle, time_t access_time, time_t write_time ) { struct file *file; struct utimbuf utimbuf; diff --git a/server/handle.c b/server/handle.c index d419d5972a1..89c92d08dfd 100644 --- a/server/handle.c +++ b/server/handle.c @@ -65,11 +65,11 @@ static struct handle_table *global_table; /* handle to table index conversion */ /* handles are a multiple of 4 under NT; handle 0 is not used */ -inline static handle_t index_to_handle( int index ) +inline static obj_handle_t index_to_handle( int index ) { - return (handle_t)((index + 1) << 2); + return (obj_handle_t)((index + 1) << 2); } -inline static int handle_to_index( handle_t handle ) +inline static int handle_to_index( obj_handle_t handle ) { return ((unsigned int)handle >> 2) - 1; } @@ -78,18 +78,18 @@ inline static int handle_to_index( handle_t handle ) #define HANDLE_OBFUSCATOR 0x544a4def -inline static int handle_is_global( handle_t handle) +inline static int handle_is_global( obj_handle_t handle) { return ((unsigned long)handle ^ HANDLE_OBFUSCATOR) < 0x10000; } -inline static handle_t handle_local_to_global( handle_t handle ) +inline static obj_handle_t handle_local_to_global( obj_handle_t handle ) { if (!handle) return 0; - return (handle_t)((unsigned long)handle ^ HANDLE_OBFUSCATOR); + return (obj_handle_t)((unsigned long)handle ^ HANDLE_OBFUSCATOR); } -inline static handle_t handle_global_to_local( handle_t handle ) +inline static obj_handle_t handle_global_to_local( obj_handle_t handle ) { - return (handle_t)((unsigned long)handle ^ HANDLE_OBFUSCATOR); + return (obj_handle_t)((unsigned long)handle ^ HANDLE_OBFUSCATOR); } @@ -189,7 +189,7 @@ static int grow_handle_table( struct handle_table *table ) } /* allocate the first free entry in the handle table */ -static handle_t alloc_entry( struct handle_table *table, void *obj, unsigned int access ) +static obj_handle_t alloc_entry( struct handle_table *table, void *obj, unsigned int access ) { struct handle_entry *entry = table->entries + table->free; int i; @@ -211,7 +211,7 @@ static handle_t alloc_entry( struct handle_table *table, void *obj, unsigned int /* allocate a handle for an object, incrementing its refcount */ /* return the handle, or 0 on error */ -handle_t alloc_handle( struct process *process, void *obj, unsigned int access, int inherit ) +obj_handle_t alloc_handle( struct process *process, void *obj, unsigned int access, int inherit ) { struct handle_table *table = (struct handle_table *)process->handles; @@ -223,7 +223,7 @@ handle_t alloc_handle( struct process *process, void *obj, unsigned int access, /* allocate a global handle for an object, incrementing its refcount */ /* return the handle, or 0 on error */ -static handle_t alloc_global_handle( void *obj, unsigned int access ) +static obj_handle_t alloc_global_handle( void *obj, unsigned int access ) { if (!global_table) { @@ -234,7 +234,7 @@ static handle_t alloc_global_handle( void *obj, unsigned int access ) } /* return a handle entry, or NULL if the handle is invalid */ -static struct handle_entry *get_handle( struct process *process, handle_t handle ) +static struct handle_entry *get_handle( struct process *process, obj_handle_t handle ) { struct handle_table *table = (struct handle_table *)process->handles; struct handle_entry *entry; @@ -312,7 +312,7 @@ struct object *copy_handle_table( struct process *process, struct process *paren /* close a handle and decrement the refcount of the associated object */ /* return 1 if OK, 0 on error */ -int close_handle( struct process *process, handle_t handle, int *fd ) +int close_handle( struct process *process, obj_handle_t handle, int *fd ) { struct handle_table *table; struct handle_entry *entry; @@ -347,7 +347,7 @@ void close_global_handles(void) } /* retrieve the object corresponding to one of the magic pseudo-handles */ -static inline struct object *get_magic_handle( handle_t handle ) +static inline struct object *get_magic_handle( obj_handle_t handle ) { switch((unsigned long)handle) { @@ -362,7 +362,7 @@ static inline struct object *get_magic_handle( handle_t handle ) } /* retrieve the object corresponding to a handle, incrementing its refcount */ -struct object *get_handle_obj( struct process *process, handle_t handle, +struct object *get_handle_obj( struct process *process, obj_handle_t handle, unsigned int access, const struct object_ops *ops ) { struct handle_entry *entry; @@ -387,7 +387,7 @@ struct object *get_handle_obj( struct process *process, handle_t handle, } /* retrieve the cached fd for a given handle */ -int get_handle_fd( struct process *process, handle_t handle, unsigned int access ) +int get_handle_fd( struct process *process, obj_handle_t handle, unsigned int access ) { struct handle_entry *entry; @@ -402,7 +402,7 @@ int get_handle_fd( struct process *process, handle_t handle, unsigned int access /* get/set the handle reserved flags */ /* return the old flags (or -1 on error) */ -static int set_handle_info( struct process *process, handle_t handle, +static int set_handle_info( struct process *process, obj_handle_t handle, int mask, int flags, int *fd ) { struct handle_entry *entry; @@ -426,10 +426,10 @@ static int set_handle_info( struct process *process, handle_t handle, } /* duplicate a handle */ -handle_t duplicate_handle( struct process *src, handle_t src_handle, struct process *dst, +obj_handle_t duplicate_handle( struct process *src, obj_handle_t src_handle, struct process *dst, unsigned int access, int inherit, int options ) { - handle_t res; + obj_handle_t res; struct object *obj = get_handle_obj( src, src_handle, 0, NULL ); if (!obj) return 0; @@ -454,10 +454,10 @@ handle_t duplicate_handle( struct process *src, handle_t src_handle, struct proc } /* open a new handle to an existing object */ -handle_t open_object( const WCHAR *name, size_t len, const struct object_ops *ops, +obj_handle_t open_object( const WCHAR *name, size_t len, const struct object_ops *ops, unsigned int access, int inherit ) { - handle_t handle = 0; + obj_handle_t handle = 0; struct object *obj = find_object( name, len ); if (obj) { diff --git a/server/handle.h b/server/handle.h index d63c89be28d..0dc9fb32b83 100644 --- a/server/handle.h +++ b/server/handle.h @@ -32,15 +32,15 @@ struct object_ops; /* alloc_handle takes a void *obj for convenience, but you better make sure */ /* that the thing pointed to starts with a struct object... */ -extern handle_t alloc_handle( struct process *process, void *obj, +extern obj_handle_t alloc_handle( struct process *process, void *obj, unsigned int access, int inherit ); -extern int close_handle( struct process *process, handle_t handle, int *fd ); -extern struct object *get_handle_obj( struct process *process, handle_t handle, +extern int close_handle( struct process *process, obj_handle_t handle, int *fd ); +extern struct object *get_handle_obj( struct process *process, obj_handle_t handle, unsigned int access, const struct object_ops *ops ); -extern int get_handle_fd( struct process *process, handle_t handle, unsigned int access ); -extern handle_t duplicate_handle( struct process *src, handle_t src_handle, struct process *dst, +extern int get_handle_fd( struct process *process, obj_handle_t handle, unsigned int access ); +extern obj_handle_t duplicate_handle( struct process *src, obj_handle_t src_handle, struct process *dst, unsigned int access, int inherit, int options ); -extern handle_t open_object( const WCHAR *name, size_t len, const struct object_ops *ops, +extern obj_handle_t open_object( const WCHAR *name, size_t len, const struct object_ops *ops, unsigned int access, int inherit ); extern struct object *alloc_handle_table( struct process *process, int count ); extern struct object *copy_handle_table( struct process *process, struct process *parent ); diff --git a/server/mapping.c b/server/mapping.c index 73cc89ccfe2..ef1d4ccea55 100644 --- a/server/mapping.c +++ b/server/mapping.c @@ -251,7 +251,7 @@ static int get_image_params( struct mapping *mapping ) static struct object *create_mapping( int size_high, int size_low, int protect, - handle_t handle, const WCHAR *name, size_t len ) + obj_handle_t handle, const WCHAR *name, size_t len ) { struct mapping *mapping; int access = 0; diff --git a/server/named_pipe.c b/server/named_pipe.c index ecad8c149b1..68c4f204f71 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c @@ -233,7 +233,7 @@ static struct named_pipe *create_named_pipe( const WCHAR *name, size_t len ) return pipe; } -static struct pipe_user *get_pipe_user_obj( struct process *process, handle_t handle, +static struct pipe_user *get_pipe_user_obj( struct process *process, obj_handle_t handle, unsigned int access ) { return (struct pipe_user *)get_handle_obj( process, handle, access, &pipe_user_ops ); diff --git a/server/object.h b/server/object.h index a904945b5bd..ef548074a1a 100644 --- a/server/object.h +++ b/server/object.h @@ -148,7 +148,7 @@ struct event; extern struct event *create_event( const WCHAR *name, size_t len, int manual_reset, int initial_state ); -extern struct event *get_event_obj( struct process *process, handle_t handle, unsigned int access ); +extern struct event *get_event_obj( struct process *process, obj_handle_t handle, unsigned int access ); extern void pulse_event( struct event *event ); extern void set_event( struct event *event ); extern void reset_event( struct event *event ); @@ -159,7 +159,7 @@ extern void abandon_mutexes( struct thread *thread ); /* file functions */ -extern struct file *get_file_obj( struct process *process, handle_t handle, +extern struct file *get_file_obj( struct process *process, obj_handle_t handle, unsigned int access ); extern int is_same_file( struct file *file1, struct file *file2 ); extern int get_file_drive_type( struct file *file ); diff --git a/server/pipe.c b/server/pipe.c index d0f6bf8344d..d135a2250a7 100644 --- a/server/pipe.c +++ b/server/pipe.c @@ -170,7 +170,7 @@ static void pipe_destroy( struct object *obj ) DECL_HANDLER(create_pipe) { struct object *obj[2]; - handle_t hread = 0, hwrite = 0; + obj_handle_t hread = 0, hwrite = 0; if (create_pipe( obj )) { diff --git a/server/process.c b/server/process.c index 8d5fde05934..0f89aa341a0 100644 --- a/server/process.c +++ b/server/process.c @@ -80,9 +80,9 @@ struct startup_info int inherit_all; /* inherit all handles from parent */ int use_handles; /* use stdio handles */ int create_flags; /* creation flags */ - handle_t hstdin; /* handle for stdin */ - handle_t hstdout; /* handle for stdout */ - handle_t hstderr; /* handle for stderr */ + obj_handle_t hstdin; /* handle for stdin */ + obj_handle_t hstdout; /* handle for stdout */ + obj_handle_t hstderr; /* handle for stderr */ struct file *exe_file; /* file handle for main exe */ struct thread *owner; /* owner thread (the one that created the new process) */ struct process *process; /* created process */ @@ -397,7 +397,7 @@ struct process *get_process_from_id( void *id ) } /* get a process from a handle (and increment the refcount) */ -struct process *get_process_from_handle( handle_t handle, unsigned int access ) +struct process *get_process_from_handle( obj_handle_t handle, unsigned int access ) { return (struct process *)get_handle_obj( current->process, handle, access, &process_ops ); diff --git a/server/process.h b/server/process.h index 7519fc5eb7b..e32049130bc 100644 --- a/server/process.h +++ b/server/process.h @@ -94,7 +94,7 @@ struct module_snapshot extern struct thread *create_process( int fd ); extern struct process *get_process_from_id( void *id ); -extern struct process *get_process_from_handle( handle_t handle, unsigned int access ); +extern struct process *get_process_from_handle( obj_handle_t handle, unsigned int access ); extern int process_set_debugger( struct process *process, struct thread *thread ); extern int debugger_detach( struct process* process, struct thread* debugger ); diff --git a/server/protocol.def b/server/protocol.def index 7222b7ec982..8b68a439fee 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -48,10 +48,7 @@ struct request_max_size int pad[16]; /* the max request size is 16 ints */ }; -/* max size of the variable part of a request */ -#define REQUEST_MAX_VAR_SIZE 1024 - -typedef int handle_t; +typedef int obj_handle_t; typedef unsigned short atom_t; typedef unsigned int user_handle_t; @@ -67,35 +64,35 @@ struct debug_event_exception }; struct debug_event_create_thread { - handle_t handle; /* handle to the new thread */ - void *teb; /* thread teb (in debugged process address space) */ - void *start; /* thread startup routine */ + obj_handle_t handle; /* handle to the new thread */ + void *teb; /* thread teb (in debugged process address space) */ + void *start; /* thread startup routine */ }; struct debug_event_create_process { - handle_t file; /* handle to the process exe file */ - handle_t process; /* handle to the new process */ - handle_t thread; /* handle to the new thread */ - void *base; /* base of executable image */ - int dbg_offset; /* offset of debug info in file */ - int dbg_size; /* size of debug info */ - void *teb; /* thread teb (in debugged process address space) */ - void *start; /* thread startup routine */ - void *name; /* image name (optional) */ - int unicode; /* is it Unicode? */ + obj_handle_t file; /* handle to the process exe file */ + obj_handle_t process; /* handle to the new process */ + obj_handle_t thread; /* handle to the new thread */ + void *base; /* base of executable image */ + int dbg_offset; /* offset of debug info in file */ + int dbg_size; /* size of debug info */ + void *teb; /* thread teb (in debugged process address space) */ + void *start; /* thread startup routine */ + void *name; /* image name (optional) */ + int unicode; /* is it Unicode? */ }; struct debug_event_exit { - int exit_code; /* thread or process exit code */ + int exit_code; /* thread or process exit code */ }; struct debug_event_load_dll { - handle_t handle; /* file handle for the dll */ - void *base; /* base address of the dll */ - int dbg_offset; /* offset of debug info in file */ - int dbg_size; /* size of debug info */ - void *name; /* image name (optional) */ - int unicode; /* is it Unicode? */ + obj_handle_t handle; /* file handle for the dll */ + void *base; /* base address of the dll */ + int dbg_offset; /* offset of debug info in file */ + int dbg_size; /* size of debug info */ + void *name; /* image name (optional) */ + int unicode; /* is it Unicode? */ }; struct debug_event_unload_dll { @@ -173,7 +170,7 @@ typedef struct { atom_t atom; /* property atom */ short string; /* was atom a string originally? */ - handle_t handle; /* handle stored in property */ + obj_handle_t handle; /* handle stored in property */ } property_data_t; /* structure to specify window rectangles */ @@ -200,26 +197,26 @@ typedef struct int inherit_all; /* inherit all handles from parent */ int use_handles; /* use stdio handles */ int create_flags; /* creation flags */ - handle_t exe_file; /* file handle for main exe */ - handle_t hstdin; /* handle for stdin */ - handle_t hstdout; /* handle for stdout */ - handle_t hstderr; /* handle for stderr */ + obj_handle_t exe_file; /* file handle for main exe */ + obj_handle_t hstdin; /* handle for stdin */ + obj_handle_t hstdout; /* handle for stdout */ + obj_handle_t hstderr; /* handle for stderr */ VARARG(info,startup_info); /* startup information */ @REPLY - handle_t info; /* new process info handle */ + obj_handle_t info; /* new process info handle */ @END /* Retrieve information about a newly started process */ @REQ(get_new_process_info) - handle_t info; /* info handle returned from new_process_request */ + obj_handle_t info; /* info handle returned from new_process_request */ int pinherit; /* process handle inherit flag */ int tinherit; /* thread handle inherit flag */ @REPLY void* pid; /* process id */ - handle_t phandle; /* process handle (in the current process) */ + obj_handle_t phandle; /* process handle (in the current process) */ void* tid; /* thread id */ - handle_t thandle; /* thread handle (in the current process) */ + obj_handle_t thandle; /* thread handle (in the current process) */ int success; /* did the process start successfully? */ @END @@ -231,7 +228,7 @@ typedef struct int request_fd; /* fd for request pipe */ @REPLY void* tid; /* thread id */ - handle_t handle; /* thread handle (in the current process) */ + obj_handle_t handle; /* thread handle (in the current process) */ @END @@ -249,10 +246,10 @@ typedef struct int create_flags; /* creation flags */ unsigned int server_start; /* server start time (GetTickCount) */ size_t info_size; /* total size of startup info */ - handle_t exe_file; /* file handle for main exe */ - handle_t hstdin; /* handle for stdin */ - handle_t hstdout; /* handle for stdout */ - handle_t hstderr; /* handle for stderr */ + obj_handle_t exe_file; /* file handle for main exe */ + obj_handle_t hstdin; /* handle for stdin */ + obj_handle_t hstdout; /* handle for stdout */ + obj_handle_t hstderr; /* handle for stderr */ @END @@ -269,7 +266,7 @@ typedef struct size_t module_size; /* main module size */ void* entry; /* process entry point */ void* name; /* ptr to ptr to name (in process addr space) */ - handle_t exe_file; /* file handle for main exe */ + obj_handle_t exe_file; /* file handle for main exe */ int gui; /* is it a GUI process? */ VARARG(filename,string); /* file name of main exe */ @REPLY @@ -294,7 +291,7 @@ typedef struct /* Terminate a process */ @REQ(terminate_process) - handle_t handle; /* process handle to terminate */ + obj_handle_t handle; /* process handle to terminate */ int exit_code; /* process exit code */ @REPLY int self; /* suicide? */ @@ -303,7 +300,7 @@ typedef struct /* Terminate a thread */ @REQ(terminate_thread) - handle_t handle; /* thread handle to terminate */ + obj_handle_t handle; /* thread handle to terminate */ int exit_code; /* thread exit code */ @REPLY int self; /* suicide? */ @@ -313,7 +310,7 @@ typedef struct /* Retrieve information about a process */ @REQ(get_process_info) - handle_t handle; /* process handle */ + obj_handle_t handle; /* process handle */ @REPLY void* pid; /* server process id */ int debugged; /* debugged? */ @@ -326,7 +323,7 @@ typedef struct /* Set a process informations */ @REQ(set_process_info) - handle_t handle; /* process handle */ + obj_handle_t handle; /* process handle */ int mask; /* setting mask (see below) */ int priority; /* priority class */ int affinity; /* affinity mask */ @@ -337,7 +334,7 @@ typedef struct /* Retrieve information about a thread */ @REQ(get_thread_info) - handle_t handle; /* thread handle */ + obj_handle_t handle; /* thread handle */ void* tid_in; /* thread id (optional) */ @REPLY void* tid; /* server thread id */ @@ -349,7 +346,7 @@ typedef struct /* Set a thread informations */ @REQ(set_thread_info) - handle_t handle; /* thread handle */ + obj_handle_t handle; /* thread handle */ int mask; /* setting mask (see below) */ int priority; /* priority class */ int affinity; /* affinity mask */ @@ -360,7 +357,7 @@ typedef struct /* Suspend a thread */ @REQ(suspend_thread) - handle_t handle; /* thread handle */ + obj_handle_t handle; /* thread handle */ @REPLY int count; /* new suspend count */ @END @@ -368,7 +365,7 @@ typedef struct /* Resume a thread */ @REQ(resume_thread) - handle_t handle; /* thread handle */ + obj_handle_t handle; /* thread handle */ @REPLY int count; /* new suspend count */ @END @@ -376,7 +373,7 @@ typedef struct /* Notify the server that a dll has been loaded */ @REQ(load_dll) - handle_t handle; /* file handle */ + obj_handle_t handle; /* file handle */ void* base; /* base address */ size_t size; /* dll size */ int dbg_offset; /* debug info offset */ @@ -394,7 +391,7 @@ typedef struct /* Queue an APC for a thread */ @REQ(queue_apc) - handle_t handle; /* thread handle */ + obj_handle_t handle; /* thread handle */ int user; /* user or system apc? */ void* func; /* function to call */ void* param; /* param for function to call */ @@ -414,7 +411,7 @@ enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC, APC_ASYNC_IO }; /* Close a handle for the current process */ @REQ(close_handle) - handle_t handle; /* handle to close */ + obj_handle_t handle; /* handle to close */ @REPLY int fd; /* associated fd to close */ @END @@ -422,7 +419,7 @@ enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC, APC_ASYNC_IO }; /* Set a handle information */ @REQ(set_handle_info) - handle_t handle; /* handle we are interested in */ + obj_handle_t handle; /* handle we are interested in */ int flags; /* new handle flags */ int mask; /* mask for flags to set */ int fd; /* file descriptor or -1 */ @@ -434,14 +431,14 @@ enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC, APC_ASYNC_IO }; /* Duplicate a handle */ @REQ(dup_handle) - handle_t src_process; /* src process handle */ - handle_t src_handle; /* src handle to duplicate */ - handle_t dst_process; /* dst process handle */ + obj_handle_t src_process; /* src process handle */ + obj_handle_t src_handle; /* src handle to duplicate */ + obj_handle_t dst_process; /* dst process handle */ unsigned int access; /* wanted access rights */ int inherit; /* inherit flag */ int options; /* duplicate options (see below) */ @REPLY - handle_t handle; /* duplicated handle in dst process */ + obj_handle_t handle; /* duplicated handle in dst process */ int fd; /* associated fd to close */ @END #define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE @@ -455,7 +452,7 @@ enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC, APC_ASYNC_IO }; unsigned int access; /* wanted access rights */ int inherit; /* inherit flag */ @REPLY - handle_t handle; /* handle to the process */ + obj_handle_t handle; /* handle to the process */ @END @@ -465,7 +462,7 @@ enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC, APC_ASYNC_IO }; unsigned int access; /* wanted access rights */ int inherit; /* inherit flag */ @REPLY - handle_t handle; /* handle to the thread */ + obj_handle_t handle; /* handle to the thread */ @END @@ -490,12 +487,12 @@ enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC, APC_ASYNC_IO }; int inherit; /* inherit flag */ VARARG(name,unicode_str); /* object name */ @REPLY - handle_t handle; /* handle to the event */ + obj_handle_t handle; /* handle to the event */ @END /* Event operation */ @REQ(event_op) - handle_t handle; /* handle to event */ + obj_handle_t handle; /* handle to event */ int op; /* event operation (see below) */ @END enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT }; @@ -507,7 +504,7 @@ enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT }; int inherit; /* inherit flag */ VARARG(name,unicode_str); /* object name */ @REPLY - handle_t handle; /* handle to the event */ + obj_handle_t handle; /* handle to the event */ @END @@ -517,13 +514,13 @@ enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT }; int inherit; /* inherit flag */ VARARG(name,unicode_str); /* object name */ @REPLY - handle_t handle; /* handle to the mutex */ + obj_handle_t handle; /* handle to the mutex */ @END /* Release a mutex */ @REQ(release_mutex) - handle_t handle; /* handle to the mutex */ + obj_handle_t handle; /* handle to the mutex */ @END @@ -533,7 +530,7 @@ enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT }; int inherit; /* inherit flag */ VARARG(name,unicode_str); /* object name */ @REPLY - handle_t handle; /* handle to the mutex */ + obj_handle_t handle; /* handle to the mutex */ @END @@ -544,13 +541,13 @@ enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT }; int inherit; /* inherit flag */ VARARG(name,unicode_str); /* object name */ @REPLY - handle_t handle; /* handle to the semaphore */ + obj_handle_t handle; /* handle to the semaphore */ @END /* Release a semaphore */ @REQ(release_semaphore) - handle_t handle; /* handle to the semaphore */ + obj_handle_t handle; /* handle to the semaphore */ unsigned int count; /* count to add to semaphore */ @REPLY unsigned int prev_count; /* previous semaphore count */ @@ -563,7 +560,7 @@ enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT }; int inherit; /* inherit flag */ VARARG(name,unicode_str); /* object name */ @REPLY - handle_t handle; /* handle to the semaphore */ + obj_handle_t handle; /* handle to the semaphore */ @END @@ -577,7 +574,7 @@ enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT }; int drive_type; /* type of drive the file is on */ VARARG(filename,string); /* file name */ @REPLY - handle_t handle; /* handle to the file */ + obj_handle_t handle; /* handle to the file */ @END @@ -587,13 +584,13 @@ enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT }; int inherit; /* inherit flag */ int fd; /* file descriptor on the client side */ @REPLY - handle_t handle; /* handle to the file */ + obj_handle_t handle; /* handle to the file */ @END /* Get a Unix fd to access a file */ @REQ(get_handle_fd) - handle_t handle; /* handle to the file */ + obj_handle_t handle; /* handle to the file */ unsigned int access; /* wanted access rights */ @REPLY int fd; /* file descriptor */ @@ -615,7 +612,7 @@ enum fd_type /* Set a file current position */ @REQ(set_file_pointer) - handle_t handle; /* handle to the file */ + obj_handle_t handle; /* handle to the file */ int low; /* position low word */ int high; /* position high word */ int whence; /* whence to seek */ @@ -627,13 +624,13 @@ enum fd_type /* Truncate (or extend) a file */ @REQ(truncate_file) - handle_t handle; /* handle to the file */ + obj_handle_t handle; /* handle to the file */ @END /* Set a file access and modification times */ @REQ(set_file_time) - handle_t handle; /* handle to the file */ + obj_handle_t handle; /* handle to the file */ time_t access_time; /* last access time */ time_t write_time; /* last write time */ @END @@ -641,13 +638,13 @@ enum fd_type /* Flush a file buffers */ @REQ(flush_file) - handle_t handle; /* handle to the file */ + obj_handle_t handle; /* handle to the file */ @END /* Get information about a file */ @REQ(get_file_info) - handle_t handle; /* handle to the file */ + obj_handle_t handle; /* handle to the file */ @REPLY int type; /* file type */ int attr; /* file attributes */ @@ -664,7 +661,7 @@ enum fd_type /* Lock a region of a file */ @REQ(lock_file) - handle_t handle; /* handle to the file */ + obj_handle_t handle; /* handle to the file */ unsigned int offset_low; /* offset of start of lock */ unsigned int offset_high; /* offset of start of lock */ unsigned int count_low; /* count of bytes to lock */ @@ -674,7 +671,7 @@ enum fd_type /* Unlock a region of a file */ @REQ(unlock_file) - handle_t handle; /* handle to the file */ + obj_handle_t handle; /* handle to the file */ unsigned int offset_low; /* offset of start of unlock */ unsigned int offset_high; /* offset of start of unlock */ unsigned int count_low; /* count of bytes to unlock */ @@ -686,8 +683,8 @@ enum fd_type @REQ(create_pipe) int inherit; /* inherit flag */ @REPLY - handle_t handle_read; /* handle to the read-side of the pipe */ - handle_t handle_write; /* handle to the write-side of the pipe */ + obj_handle_t handle_read; /* handle to the read-side of the pipe */ + obj_handle_t handle_write; /* handle to the write-side of the pipe */ @END @@ -700,25 +697,25 @@ enum fd_type int protocol; /* protocol, see socket manpage */ unsigned int flags; /* socket flags */ @REPLY - handle_t handle; /* handle to the new socket */ + obj_handle_t handle; /* handle to the new socket */ @END /* Accept a socket */ @REQ(accept_socket) - handle_t lhandle; /* handle to the listening socket */ + obj_handle_t lhandle; /* handle to the listening socket */ unsigned int access; /* wanted access rights */ int inherit; /* inherit flag */ @REPLY - handle_t handle; /* handle to the new socket */ + obj_handle_t handle; /* handle to the new socket */ @END /* Set socket event parameters */ @REQ(set_socket_event) - handle_t handle; /* handle to the socket */ + obj_handle_t handle; /* handle to the socket */ unsigned int mask; /* event mask */ - handle_t event; /* event object */ + obj_handle_t event; /* event object */ user_handle_t window; /* window to send the message to */ unsigned int msg; /* message to send */ @END @@ -726,9 +723,9 @@ enum fd_type /* Get socket event parameters */ @REQ(get_socket_event) - handle_t handle; /* handle to the socket */ + obj_handle_t handle; /* handle to the socket */ int service; /* clear pending? */ - handle_t c_event; /* event to clear */ + obj_handle_t c_event; /* event to clear */ @REPLY unsigned int mask; /* event mask */ unsigned int pmask; /* pending events */ @@ -739,15 +736,15 @@ enum fd_type /* Reenable pending socket events */ @REQ(enable_socket_event) - handle_t handle; /* handle to the socket */ + obj_handle_t handle; /* handle to the socket */ unsigned int mask; /* events to re-enable */ unsigned int sstate; /* status bits to set */ unsigned int cstate; /* status bits to clear */ @END @REQ(set_socket_deferred) - handle_t handle; /* handle to the socket */ - handle_t deferred; /* handle to the socket for which accept() is deferred */ + obj_handle_t handle; /* handle to the socket */ + obj_handle_t deferred; /* handle to the socket for which accept() is deferred */ @END /* Allocate a console (only used by a console renderer) */ @@ -756,8 +753,8 @@ enum fd_type int inherit; /* inherit flag */ void* pid; /* pid of process which shall be attached to the console */ @REPLY - handle_t handle_in; /* handle to console input */ - handle_t event; /* handle to renderer events change notification */ + obj_handle_t handle_in; /* handle to console input */ + obj_handle_t event; /* handle to renderer events change notification */ @END @@ -812,7 +809,7 @@ struct console_renderer_event /* retrieve console events for the renderer */ @REQ(get_console_renderer_events) - handle_t handle; /* handle to console input events */ + obj_handle_t handle; /* handle to console input events */ @REPLY VARARG(data,bytes); /* the various console_renderer_events */ @END @@ -826,13 +823,13 @@ struct console_renderer_event int inherit; /* inherit flag */ int share; /* share mask (only for output handles) */ @REPLY - handle_t handle; /* handle to the console */ + obj_handle_t handle; /* handle to the console */ @END /* Get a console mode (input or output) */ @REQ(get_console_mode) - handle_t handle; /* handle to the console */ + obj_handle_t handle; /* handle to the console */ @REPLY int mode; /* console mode */ @END @@ -840,16 +837,16 @@ struct console_renderer_event /* Set a console mode (input or output) */ @REQ(set_console_mode) - handle_t handle; /* handle to the console */ + obj_handle_t handle; /* handle to the console */ int mode; /* console mode */ @END /* Set info about a console (input only) */ @REQ(set_console_input_info) - handle_t handle; /* handle to console input, or 0 for process' console */ + obj_handle_t handle; /* handle to console input, or 0 for process' console */ int mask; /* setting mask (see below) */ - handle_t active_sb; /* active screen buffer */ + obj_handle_t active_sb; /* active screen buffer */ int history_mode; /* whether we duplicate lines in history */ int history_size; /* number of lines in history */ VARARG(title,unicode_str); /* console title */ @@ -862,7 +859,7 @@ struct console_renderer_event /* Get info about a console (input only) */ @REQ(get_console_input_info) - handle_t handle; /* handle to console input, or 0 for process' console */ + obj_handle_t handle; /* handle to console input, or 0 for process' console */ @REPLY int history_mode; /* whether we duplicate lines in history */ int history_size; /* number of lines in history */ @@ -873,14 +870,14 @@ struct console_renderer_event /* appends a string to console's history */ @REQ(append_console_input_history) - handle_t handle; /* handle to console input, or 0 for process' console */ + obj_handle_t handle; /* handle to console input, or 0 for process' console */ VARARG(line,unicode_str); /* line to add */ @END /* appends a string to console's history */ @REQ(get_console_input_history) - handle_t handle; /* handle to console input, or 0 for process' console */ + obj_handle_t handle; /* handle to console input, or 0 for process' console */ int index; /* index to get line from */ @REPLY int total; /* total length of line in Unicode chars */ @@ -890,18 +887,18 @@ struct console_renderer_event /* creates a new screen buffer on process' console */ @REQ(create_console_output) - handle_t handle_in; /* handle to console input, or 0 for process' console */ + obj_handle_t handle_in; /* handle to console input, or 0 for process' console */ int access; /* wanted access rights */ int share; /* sharing credentials */ int inherit; /* inherit flag */ @REPLY - handle_t handle_out; /* handle to the screen buffer */ + obj_handle_t handle_out; /* handle to the screen buffer */ @END /* Set info about a console (output only) */ @REQ(set_console_output_info) - handle_t handle; /* handle to the console */ + obj_handle_t handle; /* handle to the console */ int mask; /* setting mask (see below) */ short int cursor_size; /* size of cursor (percentage filled) */ short int cursor_visible;/* cursor visibility flag */ @@ -927,7 +924,7 @@ struct console_renderer_event /* Get info about a console (output only) */ @REQ(get_console_output_info) - handle_t handle; /* handle to the console */ + obj_handle_t handle; /* handle to the console */ @REPLY short int cursor_size; /* size of cursor (percentage filled) */ short int cursor_visible;/* cursor visibility flag */ @@ -946,7 +943,7 @@ struct console_renderer_event /* Add input records to a console input queue */ @REQ(write_console_input) - handle_t handle; /* handle to the console input */ + obj_handle_t handle; /* handle to the console input */ VARARG(rec,input_records); /* input records */ @REPLY int written; /* number of records written */ @@ -955,7 +952,7 @@ struct console_renderer_event /* Fetch input records from a console input queue */ @REQ(read_console_input) - handle_t handle; /* handle to the console input */ + obj_handle_t handle; /* handle to the console input */ int flush; /* flush the retrieved records from the queue? */ @REPLY int read; /* number of records read */ @@ -965,7 +962,7 @@ struct console_renderer_event /* write data (chars and/or attributes) in a screen buffer */ @REQ(write_console_output) - handle_t handle; /* handle to the console output */ + obj_handle_t handle; /* handle to the console output */ int x; /* position where to start writing */ int y; int mode; /* char info (see below) */ @@ -987,7 +984,7 @@ enum char_info_mode /* fill a screen buffer with constant data (chars and/or attributes) */ @REQ(fill_console_output) - handle_t handle; /* handle to the console output */ + obj_handle_t handle; /* handle to the console output */ int x; /* position where to start writing */ int y; int mode; /* char info mode */ @@ -1001,7 +998,7 @@ enum char_info_mode /* read data (chars and/or attributes) from a screen buffer */ @REQ(read_console_output) - handle_t handle; /* handle to the console output */ + obj_handle_t handle; /* handle to the console output */ int x; /* position (x,y) where to start reading */ int y; int mode; /* char info mode */ @@ -1014,7 +1011,7 @@ enum char_info_mode /* move a rect (of data) in screen buffer content */ @REQ(move_console_output) - handle_t handle; /* handle to the console output */ + obj_handle_t handle; /* handle to the console output */ short int x_src; /* position (x, y) of rect to start moving from */ short int y_src; short int x_dst; /* position (x, y) of rect to move to */ @@ -1029,7 +1026,7 @@ enum char_info_mode int subtree; /* watch all the subtree */ int filter; /* notification filter */ @REPLY - handle_t handle; /* handle to the change notification */ + obj_handle_t handle; /* handle to the change notification */ @END @@ -1039,10 +1036,10 @@ enum char_info_mode int size_low; /* mapping size */ int protect; /* protection flags (see below) */ int inherit; /* inherit flag */ - handle_t file_handle; /* file handle */ + obj_handle_t file_handle; /* file handle */ VARARG(name,unicode_str); /* object name */ @REPLY - handle_t handle; /* handle to the mapping */ + obj_handle_t handle; /* handle to the mapping */ @END /* protection flags */ #define VPROT_READ 0x01 @@ -1061,20 +1058,20 @@ enum char_info_mode int inherit; /* inherit flag */ VARARG(name,unicode_str); /* object name */ @REPLY - handle_t handle; /* handle to the mapping */ + obj_handle_t handle; /* handle to the mapping */ @END /* Get information about a file mapping */ @REQ(get_mapping_info) - handle_t handle; /* handle to the mapping */ + obj_handle_t handle; /* handle to the mapping */ @REPLY int size_high; /* mapping size */ int size_low; /* mapping size */ int protect; /* protection flags */ int header_size; /* header size (for VPROT_IMAGE mapping) */ void* base; /* default base addr (for VPROT_IMAGE mapping) */ - handle_t shared_file; /* shared mapping file handle */ + obj_handle_t shared_file; /* shared mapping file handle */ int shared_size; /* shared mapping size */ int drive_type; /* type of drive the file is on */ @END @@ -1086,7 +1083,7 @@ enum char_info_mode int inherit; /* inherit flag */ int id; /* client private id */ @REPLY - handle_t handle; /* handle to the device */ + obj_handle_t handle; /* handle to the device */ @END @@ -1096,13 +1093,13 @@ enum char_info_mode int flags; /* snapshot flags (TH32CS_*) */ void* pid; /* process id */ @REPLY - handle_t handle; /* handle to the snapshot */ + obj_handle_t handle; /* handle to the snapshot */ @END /* Get the next process from a snapshot */ @REQ(next_process) - handle_t handle; /* handle to the snapshot */ + obj_handle_t handle; /* handle to the snapshot */ int reset; /* reset snapshot position? */ @REPLY int count; /* process usage count */ @@ -1118,7 +1115,7 @@ enum char_info_mode /* Get the next thread from a snapshot */ @REQ(next_thread) - handle_t handle; /* handle to the snapshot */ + obj_handle_t handle; /* handle to the snapshot */ int reset; /* reset snapshot position? */ @REPLY int count; /* thread usage count */ @@ -1131,7 +1128,7 @@ enum char_info_mode /* Get the next module from a snapshot */ @REQ(next_module) - handle_t handle; /* handle to the snapshot */ + obj_handle_t handle; /* handle to the snapshot */ int reset; /* reset snapshot position? */ @REPLY void* pid; /* process id */ @@ -1147,7 +1144,7 @@ enum char_info_mode @REPLY void* pid; /* process id */ void* tid; /* thread id */ - handle_t wait; /* wait handle if no event ready */ + obj_handle_t wait; /* wait handle if no event ready */ VARARG(event,debug_event); /* debug event data */ @END @@ -1157,13 +1154,13 @@ enum char_info_mode int first; /* first chance exception? */ VARARG(record,exc_event); /* thread context followed by exception record */ @REPLY - handle_t handle; /* handle to the queued event */ + obj_handle_t handle; /* handle to the queued event */ @END /* Retrieve the status of an exception event */ @REQ(get_exception_status) - handle_t handle; /* handle to the queued event */ + obj_handle_t handle; /* handle to the queued event */ @REPLY int status; /* event continuation status */ VARARG(context,context); /* modified thread context */ @@ -1195,7 +1192,7 @@ enum char_info_mode /* Simulate a breakpoint in a process */ @REQ(debug_break) - handle_t handle; /* process handle */ + obj_handle_t handle; /* process handle */ @REPLY int self; /* was it the caller itself? */ @END @@ -1209,7 +1206,7 @@ enum char_info_mode /* Read data from a process address space */ @REQ(read_process_memory) - handle_t handle; /* process handle */ + obj_handle_t handle; /* process handle */ void* addr; /* addr to read from */ @REPLY VARARG(data,bytes); /* result data */ @@ -1218,7 +1215,7 @@ enum char_info_mode /* Write data to a process address space */ @REQ(write_process_memory) - handle_t handle; /* process handle */ + obj_handle_t handle; /* process handle */ void* addr; /* addr to write to (must be int-aligned) */ unsigned int first_mask; /* mask for first word */ unsigned int last_mask; /* mask for last word */ @@ -1228,7 +1225,7 @@ enum char_info_mode /* Create a registry key */ @REQ(create_key) - handle_t parent; /* handle to the parent key */ + obj_handle_t parent; /* handle to the parent key */ unsigned int access; /* desired access rights */ unsigned int options; /* creation options */ time_t modif; /* last modification time */ @@ -1236,29 +1233,29 @@ enum char_info_mode VARARG(name,unicode_str,namelen); /* key name */ VARARG(class,unicode_str); /* class name */ @REPLY - handle_t hkey; /* handle to the created key */ + obj_handle_t hkey; /* handle to the created key */ int created; /* has it been newly created? */ @END /* Open a registry key */ @REQ(open_key) - handle_t parent; /* handle to the parent key */ + obj_handle_t parent; /* handle to the parent key */ unsigned int access; /* desired access rights */ VARARG(name,unicode_str); /* key name */ @REPLY - handle_t hkey; /* handle to the open key */ + obj_handle_t hkey; /* handle to the open key */ @END /* Delete a registry key */ @REQ(delete_key) - handle_t hkey; /* handle to the key */ + obj_handle_t hkey; /* handle to the key */ @END /* Enumerate registry subkeys */ @REQ(enum_key) - handle_t hkey; /* handle to registry key */ + obj_handle_t hkey; /* handle to registry key */ int index; /* index of subkey (or -1 for current key) */ int info_class; /* requested information class */ @REPLY @@ -1278,7 +1275,7 @@ enum char_info_mode /* Set a value of a registry key */ @REQ(set_key_value) - handle_t hkey; /* handle to registry key */ + obj_handle_t hkey; /* handle to registry key */ int type; /* value type */ size_t namelen; /* length of value name in bytes */ VARARG(name,unicode_str,namelen); /* value name */ @@ -1288,7 +1285,7 @@ enum char_info_mode /* Retrieve the value of a registry key */ @REQ(get_key_value) - handle_t hkey; /* handle to registry key */ + obj_handle_t hkey; /* handle to registry key */ VARARG(name,unicode_str); /* value name */ @REPLY int type; /* value type */ @@ -1299,7 +1296,7 @@ enum char_info_mode /* Enumerate a value of a registry key */ @REQ(enum_key_value) - handle_t hkey; /* handle to registry key */ + obj_handle_t hkey; /* handle to registry key */ int index; /* value index */ int info_class; /* requested information class */ @REPLY @@ -1313,29 +1310,29 @@ enum char_info_mode /* Delete a value of a registry key */ @REQ(delete_key_value) - handle_t hkey; /* handle to registry key */ + obj_handle_t hkey; /* handle to registry key */ VARARG(name,unicode_str); /* value name */ @END /* Load a registry branch from a file */ @REQ(load_registry) - handle_t hkey; /* root key to load to */ - handle_t file; /* file to load from */ + obj_handle_t hkey; /* root key to load to */ + obj_handle_t file; /* file to load from */ VARARG(name,unicode_str); /* subkey name */ @END /* Save a registry branch to a file */ @REQ(save_registry) - handle_t hkey; /* key to save */ - handle_t file; /* file to save to */ + obj_handle_t hkey; /* key to save */ + obj_handle_t file; /* file to save to */ @END /* Save a registry branch at server exit */ @REQ(save_registry_atexit) - handle_t hkey; /* key to save */ + obj_handle_t hkey; /* key to save */ VARARG(file,string); /* file to save to */ @END @@ -1354,7 +1351,7 @@ enum char_info_mode int manual; /* manual reset */ VARARG(name,unicode_str); /* object name */ @REPLY - handle_t handle; /* handle to the timer */ + obj_handle_t handle; /* handle to the timer */ @END @@ -1364,12 +1361,12 @@ enum char_info_mode int inherit; /* inherit flag */ VARARG(name,unicode_str); /* object name */ @REPLY - handle_t handle; /* handle to the timer */ + obj_handle_t handle; /* handle to the timer */ @END /* Set a waitable timer */ @REQ(set_timer) - handle_t handle; /* handle to the timer */ + obj_handle_t handle; /* handle to the timer */ int sec; /* next expiration absolute time */ int usec; /* next expiration absolute time */ int period; /* timer period in ms */ @@ -1379,13 +1376,13 @@ enum char_info_mode /* Cancel a waitable timer */ @REQ(cancel_timer) - handle_t handle; /* handle to the timer */ + obj_handle_t handle; /* handle to the timer */ @END /* Retrieve the current context of a thread */ @REQ(get_thread_context) - handle_t handle; /* thread handle */ + obj_handle_t handle; /* thread handle */ unsigned int flags; /* context flags */ @REPLY VARARG(context,context); /* thread context */ @@ -1394,7 +1391,7 @@ enum char_info_mode /* Set the current context of a thread */ @REQ(set_thread_context) - handle_t handle; /* thread handle */ + obj_handle_t handle; /* thread handle */ unsigned int flags; /* context flags */ VARARG(context,context); /* thread context */ @END @@ -1402,7 +1399,7 @@ enum char_info_mode /* Fetch a selector entry for a thread */ @REQ(get_selector_entry) - handle_t handle; /* thread handle */ + obj_handle_t handle; /* thread handle */ int entry; /* LDT entry */ @REPLY unsigned int base; /* selector base */ @@ -1455,7 +1452,7 @@ enum char_info_mode /* Get the message queue of the current thread */ @REQ(get_msg_queue) @REPLY - handle_t handle; /* handle to the queue */ + obj_handle_t handle; /* handle to the queue */ @END @@ -1481,10 +1478,10 @@ enum char_info_mode /* Wait for a process to start waiting on input */ @REQ(wait_input_idle) - handle_t handle; /* process handle */ + obj_handle_t handle; /* process handle */ int timeout; /* timeout */ @REPLY - handle_t event; /* handle to idle event */ + obj_handle_t event; /* handle to idle event */ @END @@ -1583,13 +1580,13 @@ enum message_type unsigned int sharing; /* sharing flags */ VARARG(name,string); /* file name */ @REPLY - handle_t handle; /* handle to the port */ + obj_handle_t handle; /* handle to the port */ @END /* Retrieve info about a serial port */ @REQ(get_serial_info) - handle_t handle; /* handle to comm port */ + obj_handle_t handle; /* handle to comm port */ @REPLY unsigned int readinterval; unsigned int readconst; @@ -1603,7 +1600,7 @@ enum message_type /* Set info about a serial port */ @REQ(set_serial_info) - handle_t handle; /* handle to comm port */ + obj_handle_t handle; /* handle to comm port */ int flags; /* bitmask to set values (see below) */ unsigned int readinterval; unsigned int readconst; @@ -1620,7 +1617,7 @@ enum message_type /* Create / reschedule an async I/O */ @REQ(register_async) - handle_t handle; /* handle to comm port, socket or file */ + obj_handle_t handle; /* handle to comm port, socket or file */ int type; void* overlapped; int count; @@ -1642,7 +1639,7 @@ enum message_type unsigned int timeout; VARARG(name,unicode_str); /* pipe name */ @REPLY - handle_t handle; /* handle to the pipe */ + obj_handle_t handle; /* handle to the pipe */ @END @@ -1651,13 +1648,13 @@ enum message_type unsigned int access; VARARG(name,unicode_str); /* pipe name */ @REPLY - handle_t handle; /* handle to the pipe */ + obj_handle_t handle; /* handle to the pipe */ @END /* Connect to a named pipe */ @REQ(connect_named_pipe) - handle_t handle; + obj_handle_t handle; void* overlapped; void* func; @END @@ -1674,12 +1671,12 @@ enum message_type /* Disconnect a named pipe */ @REQ(disconnect_named_pipe) - handle_t handle; + obj_handle_t handle; @END @REQ(get_named_pipe_info) - handle_t handle; + obj_handle_t handle; @REPLY unsigned int flags; unsigned int maxinstances; @@ -1695,12 +1692,12 @@ enum message_type unsigned int file_id; unsigned int dialect; @REPLY - handle_t handle; + obj_handle_t handle; @END @REQ(get_smb_info) - handle_t handle; + obj_handle_t handle; unsigned int flags; unsigned int offset; @REPLY @@ -1870,7 +1867,7 @@ enum message_type user_handle_t window; /* handle to the window */ atom_t atom; /* property atom (high-word set if it was a string) */ int string; /* was atom a string originally? */ - handle_t handle; /* handle to store */ + obj_handle_t handle; /* handle to store */ @END @@ -1879,7 +1876,7 @@ enum message_type user_handle_t window; /* handle to the window */ atom_t atom; /* property atom */ @REPLY - handle_t handle; /* handle stored in property */ + obj_handle_t handle; /* handle stored in property */ @END @@ -1888,7 +1885,7 @@ enum message_type user_handle_t window; /* handle to the window */ atom_t atom; /* property atom */ @REPLY - handle_t handle; /* handle stored in property */ + obj_handle_t handle; /* handle stored in property */ @END diff --git a/server/registry.c b/server/registry.c index 5ba94ccf64a..1e8886737c1 100644 --- a/server/registry.c +++ b/server/registry.c @@ -891,7 +891,7 @@ static void delete_value( struct key *key, const WCHAR *name ) } } -static struct key *create_root_key( handle_t hkey ) +static struct key *create_root_key( obj_handle_t hkey ) { WCHAR keyname[80]; int i, dummy; @@ -902,7 +902,7 @@ static struct key *create_root_key( handle_t hkey ) i = 0; while (*p) keyname[i++] = *p++; - if (hkey == (handle_t)HKEY_CURRENT_USER) /* this one is special */ + if (hkey == (obj_handle_t)HKEY_CURRENT_USER) /* this one is special */ { /* get the current user name */ char buffer[10]; @@ -927,7 +927,7 @@ static struct key *create_root_key( handle_t hkey ) } /* get the registry key corresponding to an hkey handle */ -static struct key *get_hkey_obj( handle_t hkey, unsigned int access ) +static struct key *get_hkey_obj( obj_handle_t hkey, unsigned int access ) { struct key *key; @@ -1330,7 +1330,7 @@ static void load_keys( struct key *key, FILE *f ) } /* load a part of the registry from a file */ -static void load_registry( struct key *key, handle_t handle ) +static void load_registry( struct key *key, obj_handle_t handle ) { struct object *obj; int fd; @@ -1420,7 +1420,7 @@ static void save_all_subkeys( struct key *key, FILE *f ) } /* save a registry branch to a file handle */ -static void save_registry( struct key *key, handle_t handle ) +static void save_registry( struct key *key, obj_handle_t handle ) { struct object *obj; int fd; diff --git a/server/request.c b/server/request.c index 7ed598fcd65..0414ed171e4 100644 --- a/server/request.c +++ b/server/request.c @@ -374,7 +374,7 @@ int receive_fd( struct process *process ) } /* send an fd to a client */ -int send_client_fd( struct process *process, int fd, handle_t handle ) +int send_client_fd( struct process *process, int fd, obj_handle_t handle ) { int ret; diff --git a/server/request.h b/server/request.h index f14b26efa89..94a659de0fe 100644 --- a/server/request.h +++ b/server/request.h @@ -52,7 +52,7 @@ extern void fatal_perror( const char *err, ... ); extern const char *get_config_dir(void); extern void *set_reply_data_size( size_t size ); extern int receive_fd( struct process *process ); -extern int send_client_fd( struct process *process, int fd, handle_t handle ); +extern int send_client_fd( struct process *process, int fd, obj_handle_t handle ); extern void read_request( struct thread *thread ); extern void write_reply( struct thread *thread ); extern unsigned int get_tick_count(void); diff --git a/server/semaphore.c b/server/semaphore.c index 80f96268b7c..bd1579ae3c7 100644 --- a/server/semaphore.c +++ b/server/semaphore.c @@ -82,7 +82,7 @@ static struct semaphore *create_semaphore( const WCHAR *name, size_t len, return sem; } -static unsigned int release_semaphore( handle_t handle, unsigned int count ) +static unsigned int release_semaphore( obj_handle_t handle, unsigned int count ) { struct semaphore *sem; unsigned int prev = 0; diff --git a/server/serial.c b/server/serial.c index dd5f90c038b..486b5abb477 100644 --- a/server/serial.c +++ b/server/serial.c @@ -174,7 +174,7 @@ static void serial_dump( struct object *obj, int verbose ) fprintf( stderr, "Port fd=%d mask=%x\n", serial->obj.fd, serial->eventmask ); } -struct serial *get_serial_obj( struct process *process, handle_t handle, unsigned int access ) +struct serial *get_serial_obj( struct process *process, obj_handle_t handle, unsigned int access ) { return (struct serial *)get_handle_obj( process, handle, access, &serial_ops ); } diff --git a/server/smb.c b/server/smb.c index ab0e84d2a77..790f50375a7 100644 --- a/server/smb.c +++ b/server/smb.c @@ -94,7 +94,7 @@ static void smb_dump( struct object *obj, int verbose ) fprintf( stderr, "smb file with socket fd=%d \n", smb->obj.fd ); } -struct smb *get_smb_obj( struct process *process, handle_t handle, unsigned int access ) +struct smb *get_smb_obj( struct process *process, obj_handle_t handle, unsigned int access ) { return (struct smb *)get_handle_obj( process, handle, access, &smb_ops ); } diff --git a/server/sock.c b/server/sock.c index f81b5ec7aa2..4f79d947d02 100644 --- a/server/sock.c +++ b/server/sock.c @@ -540,7 +540,7 @@ static struct object *create_socket( int family, int type, int protocol, unsigne } /* accept a socket (creates a new fd) */ -static struct sock *accept_socket( handle_t handle ) +static struct sock *accept_socket( obj_handle_t handle ) { struct sock *acceptsock; struct sock *sock; diff --git a/server/thread.c b/server/thread.c index 47208f3d4db..ecb987021eb 100644 --- a/server/thread.c +++ b/server/thread.c @@ -257,7 +257,7 @@ struct thread *get_thread_from_id( void *id ) } /* get a thread from a handle (and increment the refcount) */ -struct thread *get_thread_from_handle( handle_t handle, unsigned int access ) +struct thread *get_thread_from_handle( obj_handle_t handle, unsigned int access ) { return (struct thread *)get_handle_obj( current->process, handle, access, &thread_ops ); @@ -485,7 +485,7 @@ static void thread_timeout( void *ptr ) } /* select on a list of handles */ -static void select_on( int count, void *cookie, const handle_t *handles, +static void select_on( int count, void *cookie, const obj_handle_t *handles, int flags, int sec, int usec ) { int ret, i; @@ -872,7 +872,7 @@ DECL_HANDLER(open_thread) DECL_HANDLER(get_thread_info) { struct thread *thread; - handle_t handle = req->handle; + obj_handle_t handle = req->handle; if (!handle) thread = get_thread_from_id( req->tid_in ); else thread = get_thread_from_handle( req->handle, THREAD_QUERY_INFORMATION ); diff --git a/server/thread.h b/server/thread.h index f5d5f0159ab..e502c233a71 100644 --- a/server/thread.h +++ b/server/thread.h @@ -105,7 +105,7 @@ extern struct thread *current; extern struct thread *create_thread( int fd, struct process *process ); extern struct thread *get_thread_from_id( void *id ); -extern struct thread *get_thread_from_handle( handle_t handle, unsigned int access ); +extern struct thread *get_thread_from_handle( obj_handle_t handle, unsigned int access ); extern struct thread *get_thread_from_pid( int pid ); extern int suspend_thread( struct thread *thread, int check_limit ); extern int resume_thread( struct thread *thread ); diff --git a/server/trace.c b/server/trace.c index f610d049cab..b36cfa7de11 100644 --- a/server/trace.c +++ b/server/trace.c @@ -117,7 +117,7 @@ static void dump_varargs_ints( size_t size ) static void dump_varargs_handles( size_t size ) { - const handle_t *data = cur_data; + const obj_handle_t *data = cur_data; size_t len = size / sizeof(*data); fputc( '{', stderr ); diff --git a/server/window.c b/server/window.c index b78baf5be90..c5f836ebc41 100644 --- a/server/window.c +++ b/server/window.c @@ -39,7 +39,7 @@ struct property { unsigned short type; /* property type (see below) */ atom_t atom; /* property atom */ - handle_t handle; /* property handle (user-defined storage) */ + obj_handle_t handle; /* property handle (user-defined storage) */ }; enum property_type @@ -138,7 +138,7 @@ static void link_window( struct window *win, struct window *parent, struct windo } /* set a window property */ -static void set_property( struct window *win, atom_t atom, handle_t handle, +static void set_property( struct window *win, atom_t atom, obj_handle_t handle, enum property_type type ) { int i, free = -1; @@ -186,7 +186,7 @@ static void set_property( struct window *win, atom_t atom, handle_t handle, } /* remove a window property */ -static handle_t remove_property( struct window *win, atom_t atom ) +static obj_handle_t remove_property( struct window *win, atom_t atom ) { int i; @@ -205,7 +205,7 @@ static handle_t remove_property( struct window *win, atom_t atom ) } /* find a window property */ -static handle_t get_property( struct window *win, atom_t atom ) +static obj_handle_t get_property( struct window *win, atom_t atom ) { int i; diff --git a/tools/make_requests b/tools/make_requests index f23416c3968..54612d5bd53 100755 --- a/tools/make_requests +++ b/tools/make_requests @@ -31,7 +31,7 @@ "void*" => "%p", "time_t" => "%ld", "size_t" => "%d", - "handle_t" => "%d", + "obj_handle_t" => "%d", "atom_t" => "%04x", "user_handle_t" => "%08x", "rectangle_t" => "&dump_rectangle",