File indexing completed on 2025-01-30 10:02:28
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef BOOST_WINAPI_PROCESS_HPP_INCLUDED_
0010 #define BOOST_WINAPI_PROCESS_HPP_INCLUDED_
0011
0012 #include <boost/winapi/config.hpp>
0013 #include <boost/winapi/basic_types.hpp>
0014 #include <boost/winapi/access_rights.hpp>
0015 #include <boost/winapi/get_current_process.hpp>
0016 #include <boost/winapi/get_current_process_id.hpp>
0017 #include <boost/winapi/detail/header.hpp>
0018
0019 #ifdef BOOST_HAS_PRAGMA_ONCE
0020 #pragma once
0021 #endif
0022
0023 #if !defined( BOOST_USE_WINDOWS_H )
0024 extern "C" {
0025
0026 #if BOOST_WINAPI_PARTITION_APP_SYSTEM
0027 struct _PROCESS_INFORMATION;
0028 #if !defined( BOOST_NO_ANSI_APIS )
0029 struct _STARTUPINFOA;
0030 #endif
0031 struct _STARTUPINFOW;
0032 #endif
0033
0034 #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
0035
0036 #if BOOST_WINAPI_PARTITION_DESKTOP_SYSTEM
0037 struct _PROC_THREAD_ATTRIBUTE_LIST;
0038 #endif
0039
0040 #if BOOST_WINAPI_PARTITION_DESKTOP
0041 #if !defined( BOOST_NO_ANSI_APIS )
0042 struct _STARTUPINFOEXA;
0043 #endif
0044 struct _STARTUPINFOEXW;
0045 #endif
0046
0047 #endif
0048
0049 #if BOOST_WINAPI_PARTITION_DESKTOP_SYSTEM
0050
0051 #if !defined(_WIN32_WCE)
0052
0053 BOOST_WINAPI_IMPORT BOOST_NORETURN boost::winapi::VOID_ BOOST_WINAPI_WINAPI_CC
0054 ExitProcess(boost::winapi::UINT_ uExitCode);
0055 #endif
0056
0057 BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC GetExitCodeProcess(
0058 boost::winapi::HANDLE_ hProcess,
0059 boost::winapi::LPDWORD_ lpExitCode);
0060
0061 #if !defined( BOOST_NO_ANSI_APIS )
0062 BOOST_WINAPI_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC CreateProcessA(
0063 boost::winapi::LPCSTR_ lpApplicationName,
0064 boost::winapi::LPSTR_ lpCommandLine,
0065 ::_SECURITY_ATTRIBUTES* lpProcessAttributes,
0066 ::_SECURITY_ATTRIBUTES* lpThreadAttributes,
0067 boost::winapi::INT_ bInheritHandles,
0068 boost::winapi::DWORD_ dwCreationFlags,
0069 boost::winapi::LPVOID_ lpEnvironment,
0070 boost::winapi::LPCSTR_ lpCurrentDirectory,
0071 ::_STARTUPINFOA* lpStartupInfo,
0072 ::_PROCESS_INFORMATION* lpProcessInformation);
0073 #endif
0074
0075 #if defined(_WIN32_WCE)
0076 BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC CreateProcessW(
0077 boost::winapi::LPCWSTR_ lpApplicationName,
0078 boost::winapi::LPCWSTR_ lpCommandLine,
0079 ::_SECURITY_ATTRIBUTES* lpProcessAttributes,
0080 ::_SECURITY_ATTRIBUTES* lpThreadAttributes,
0081 boost::winapi::INT_ bInheritHandles,
0082 boost::winapi::DWORD_ dwCreationFlags,
0083 boost::winapi::LPVOID_ lpEnvironment,
0084 boost::winapi::LPWSTR_ lpCurrentDirectory,
0085 ::_STARTUPINFOW* lpStartupInfo,
0086 ::_PROCESS_INFORMATION* lpProcessInformation);
0087 #else
0088 BOOST_WINAPI_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC CreateProcessW(
0089 boost::winapi::LPCWSTR_ lpApplicationName,
0090 boost::winapi::LPWSTR_ lpCommandLine,
0091 ::_SECURITY_ATTRIBUTES* lpProcessAttributes,
0092 ::_SECURITY_ATTRIBUTES* lpThreadAttributes,
0093 boost::winapi::INT_ bInheritHandles,
0094 boost::winapi::DWORD_ dwCreationFlags,
0095 boost::winapi::LPVOID_ lpEnvironment,
0096 boost::winapi::LPCWSTR_ lpCurrentDirectory,
0097 ::_STARTUPINFOW* lpStartupInfo,
0098 ::_PROCESS_INFORMATION* lpProcessInformation);
0099 #endif
0100
0101
0102 #endif
0103
0104 #if BOOST_WINAPI_PARTITION_APP_SYSTEM
0105
0106 BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::HANDLE_ BOOST_WINAPI_WINAPI_CC OpenProcess(
0107 boost::winapi::DWORD_ dwDesiredAccess,
0108 boost::winapi::BOOL_ bInheritHandle,
0109 boost::winapi::DWORD_ dwProcessId);
0110
0111 #if defined(_WIN32_WCE)
0112 BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC TerminateProcess(
0113 boost::winapi::HANDLE_ hProcess,
0114 boost::winapi::DWORD_ uExitCode);
0115 #else
0116 BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC TerminateProcess(
0117 boost::winapi::HANDLE_ hProcess,
0118 boost::winapi::UINT_ uExitCode);
0119 #endif
0120
0121 #endif
0122
0123 }
0124 #endif
0125
0126 namespace boost {
0127 namespace winapi {
0128
0129 #if defined( BOOST_USE_WINDOWS_H )
0130
0131 #if BOOST_WINAPI_PARTITION_APP_SYSTEM
0132
0133 BOOST_CONSTEXPR_OR_CONST DWORD_ DEBUG_PROCESS_ = DEBUG_PROCESS;
0134 BOOST_CONSTEXPR_OR_CONST DWORD_ DEBUG_ONLY_THIS_PROCESS_ = DEBUG_ONLY_THIS_PROCESS;
0135 BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_SUSPENDED_ = CREATE_SUSPENDED;
0136 BOOST_CONSTEXPR_OR_CONST DWORD_ DETACHED_PROCESS_ = DETACHED_PROCESS;
0137 BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_NEW_CONSOLE_ = CREATE_NEW_CONSOLE;
0138 BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_NEW_PROCESS_GROUP_ = CREATE_NEW_PROCESS_GROUP;
0139 BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_UNICODE_ENVIRONMENT_ = CREATE_UNICODE_ENVIRONMENT;
0140 BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_SEPARATE_WOW_VDM_ = CREATE_SEPARATE_WOW_VDM;
0141 BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_SHARED_WOW_VDM_ = CREATE_SHARED_WOW_VDM;
0142 BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_FORCEDOS_ = CREATE_FORCEDOS;
0143 BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_BREAKAWAY_FROM_JOB_ = CREATE_BREAKAWAY_FROM_JOB;
0144 BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_DEFAULT_ERROR_MODE_ = CREATE_DEFAULT_ERROR_MODE;
0145 BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_NO_WINDOW_ = CREATE_NO_WINDOW;
0146
0147
0148 BOOST_CONSTEXPR_OR_CONST DWORD_ PROFILE_USER_ = PROFILE_USER;
0149 BOOST_CONSTEXPR_OR_CONST DWORD_ PROFILE_KERNEL_ = PROFILE_KERNEL;
0150 BOOST_CONSTEXPR_OR_CONST DWORD_ PROFILE_SERVER_ = PROFILE_SERVER;
0151
0152 #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
0153 BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_PROTECTED_PROCESS_ = CREATE_PROTECTED_PROCESS;
0154 BOOST_CONSTEXPR_OR_CONST DWORD_ EXTENDED_STARTUPINFO_PRESENT_ = EXTENDED_STARTUPINFO_PRESENT;
0155 #endif
0156
0157 #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN7
0158 BOOST_CONSTEXPR_OR_CONST DWORD_ INHERIT_PARENT_AFFINITY_ = INHERIT_PARENT_AFFINITY;
0159 #endif
0160
0161
0162 #if defined(UNDER_CE)
0163 BOOST_CONSTEXPR_OR_CONST DWORD_ INHERIT_CALLER_PRIORITY_ = INHERIT_CALLER_PRIORITY;
0164 #endif
0165
0166 #endif
0167
0168 #if BOOST_WINAPI_PARTITION_DESKTOP
0169
0170 BOOST_CONSTEXPR_OR_CONST DWORD_ STARTF_USESHOWWINDOW_ = STARTF_USESHOWWINDOW;
0171 BOOST_CONSTEXPR_OR_CONST DWORD_ STARTF_USESIZE_ = STARTF_USESIZE;
0172 BOOST_CONSTEXPR_OR_CONST DWORD_ STARTF_USEPOSITION_ = STARTF_USEPOSITION;
0173 BOOST_CONSTEXPR_OR_CONST DWORD_ STARTF_USECOUNTCHARS_ = STARTF_USECOUNTCHARS;
0174 BOOST_CONSTEXPR_OR_CONST DWORD_ STARTF_USEFILLATTRIBUTE_ = STARTF_USEFILLATTRIBUTE;
0175 BOOST_CONSTEXPR_OR_CONST DWORD_ STARTF_RUNFULLSCREEN_ = STARTF_RUNFULLSCREEN;
0176 BOOST_CONSTEXPR_OR_CONST DWORD_ STARTF_FORCEONFEEDBACK_ = STARTF_FORCEONFEEDBACK;
0177 BOOST_CONSTEXPR_OR_CONST DWORD_ STARTF_FORCEOFFFEEDBACK_ = STARTF_FORCEOFFFEEDBACK;
0178 BOOST_CONSTEXPR_OR_CONST DWORD_ STARTF_USESTDHANDLES_ = STARTF_USESTDHANDLES;
0179 BOOST_CONSTEXPR_OR_CONST DWORD_ STARTF_USEHOTKEY_ = STARTF_USEHOTKEY;
0180
0181 #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN7
0182 BOOST_CONSTEXPR_OR_CONST DWORD_ STARTF_TITLEISLINKNAME_ = STARTF_TITLEISLINKNAME;
0183 BOOST_CONSTEXPR_OR_CONST DWORD_ STARTF_TITLEISAPPID_ = STARTF_TITLEISAPPID;
0184 BOOST_CONSTEXPR_OR_CONST DWORD_ STARTF_PREVENTPINNING_ = STARTF_PREVENTPINNING;
0185 #endif
0186
0187 #endif
0188
0189 BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_TERMINATE_ = PROCESS_TERMINATE;
0190 BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_CREATE_THREAD_ = PROCESS_CREATE_THREAD;
0191 BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_SET_SESSIONID_ = PROCESS_SET_SESSIONID;
0192 BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_VM_OPERATION_ = PROCESS_VM_OPERATION;
0193 BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_VM_READ_ = PROCESS_VM_READ;
0194 BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_VM_WRITE_ = PROCESS_VM_WRITE;
0195 BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_DUP_HANDLE_ = PROCESS_DUP_HANDLE;
0196 BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_CREATE_PROCESS_ = PROCESS_CREATE_PROCESS;
0197 BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_SET_QUOTA_ = PROCESS_SET_QUOTA;
0198 BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_SET_INFORMATION_ = PROCESS_SET_INFORMATION;
0199 BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_QUERY_INFORMATION_ = PROCESS_QUERY_INFORMATION;
0200 BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_SUSPEND_RESUME_ = PROCESS_SUSPEND_RESUME;
0201 BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_ALL_ACCESS_ = PROCESS_ALL_ACCESS;
0202
0203 #else
0204
0205 #if BOOST_WINAPI_PARTITION_APP_SYSTEM
0206
0207 BOOST_CONSTEXPR_OR_CONST DWORD_ DEBUG_PROCESS_ = 0x1;
0208 BOOST_CONSTEXPR_OR_CONST DWORD_ DEBUG_ONLY_THIS_PROCESS_ = 0x2;
0209 BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_SUSPENDED_ = 0x4;
0210 BOOST_CONSTEXPR_OR_CONST DWORD_ DETACHED_PROCESS_ = 0x8;
0211 BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_NEW_CONSOLE_ = 0x10;
0212 BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_NEW_PROCESS_GROUP_ = 0x200;
0213 BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_UNICODE_ENVIRONMENT_ = 0x400;
0214 BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_SEPARATE_WOW_VDM_ = 0x800;
0215 BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_SHARED_WOW_VDM_ = 0x1000;
0216 BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_FORCEDOS_ = 0x2000;
0217 BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_BREAKAWAY_FROM_JOB_ = 0x1000000;
0218 BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_DEFAULT_ERROR_MODE_ = 0x4000000;
0219 BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_NO_WINDOW_ = 0x8000000;
0220
0221
0222 BOOST_CONSTEXPR_OR_CONST DWORD_ PROFILE_USER_ = 0x10000000;
0223 BOOST_CONSTEXPR_OR_CONST DWORD_ PROFILE_KERNEL_ = 0x20000000;
0224 BOOST_CONSTEXPR_OR_CONST DWORD_ PROFILE_SERVER_ = 0x40000000;
0225
0226 #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
0227 BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_PROTECTED_PROCESS_ = 0x40000;
0228 BOOST_CONSTEXPR_OR_CONST DWORD_ EXTENDED_STARTUPINFO_PRESENT_ = 0x80000;
0229 #endif
0230
0231 #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN7
0232 BOOST_CONSTEXPR_OR_CONST DWORD_ INHERIT_PARENT_AFFINITY_ = 0x10000;
0233 #endif
0234
0235
0236 #if defined(UNDER_CE)
0237 BOOST_CONSTEXPR_OR_CONST DWORD_ INHERIT_CALLER_PRIORITY_ = 0x20000;
0238 #endif
0239
0240 #endif
0241
0242 #if BOOST_WINAPI_PARTITION_DESKTOP
0243
0244 BOOST_CONSTEXPR_OR_CONST DWORD_ STARTF_USESHOWWINDOW_ = 0x00000001;
0245 BOOST_CONSTEXPR_OR_CONST DWORD_ STARTF_USESIZE_ = 0x00000002;
0246 BOOST_CONSTEXPR_OR_CONST DWORD_ STARTF_USEPOSITION_ = 0x00000004;
0247 BOOST_CONSTEXPR_OR_CONST DWORD_ STARTF_USECOUNTCHARS_ = 0x00000008;
0248 BOOST_CONSTEXPR_OR_CONST DWORD_ STARTF_USEFILLATTRIBUTE_ = 0x00000010;
0249 BOOST_CONSTEXPR_OR_CONST DWORD_ STARTF_RUNFULLSCREEN_ = 0x00000020;
0250 BOOST_CONSTEXPR_OR_CONST DWORD_ STARTF_FORCEONFEEDBACK_ = 0x00000040;
0251 BOOST_CONSTEXPR_OR_CONST DWORD_ STARTF_FORCEOFFFEEDBACK_ = 0x00000080;
0252 BOOST_CONSTEXPR_OR_CONST DWORD_ STARTF_USESTDHANDLES_ = 0x00000100;
0253 BOOST_CONSTEXPR_OR_CONST DWORD_ STARTF_USEHOTKEY_ = 0x00000200;
0254
0255 #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN7
0256 BOOST_CONSTEXPR_OR_CONST DWORD_ STARTF_TITLEISLINKNAME_ = 0x00000800;
0257 BOOST_CONSTEXPR_OR_CONST DWORD_ STARTF_TITLEISAPPID_ = 0x00001000;
0258 BOOST_CONSTEXPR_OR_CONST DWORD_ STARTF_PREVENTPINNING_ = 0x00002000;
0259 #endif
0260
0261 #endif
0262
0263 BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_TERMINATE_ = 0x0001;
0264 BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_CREATE_THREAD_ = 0x0002;
0265 BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_SET_SESSIONID_ = 0x0004;
0266 BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_VM_OPERATION_ = 0x0008;
0267 BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_VM_READ_ = 0x0010;
0268 BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_VM_WRITE_ = 0x0020;
0269 BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_DUP_HANDLE_ = 0x0040;
0270 BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_CREATE_PROCESS_ = 0x0080;
0271 BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_SET_QUOTA_ = 0x0100;
0272 BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_SET_INFORMATION_ = 0x0200;
0273 BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_QUERY_INFORMATION_ = 0x0400;
0274 BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_SUSPEND_RESUME_ = 0x0800;
0275 BOOST_CONSTEXPR_OR_CONST DWORD_ PROCESS_ALL_ACCESS_ = (STANDARD_RIGHTS_REQUIRED_ | SYNCHRONIZE_ |
0276 #if BOOST_USE_NTDDI_VERSION >= BOOST_WINAPI_NTDDI_WIN6
0277 0xFFFF
0278 #else
0279 0x0FFF
0280 #endif
0281 );
0282
0283 #endif
0284
0285 #if BOOST_WINAPI_PARTITION_APP_SYSTEM
0286
0287 #if defined( BOOST_USE_WINDOWS_H ) && !defined( BOOST_WINAPI_IS_MINGW )
0288
0289 BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_PRESERVE_CODE_AUTHZ_LEVEL_ = CREATE_PRESERVE_CODE_AUTHZ_LEVEL;
0290
0291
0292 BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_IGNORE_SYSTEM_DEFAULT_ = CREATE_IGNORE_SYSTEM_DEFAULT;
0293
0294 #else
0295
0296 BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_PRESERVE_CODE_AUTHZ_LEVEL_ = 0x2000000;
0297
0298
0299 BOOST_CONSTEXPR_OR_CONST DWORD_ CREATE_IGNORE_SYSTEM_DEFAULT_ = 0x80000000;
0300
0301 #endif
0302
0303 #endif
0304
0305 #if BOOST_WINAPI_PARTITION_APP_SYSTEM
0306
0307 typedef struct BOOST_MAY_ALIAS _PROCESS_INFORMATION {
0308 HANDLE_ hProcess;
0309 HANDLE_ hThread;
0310 DWORD_ dwProcessId;
0311 DWORD_ dwThreadId;
0312 } PROCESS_INFORMATION_, *PPROCESS_INFORMATION_, *LPPROCESS_INFORMATION_;
0313
0314 #if !defined(BOOST_NO_ANSI_APIS)
0315 typedef struct BOOST_MAY_ALIAS _STARTUPINFOA {
0316 DWORD_ cb;
0317 LPSTR_ lpReserved;
0318 LPSTR_ lpDesktop;
0319 LPSTR_ lpTitle;
0320 DWORD_ dwX;
0321 DWORD_ dwY;
0322 DWORD_ dwXSize;
0323 DWORD_ dwYSize;
0324 DWORD_ dwXCountChars;
0325 DWORD_ dwYCountChars;
0326 DWORD_ dwFillAttribute;
0327 DWORD_ dwFlags;
0328 WORD_ wShowWindow;
0329 WORD_ cbReserved2;
0330 LPBYTE_ lpReserved2;
0331 HANDLE_ hStdInput;
0332 HANDLE_ hStdOutput;
0333 HANDLE_ hStdError;
0334 } STARTUPINFOA_, *LPSTARTUPINFOA_;
0335 #endif
0336
0337 typedef struct BOOST_MAY_ALIAS _STARTUPINFOW {
0338 DWORD_ cb;
0339 LPWSTR_ lpReserved;
0340 LPWSTR_ lpDesktop;
0341 LPWSTR_ lpTitle;
0342 DWORD_ dwX;
0343 DWORD_ dwY;
0344 DWORD_ dwXSize;
0345 DWORD_ dwYSize;
0346 DWORD_ dwXCountChars;
0347 DWORD_ dwYCountChars;
0348 DWORD_ dwFillAttribute;
0349 DWORD_ dwFlags;
0350 WORD_ wShowWindow;
0351 WORD_ cbReserved2;
0352 LPBYTE_ lpReserved2;
0353 HANDLE_ hStdInput;
0354 HANDLE_ hStdOutput;
0355 HANDLE_ hStdError;
0356 } STARTUPINFOW_, *LPSTARTUPINFOW_;
0357
0358 #endif
0359
0360 #if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
0361
0362 #if BOOST_WINAPI_PARTITION_DESKTOP_SYSTEM
0363 typedef struct _PROC_THREAD_ATTRIBUTE_LIST PROC_THREAD_ATTRIBUTE_LIST_, *PPROC_THREAD_ATTRIBUTE_LIST_;
0364 #endif
0365
0366 #if BOOST_WINAPI_PARTITION_DESKTOP
0367
0368 #if !defined(BOOST_NO_ANSI_APIS)
0369 typedef struct BOOST_MAY_ALIAS _STARTUPINFOEXA {
0370 STARTUPINFOA_ StartupInfo;
0371 PPROC_THREAD_ATTRIBUTE_LIST_ lpAttributeList;
0372 } STARTUPINFOEXA_, *LPSTARTUPINFOEXA_;
0373 #endif
0374
0375 typedef struct BOOST_MAY_ALIAS _STARTUPINFOEXW {
0376 STARTUPINFOW_ StartupInfo;
0377 PPROC_THREAD_ATTRIBUTE_LIST_ lpAttributeList;
0378 } STARTUPINFOEXW_, *LPSTARTUPINFOEXW_;
0379
0380 #endif
0381
0382 #endif
0383
0384 #if BOOST_WINAPI_PARTITION_APP_SYSTEM
0385
0386 using ::TerminateProcess;
0387 using ::OpenProcess;
0388
0389 #endif
0390
0391 #if BOOST_WINAPI_PARTITION_DESKTOP_SYSTEM
0392
0393 using ::GetExitCodeProcess;
0394 #if !defined(_WIN32_WCE)
0395 using ::ExitProcess;
0396 #endif
0397
0398 BOOST_FORCEINLINE BOOST_NORETURN boost::winapi::VOID_ exit_process(
0399 boost::winapi::UINT_ uExitCode)
0400 {
0401 #if !defined(_WIN32_WCE)
0402 ExitProcess(uExitCode);
0403 #else
0404
0405 TerminateProcess(GetCurrentProcess(), (uExitCode));
0406 #endif
0407 }
0408
0409 #if !defined( BOOST_NO_ANSI_APIS )
0410 BOOST_FORCEINLINE BOOL_ CreateProcessA(
0411 LPCSTR_ lpApplicationName,
0412 LPSTR_ lpCommandLine,
0413 LPSECURITY_ATTRIBUTES_ lpProcessAttributes,
0414 LPSECURITY_ATTRIBUTES_ lpThreadAttributes,
0415 INT_ bInheritHandles,
0416 DWORD_ dwCreationFlags,
0417 LPVOID_ lpEnvironment,
0418 LPCSTR_ lpCurrentDirectory,
0419 LPSTARTUPINFOA_ lpStartupInfo,
0420 LPPROCESS_INFORMATION_ lpProcessInformation)
0421 {
0422 return ::CreateProcessA(
0423 lpApplicationName,
0424 lpCommandLine,
0425 reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpProcessAttributes),
0426 reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpThreadAttributes),
0427 bInheritHandles,
0428 dwCreationFlags,
0429 lpEnvironment,
0430 lpCurrentDirectory,
0431 reinterpret_cast< ::_STARTUPINFOA* >(lpStartupInfo),
0432 reinterpret_cast< ::_PROCESS_INFORMATION* >(lpProcessInformation));
0433 }
0434
0435 BOOST_FORCEINLINE BOOL_ create_process(
0436 LPCSTR_ lpApplicationName,
0437 LPSTR_ lpCommandLine,
0438 LPSECURITY_ATTRIBUTES_ lpProcessAttributes,
0439 LPSECURITY_ATTRIBUTES_ lpThreadAttributes,
0440 INT_ bInheritHandles,
0441 DWORD_ dwCreationFlags,
0442 LPVOID_ lpEnvironment,
0443 LPCSTR_ lpCurrentDirectory,
0444 LPSTARTUPINFOA_ lpStartupInfo,
0445 LPPROCESS_INFORMATION_ lpProcessInformation)
0446 {
0447 return ::CreateProcessA(
0448 lpApplicationName,
0449 lpCommandLine,
0450 reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpProcessAttributes),
0451 reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpThreadAttributes),
0452 bInheritHandles,
0453 dwCreationFlags,
0454 lpEnvironment,
0455 lpCurrentDirectory,
0456 reinterpret_cast< ::_STARTUPINFOA* >(lpStartupInfo),
0457 reinterpret_cast< ::_PROCESS_INFORMATION* >(lpProcessInformation));
0458 }
0459 #endif
0460
0461 BOOST_FORCEINLINE BOOL_ CreateProcessW(
0462 LPCWSTR_ lpApplicationName,
0463 LPWSTR_ lpCommandLine,
0464 LPSECURITY_ATTRIBUTES_ lpProcessAttributes,
0465 LPSECURITY_ATTRIBUTES_ lpThreadAttributes,
0466 INT_ bInheritHandles,
0467 DWORD_ dwCreationFlags,
0468 LPVOID_ lpEnvironment,
0469 LPCWSTR_ lpCurrentDirectory,
0470 LPSTARTUPINFOW_ lpStartupInfo,
0471 LPPROCESS_INFORMATION_ lpProcessInformation)
0472 {
0473 return ::CreateProcessW(
0474 lpApplicationName,
0475 lpCommandLine,
0476 reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpProcessAttributes),
0477 reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpThreadAttributes),
0478 bInheritHandles,
0479 dwCreationFlags,
0480 lpEnvironment,
0481 #if defined(_WIN32_WCE)
0482 const_cast<LPWSTR_>(lpCurrentDirectory),
0483 #else
0484 lpCurrentDirectory,
0485 #endif
0486 reinterpret_cast< ::_STARTUPINFOW* >(lpStartupInfo),
0487 reinterpret_cast< ::_PROCESS_INFORMATION* >(lpProcessInformation));
0488 }
0489
0490 BOOST_FORCEINLINE BOOL_ create_process(
0491 LPCWSTR_ lpApplicationName,
0492 LPWSTR_ lpCommandLine,
0493 LPSECURITY_ATTRIBUTES_ lpProcessAttributes,
0494 LPSECURITY_ATTRIBUTES_ lpThreadAttributes,
0495 INT_ bInheritHandles,
0496 DWORD_ dwCreationFlags,
0497 LPVOID_ lpEnvironment,
0498 LPCWSTR_ lpCurrentDirectory,
0499 LPSTARTUPINFOW_ lpStartupInfo,
0500 LPPROCESS_INFORMATION_ lpProcessInformation)
0501 {
0502 return ::CreateProcessW(
0503 lpApplicationName,
0504 lpCommandLine,
0505 reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpProcessAttributes),
0506 reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(lpThreadAttributes),
0507 bInheritHandles,
0508 dwCreationFlags,
0509 lpEnvironment,
0510 #if defined(_WIN32_WCE)
0511 const_cast<LPWSTR_>(lpCurrentDirectory),
0512 #else
0513 lpCurrentDirectory,
0514 #endif
0515 reinterpret_cast< ::_STARTUPINFOW* >(lpStartupInfo),
0516 reinterpret_cast< ::_PROCESS_INFORMATION* >(lpProcessInformation));
0517 }
0518
0519 #endif
0520
0521 }
0522 }
0523
0524 #include <boost/winapi/detail/footer.hpp>
0525
0526 #endif