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

Function w_WriteFile

PoolParty/WinApi.cpp:84–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84void w_WriteFile(HANDLE hFile, LPCVOID lpBuffer, DWORD dwNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped)
85{
86 if (!WriteFile(hFile, lpBuffer, dwNumberOfBytesToWrite, lpNumberOfBytesWritten, lpOverlapped))
87 {
88
89 /* file flag overlapped wont return true, yet the operation wont fail */
90 if (lpOverlapped)
91 {
92 if (GetLastError() == ERROR_IO_PENDING)
93 {
94 return;
95 }
96 }
97 throw std::runtime_error(GetLastErrorString("WriteFile", GetLastError()));
98 }
99
100}
101
102std::shared_ptr<HANDLE> w_CreateJobObject(LPSECURITY_ATTRIBUTES lpJobAttributes, LPWSTR lpName)
103{

Callers 1

SetupExecutionMethod · 0.85

Calls 1

GetLastErrorStringFunction · 0.85

Tested by

no test coverage detected