From 6679e3eea5cdbba41aaaea53306c3a9f6f754f12 Mon Sep 17 00:00:00 2001 From: Florian Roth Date: Tue, 23 Mar 2021 21:17:57 +0100 Subject: [PATCH] fix: pass through exit code --- source/Raccine/raccine.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/source/Raccine/raccine.cpp b/source/Raccine/raccine.cpp index 1a0f1d9..39e6c83 100644 --- a/source/Raccine/raccine.cpp +++ b/source/Raccine/raccine.cpp @@ -15,6 +15,7 @@ int wmain(int argc, WCHAR* argv[]) { setlocale(LC_ALL, ""); + DWORD threadExitcode = 0; std::vector command_line; std::wstring sCommandLine; @@ -122,6 +123,12 @@ int wmain(int argc, WCHAR* argv[]) ResumeThread(hThread); WaitForSingleObject(hProcess, INFINITE); + if (GetExitCodeThread(hThread, &threadExitcode) == false) + { + if (configuration.is_debug_mode()) { + wprintf(L"can't get return code. error number: %d\n", GetLastError()); + } + } } } else { @@ -130,8 +137,11 @@ int wmain(int argc, WCHAR* argv[]) } } + //if (configuration.is_debug_mode()) { + // wprintf(L"return code: %d\n", threadExitcode); + //} // Log events logSend(sListLogs); - return 0; + return threadExitcode; }