diff --git a/include/server/process.h b/include/server/process.h new file mode 100644 index 00000000000..b155cbc738d --- /dev/null +++ b/include/server/process.h @@ -0,0 +1,63 @@ +/* + * Wine server processes + * + * Copyright (C) 1999 Alexandre Julliard + */ + +#ifndef __WINE_SERVER_PROCESS_H +#define __WINE_SERVER_PROCESS_H + +#ifndef __WINE_SERVER__ +#error This file can only be used in the Wine server +#endif + +#include "server/object.h" + +/* process structures */ + +struct process; + +struct process_snapshot +{ + struct process *process; /* process ptr */ + struct process *parent; /* process parent */ + int threads; /* number of threads */ + int priority; /* priority class */ +}; + +/* process functions */ + +extern struct process *create_process(void); +extern struct process *get_process_from_id( void *id ); +extern struct process *get_process_from_handle( int handle, unsigned int access ); +extern void add_process_thread( struct process *process, + struct thread *thread ); +extern void remove_process_thread( struct process *process, + struct thread *thread ); +extern void kill_process( struct process *process, int exit_code ); +extern void get_process_info( struct process *process, + struct get_process_info_reply *reply ); +extern void set_process_info( struct process *process, + struct set_process_info_request *req ); +extern int alloc_console( struct process *process ); +extern int free_console( struct process *process ); +extern struct object *get_console( struct process *process, int output ); +extern struct process_snapshot *process_snap( int *count ); + +/* handle functions */ + +/* alloc_handle takes a void *obj for convenience, but you better make sure */ +/* that the thing pointed to starts with a struct object... */ +extern int alloc_handle( struct process *process, void *obj, + unsigned int access, int inherit ); +extern int close_handle( struct process *process, int handle ); +extern int set_handle_info( struct process *process, int handle, + int mask, int flags ); +extern struct object *get_handle_obj( struct process *process, int handle, + unsigned int access, const struct object_ops *ops ); +extern int duplicate_handle( struct process *src, int src_handle, struct process *dst, + int dst_handle, unsigned int access, int inherit, int options ); +extern int open_object( const char *name, const struct object_ops *ops, + unsigned int access, int inherit ); + +#endif /* __WINE_SERVER_PROCESS_H */ diff --git a/server/console.c b/server/console.c index 7862bcb7467..0d095b41c84 100644 --- a/server/console.c +++ b/server/console.c @@ -23,6 +23,7 @@ #include "winerror.h" #include "winnt.h" #include "wincon.h" +#include "server/process.h" #include "server/thread.h" struct screen_buffer; diff --git a/server/event.c b/server/event.c index a6ca09968b1..04f51603918 100644 --- a/server/event.c +++ b/server/event.c @@ -10,6 +10,7 @@ #include "winerror.h" #include "winnt.h" +#include "server/process.h" #include "server/thread.h" struct event diff --git a/server/file.c b/server/file.c index bae1173541d..e2d1c371987 100644 --- a/server/file.c +++ b/server/file.c @@ -19,6 +19,7 @@ #include "winerror.h" #include "winbase.h" +#include "server/process.h" #include "server/thread.h" struct file diff --git a/server/mapping.c b/server/mapping.c index ceabd5d9a7c..b6f4b688b77 100644 --- a/server/mapping.c +++ b/server/mapping.c @@ -11,6 +11,7 @@ #include "winerror.h" #include "winnt.h" +#include "server/process.h" #include "server/thread.h" struct mapping diff --git a/server/mutex.c b/server/mutex.c index 62fe216dd99..1127de2f6b8 100644 --- a/server/mutex.c +++ b/server/mutex.c @@ -10,6 +10,7 @@ #include "winerror.h" #include "winnt.h" +#include "server/process.h" #include "server/thread.h" struct mutex diff --git a/server/semaphore.c b/server/semaphore.c index deb06182969..ad92a6953da 100644 --- a/server/semaphore.c +++ b/server/semaphore.c @@ -10,6 +10,7 @@ #include "winerror.h" #include "winnt.h" +#include "server/process.h" #include "server/thread.h" struct semaphore diff --git a/server/thread.c b/server/thread.c index 5bf2f70e533..cd07d0af47d 100644 --- a/server/thread.c +++ b/server/thread.c @@ -20,6 +20,7 @@ #include "winerror.h" #include "server.h" #include "server/thread.h" +#include "server/process.h" /* thread queues */