4 * Copyright (C) 1998 Alexandre Julliard
7 #ifndef __WINE_SERVER_OBJECT_H
8 #define __WINE_SERVER_OBJECT_H
10 #ifndef __WINE_SERVER__
11 #error This file can only be used in the Wine server
15 #include "server/request.h"
24 void (*dump)(struct object *,int); /* dump the object (for debugging) */
25 void (*destroy)(struct object *); /* destroy on refcount == 0 */
30 unsigned int refcount;
31 const struct object_ops *ops;
32 struct object_name *name;
35 extern void init_object( struct object *obj, const struct object_ops *ops,
37 /* grab/release_object can take any pointer, but you better make sure */
38 /* that the thing pointed to starts with a struct object... */
39 extern struct object *grab_object( void *obj );
40 extern void release_object( void *obj );
42 /* request handlers */
47 extern void call_req_handler( struct thread *thread, enum request req,
48 void *data, int len, int fd );
49 extern void call_timeout_handler( struct thread *thread );
50 extern void call_kill_handler( struct thread *thread, int exit_code );
52 extern void trace_request( enum request req, void *data, int len, int fd );
53 extern void trace_timeout(void);
54 extern void trace_kill( int exit_code );
55 extern void trace_reply( struct thread *thread, int type, int pass_fd,
56 struct iovec *vec, int veclen );
58 /* socket functions */
60 extern int add_client( int client_fd, struct thread *self );
61 extern void remove_client( int client_fd, int exit_code );
62 extern int get_initial_client_fd(void);
63 extern void set_timeout( int client_fd, struct timeval *when );
64 extern int send_reply_v( int client_fd, int type, int pass_fd,
65 struct iovec *vec, int veclen );
67 /* process functions */
71 extern struct process *create_process(void);
72 extern struct process *get_process_from_id( void *id );
73 extern struct process *get_process_from_handle( int handle, unsigned int access );
74 extern void add_process_thread( struct process *process,
75 struct thread *thread );
76 extern void remove_process_thread( struct process *process,
77 struct thread *thread );
78 extern void kill_process( struct process *process, int exit_code );
79 extern void get_process_info( struct process *process,
80 struct get_process_info_reply *reply );
82 /* handle functions */
84 /* alloc_handle takes a void *obj for convenience, but you better make sure */
85 /* that the thing pointed to starts with a struct object... */
86 extern int alloc_handle( struct process *process, void *obj,
87 unsigned int access, int inherit );
88 extern int close_handle( struct process *process, int handle );
89 extern int set_handle_info( struct process *process, int handle,
90 int mask, int flags );
91 extern struct object *get_handle_obj( struct process *process, int handle,
92 unsigned int access, const struct object_ops *ops );
93 extern int duplicate_handle( struct process *src, int src_handle, struct process *dst,
94 int dst_handle, unsigned int access, int inherit, int options );
96 extern int debug_level;
98 #endif /* __WINE_SERVER_OBJECT_H */