No longer directly accessing debuggee memory.
[wine] / server / process.h
1 /*
2  * Wine server processes
3  *
4  * Copyright (C) 1999 Alexandre Julliard
5  */
6
7 #ifndef __WINE_SERVER_PROCESS_H
8 #define __WINE_SERVER_PROCESS_H
9
10 #ifndef __WINE_SERVER__
11 #error This file can only be used in the Wine server
12 #endif
13
14 #include "object.h"
15
16 /* process structures */
17
18 struct process
19 {
20     struct object        obj;             /* object header */
21     struct process      *next;            /* system-wide process list */
22     struct process      *prev;
23     struct thread       *thread_list;     /* head of the thread list */
24     struct thread       *debugger;        /* thread debugging this process */
25     struct file         *exe_file;        /* main exe file */
26     struct object       *handles;         /* handle entries */
27     int                  exit_code;       /* process exit code */
28     int                  running_threads; /* number of threads running in this process */
29     struct timeval       start_time;      /* absolute time at process start */
30     struct timeval       end_time;        /* absolute time at process end */
31     int                  priority;        /* priority class */
32     int                  affinity;        /* process affinity mask */
33     int                  suspend;         /* global process suspend count */
34     int                  create_flags;    /* process creation flags */
35     struct object       *console_in;      /* console input */
36     struct object       *console_out;     /* console output */
37     struct event        *init_event;      /* event for init done */
38     void                *ldt_copy;        /* pointer to LDT copy in client addr space */
39     void                *ldt_flags;       /* pointer to LDT flags in client addr space */
40     void                *module;          /* main module base address */
41     struct new_process_request *info;     /* startup info (freed after startup) */
42 };
43
44 struct process_snapshot
45 {
46     struct process *process;  /* process ptr */
47     struct process *parent;   /* process parent */
48     int             threads;  /* number of threads */
49     int             priority; /* priority class */
50 };
51
52 /* process functions */
53
54 extern struct thread *create_process( int fd, struct process *parent,
55                                       struct new_process_request *req,
56                                       const char *cmd_line, size_t len );
57 extern struct process *get_process_from_id( void *id );
58 extern struct process *get_process_from_handle( int handle, unsigned int access );
59 extern int process_set_debugger( struct process *process, struct thread *thread );
60 extern void add_process_thread( struct process *process,
61                                 struct thread *thread );
62 extern void remove_process_thread( struct process *process,
63                                    struct thread *thread );
64 extern void suspend_process( struct process *process );
65 extern void resume_process( struct process *process );
66 extern void kill_process( struct process *process, int exit_code );
67 extern void kill_debugged_processes( struct thread *debugger, int exit_code );
68 extern struct process_snapshot *process_snap( int *count );
69
70 static inline void *get_process_id( struct process *process ) { return process; }
71
72 #endif  /* __WINE_SERVER_PROCESS_H */