@@ -44,13 +44,20 @@ internal actual suspend fun executeCommand(
4444 }
4545
4646 var hOut: HANDLE ? = CreateFileW (
47- /* lpFileName = */ outPath,
48- /* dwDesiredAccess = */ GENERIC_WRITE .toUInt(),
49- /* dwShareMode = */ (FILE_SHARE_READ or FILE_SHARE_WRITE ).toUInt(),
50- /* lpSecurityAttributes = */ sa.ptr,
51- /* dwCreationDisposition = */ CREATE_ALWAYS .toUInt(),
52- /* dwFlagsAndAttributes = */ FILE_ATTRIBUTE_NORMAL .toUInt(),
53- /* hTemplateFile = */ null ,
47+ /* lpFileName = */
48+ outPath,
49+ /* dwDesiredAccess = */
50+ GENERIC_WRITE .toUInt(),
51+ /* dwShareMode = */
52+ (FILE_SHARE_READ or FILE_SHARE_WRITE ).toUInt(),
53+ /* lpSecurityAttributes = */
54+ sa.ptr,
55+ /* dwCreationDisposition = */
56+ CREATE_ALWAYS .toUInt(),
57+ /* dwFlagsAndAttributes = */
58+ FILE_ATTRIBUTE_NORMAL .toUInt(),
59+ /* hTemplateFile = */
60+ null ,
5461 )
5562 if (hOut == INVALID_HANDLE_VALUE ) error(" CreateFileW failed for temp output (GetLastError=${GetLastError ()} )" )
5663
@@ -80,16 +87,26 @@ internal actual suspend fun executeCommand(
8087 val pi = alloc<PROCESS_INFORMATION >()
8188
8289 val created = CreateProcessW (
83- /* lpApplicationName = */ cmdExe,
84- /* lpCommandLine = */ cmdLineBuf,
85- /* lpProcessAttributes = */ null ,
86- /* lpThreadAttributes = */ null ,
87- /* bInheritHandles = */ TRUE ,
88- /* dwCreationFlags = */ CREATE_NO_WINDOW .toUInt(),
89- /* lpEnvironment = */ null ,
90- /* lpCurrentDirectory = */ null ,
91- /* lpStartupInfo = */ si.ptr,
92- /* lpProcessInformation = */ pi.ptr,
90+ /* lpApplicationName = */
91+ cmdExe,
92+ /* lpCommandLine = */
93+ cmdLineBuf,
94+ /* lpProcessAttributes = */
95+ null ,
96+ /* lpThreadAttributes = */
97+ null ,
98+ /* bInheritHandles = */
99+ TRUE ,
100+ /* dwCreationFlags = */
101+ CREATE_NO_WINDOW .toUInt(),
102+ /* lpEnvironment = */
103+ null ,
104+ /* lpCurrentDirectory = */
105+ null ,
106+ /* lpStartupInfo = */
107+ si.ptr,
108+ /* lpProcessInformation = */
109+ pi.ptr,
93110 )
94111 if (created == 0 ) error(" CreateProcessW failed (GetLastError=${GetLastError ()} )" )
95112
@@ -124,13 +141,20 @@ internal actual suspend fun executeCommand(
124141
125142 // 7) read back bounded
126143 val hIn: HANDLE ? = CreateFileW (
127- /* lpFileName = */ outPath,
128- /* dwDesiredAccess = */ GENERIC_READ .toUInt(),
129- /* dwShareMode = */ (FILE_SHARE_READ or FILE_SHARE_WRITE ).toUInt(),
130- /* lpSecurityAttributes = */ null ,
131- /* dwCreationDisposition = */ OPEN_EXISTING .toUInt(),
132- /* dwFlagsAndAttributes = */ FILE_ATTRIBUTE_NORMAL .toUInt(),
133- /* hTemplateFile = */ null ,
144+ /* lpFileName = */
145+ outPath,
146+ /* dwDesiredAccess = */
147+ GENERIC_READ .toUInt(),
148+ /* dwShareMode = */
149+ (FILE_SHARE_READ or FILE_SHARE_WRITE ).toUInt(),
150+ /* lpSecurityAttributes = */
151+ null ,
152+ /* dwCreationDisposition = */
153+ OPEN_EXISTING .toUInt(),
154+ /* dwFlagsAndAttributes = */
155+ FILE_ATTRIBUTE_NORMAL .toUInt(),
156+ /* hTemplateFile = */
157+ null ,
134158 )
135159 if (hIn == INVALID_HANDLE_VALUE ) {
136160 _wunlink (outPath.wideCString(this ))
0 commit comments