Merge pull request #49 from jazzwolf/main
Use utils:nt::handle instead of raw process handle
This commit is contained in:
commit
a4016c8c53
@ -1,5 +1,4 @@
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <Windows.h>
|
||||
#include <utils/nt.hpp>
|
||||
#include <cstdlib>
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user