Re: [PATCH 3/4] wshom.ocx: Implement Exec() method
Hi Nikolay, On 03/09/15 06:41, Nikolay Sivov wrote:
+ if (!CreateProcessW(NULL, command, NULL, NULL, FALSE, 0, NULL, NULL, &si, &info)) + return HRESULT_FROM_WIN32(GetLastError()); + + hr = WshExec_create(&info, ret); + if (FAILED(hr)) { + TerminateProcess(info.hProcess, hr);
This is questionable error handling. You wouldn't need that if you called WshExec_create before CreateProcessW. Cheers, Jacek
On 09.03.2015 13:55, Jacek Caban wrote:
Hi Nikolay,
On 03/09/15 06:41, Nikolay Sivov wrote:
+ if (!CreateProcessW(NULL, command, NULL, NULL, FALSE, 0, NULL, NULL, &si, &info)) + return HRESULT_FROM_WIN32(GetLastError()); + + hr = WshExec_create(&info, ret); + if (FAILED(hr)) { + TerminateProcess(info.hProcess, hr); This is questionable error handling. You wouldn't need that if you called WshExec_create before CreateProcessW. I did it like that to cleanly pass 'info' to newly created instance, but you're probably right, I'll change that.
Cheers, Jacek
participants (2)
-
Jacek Caban -
Nikolay Sivov