Release 970415
[wine/multimedia.git] / include / process.h
blobdc6b421d5e6f7b6711e65277395f7aaccd72e85e
1 /*
2 * Process definitions
4 * Copyright 1996 Alexandre Julliard
5 */
7 #ifndef __WINE_PROCESS_H
8 #define __WINE_PROCESS_H
10 #include "windows.h"
11 #include "winbase.h"
12 #include "winnt.h"
13 #include "handle32.h"
14 #include "task.h"
16 /* Process handle entry */
17 typedef struct
19 DWORD flags; /* Handle flags */
20 K32OBJ *ptr; /* Object ptr */
21 } HANDLE_ENTRY;
23 /* Process handle table */
24 typedef struct
26 DWORD count;
27 HANDLE_ENTRY entries[1];
28 } HANDLE_TABLE;
30 /* Win32 process environment database */
31 typedef struct
33 LPSTR environ; /* 00 Process environment strings */
34 DWORD env_size; /* 04 Environment size (was: Unknown) */
35 LPSTR cmd_line; /* 08 Command line */
36 LPSTR cur_dir; /* 0c Current directory */
37 STARTUPINFO32A *startup_info; /* 10 Startup information */
38 HANDLE32 hStdin; /* 14 Handle for standard input */
39 HANDLE32 hStdout; /* 18 Handle for standard output */
40 HANDLE32 hStderr; /* 1c Handle for standard error */
41 DWORD unknown2; /* 20 Unknown */
42 DWORD inherit_console; /* 24 Inherit console flag */
43 DWORD break_type; /* 28 Console events flag */
44 K32OBJ *break_sem; /* 2c SetConsoleCtrlHandler semaphore */
45 K32OBJ *break_event; /* 30 SetConsoleCtrlHandler event */
46 K32OBJ *break_thread; /* 34 SetConsoleCtrlHandler thread */
47 void *break_handlers; /* 38 List of console handlers */
48 } ENVDB;
50 /* Win32 process database */
51 typedef struct _PDB32
53 K32OBJ header; /* 00 Kernel object header */
54 DWORD unknown1; /* 08 Unknown */
55 K32OBJ *event; /* 0c Pointer to an event object */
56 DWORD exit_code; /* 10 Process exit code */
57 DWORD unknown2; /* 14 Unknown */
58 HANDLE32 heap; /* 18 Default process heap */
59 HANDLE32 mem_context; /* 1c Process memory context */
60 DWORD flags; /* 20 Flags */
61 void *pdb16; /* 24 DOS PSP */
62 WORD PSP_sel; /* 28 Selector to DOS PSP */
63 WORD module; /* 2a IMTE for the process module */
64 WORD threads; /* 2c Number of threads */
65 WORD running_threads; /* 2e Number of running threads */
66 WORD unknown3; /* 30 Unknown */
67 WORD ring0_threads; /* 32 Number of ring 0 threads */
68 HANDLE32 system_heap; /* 34 System heap to allocate handles */
69 HTASK32 task; /* 38 Win16 task */
70 void *mem_map_files; /* 3c Pointer to mem-mapped files */
71 ENVDB *env_db; /* 40 Environment database */
72 HANDLE_TABLE *handle_table; /* 44 Handle table */
73 struct _PDB32 *parent; /* 48 Parent process */
74 void *modref_list; /* 4c MODREF list */
75 void *thread_list; /* 50 List of threads */
76 void *debuggee_CB; /* 54 Debuggee context block */
77 void *local_heap_free; /* 58 Head of local heap free list */
78 DWORD unknown4; /* 5c Unknown */
79 CRITICAL_SECTION crit_section; /* 60 Critical section */
80 DWORD unknown5[3]; /* 78 Unknown */
81 K32OBJ *console; /* 84 Console */
82 DWORD tls_bits[2]; /* 88 TLS in-use bits */
83 DWORD process_dword; /* 90 Unknown */
84 struct _PDB32 *group; /* 94 Process group */
85 void *exe_modref; /* 98 MODREF for the process EXE */
86 LPTOP_LEVEL_EXCEPTION_FILTER top_filter; /* 9c Top exception filter */
87 DWORD priority; /* a0 Priority level */
88 HANDLE32 heap_list; /* a4 Head of process heap list */
89 void *heap_handles; /* a8 Head of heap handles list */
90 DWORD unknown6; /* ac Unknown */
91 K32OBJ *console_provider; /* b0 Console provider (??) */
92 WORD env_selector; /* b4 Selector to process environment */
93 WORD error_mode; /* b6 Error mode */
94 K32OBJ *load_done_evt; /* b8 Event for process loading done */
95 DWORD unknown7; /* bc Unknown */
96 DWORD unknown8; /* c0 Unknown (NT) */
97 LCID locale; /* c4 Locale to be queried by GetThreadLocale (NT) */
98 } PDB32;
100 extern HANDLE32 PROCESS_AllocHandle( K32OBJ *ptr, DWORD flags);
101 extern K32OBJ *PROCESS_GetObjPtr( HANDLE32 handle, K32OBJ_TYPE type );
102 extern BOOL32 PROCESS_SetObjPtr( HANDLE32 handle, K32OBJ *ptr, DWORD flags );
104 extern PDB32 *PROCESS_Create( TDB *pTask );
105 extern void PROCESS_Destroy( K32OBJ *ptr );
107 extern PDB32 *pCurrentProcess;
109 #endif /* __WINE_PROCESS_H */