MCPcopy Create free account
hub / github.com/LUX-Core/lux / getErrorMessage

Function getErrorMessage

src/crypto/RandomX/virtual_memory.cpp:51–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49
50#if defined(_WIN32) || defined(__CYGWIN__)
51std::string getErrorMessage(const char* function) {
52 LPSTR messageBuffer = nullptr;
53 size_t size = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
54 NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&messageBuffer, 0, NULL);
55 std::string message(messageBuffer, size);
56 LocalFree(messageBuffer);
57 return std::string(function) + std::string(": ") + message;
58}
59
60void setPrivilege(const char* pszPrivilege, BOOL bEnable) {
61 HANDLE hToken;

Callers 4

setPrivilegeFunction · 0.85
allocMemoryPagesFunction · 0.85
pageProtectFunction · 0.85
allocLargePagesMemoryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected