Log CreateProcessW() error code on Windows

Refs #2838 <https://github.com/Genymobile/scrcpy/issues/2838>
This commit is contained in:
Romain Vimont 2021-11-30 09:41:47 +01:00
parent cb8713eb1f
commit 86c91e183d

View file

@ -154,7 +154,9 @@ sc_process_execute_p(const char *const argv[], HANDLE *handle, unsigned flags,
dwCreationFlags, NULL, NULL, &si.StartupInfo, &pi); dwCreationFlags, NULL, NULL, &si.StartupInfo, &pi);
free(wide); free(wide);
if (!ok) { if (!ok) {
if (GetLastError() == ERROR_FILE_NOT_FOUND) { int err = GetLastError();
LOGE("CreateProcessW() error %d", err);
if (err == ERROR_FILE_NOT_FOUND) {
ret = SC_PROCESS_ERROR_MISSING_BINARY; ret = SC_PROCESS_ERROR_MISSING_BINARY;
} }
goto error_free_attribute_list; goto error_free_attribute_list;