| 38 | } |
| 39 | |
| 40 | std::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 | |
| 59 | std::shared_ptr<HANDLE> w_CreateFile( |
| 60 | LPCWSTR lpFileName, |
no test coverage detected