mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-27 23:37:05 -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
|
||||
::WaitForSingleObject(pi.hProcess, INFINITE);
|
||||
|
||||
// Clean up
|
||||
::CloseHandle(pi.hProcess);
|
||||
::CloseHandle(pi.hThread);
|
||||
::CloseHandle(hChildStdoutRead);
|
||||
|
||||
// Get the exit code of the child process
|
||||
DWORD exitCode = 0;
|
||||
if (::GetExitCodeProcess(pi.hProcess, &exitCode)) {
|
||||
return static_cast<int>(exitCode);
|
||||
} else {
|
||||
return EXIT_FAILURE;
|
||||
if (!::GetExitCodeProcess(pi.hProcess, &exitCode)) {
|
||||
exitCode = EXIT_FAILURE;
|
||||
}
|
||||
|
||||
// Clean up
|
||||
::CloseHandle(pi.hProcess);
|
||||
::CloseHandle(pi.hThread);
|
||||
::CloseHandle(hChildStdoutRead);
|
||||
|
||||
return static_cast<int>(exitCode);
|
||||
}
|
||||
|
||||
int main() {
|
||||
|
||||
Reference in New Issue
Block a user