From 69a9d58733e770053294bdd25542958ead875a17 Mon Sep 17 00:00:00 2001 From: jazzwolf <114281491+jazzwolf@users.noreply.github.com> Date: Fri, 7 Oct 2022 18:52:50 +0200 Subject: [PATCH] Use utils:nt::handle --- src/runner/runner.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/runner/runner.cpp b/src/runner/runner.cpp index 738a0b95..b2a7ace2 100644 --- a/src/runner/runner.cpp +++ b/src/runner/runner.cpp @@ -1,5 +1,4 @@ -#define WIN32_LEAN_AND_MEAN -#include +#include #include int __stdcall WinMain(HINSTANCE, HINSTANCE, PSTR, int) @@ -10,11 +9,10 @@ int __stdcall WinMain(HINSTANCE, HINSTANCE, PSTR, int) if (parent_proc) { const auto pid = DWORD(atoi(parent_proc + strlen(command))); - auto* const process_handle = OpenProcess(SYNCHRONIZE, FALSE, pid); + const utils::nt::handle<> process_handle = OpenProcess(SYNCHRONIZE, FALSE, pid); if (process_handle) { WaitForSingleObject(process_handle, INFINITE); - CloseHandle(process_handle); return 0; } }