MCPcopy Create free account
hub / github.com/SafeBreach-Labs/PoolParty / w_OpenProcess

Function w_OpenProcess

PoolParty/WinApi.cpp:3–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include "WinApi.hpp"
2
3std::shared_ptr<HANDLE> w_OpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId)
4{
5 const auto hTargetPid = RAISE_IF_HANDLE_INVALID(
6 "OpenProcess",
7 OpenProcess(
8 dwDesiredAccess,
9 bInheritHandle,
10 dwProcessId)
11 );
12
13 return std::shared_ptr<HANDLE>(new HANDLE(hTargetPid), [](HANDLE* p_handle) {CloseHandle(*p_handle); });
14}
15
16std::shared_ptr<HANDLE> w_DuplicateHandle(
17 HANDLE hSourceProcessHandle,

Callers 1

Calls 1

RAISE_IF_HANDLE_INVALIDFunction · 0.85

Tested by

no test coverage detected