From 1de4f4a059de35d9001ddc0f6f1546bbd32ed41d Mon Sep 17 00:00:00 2001 From: "DESKTOP-0Q3GGGJ\\Anthony" Date: Thu, 13 Oct 2022 23:46:41 -0600 Subject: [PATCH] kill event in case of error --- OldCPUSimulator/OldCPUSimulator.h | 2 +- OldCPUSimulator/shared.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OldCPUSimulator/OldCPUSimulator.h b/OldCPUSimulator/OldCPUSimulator.h index 3574c4e..7a56c1e 100644 --- a/OldCPUSimulator/OldCPUSimulator.h +++ b/OldCPUSimulator/OldCPUSimulator.h @@ -50,7 +50,7 @@ class OldCPUSimulator { NtQuerySystemInformationProc ntQuerySystemInformation = NULL; inline bool OldCPUSimulator::wait(UINT waitMs, UINT s2, HANDLE timeEvent) { - UINT timerID = timeSetEvent(waitMs, 0, (LPTIMECALLBACK)timeEvent, 0, TIME_ONESHOT | TIME_CALLBACK_EVENT_SET); + UINT timerID = timeSetEvent(waitMs, 0, (LPTIMECALLBACK)timeEvent, 0, TIME_ONESHOT | TIME_CALLBACK_EVENT_SET | TIME_KILL_SYNCHRONOUS); if (!timerID) { return false; diff --git a/OldCPUSimulator/shared.cpp b/OldCPUSimulator/shared.cpp index 19853cf..f355d91 100644 --- a/OldCPUSimulator/shared.cpp +++ b/OldCPUSimulator/shared.cpp @@ -207,7 +207,7 @@ std::string getArgumentSliceFromCommandLine(std::string commandLine, int begin, end += argumentsSize; } - end = min(argumentsSize - 1, end); + end = min((int)argumentsSize - 1, end); std::string argumentSlice = "";