Call timeBeginPeriod/timeEndPeriod.

This commit is contained in:
Skyth 2024-12-18 19:21:40 +03:00
parent 8d834494f5
commit 8e602837e8
3 changed files with 16 additions and 1 deletions

View file

@ -15,6 +15,11 @@ void App::Restart(std::vector<std::string> restartArgs)
void App::Exit()
{
Config::Save();
#ifdef _WIN32
timeEndPeriod(1);
#endif
std::_Exit(0);
}

View file

@ -546,7 +546,13 @@ uint32_t KeDelayExecutionThread(uint32_t WaitMode, bool Alertable, be<int64_t>*
if (Alertable)
return STATUS_USER_APC;
std::this_thread::sleep_for(std::chrono::milliseconds(GuestTimeoutToMilliseconds(Timeout)));
uint32_t timeout = GuestTimeoutToMilliseconds(Timeout);
#ifdef _WIN32
Sleep(timeout);
#else
std::this_thread::sleep_for(std::chrono::milliseconds(timeout));
#endif
return STATUS_SUCCESS;
}

View file

@ -137,6 +137,10 @@ uint32_t LdrLoadModule(const std::filesystem::path &path)
int main(int argc, char *argv[])
{
#ifdef _WIN32
timeBeginPeriod(1);
#endif
os::logger::Init();
bool forceInstaller = false;