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

Function w_CreateFile

PoolParty/WinApi.cpp:59–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59std::shared_ptr<HANDLE> w_CreateFile(
60 LPCWSTR lpFileName,
61 DWORD dwDesiredAccess,
62 DWORD dwShareMode,
63 LPSECURITY_ATTRIBUTES lpSecurityAttributes,
64 DWORD dwCreationDisposition,
65 DWORD dwFlagsAndAttributes,
66 HANDLE hTemplateFile
67)
68{
69 const auto hFile = RAISE_IF_HANDLE_INVALID(
70 "CreateFile",
71 CreateFile(
72 lpFileName,
73 dwDesiredAccess,
74 dwShareMode,
75 lpSecurityAttributes,
76 dwCreationDisposition,
77 dwFlagsAndAttributes,
78 hTemplateFile)
79 );
80
81 return std::shared_ptr<HANDLE>(new HANDLE(hFile), [](HANDLE* p_handle) {CloseHandle(*p_handle); });
82}
83
84void w_WriteFile(HANDLE hFile, LPCVOID lpBuffer, DWORD dwNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped)
85{

Callers 1

SetupExecutionMethod · 0.85

Calls 1

RAISE_IF_HANDLE_INVALIDFunction · 0.85

Tested by

no test coverage detected