2 * processes.h: Process handles
5 * Dick Porter (dick@ximian.com)
7 * (C) 2002 Ximian, Inc.
10 #ifndef _WAPI_PROCESSES_H_
11 #define _WAPI_PROCESSES_H_
15 #include <mono/io-layer/handles.h>
16 #include <mono/io-layer/access.h>
21 STARTF_USESHOWWINDOW
=0x001,
23 STARTF_USEPOSITION
=0x004,
24 STARTF_USECOUNTCHARS
=0x008,
25 STARTF_USEFILLATTRIBUTE
=0x010,
26 STARTF_RUNFULLSCREEN
=0x020,
27 STARTF_FORCEONFEEDBACK
=0x040,
28 STARTF_FORCEOFFFEEDBACK
=0x080,
29 STARTF_USESTDHANDLES
=0x100
33 typedef struct _WapiStartupInfo WapiStartupInfo
;
35 struct _WapiStartupInfo
45 guint32 dwXCountChars
;
46 guint32 dwYCountChars
;
47 guint32 dwFillAttribute
;
48 WapiStartupFlags dwFlags
;
57 typedef struct _WapiProcessInformation WapiProcessInformation
;
59 struct _WapiProcessInformation
68 SEE_MASK_CLASSNAME
= 0x01,
69 SEE_MASK_CLASSKEY
= 0x03,
70 SEE_MASK_IDLIST
= 0x04,
71 SEE_MASK_INVOKEIDLIST
= 0x0c,
73 SEE_MASK_HOTKEY
= 0x20,
74 SEE_MASK_NOCLOSEPROCESS
= 0x40,
75 SEE_MASK_CONNECTNETDRV
= 0x80,
76 SEE_MASK_FLAG_DDEWAIT
= 0x100,
77 SEE_MASK_DOENVSUBST
= 0x200,
78 SEE_MASK_FLAG_NO_UI
= 0x400,
79 SEE_MASK_NO_CONSOLE
= 0x8000,
80 SEE_MASK_UNICODE
= 0x10000,
81 SEE_MASK_HMONITOR
= 0x200000,
82 /*SEE_MASK_FLAG_LOG_USAGE,*/
83 /*SEE_MASK_NOZONECHECKS,*/
84 } WapiShellExecuteInfoFlags
;
92 SW_SHOWNOACTIVATE
= 4,
95 SW_SHOWMINNOACTIVE
= 7,
99 } WapiShellExecuteShowFlags
;
101 typedef struct _WapiShellExecuteInfo WapiShellExecuteInfo
;
103 struct _WapiShellExecuteInfo
106 WapiShellExecuteInfoFlags fMask
;
108 const gunichar2
*lpVerb
;
109 const gunichar2
*lpFile
;
110 const gunichar2
*lpParameters
;
111 const gunichar2
*lpDirectory
;
112 WapiShellExecuteShowFlags nShow
;
115 const gunichar2
*lpClass
;
127 #define DEBUG_PROCESS 0x00000001
128 #define DEBUG_ONLY_THIS_PROCESS 0x00000002
129 #define CREATE_SUSPENDED 0x00000004
130 #define DETACHED_PROCESS 0x00000008
131 #define CREATE_NEW_CONSOLE 0x00000010
132 #define NORMAL_PRIORITY_CLASS 0x00000020
133 #define IDLE_PRIORITY_CLASS 0x00000040
134 #define HIGH_PRIORITY_CLASS 0x00000080
135 #define REALTIME_PRIORITY_CLASS 0x00000100
136 #define CREATE_NEW_PROCESS_GROUP 0x00000200
137 #define CREATE_UNICODE_ENVIRONMENT 0x00000400
138 #define CREATE_SEPARATE_WOW_VDM 0x00000800
139 #define CREATE_SHARED_WOW_VDM 0x00001000
140 #define CREATE_FORCEDOS 0x00002000
141 #define BELOW_NORMAL_PRIORITY_CLASS 0x00004000
142 #define ABOVE_NORMAL_PRIORITY_CLASS 0x00008000
143 #define CREATE_BREAKAWAY_FROM_JOB 0x01000000
144 #define CREATE_WITH_USERPROFILE 0x02000000
145 #define CREATE_DEFAULT_ERROR_MODE 0x04000000
146 #define CREATE_NO_WINDOW 0x08000000
149 #define CREATE_PRESERVE_CODE_AUTHZ_LEVEL find out the value for this one...
152 #define PROCESS_TERMINATE 0x0001
153 #define PROCESS_CREATE_THREAD 0x0002
154 #define PROCESS_SET_SESSIONID 0x0004
155 #define PROCESS_VM_OPERATION 0x0008
156 #define PROCESS_VM_READ 0x0010
157 #define PROCESS_VM_WRITE 0x0020
158 #define PROCESS_DUP_HANDLE 0x0040
159 #define PROCESS_CREATE_PROCESS 0x0080
160 #define PROCESS_SET_QUOTA 0x0100
161 #define PROCESS_SET_INFORMATION 0x0200
162 #define PROCESS_QUERY_INFORMATION 0x0400
163 #define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xfff)
165 extern gboolean
ShellExecuteEx (WapiShellExecuteInfo
*sei
);
166 extern gboolean
CreateProcess (const gunichar2
*appname
,
167 const gunichar2
*cmdline
,
168 WapiSecurityAttributes
*process_attrs
,
169 WapiSecurityAttributes
*thread_attrs
,
170 gboolean inherit_handles
, guint32 create_flags
,
171 gpointer environ
, const gunichar2
*cwd
,
172 WapiStartupInfo
*startup
,
173 WapiProcessInformation
*process_info
);
174 extern gpointer
GetCurrentProcess (void);
175 extern guint32
GetProcessId (gpointer handle
);
176 extern guint32
GetCurrentProcessId (void);
177 extern gboolean
EnumProcesses (guint32
*pids
, guint32 len
, guint32
*needed
);
178 extern gpointer
OpenProcess (guint32 access
, gboolean inherit
, guint32 pid
);
179 extern gboolean
GetExitCodeProcess (gpointer process
, guint32
*code
);
180 extern gboolean
GetProcessTimes (gpointer process
, WapiFileTime
*create_time
,
181 WapiFileTime
*exit_time
,
182 WapiFileTime
*kernel_time
,
183 WapiFileTime
*user_time
);
184 extern gboolean
EnumProcessModules (gpointer process
, gpointer
*modules
,
185 guint32 size
, guint32
*needed
);
186 extern guint32
GetModuleBaseName (gpointer process
, gpointer module
,
187 gunichar2
*basename
, guint32 size
);
188 extern gboolean
GetProcessWorkingSetSize (gpointer process
, size_t *min
,
190 extern gboolean
SetProcessWorkingSetSize (gpointer process
, size_t min
,
193 extern gboolean
TerminateProcess (gpointer process
, gint32 exitCode
);
197 #endif /* _WAPI_PROCESSES_H_ */