ReactOS 0.4.16-dev-816-g135a9a9
CreateProcessA.cpp File Reference
Include dependency graph for CreateProcessA.cpp:

Go to the source code of this file.

Functions

BOOL __cdecl __acrt_CreateProcessA (LPCSTR const lpApplicationName, LPSTR const lpCommandLine, LPSECURITY_ATTRIBUTES const lpProcessAttributes, LPSECURITY_ATTRIBUTES const lpThreadAttributes, BOOL const bInheritHandles, DWORD const dwCreationFlags, LPVOID const lpEnvironment, LPCSTR const lpCurrentDirectory, LPSTARTUPINFOW const lpStartupInfo, LPPROCESS_INFORMATION const lpProcessInformation)
 

Function Documentation

◆ __acrt_CreateProcessA()

BOOL __cdecl __acrt_CreateProcessA ( LPCSTR const  lpApplicationName,
LPSTR const  lpCommandLine,
LPSECURITY_ATTRIBUTES const  lpProcessAttributes,
LPSECURITY_ATTRIBUTES const  lpThreadAttributes,
BOOL const  bInheritHandles,
DWORD const  dwCreationFlags,
LPVOID const  lpEnvironment,
LPCSTR const  lpCurrentDirectory,
LPSTARTUPINFOW const  lpStartupInfo,
LPPROCESS_INFORMATION const  lpProcessInformation 
)

Definition at line 11 of file CreateProcessA.cpp.

23{
24 __crt_internal_win32_buffer<wchar_t> wide_application_name;
26 __crt_internal_win32_buffer<wchar_t> wide_current_directory;
27
29 lpApplicationName,
30 wide_application_name,
32 );
33
34 if (cvt1 != 0) {
35 return FALSE;
36 }
37
39 lpCommandLine,
40 wide_command_line,
42 );
43
44 if (cvt2 != 0) {
45 return FALSE;
46 }
47
48 LPWSTR wide_current_directory_ptr = nullptr;
49
50 if (lpCurrentDirectory != nullptr) {
51 errno_t const cvt3 = __acrt_mbs_to_wcs_cp(
52 lpCurrentDirectory,
53 wide_current_directory,
55 );
56
57 if (cvt3 != 0) {
58 return FALSE;
59 }
60
61 wide_current_directory_ptr = wide_current_directory.data();
62 }
63
64 // converted_command_line is an out parameter, but is not reconverted to utf8 string,
65 // since it is only written to in the Wide version. CreateProcessA does not expect it
66 // to have changed.
67 return ::CreateProcessW(
68 wide_application_name.data(),
69 wide_command_line.data(),
70 lpProcessAttributes,
71 lpThreadAttributes,
72 bInheritHandles,
73 dwCreationFlags,
74 lpEnvironment,
75 wide_current_directory_ptr,
76 lpStartupInfo,
77 lpProcessInformation
78 );
79}
errno_t __acrt_mbs_to_wcs_cp(char const *const null_terminated_input_string, __crt_win32_buffer< wchar_t, ResizePolicy > &win32_buffer, unsigned int const code_page)
unsigned int __acrt_get_utf8_acp_compatibility_codepage()
#define FALSE
Definition: types.h:117
errno_t const cvt2
Definition: strftime.cpp:161
errno_t const cvt1
Definition: strftime.cpp:139
int errno_t
Definition: corecrt.h:615
WCHAR * LPWSTR
Definition: xmlstorage.h:184