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

Function w_CreateEvent

PoolParty/WinApi.cpp:40–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40std::shared_ptr<HANDLE> w_CreateEvent(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitalState, LPWSTR lpName)
41{
42 const auto hEvent = RAISE_IF_HANDLE_INVALID(
43 "CreateEvent",
44 CreateEvent(
45 lpEventAttributes,
46 bManualReset,
47 bInitalState,
48 lpName)
49 );
50
51 if (GetLastError() == ERROR_ALREADY_EXISTS)
52 {
53 std::printf("WARNING: The event `%S` already exists\n", lpName);
54 }
55
56 return std::shared_ptr<HANDLE>(new HANDLE(hEvent), [](HANDLE* p_handle){CloseHandle(*p_handle);});
57}
58
59std::shared_ptr<HANDLE> w_CreateFile(
60 LPCWSTR lpFileName,

Callers 1

SetupExecutionMethod · 0.85

Calls 1

RAISE_IF_HANDLE_INVALIDFunction · 0.85

Tested by

no test coverage detected