4 * Copyright 1996 Alexandre Julliard
7 #ifndef __WINE_PROCESS_H
8 #define __WINE_PROCESS_H
16 /* Current Process pseudo-handle - Returned by GetCurrentProcess*/
17 #define CURRENT_PROCESS_PSEUDOHANDLE ((HANDLE)0x7fffffff)
19 /* Win32 process environment database */
22 LPSTR environ
; /* 00 Process environment strings */
23 DWORD unknown1
; /* 04 Unknown */
24 LPSTR cmd_line
; /* 08 Command line */
25 LPSTR cur_dir
; /* 0c Current directory */
26 STARTUPINFOA
*startup_info
; /* 10 Startup information */
27 HANDLE hStdin
; /* 14 Handle for standard input */
28 HANDLE hStdout
; /* 18 Handle for standard output */
29 HANDLE hStderr
; /* 1c Handle for standard error */
30 DWORD unknown2
; /* 20 Unknown */
31 DWORD inherit_console
; /* 24 Inherit console flag */
32 DWORD break_type
; /* 28 Console events flag */
33 void *break_sem
; /* 2c SetConsoleCtrlHandler semaphore */
34 void *break_event
; /* 30 SetConsoleCtrlHandler event */
35 void *break_thread
; /* 34 SetConsoleCtrlHandler thread */
36 void *break_handlers
; /* 38 List of console handlers */
37 /* The following are Wine-specific fields */
38 CRITICAL_SECTION section
; /* 3c Env DB critical section */
39 LPWSTR cmd_lineW
; /* 40 Unicode command line */
40 WORD env_sel
; /* 44 Environment strings selector */
43 /* Win32 process database */
46 LONG header
[2]; /* 00 Kernel object header */
47 DWORD unknown1
; /* 08 Unknown */
48 void *event
; /* 0c Pointer to an event object (unused) */
49 DWORD exit_code
; /* 10 Process exit code */
50 DWORD unknown2
; /* 14 Unknown */
51 HANDLE heap
; /* 18 Default process heap */
52 HANDLE mem_context
; /* 1c Process memory context */
53 DWORD flags
; /* 20 Flags */
54 void *pdb16
; /* 24 DOS PSP */
55 WORD PSP_sel
; /* 28 Selector to DOS PSP */
56 WORD module
; /* 2a IMTE for the process module */
57 WORD threads
; /* 2c Number of threads */
58 WORD running_threads
; /* 2e Number of running threads */
59 WORD unknown3
; /* 30 Unknown */
60 WORD ring0_threads
; /* 32 Number of ring 0 threads */
61 HANDLE system_heap
; /* 34 System heap to allocate handles */
62 HTASK task
; /* 38 Win16 task */
63 void *mem_map_files
; /* 3c Pointer to mem-mapped files */
64 ENVDB
*env_db
; /* 40 Environment database */
65 void *handle_table
; /* 44 Handle table */
66 struct _PDB
*parent
; /* 48 Parent process */
67 WINE_MODREF
*modref_list
; /* 4c MODREF list */
68 void *thread_list
; /* 50 List of threads */
69 void *debuggee_CB
; /* 54 Debuggee context block */
70 void *local_heap_free
; /* 58 Head of local heap free list */
71 DWORD unknown4
; /* 5c Unknown */
72 CRITICAL_SECTION crit_section
; /* 60 Critical section */
73 DWORD unknown5
[3]; /* 78 Unknown */
74 void *console
; /* 84 Console */
75 DWORD tls_bits
[2]; /* 88 TLS in-use bits */
76 DWORD process_dword
; /* 90 Unknown */
77 struct _PDB
*group
; /* 94 Process group */
78 WINE_MODREF
*exe_modref
; /* 98 MODREF for the process EXE */
79 LPTOP_LEVEL_EXCEPTION_FILTER top_filter
; /* 9c Top exception filter */
80 DWORD priority
; /* a0 Priority level */
81 HANDLE heap_list
; /* a4 Head of process heap list */
82 void *heap_handles
; /* a8 Head of heap handles list */
83 DWORD unknown6
; /* ac Unknown */
84 void *console_provider
; /* b0 Console provider (??) */
85 WORD env_selector
; /* b4 Selector to process environment */
86 WORD error_mode
; /* b6 Error mode */
87 HANDLE load_done_evt
; /* b8 Event for process loading done */
88 DWORD unknown7
; /* bc Unknown */
89 DWORD unknown8
; /* c0 Unknown (NT) */
90 LCID locale
; /* c4 Locale to be queried by GetThreadLocale (NT) */
91 /* The following are Wine-specific fields */
92 void *server_pid
; /* Server id for this process */
93 HANDLE
*dos_handles
; /* Handles mapping DOS -> Win32 */
94 struct _PDB
*next
; /* List reference - list of PDB's */
98 #define PDB32_WIN16_PROC 0x0008 /* Win16 process */
99 #define PDB32_DOS_PROC 0x0010 /* Dos process */
100 #define PDB32_CONSOLE_PROC 0x0020 /* Console process */
101 #define PDB32_FILE_APIS_OEM 0x0040 /* File APIs are OEM */
102 #define PDB32_WIN32S_PROC 0x8000 /* Win32s process */
104 /* scheduler/environ.c */
105 extern BOOL
ENV_BuildEnvironment( PDB
*pdb
);
106 extern BOOL
ENV_InheritEnvironment( PDB
*pdb
, LPCSTR env
);
107 extern void ENV_FreeEnvironment( PDB
*pdb
);
109 /* scheduler/process.c */
110 extern BOOL
PROCESS_Init( void );
111 extern PDB
*PROCESS_Current(void);
112 extern BOOL
PROCESS_IsCurrent( HANDLE handle
);
113 extern PDB
*PROCESS_Initial(void);
114 extern PDB
*PROCESS_IdToPDB( DWORD id
);
115 extern PDB
*PROCESS_Create( struct _NE_MODULE
*pModule
,
116 LPCSTR cmd_line
, LPCSTR env
,
117 HINSTANCE16 hInstance
, HINSTANCE16 hPrevInstance
,
118 LPSECURITY_ATTRIBUTES psa
, LPSECURITY_ATTRIBUTES tsa
,
120 STARTUPINFOA
*startup
, PROCESS_INFORMATION
*info
);
121 extern void PROCESS_FreePDB( PDB
*pdb
);
122 extern void PROCESS_SuspendOtherThreads(void);
123 extern void PROCESS_ResumeOtherThreads(void);
125 #endif /* __WINE_PROCESS_H */