mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-29 08:20:02 -05:00
fix: Exit code getting in forwarder not working
This commit is contained in:
@@ -126,17 +126,18 @@ int launchExecutable() {
|
|||||||
// Wait for the child process to exit
|
// Wait for the child process to exit
|
||||||
::WaitForSingleObject(pi.hProcess, INFINITE);
|
::WaitForSingleObject(pi.hProcess, INFINITE);
|
||||||
|
|
||||||
// Clean up
|
// Get the exit code of the child process
|
||||||
::CloseHandle(pi.hProcess);
|
|
||||||
::CloseHandle(pi.hThread);
|
|
||||||
::CloseHandle(hChildStdoutRead);
|
|
||||||
|
|
||||||
DWORD exitCode = 0;
|
DWORD exitCode = 0;
|
||||||
if (::GetExitCodeProcess(pi.hProcess, &exitCode)) {
|
if (!::GetExitCodeProcess(pi.hProcess, &exitCode)) {
|
||||||
return static_cast<int>(exitCode);
|
exitCode = EXIT_FAILURE;
|
||||||
} else {
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clean up
|
||||||
|
::CloseHandle(pi.hProcess);
|
||||||
|
::CloseHandle(pi.hThread);
|
||||||
|
::CloseHandle(hChildStdoutRead);
|
||||||
|
|
||||||
|
return static_cast<int>(exitCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|||||||
Reference in New Issue
Block a user