diff --git a/rpm.cpp b/rpm.cpp new file mode 100644 index 00000000..fc354e12 --- /dev/null +++ b/rpm.cpp @@ -0,0 +1,93 @@ +#include +#include +#include + +#define uint size_t +#define PAGE_SIZE 0x1000 + +#ifdef _WIN64 +#define HIGHEST_USER_ADDR 0x7FFFFFEFFFF +#else //x86 +#define HIGHEST_USER_ADDR 0x7FFEFFFF +#endif // _WIN64 + +bool readblock(uint addr, unsigned char block[PAGE_SIZE]) +{ + printf("readblock(%X[%X])\n", addr, PAGE_SIZE); + memset(block, 0xFF, PAGE_SIZE); + return true; +} + +bool memread(uint addr, unsigned char* data, uint size) +{ + //check if the address is inside user space + if(addr > HIGHEST_USER_ADDR) + return false; + + puts("-start-"); + printf(" addr: %X\n size: %X\n", addr, size); + + //calculate the start page + uint start = addr & ~(PAGE_SIZE - 1); + printf(" start: %X\n", start); + + //calculate the end page + uint end = addr + size; + uint x = end & (PAGE_SIZE - 1); + if(x) + end += (PAGE_SIZE - x); + printf(" end: %X\n", end); + + //calculate the number of pages to read + uint npages = (end - start) / PAGE_SIZE; + printf("npages: %d\n\n", npages); + + //go over all pages + for(uint i = 0, j = start; i < npages; i++) + { + //read one page (j should always align with PAGE_SIZE) + unsigned char block[PAGE_SIZE]; + if(!readblock(j, block)) + { + return false; + } + + //these are the offsets and sizes in the block to write to append to the output buffer + uint roffset = 0; + uint rsize = PAGE_SIZE; + + if(i == npages - 1) //last page (first because there might only be one page) + { + rsize = size - (j - start); //remaining size + } + else if(i == 0) //first page + { + roffset = addr & (PAGE_SIZE - 1); + rsize = PAGE_SIZE - roffset; + } + + printf("roffset: %X\n rsize: %X\n", roffset, rsize); + puts(""); + + //copy the required block data in the output buffer + memcpy(data, block + roffset, rsize); + data += rsize; + + j += rsize; + } + + puts("--end--\n"); + return true; +} + +int main() +{ + unsigned char out[0x10000] = {0}; + memread(0x12A45, out, 0x3456); + memread(0x12000, out, 0x456); + memread(0x12000, out, 0x3456); + memread(0x12000, out, 0x4000); + memread(0x12ff0, out, 0x16); + memread(0x100, out, 0x3090); + return 0; +} \ No newline at end of file diff --git a/x64_dbg.sln b/x64_dbg.sln index 9f3fc16c..a7e946e6 100644 --- a/x64_dbg.sln +++ b/x64_dbg.sln @@ -1,8 +1,6 @@  -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.31101.0 -MinimumVisualStudioVersion = 10.0.40219.1 +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x64_dbg_bridge", "x64_dbg_bridge\x64_dbg_bridge.vcxproj", "{944D9923-CB1A-6F6C-BCBC-9E00A71954C1}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x64_dbg_exe", "x64_dbg_exe\x64_dbg_exe.vcxproj", "{3A22175E-6B72-FDCC-1603-C4A2163C7900}" @@ -19,39 +17,22 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x64_dbg_launcher", "x64_dbg EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {944D9923-CB1A-6F6C-BCBC-9E00A71954C1}.Debug|Win32.ActiveCfg = Debug|Win32 - {944D9923-CB1A-6F6C-BCBC-9E00A71954C1}.Debug|Win32.Build.0 = Debug|Win32 - {944D9923-CB1A-6F6C-BCBC-9E00A71954C1}.Debug|x64.ActiveCfg = Debug|x64 - {944D9923-CB1A-6F6C-BCBC-9E00A71954C1}.Debug|x64.Build.0 = Debug|x64 {944D9923-CB1A-6F6C-BCBC-9E00A71954C1}.Release|Win32.ActiveCfg = Release|Win32 {944D9923-CB1A-6F6C-BCBC-9E00A71954C1}.Release|Win32.Build.0 = Release|Win32 {944D9923-CB1A-6F6C-BCBC-9E00A71954C1}.Release|x64.ActiveCfg = Release|x64 {944D9923-CB1A-6F6C-BCBC-9E00A71954C1}.Release|x64.Build.0 = Release|x64 - {3A22175E-6B72-FDCC-1603-C4A2163C7900}.Debug|Win32.ActiveCfg = Debug|Win32 - {3A22175E-6B72-FDCC-1603-C4A2163C7900}.Debug|Win32.Build.0 = Debug|Win32 - {3A22175E-6B72-FDCC-1603-C4A2163C7900}.Debug|x64.ActiveCfg = Debug|x64 - {3A22175E-6B72-FDCC-1603-C4A2163C7900}.Debug|x64.Build.0 = Debug|x64 {3A22175E-6B72-FDCC-1603-C4A2163C7900}.Release|Win32.ActiveCfg = Release|Win32 {3A22175E-6B72-FDCC-1603-C4A2163C7900}.Release|Win32.Build.0 = Release|Win32 {3A22175E-6B72-FDCC-1603-C4A2163C7900}.Release|x64.ActiveCfg = Release|x64 {3A22175E-6B72-FDCC-1603-C4A2163C7900}.Release|x64.Build.0 = Release|x64 - {E6548308-401E-3A8A-5819-905DB90522A6}.Debug|Win32.ActiveCfg = Debug|Win32 - {E6548308-401E-3A8A-5819-905DB90522A6}.Debug|Win32.Build.0 = Debug|Win32 - {E6548308-401E-3A8A-5819-905DB90522A6}.Debug|x64.ActiveCfg = Debug|x64 - {E6548308-401E-3A8A-5819-905DB90522A6}.Debug|x64.Build.0 = Debug|x64 {E6548308-401E-3A8A-5819-905DB90522A6}.Release|Win32.ActiveCfg = Release|Win32 {E6548308-401E-3A8A-5819-905DB90522A6}.Release|Win32.Build.0 = Release|Win32 {E6548308-401E-3A8A-5819-905DB90522A6}.Release|x64.ActiveCfg = Release|x64 {E6548308-401E-3A8A-5819-905DB90522A6}.Release|x64.Build.0 = Release|x64 - {AC3F927A-4079-4C97-B8BE-8D04546802E7}.Debug|Win32.ActiveCfg = Debug|Win32 - {AC3F927A-4079-4C97-B8BE-8D04546802E7}.Debug|Win32.Build.0 = Debug|Win32 - {AC3F927A-4079-4C97-B8BE-8D04546802E7}.Debug|x64.ActiveCfg = Debug|Win32 {AC3F927A-4079-4C97-B8BE-8D04546802E7}.Release|Win32.ActiveCfg = Release|Win32 {AC3F927A-4079-4C97-B8BE-8D04546802E7}.Release|Win32.Build.0 = Release|Win32 {AC3F927A-4079-4C97-B8BE-8D04546802E7}.Release|x64.ActiveCfg = Release|Win32 diff --git a/x64_dbg_bridge/bridgemain.h b/x64_dbg_bridge/bridgemain.h index 28cbfa2c..c64fe3c1 100644 --- a/x64_dbg_bridge/bridgemain.h +++ b/x64_dbg_bridge/bridgemain.h @@ -540,8 +540,8 @@ typedef struct typedef struct { int ThreadNumber; - HANDLE Handle; - DWORD ThreadId; + HANDLE hThread; + DWORD dwThreadId; duint ThreadStartAddress; duint ThreadLocalBase; char threadName[MAX_THREAD_NAME_SIZE]; diff --git a/x64_dbg_bridge/x64_dbg_bridge.vcxproj b/x64_dbg_bridge/x64_dbg_bridge.vcxproj index da4f609d..a68af05d 100644 --- a/x64_dbg_bridge/x64_dbg_bridge.vcxproj +++ b/x64_dbg_bridge/x64_dbg_bridge.vcxproj @@ -1,14 +1,6 @@  - - Debug - Win32 - - - Debug - x64 - Release Win32 @@ -35,22 +27,10 @@ DynamicLibrary false - v120 - - - DynamicLibrary - false - v120 DynamicLibrary false - v120 - - - DynamicLibrary - false - v120 @@ -58,15 +38,9 @@ - - - - - - false @@ -74,22 +48,11 @@ $(Platform)\$(Configuration)\ x32_bridge - - false - $(SolutionDir)bin\x32\ - $(Platform)\$(Configuration)\ - x32_bridge - false $(SolutionDir)bin\x64\ x64_bridge - - false - $(SolutionDir)bin\x64\ - x64_bridge - BUILD_BRIDGE;WIN32;NDEBUG;_WINDOWS;_USRDLL;X64_DBG_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) @@ -106,22 +69,6 @@ true - - - BUILD_BRIDGE;WIN32;NDEBUG;_WINDOWS;_USRDLL;X64_DBG_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - MultiThreadedDLL - Level3 - ProgramDatabase - MaxSpeed - - - MachineX86 - true - Windows - true - true - - BUILD_BRIDGE;WIN32;NDEBUG;_WINDOWS;_USRDLL;X64_DBG_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) @@ -136,20 +83,6 @@ true - - - BUILD_BRIDGE;WIN32;NDEBUG;_WINDOWS;_USRDLL;X64_DBG_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - MultiThreadedDLL - Level3 - ProgramDatabase - - - true - Windows - true - true - - diff --git a/x64_dbg_bridge/x64_dbg_bridge.vcxproj.user b/x64_dbg_bridge/x64_dbg_bridge.vcxproj.user index bdb12b67..b72054fc 100644 --- a/x64_dbg_bridge/x64_dbg_bridge.vcxproj.user +++ b/x64_dbg_bridge/x64_dbg_bridge.vcxproj.user @@ -5,19 +5,9 @@ WindowsLocalDebugger $(OutDir) - - $(OutDir)\x32_dbg.exe - WindowsLocalDebugger - $(OutDir) - $(OutDir)\x64_dbg.exe WindowsLocalDebugger $(OutDir) - - $(OutDir)\x64_dbg.exe - WindowsLocalDebugger - $(OutDir) - \ No newline at end of file diff --git a/x64_dbg_dbg/_dbgfunctions.cpp b/x64_dbg_dbg/_dbgfunctions.cpp index 6accb9cd..57bc9934 100644 --- a/x64_dbg_dbg/_dbgfunctions.cpp +++ b/x64_dbg_dbg/_dbgfunctions.cpp @@ -24,7 +24,7 @@ static bool _assembleatex(duint addr, const char* instruction, char* error, bool static bool _sectionfromaddr(duint addr, char* section) { - HMODULE hMod = (HMODULE)ModBaseFromAddr(addr); + HMODULE hMod = (HMODULE)modbasefromaddr(addr); if(!hMod) return false; wchar_t curModPath[MAX_PATH] = L""; @@ -72,7 +72,7 @@ static bool _patchinrange(duint start, duint end) static bool _mempatch(duint va, const unsigned char* src, duint size) { - return MemPatch((void*)va, (void*)src, size, 0); + return mempatch(fdProcessInfo->hProcess, (void*)va, src, size, 0); } static void _patchrestorerange(duint start, duint end) @@ -162,17 +162,17 @@ bool _getprocesslist(DBGPROCESSINFO** entries, int* count) static void _memupdatemap() { - MemUpdateMap(fdProcessInfo->hProcess); + memupdatemap(fdProcessInfo->hProcess); } void dbgfunctionsinit() { _dbgfunctions.AssembleAtEx = _assembleatex; _dbgfunctions.SectionFromAddr = _sectionfromaddr; - _dbgfunctions.ModNameFromAddr = ModNameFromAddr; - _dbgfunctions.ModBaseFromAddr = ModBaseFromAddr; - _dbgfunctions.ModBaseFromName = ModBaseFromName; - _dbgfunctions.ModSizeFromAddr = ModSizeFromAddr; + _dbgfunctions.ModNameFromAddr = modnamefromaddr; + _dbgfunctions.ModBaseFromAddr = modbasefromaddr; + _dbgfunctions.ModBaseFromName = modbasefromname; + _dbgfunctions.ModSizeFromAddr = modsizefromaddr; _dbgfunctions.Assemble = assemble; _dbgfunctions.PatchGet = _patchget; _dbgfunctions.PatchInRange = _patchinrange; @@ -181,12 +181,12 @@ void dbgfunctionsinit() _dbgfunctions.PatchEnum = (PATCHENUM)patchenum; _dbgfunctions.PatchRestore = _patchrestore; _dbgfunctions.PatchFile = (PATCHFILE)patchfile; - _dbgfunctions.ModPathFromAddr = ModPathFromAddr; - _dbgfunctions.ModPathFromName = ModPathFromName; + _dbgfunctions.ModPathFromAddr = modpathfromaddr; + _dbgfunctions.ModPathFromName = modpathfromname; _dbgfunctions.DisasmFast = disasmfast; _dbgfunctions.MemUpdateMap = _memupdatemap; _dbgfunctions.GetCallStack = _getcallstack; - _dbgfunctions.SymbolDownloadAllSymbols = SymDownloadAllSymbols; + _dbgfunctions.SymbolDownloadAllSymbols = symdownloadallsymbols; _dbgfunctions.GetJit = _getjit; _dbgfunctions.GetJitAuto = _getjitauto; _dbgfunctions.GetDefJit = dbggetdefjit; diff --git a/x64_dbg_dbg/_exports.cpp b/x64_dbg_dbg/_exports.cpp index ab8592ff..d4aa29db 100644 --- a/x64_dbg_dbg/_exports.cpp +++ b/x64_dbg_dbg/_exports.cpp @@ -26,17 +26,17 @@ static bool bOnlyCipAutoComments = false; extern "C" DLL_EXPORT duint _dbg_memfindbaseaddr(duint addr, duint* size) { - return MemFindBaseAddr(addr, size); + return memfindbaseaddr(addr, size); } extern "C" DLL_EXPORT bool _dbg_memread(duint addr, unsigned char* dest, duint size, duint* read) { - return MemRead((void*)addr, dest, size, read); + return memread(fdProcessInfo->hProcess, (void*)addr, dest, size, read); } extern "C" DLL_EXPORT bool _dbg_memwrite(duint addr, const unsigned char* src, duint size, duint* written) { - return MemWrite((void*)addr, (void*)src, size, written); + return memwrite(fdProcessInfo->hProcess, (void*)addr, src, size, written); } extern "C" DLL_EXPORT bool _dbg_memmap(MEMMAP* memmap) @@ -57,7 +57,7 @@ extern "C" DLL_EXPORT bool _dbg_memmap(MEMMAP* memmap) extern "C" DLL_EXPORT bool _dbg_memisvalidreadptr(duint addr) { - return MemIsValidReadPtr(addr); + return memisvalidreadptr(fdProcessInfo->hProcess, addr); } extern "C" DLL_EXPORT bool _dbg_valfromstring(const char* string, duint* value) @@ -69,7 +69,6 @@ extern "C" DLL_EXPORT bool _dbg_isdebugging() { if(IsFileBeingDebugged()) return true; - return false; } @@ -94,7 +93,7 @@ extern "C" DLL_EXPORT bool _dbg_addrinfoget(duint addr, SEGMENTREG segment, ADDR bool retval = false; if(addrinfo->flags & flagmodule) //get module { - if(ModNameFromAddr(addr, addrinfo->module, false)) //get module name + if(modnamefromaddr(addr, addrinfo->module, false)) //get module name retval = true; } if(addrinfo->flags & flaglabel) @@ -122,7 +121,7 @@ extern "C" DLL_EXPORT bool _dbg_addrinfoget(duint addr, SEGMENTREG segment, ADDR if(disasmfast(addr, &basicinfo) && basicinfo.branch && !basicinfo.call && basicinfo.memory.value) //thing is a JMP { uint val = 0; - if(MemRead((void*)basicinfo.memory.value, &val, sizeof(val), 0)) + if(memread(fdProcessInfo->hProcess, (const void*)basicinfo.memory.value, &val, sizeof(val), 0)) { if(SafeSymFromAddr(fdProcessInfo->hProcess, (DWORD64)val, &displacement, pSymbol) and !displacement) { @@ -138,12 +137,12 @@ extern "C" DLL_EXPORT bool _dbg_addrinfoget(duint addr, SEGMENTREG segment, ADDR } if(addrinfo->flags & flagbookmark) { - addrinfo->isbookmark = BookmarkGet(addr); + addrinfo->isbookmark = bookmarkget(addr); retval = true; } if(addrinfo->flags & flagfunction) { - if(FunctionGet(addr, &addrinfo->function.start, &addrinfo->function.end)) + if(functionget(addr, &addrinfo->function.start, &addrinfo->function.end)) retval = true; } if(addrinfo->flags & flagloop) @@ -154,7 +153,7 @@ extern "C" DLL_EXPORT bool _dbg_addrinfoget(duint addr, SEGMENTREG segment, ADDR if(addrinfo->flags & flagcomment) { *addrinfo->comment = 0; - if(CommentGet(addr, addrinfo->comment)) + if(commentget(addr, addrinfo->comment)) retval = true; else { @@ -300,15 +299,15 @@ extern "C" DLL_EXPORT bool _dbg_addrinfoset(duint addr, ADDRINFO* addrinfo) } if(addrinfo->flags & flagcomment) //set comment { - if(CommentSet(addr, addrinfo->comment, true)) + if(commentset(addr, addrinfo->comment, true)) retval = true; } if(addrinfo->flags & flagbookmark) //set bookmark { if(addrinfo->isbookmark) - retval = BookmarkSet(addr, true); + retval = bookmarkset(addr, true); else - retval = BookmarkDelete(addr); + retval = bookmarkdel(addr); } return retval; } @@ -318,20 +317,20 @@ extern "C" DLL_EXPORT int _dbg_bpgettypeat(duint addr) static uint cacheAddr; static int cacheBpCount; static int cacheResult; - int bpcount = BpGetList(nullptr); + int bpcount = bpgetlist(0); if(cacheAddr != addr or cacheBpCount != bpcount) { BREAKPOINT bp; cacheAddr = addr; cacheResult = 0; cacheBpCount = bpcount; - if(BpGet(addr, BPNORMAL, 0, &bp)) + if(bpget(addr, BPNORMAL, 0, &bp)) if(bp.enabled) cacheResult |= bp_normal; - if(BpGet(addr, BPHARDWARE, 0, &bp)) + if(bpget(addr, BPHARDWARE, 0, &bp)) if(bp.enabled) cacheResult |= bp_hardware; - if(BpGet(addr, BPMEMORY, 0, &bp)) + if(bpget(addr, BPMEMORY, 0, &bp)) if(bp.enabled) cacheResult |= bp_memory; } @@ -504,7 +503,7 @@ extern "C" DLL_EXPORT int _dbg_getbplist(BPXTYPE type, BPMAP* bpmap) if(!bpmap) return 0; std::vector list; - int bpcount = BpGetList(&list); + int bpcount = bpgetlist(&list); if(bpcount == 0) { bpmap->count = 0; @@ -567,7 +566,7 @@ extern "C" DLL_EXPORT int _dbg_getbplist(BPXTYPE type, BPMAP* bpmap) curBp.addr = list[i].addr; curBp.enabled = list[i].enabled; //TODO: fix this - if(MemIsValidReadPtr(curBp.addr)) + if(memisvalidreadptr(fdProcessInfo->hProcess, curBp.addr)) curBp.active = true; strcpy_s(curBp.mod, list[i].mod); strcpy_s(curBp.name, list[i].name); @@ -614,7 +613,7 @@ extern "C" DLL_EXPORT uint _dbg_getbranchdestination(uint addr) extern "C" DLL_EXPORT bool _dbg_functionoverlaps(uint start, uint end) { - return FunctionOverlaps(start, end); + return functionoverlaps(start, end); } extern "C" DLL_EXPORT uint _dbg_sendmessage(DBGMSG type, void* param1, void* param2) @@ -690,7 +689,7 @@ extern "C" DLL_EXPORT uint _dbg_sendmessage(DBGMSG type, void* param1, void* par case DBG_SYMBOL_ENUM: { SYMBOLCBINFO* cbInfo = (SYMBOLCBINFO*)param1; - SymEnum(cbInfo->base, cbInfo->cbSymbolEnum, cbInfo->user); + symenum(cbInfo->base, cbInfo->cbSymbolEnum, cbInfo->user); } break; @@ -702,7 +701,7 @@ extern "C" DLL_EXPORT uint _dbg_sendmessage(DBGMSG type, void* param1, void* par case DBG_MODBASE_FROM_NAME: { - return ModBaseFromName((const char*)param1); + return modbasefromname((const char*)param1); } break; @@ -720,7 +719,7 @@ extern "C" DLL_EXPORT uint _dbg_sendmessage(DBGMSG type, void* param1, void* par case DBG_GET_THREAD_LIST: { - ThreadGetList((THREADLIST*)param1); + threadgetlist((THREADLIST*)param1); } break; @@ -776,7 +775,7 @@ extern "C" DLL_EXPORT uint _dbg_sendmessage(DBGMSG type, void* param1, void* par if(!param1 or !param2) return 0; unsigned char data[16]; - if(!MemRead(param1, data, sizeof(data), 0)) + if(!memread(fdProcessInfo->hProcess, param1, data, sizeof(data), 0)) return 0; DISASM disasm; memset(&disasm, 0, sizeof(disasm)); @@ -805,28 +804,28 @@ extern "C" DLL_EXPORT uint _dbg_sendmessage(DBGMSG type, void* param1, void* par case DBG_FUNCTION_GET: { FUNCTION_LOOP_INFO* info = (FUNCTION_LOOP_INFO*)param1; - return (uint)FunctionGet(info->addr, &info->start, &info->end); + return (uint)functionget(info->addr, &info->start, &info->end); } break; case DBG_FUNCTION_OVERLAPS: { FUNCTION_LOOP_INFO* info = (FUNCTION_LOOP_INFO*)param1; - return (uint)FunctionOverlaps(info->start, info->end); + return (uint)functionoverlaps(info->start, info->end); } break; case DBG_FUNCTION_ADD: { FUNCTION_LOOP_INFO* info = (FUNCTION_LOOP_INFO*)param1; - return (uint)FunctionAdd(info->start, info->end, info->manual); + return (uint)functionadd(info->start, info->end, info->manual); } break; case DBG_FUNCTION_DEL: { FUNCTION_LOOP_INFO* info = (FUNCTION_LOOP_INFO*)param1; - return (uint)FunctionDelete(info->addr); + return (uint)functiondel(info->addr); } break; @@ -867,7 +866,7 @@ extern "C" DLL_EXPORT uint _dbg_sendmessage(DBGMSG type, void* param1, void* par case DBG_IS_BP_DISABLED: { BREAKPOINT bp; - if(BpGet((uint)param1, BPNORMAL, 0, &bp)) + if(bpget((uint)param1, BPNORMAL, 0, &bp)) return !(uint)bp.enabled; return (uint)false; } @@ -875,13 +874,13 @@ extern "C" DLL_EXPORT uint _dbg_sendmessage(DBGMSG type, void* param1, void* par case DBG_SET_AUTO_COMMENT_AT: { - return (uint)CommentSet((uint)param1, (const char*)param2, false); + return (uint)commentset((uint)param1, (const char*)param2, false); } break; case DBG_DELETE_AUTO_COMMENT_RANGE: { - CommentDelRange((uint)param1, (uint)param2); + commentdelrange((uint)param1, (uint)param2); } break; @@ -899,25 +898,25 @@ extern "C" DLL_EXPORT uint _dbg_sendmessage(DBGMSG type, void* param1, void* par case DBG_SET_AUTO_BOOKMARK_AT: { - return (uint)BookmarkSet((uint)param1, false); + return (uint)bookmarkset((uint)param1, false); } break; case DBG_DELETE_AUTO_BOOKMARK_RANGE: { - BookmarkDelRange((uint)param1, (uint)param2); + bookmarkdelrange((uint)param1, (uint)param2); } break; case DBG_SET_AUTO_FUNCTION_AT: { - return (uint)FunctionAdd((uint)param1, (uint)param2, false); + return (uint)functionadd((uint)param1, (uint)param2, false); } break; case DBG_DELETE_AUTO_FUNCTION_RANGE: { - FunctionDelRange((uint)param1, (uint)param2); + functiondelrange((uint)param1, (uint)param2); } break; diff --git a/x64_dbg_dbg/_global.cpp b/x64_dbg_dbg/_global.cpp index 63822d1c..3e1fc67e 100644 --- a/x64_dbg_dbg/_global.cpp +++ b/x64_dbg_dbg/_global.cpp @@ -97,7 +97,9 @@ bool arraycontains(const char* cmd_list, const char* cmd) bool scmp(const char* a, const char* b) { - return _stricmp(a, b) == 0; + if(_stricmp(a, b)) + return false; + return true; } void formathex(char* string) diff --git a/x64_dbg_dbg/_global.h b/x64_dbg_dbg/_global.h index 54b7c1f4..60bf68f9 100644 --- a/x64_dbg_dbg/_global.h +++ b/x64_dbg_dbg/_global.h @@ -1,7 +1,7 @@ #ifndef _GLOBAL_H #define _GLOBAL_H -#define _WIN32_WINNT 0x0600 +#define _WIN32_WINNT 0x0501 #define WINVER 0x0501 #define _WIN32_IE 0x0500 @@ -16,7 +16,6 @@ #include #include #include -#include #include #include "..\x64_dbg_bridge\bridgemain.h" #include "jansson\jansson.h" @@ -52,6 +51,42 @@ typedef unsigned long uint; typedef long sint; #endif // _WIN64 +enum BITMASK +{ + BIT1 = 0x1, + BIT2 = 0x2, + BIT3 = 0x4, + BIT4 = 0x8, + BIT5 = 0x10, + BIT6 = 0x20, + BIT7 = 0x40, + BIT8 = 0x80, + BIT9 = 0x100, + BIT10 = 0x200, + BIT11 = 0x400, + BIT12 = 0x800, + BIT13 = 0x1000, + BIT14 = 0x2000, + BIT15 = 0x4000, + BIT16 = 0x8000, + BIT17 = 0x10000, + BIT18 = 0x20000, + BIT19 = 0x40000, + BIT20 = 0x80000, + BIT21 = 0x100000, + BIT22 = 0x200000, + BIT23 = 0x400000, + BIT24 = 0x800000, + BIT25 = 0x1000000, + BIT26 = 0x2000000, + BIT27 = 0x4000000, + BIT28 = 0x8000000, + BIT29 = 0x10000000, + BIT30 = 0x20000000, + BIT31 = 0x40000000, + BIT32 = 0x80000000 +}; + enum arch { notfound, diff --git a/x64_dbg_dbg/addrinfo.cpp b/x64_dbg_dbg/addrinfo.cpp index f8fba9e9..b49f2d87 100644 --- a/x64_dbg_dbg/addrinfo.cpp +++ b/x64_dbg_dbg/addrinfo.cpp @@ -21,12 +21,12 @@ void dbsave() dprintf("saving database..."); DWORD ticks = GetTickCount(); JSON root = json_object(); - CommentCacheSave(root); + commentcachesave(root); labelcachesave(root); - BookmarkCacheSave(root); - FunctionCacheSave(root); + bookmarkcachesave(root); + functioncachesave(root); loopcachesave(root); - BpCacheSave(root); + bpcachesave(root); WString wdbpath = StringUtils::Utf8ToUtf16(dbpath); if(json_object_size(root)) { @@ -68,7 +68,7 @@ void dbload() return; } FILE* jsonFile = 0; - if(_wfopen_s(&jsonFile, wdbpath.c_str(), L"rb") != 0) + if(_wfopen_s(&jsonFile, wdbpath.c_str(), L"rb")) { dputs("\nfailed to open database file!"); return; @@ -82,12 +82,12 @@ void dbload() dputs("\ninvalid database file (JSON)!"); return; } - CommentCacheLoad(root); + commentcacheload(root); labelcacheload(root); - BookmarkCacheLoad(root); - FunctionCacheLoad(root); + bookmarkcacheload(root); + functioncacheload(root); loopcacheload(root); - BpCacheLoad(root); + bpcacheload(root); json_decref(root); //free root dprintf("%ums\n", GetTickCount() - ticks); } @@ -95,12 +95,12 @@ void dbload() void dbclose() { dbsave(); - CommentClear(); + commentclear(); labelclear(); - BookmarkClear(); - FunctionClear(); + bookmarkclear(); + functionclear(); loopclear(); - BpClear(); + bpclear(); patchclear(); } @@ -111,44 +111,44 @@ bool apienumexports(uint base, EXPORTENUMCALLBACK cbEnum) VirtualQueryEx(fdProcessInfo->hProcess, (const void*)base, &mbi, sizeof(mbi)); uint size = mbi.RegionSize; Memory buffer(size, "apienumexports:buffer"); - if(!MemRead((void*)base, buffer, size, 0)) + if(!memread(fdProcessInfo->hProcess, (const void*)base, buffer, size, 0)) return false; IMAGE_NT_HEADERS* pnth = (IMAGE_NT_HEADERS*)((uint)buffer + GetPE32DataFromMappedFile((ULONG_PTR)buffer, 0, UE_PE_OFFSET)); uint export_dir_rva = pnth->OptionalHeader.DataDirectory[0].VirtualAddress; uint export_dir_size = pnth->OptionalHeader.DataDirectory[0].Size; IMAGE_EXPORT_DIRECTORY export_dir; memset(&export_dir, 0, sizeof(export_dir)); - MemRead((void*)(export_dir_rva + base), &export_dir, sizeof(export_dir), 0); + memread(fdProcessInfo->hProcess, (const void*)(export_dir_rva + base), &export_dir, sizeof(export_dir), 0); unsigned int NumberOfNames = export_dir.NumberOfNames; if(!export_dir.NumberOfFunctions or !NumberOfNames) //no named exports return false; char modname[MAX_MODULE_SIZE] = ""; - ModNameFromAddr(base, modname, true); + modnamefromaddr(base, modname, true); uint original_name_va = export_dir.Name + base; char original_name[deflen] = ""; memset(original_name, 0, sizeof(original_name)); - MemRead((void*)original_name_va, original_name, deflen, 0); + memread(fdProcessInfo->hProcess, (const void*)original_name_va, original_name, deflen, 0); char* AddrOfFunctions_va = (char*)(export_dir.AddressOfFunctions + base); char* AddrOfNames_va = (char*)(export_dir.AddressOfNames + base); char* AddrOfNameOrdinals_va = (char*)(export_dir.AddressOfNameOrdinals + base); for(DWORD i = 0; i < NumberOfNames; i++) { DWORD curAddrOfName = 0; - MemRead(AddrOfNames_va + sizeof(DWORD)*i, &curAddrOfName, sizeof(DWORD), 0); + memread(fdProcessInfo->hProcess, AddrOfNames_va + sizeof(DWORD)*i, &curAddrOfName, sizeof(DWORD), 0); char* cur_name_va = (char*)(curAddrOfName + base); char cur_name[deflen] = ""; memset(cur_name, 0, deflen); - MemRead(cur_name_va, cur_name, deflen, 0); + memread(fdProcessInfo->hProcess, cur_name_va, cur_name, deflen, 0); WORD curAddrOfNameOrdinals = 0; - MemRead(AddrOfNameOrdinals_va + sizeof(WORD)*i, &curAddrOfNameOrdinals, sizeof(WORD), 0); + memread(fdProcessInfo->hProcess, AddrOfNameOrdinals_va + sizeof(WORD)*i, &curAddrOfNameOrdinals, sizeof(WORD), 0); DWORD curFunctionRva = 0; - MemRead(AddrOfFunctions_va + sizeof(DWORD)*curAddrOfNameOrdinals, &curFunctionRva, sizeof(DWORD), 0); + memread(fdProcessInfo->hProcess, AddrOfFunctions_va + sizeof(DWORD)*curAddrOfNameOrdinals, &curFunctionRva, sizeof(DWORD), 0); if(curFunctionRva >= export_dir_rva and curFunctionRva < export_dir_rva + export_dir_size) { char forwarded_api[deflen] = ""; memset(forwarded_api, 0, deflen); - MemRead((void*)(curFunctionRva + base), forwarded_api, deflen, 0); + memread(fdProcessInfo->hProcess, (void*)(curFunctionRva + base), forwarded_api, deflen, 0); int len = (int)strlen(forwarded_api); int j = 0; while(forwarded_api[j] != '.' and j < len) diff --git a/x64_dbg_dbg/assemble.cpp b/x64_dbg_dbg/assemble.cpp index a8389045..6c6f1f11 100644 --- a/x64_dbg_dbg/assemble.cpp +++ b/x64_dbg_dbg/assemble.cpp @@ -67,12 +67,12 @@ bool assembleat(uint addr, const char* instruction, int* size, char* error, bool if(size) *size = destSize; - bool ret = MemPatch((void*)addr, dest, destSize, 0); + bool ret = mempatch(fdProcessInfo->hProcess, (void*)addr, dest, destSize, 0); if(ret && fillnop && nopsize) { if(size) *size += nopsize; - if(!MemPatch((void*)(addr + destSize), nops, nopsize, 0)) + if(!mempatch(fdProcessInfo->hProcess, (void*)(addr + destSize), nops, nopsize, 0)) ret = false; } GuiUpdatePatches(); diff --git a/x64_dbg_dbg/bookmark.cpp b/x64_dbg_dbg/bookmark.cpp index 1669d3df..7f66977d 100644 --- a/x64_dbg_dbg/bookmark.cpp +++ b/x64_dbg_dbg/bookmark.cpp @@ -4,206 +4,159 @@ #include "debugger.h" #include "memory.h" -typedef std::unordered_map BookmarksInfo; +typedef std::map BookmarksInfo; static BookmarksInfo bookmarks; -bool BookmarkSet(uint Address, bool Manual) +bool bookmarkset(uint addr, bool manual) { - // CHECK: Export call - if(!DbgIsDebugging()) + if(!DbgIsDebugging() or !memisvalidreadptr(fdProcessInfo->hProcess, addr)) return false; - - // Validate the incoming address - if(!MemIsValidReadPtr(Address)) - return false; - BOOKMARKSINFO bookmark; - ModNameFromAddr(Address, bookmark.mod, true); - bookmark.addr = Address; - bookmark.manual = Manual; - - // Exclusive lock to insert new data - EXCLUSIVE_ACQUIRE(LockBookmarks); - - if(!bookmarks.insert(std::make_pair(Address, bookmark)).second) - return BookmarkDelete(Address); - + modnamefromaddr(addr, bookmark.mod, true); + bookmark.addr = addr - modbasefromaddr(addr); + bookmark.manual = manual; + CriticalSectionLocker locker(LockBookmarks); + if(!bookmarks.insert(std::make_pair(modhashfromva(addr), bookmark)).second) + return bookmarkdel(addr); return true; } -bool BookmarkGet(uint Address) +bool bookmarkget(uint addr) { - // CHECK: Export call if(!DbgIsDebugging()) return false; - - SHARED_ACQUIRE(LockBookmarks); - return (bookmarks.count(Address) > 0); + CriticalSectionLocker locker(LockBookmarks); + if(bookmarks.count(modhashfromva(addr))) + return true; + return false; } -bool BookmarkDelete(uint Address) +bool bookmarkdel(uint addr) { - // CHECK: Export call if(!DbgIsDebugging()) return false; - - EXCLUSIVE_ACQUIRE(LockBookmarks); - return (bookmarks.erase(Address) > 0); + CriticalSectionLocker locker(LockBookmarks); + return (bookmarks.erase(modhashfromva(addr)) > 0); } -void BookmarkDelRange(uint Start, uint End) +void bookmarkdelrange(uint start, uint end) { - // CHECK: Export call if(!DbgIsDebugging()) return; - - // Are all bookmarks going to be deleted? - // 0x00000000 - 0xFFFFFFFF - if(Start == 0 && End == ~0) + bool bDelAll = (start == 0 && end == ~0); //0x00000000-0xFFFFFFFF + uint modbase = modbasefromaddr(start); + if(modbase != modbasefromaddr(end)) + return; + start -= modbase; + end -= modbase; + CriticalSectionLocker locker(LockBookmarks); + BookmarksInfo::iterator i = bookmarks.begin(); + while(i != bookmarks.end()) { - EXCLUSIVE_ACQUIRE(LockBookmarks); - bookmarks.clear(); - } - else - { - // Make sure 'Start' and 'End' reference the same module - uint moduleBase = ModBaseFromAddr(Start); - - if(moduleBase != ModBaseFromAddr(End)) - return; - - EXCLUSIVE_ACQUIRE(LockBookmarks); - for(auto itr = bookmarks.begin(); itr != bookmarks.end();) + if(i->second.manual) //ignore manual { - // Ignore manually set entries - if(itr->second.manual) - { - itr++; - continue; - } - - // [Start, End) - if(itr->second.addr >= Start && itr->second.addr < End) - itr = bookmarks.erase(itr); - else - itr++; + i++; + continue; } - } -} - -void BookmarkCacheSave(JSON Root) -{ - EXCLUSIVE_ACQUIRE(LockBookmarks); - - const JSON jsonBookmarks = json_array(); - const JSON jsonAutoBookmarks = json_array(); - - // Save to the JSON root - for(auto & itr : bookmarks) - { - JSON currentBookmark = json_object(); - - // The address must be adjusted to use an offset - // OFFSET = ADDRESS - MOD_BASE - uint virtualOffset = itr.second.addr - ModBaseFromAddr(itr.second.addr); - - json_object_set_new(currentBookmark, "module", json_string(itr.second.mod)); - json_object_set_new(currentBookmark, "address", json_hex(virtualOffset)); - - if(itr.second.manual) - json_array_append_new(jsonBookmarks, currentBookmark); + if(bDelAll || (i->second.addr >= start && i->second.addr < end)) + bookmarks.erase(i++); else - json_array_append_new(jsonAutoBookmarks, currentBookmark); + i++; } - - if(json_array_size(jsonBookmarks)) - json_object_set(Root, "bookmarks", jsonBookmarks); - - if(json_array_size(jsonAutoBookmarks)) - json_object_set(Root, "autobookmarks", jsonAutoBookmarks); - - json_decref(jsonBookmarks); - json_decref(jsonAutoBookmarks); } -void BookmarkCacheLoad(JSON Root) +void bookmarkcachesave(JSON root) { - EXCLUSIVE_ACQUIRE(LockBookmarks); + CriticalSectionLocker locker(LockBookmarks); + const JSON jsonbookmarks = json_array(); + const JSON jsonautobookmarks = json_array(); + for(BookmarksInfo::iterator i = bookmarks.begin(); i != bookmarks.end(); ++i) + { + const BOOKMARKSINFO curBookmark = i->second; + JSON curjsonbookmark = json_object(); + json_object_set_new(curjsonbookmark, "module", json_string(curBookmark.mod)); + json_object_set_new(curjsonbookmark, "address", json_hex(curBookmark.addr)); + if(curBookmark.manual) + json_array_append_new(jsonbookmarks, curjsonbookmark); + else + json_array_append_new(jsonautobookmarks, curjsonbookmark); + } + if(json_array_size(jsonbookmarks)) + json_object_set(root, "bookmarks", jsonbookmarks); + json_decref(jsonbookmarks); + if(json_array_size(jsonautobookmarks)) + json_object_set(root, "autobookmarks", jsonautobookmarks); + json_decref(jsonautobookmarks); +} - // Inline lambda to parse each JSON entry - auto AddBookmarks = [](const JSON Object, bool Manual) +void bookmarkcacheload(JSON root) +{ + CriticalSectionLocker locker(LockBookmarks); + bookmarks.clear(); + const JSON jsonbookmarks = json_object_get(root, "bookmarks"); + if(jsonbookmarks) { size_t i; JSON value; - - json_array_foreach(Object, i, value) + json_array_foreach(jsonbookmarks, i, value) { - BOOKMARKSINFO bookmarkInfo; - memset(&bookmarkInfo, 0, sizeof(BOOKMARKSINFO)); - - // Load the module name + BOOKMARKSINFO curBookmark; const char* mod = json_string_value(json_object_get(value, "module")); - if(mod && *mod && strlen(mod) < MAX_MODULE_SIZE) - strcpy_s(bookmarkInfo.mod, mod); - - // Load address and set auto-generated flag - bookmarkInfo.addr = (uint)json_hex_value(json_object_get(value, "address")); - bookmarkInfo.manual = Manual; - - // The offset must be adjusted to use virtual addressing - // ADDRESS = OFFSET + MOD_BASE - bookmarkInfo.addr += ModBaseFromName(bookmarkInfo.mod); - - bookmarks.insert(std::make_pair(bookmarkInfo.addr, bookmarkInfo)); + strcpy_s(curBookmark.mod, mod); + else + *curBookmark.mod = '\0'; + curBookmark.addr = (uint)json_hex_value(json_object_get(value, "address")); + curBookmark.manual = true; + const uint key = modhashfromname(curBookmark.mod) + curBookmark.addr; + bookmarks.insert(std::make_pair(key, curBookmark)); } - }; - - // Remove existing entries - bookmarks.clear(); - - const JSON jsonBookmarks = json_object_get(Root, "bookmarks"); - const JSON jsonAutoBookmarks = json_object_get(Root, "autobookmarks"); - - // Load user-set bookmarks - if(jsonBookmarks) - AddBookmarks(jsonBookmarks, true); - - // Load auto-set bookmarks - if(jsonAutoBookmarks) - AddBookmarks(jsonAutoBookmarks, false); + } + JSON jsonautobookmarks = json_object_get(root, "autobookmarks"); + if(jsonautobookmarks) + { + size_t i; + JSON value; + json_array_foreach(jsonautobookmarks, i, value) + { + BOOKMARKSINFO curBookmark; + const char* mod = json_string_value(json_object_get(value, "module")); + if(mod && *mod && strlen(mod) < MAX_MODULE_SIZE) + strcpy_s(curBookmark.mod, mod); + else + *curBookmark.mod = '\0'; + curBookmark.addr = (uint)json_hex_value(json_object_get(value, "address")); + curBookmark.manual = false; + const uint key = modhashfromname(curBookmark.mod) + curBookmark.addr; + bookmarks.insert(std::make_pair(key, curBookmark)); + } + } } -bool BookmarkEnum(BOOKMARKSINFO* List, size_t* Size) +bool bookmarkenum(BOOKMARKSINFO* bookmarklist, size_t* cbsize) { - // The array container must be set, or the size must be set, or both - if(!List && !Size) + if(!DbgIsDebugging()) return false; - - SHARED_ACQUIRE(LockBookmarks); - - // Return the size if set - if(Size) + if(!bookmarklist && !cbsize) + return false; + CriticalSectionLocker locker(LockBookmarks); + if(!bookmarklist && cbsize) { - *Size = bookmarks.size() * sizeof(BOOKMARKSINFO); - - if(!List) - return true; + *cbsize = bookmarks.size() * sizeof(BOOKMARKSINFO); + return true; } - - // Copy struct over - for(auto & itr : bookmarks) + int j = 0; + for(BookmarksInfo::iterator i = bookmarks.begin(); i != bookmarks.end(); ++i, j++) { - *List = itr.second; - List++; + bookmarklist[j] = i->second; + bookmarklist[j].addr += modbasefromname(bookmarklist[j].mod); } - return true; } -void BookmarkClear() +void bookmarkclear() { - EXCLUSIVE_ACQUIRE(LockBookmarks); - bookmarks.clear(); + CriticalSectionLocker locker(LockBookmarks); + BookmarksInfo().swap(bookmarks); } \ No newline at end of file diff --git a/x64_dbg_dbg/bookmark.h b/x64_dbg_dbg/bookmark.h index a6898ddc..1ee9ee82 100644 --- a/x64_dbg_dbg/bookmark.h +++ b/x64_dbg_dbg/bookmark.h @@ -1,4 +1,5 @@ -#pragma once +#ifndef _BOOKMARK_H +#define _BOOKMARK_H #include "_global.h" @@ -9,11 +10,13 @@ struct BOOKMARKSINFO bool manual; }; -bool BookmarkSet(uint Address, bool Manual); -bool BookmarkGet(uint Address); -bool BookmarkDelete(uint Address); -void BookmarkDelRange(uint Start, uint End); -void BookmarkCacheSave(JSON Root); -void BookmarkCacheLoad(JSON Root); -bool BookmarkEnum(BOOKMARKSINFO* List, size_t* Size); -void BookmarkClear(); \ No newline at end of file +bool bookmarkset(uint addr, bool manual); +bool bookmarkget(uint addr); +bool bookmarkdel(uint addr); +void bookmarkdelrange(uint start, uint end); +void bookmarkcachesave(JSON root); +void bookmarkcacheload(JSON root); +bool bookmarkenum(BOOKMARKSINFO* bookmarklist, size_t* cbsize); +void bookmarkclear(); + +#endif //_BOOKMARK_H \ No newline at end of file diff --git a/x64_dbg_dbg/breakpoint.cpp b/x64_dbg_dbg/breakpoint.cpp index c5447e86..f673d0f1 100644 --- a/x64_dbg_dbg/breakpoint.cpp +++ b/x64_dbg_dbg/breakpoint.cpp @@ -11,385 +11,266 @@ typedef std::map BreakpointsInfo; static BreakpointsInfo breakpoints; -BREAKPOINT* BpInfoFromAddr(BP_TYPE Type, uint Address) -{ - // - // NOTE: THIS DOES _NOT_ USE LOCKS - // - auto found = breakpoints.find(BreakpointKey(Type, ModHashFromAddr(Address))); - - // Was the module found with this address? - if(found == breakpoints.end()) - return nullptr; - - return &found->second; -} - -int BpGetList(std::vector* List) -{ - // CHECK: Exported function - if(!DbgIsDebugging()) - return false; - - SHARED_ACQUIRE(LockBreakpoints); - - // Did the caller request an output? - if(List) - { - // Enumerate all breakpoints in the global list, fixing the relative - // offset to a virtual address - for(auto & i : breakpoints) - { - BREAKPOINT currentBp = i.second; - currentBp.addr += ModBaseFromName(currentBp.mod); - currentBp.active = MemIsValidReadPtr(currentBp.addr); - - List->push_back(currentBp); - } - } - - return (int)breakpoints.size(); -} - -bool BpNew(uint Address, bool Enable, bool Singleshot, short OldBytes, BP_TYPE Type, DWORD TitanType, const char* Name) -{ - // CHECK: Command function - if(!DbgIsDebugging()) - return false; - - // Fail if the address is a bad memory region - if(!MemIsValidReadPtr(Address)) - return false; - - // Fail if the breakpoint already exists - if(BpGet(Address, Type, Name, nullptr)) - return false; - - // Default to an empty name if one wasn't supplied - if(!Name) - Name = ""; - - BREAKPOINT bp; - memset(&bp, 0, sizeof(BREAKPOINT)); - - ModNameFromAddr(Address, bp.mod, true); - strcpy_s(bp.name, Name); - - bp.active = true; - bp.addr = Address - ModBaseFromAddr(Address); - bp.enabled = Enable; - bp.oldbytes = OldBytes; - bp.singleshoot = Singleshot; - bp.titantype = TitanType; - bp.type = Type; - - // Insert new entry to the global list - EXCLUSIVE_ACQUIRE(LockBreakpoints); - - breakpoints.insert(std::make_pair(BreakpointKey(Type, ModHashFromAddr(Address)), bp)); - return true; -} - -bool BpGet(uint Address, BP_TYPE Type, const char* Name, BREAKPOINT* Bp) -{ - // CHECK: Export/Command function - if(!DbgIsDebugging()) - return false; - - SHARED_ACQUIRE(LockBreakpoints); - - // Name is optional - if(!Name || Name[0] == '\0') - { - // Perform a lookup by address only - BREAKPOINT* bpInfo = BpInfoFromAddr(Type, Address); - - if(!bpInfo) - return false; - - // Succeed even if the user didn't request anything - if(!Bp) - return true; - - *Bp = *bpInfo; - Bp->addr += ModBaseFromAddr(Address); - Bp->active = MemIsValidReadPtr(Bp->addr); - return true; - } - - // Do a lookup by breakpoint name - for(auto & i : breakpoints) - { - // Do the names match? - if(strcmp(Name, i.second.name) != 0) - continue; - - // Fill out the optional user buffer - if(Bp) - { - *Bp = i.second; - Bp->addr += ModBaseFromAddr(Address); - Bp->active = MemIsValidReadPtr(Bp->addr); - } - - // Return true if the name was found at all - return true; - } - - return false; -} - -bool BpDelete(uint Address, BP_TYPE Type) -{ - // CHECK: Command function - if(!DbgIsDebugging()) - return false; - - // Erase the index from the global list - EXCLUSIVE_ACQUIRE(LockBreakpoints); - - return (breakpoints.erase(BreakpointKey(Type, ModHashFromAddr(Address))) > 0); -} - -bool BpEnable(uint Address, BP_TYPE Type, bool Enable) -{ - // CHECK: Command function - if(!DbgIsDebugging()) - return false; - - EXCLUSIVE_ACQUIRE(LockBreakpoints); - - // Check if the breakpoint exists first - BREAKPOINT* bpInfo = BpInfoFromAddr(Type, Address); - - if(!bpInfo) - return false; - - bpInfo->enabled = Enable; - return true; -} - -bool BpSetName(uint Address, BP_TYPE Type, const char* Name) -{ - // CHECK: Future(?); This is not used anywhere - if(!DbgIsDebugging()) - return false; - - // If a name wasn't supplied, set to nothing - if(!Name) - Name = ""; - - EXCLUSIVE_ACQUIRE(LockBreakpoints); - - // Check if the breakpoint exists first - BREAKPOINT* bpInfo = BpInfoFromAddr(Type, Address); - - if(!bpInfo) - return false; - - strcpy_s(bpInfo->name, Name); - return true; -} - -bool BpSetTitanType(uint Address, BP_TYPE Type, int TitanType) -{ - // CHECK: Command function - if(!DbgIsDebugging()) - return false; - - EXCLUSIVE_ACQUIRE(LockBreakpoints); - - // Set the TitanEngine type, separate from BP_TYPE - BREAKPOINT* bpInfo = BpInfoFromAddr(Type, Address); - - if(!bpInfo) - return false; - - bpInfo->titantype = TitanType; - return true; -} - -bool BpEnumAll(BPENUMCALLBACK EnumCallback, const char* Module) +int bpgetlist(std::vector* list) { if(!DbgIsDebugging()) return false; - - SHARED_ACQUIRE(LockBreakpoints); - - // Loop each entry, executing the user's callback - bool callbackStatus = false; - - for(auto & i : breakpoints) - { - // If a module name was sent, check it - if(Module && Module[0] != '\0') - { - if(strcmp(i.second.mod, Module) != 0) - continue; - } - - BREAKPOINT bpInfo = i.second; - bpInfo.addr += ModBaseFromName(bpInfo.mod); - bpInfo.active = MemIsValidReadPtr(bpInfo.addr); - - // Execute the callback - if(!EnumCallback(&bpInfo)) - callbackStatus = false; - } - - return callbackStatus; -} - -bool BpEnumAll(BPENUMCALLBACK EnumCallback) -{ - return BpEnumAll(EnumCallback, nullptr); -} - -int BpGetCount(BP_TYPE Type, bool EnabledOnly) -{ - SHARED_ACQUIRE(LockBreakpoints); - - // Count the number of enabled/disabled breakpoint types + BREAKPOINT curBp; int count = 0; - - for(auto & i : breakpoints) + CriticalSectionLocker locker(LockBreakpoints); + for(BreakpointsInfo::iterator i = breakpoints.begin(); i != breakpoints.end(); ++i) { - // Check if the type matches - if(i.first.first != Type) - continue; - - // If it's not enabled, skip it - if(EnabledOnly && !i.second.enabled) - continue; - + curBp = i->second; + curBp.addr += modbasefromname(curBp.mod); + curBp.active = memisvalidreadptr(fdProcessInfo->hProcess, curBp.addr); count++; + if(list) + list->push_back(curBp); } - return count; } -void BpToBridge(const BREAKPOINT* Bp, BRIDGEBP* BridgeBp) +bool bpnew(uint addr, bool enabled, bool singleshoot, short oldbytes, BP_TYPE type, DWORD titantype, const char* name) { - // - // Convert a debugger breakpoint to an open/exported - // bridge breakpoint - // - // TOOD: ASSERT(?) These should never be null - if(!Bp || !BridgeBp) + if(!DbgIsDebugging() or !memisvalidreadptr(fdProcessInfo->hProcess, addr) or bpget(addr, type, name, 0)) + return false; + BREAKPOINT bp; + modnamefromaddr(addr, bp.mod, true); + uint modbase = modbasefromaddr(addr); + bp.active = true; + bp.addr = addr - modbase; + bp.enabled = enabled; + if(name and * name) + strcpy_s(bp.name, name); + else + *bp.name = '\0'; + bp.oldbytes = oldbytes; + bp.singleshoot = singleshoot; + bp.titantype = titantype; + bp.type = type; + CriticalSectionLocker locker(LockBreakpoints); + breakpoints.insert(std::make_pair(BreakpointKey(type, modhashfromva(addr)), bp)); + return true; +} + +bool bpget(uint addr, BP_TYPE type, const char* name, BREAKPOINT* bp) +{ + if(!DbgIsDebugging()) + return false; + BREAKPOINT curBp; + CriticalSectionLocker locker(LockBreakpoints); + if(!name) + { + BreakpointsInfo::iterator found = breakpoints.find(BreakpointKey(type, modhashfromva(addr))); + if(found == breakpoints.end()) //not found + return false; + if(!bp) + return true; + curBp = found->second; + curBp.addr += modbasefromaddr(addr); + curBp.active = memisvalidreadptr(fdProcessInfo->hProcess, curBp.addr); + *bp = curBp; + return true; + } + for(BreakpointsInfo::iterator i = breakpoints.begin(); i != breakpoints.end(); ++i) + { + curBp = i->second; + if(name and * name) + { + if(!strcmp(name, curBp.name)) + { + if(bp) + { + curBp.addr += modbasefromname(curBp.mod); + curBp.active = memisvalidreadptr(fdProcessInfo->hProcess, curBp.addr); + *bp = curBp; + } + return true; + } + } + } + return false; +} + +bool bpdel(uint addr, BP_TYPE type) +{ + if(!DbgIsDebugging()) + return false; + CriticalSectionLocker locker(LockBreakpoints); + return (breakpoints.erase(BreakpointKey(type, modhashfromva(addr))) > 0); +} + +bool bpenable(uint addr, BP_TYPE type, bool enable) +{ + if(!DbgIsDebugging()) + return false; + CriticalSectionLocker locker(LockBreakpoints); + BreakpointsInfo::iterator found = breakpoints.find(BreakpointKey(type, modhashfromva(addr))); + if(found == breakpoints.end()) //not found + return false; + breakpoints[found->first].enabled = enable; + return true; +} + +bool bpsetname(uint addr, BP_TYPE type, const char* name) +{ + if(!DbgIsDebugging() or !name or !*name) + return false; + CriticalSectionLocker locker(LockBreakpoints); + BreakpointsInfo::iterator found = breakpoints.find(BreakpointKey(type, modhashfromva(addr))); + if(found == breakpoints.end()) //not found + return false; + strcpy_s(breakpoints[found->first].name, name); + return true; +} + +bool bpsettitantype(uint addr, BP_TYPE type, int titantype) +{ + if(!DbgIsDebugging()) + return false; + CriticalSectionLocker locker(LockBreakpoints); + BreakpointsInfo::iterator found = breakpoints.find(BreakpointKey(type, modhashfromva(addr))); + if(found == breakpoints.end()) //not found + return false; + breakpoints[found->first].titantype = titantype; + return true; +} + +bool bpenumall(BPENUMCALLBACK cbEnum, const char* module) +{ + if(!DbgIsDebugging()) + return false; + bool retval = true; + BREAKPOINT curBp; + CriticalSectionLocker locker(LockBreakpoints); + BreakpointsInfo::iterator i = breakpoints.begin(); + while(i != breakpoints.end()) + { + BreakpointsInfo::iterator j = i; + ++i; + curBp = j->second; + curBp.addr += modbasefromname(curBp.mod); //RVA to VA + curBp.active = memisvalidreadptr(fdProcessInfo->hProcess, curBp.addr); //TODO: wtf am I doing? + if(module and * module) + { + if(!strcmp(curBp.mod, module)) + { + if(!cbEnum(&curBp)) + retval = false; + } + } + else + { + if(!cbEnum(&curBp)) + retval = false; + } + } + return retval; +} + +bool bpenumall(BPENUMCALLBACK cbEnum) +{ + return bpenumall(cbEnum, 0); +} + +int bpgetcount(BP_TYPE type, bool enabledonly) +{ + int count = 0; + CriticalSectionLocker locker(LockBreakpoints); + for(BreakpointsInfo::iterator i = breakpoints.begin(); i != breakpoints.end(); ++i) + { + if(i->first.first == type && (!enabledonly || i->second.enabled)) + count++; + } + return count; +} + +void bptobridge(const BREAKPOINT* bp, BRIDGEBP* bridge) +{ + if(!bp or !bridge) return; - - memset(BridgeBp, 0, sizeof(BRIDGEBP)); - strcpy_s(BridgeBp->mod, Bp->mod); - strcpy_s(BridgeBp->name, Bp->name); - - BridgeBp->active = Bp->active; - BridgeBp->addr = Bp->addr; - BridgeBp->enabled = Bp->enabled; - BridgeBp->singleshoot = Bp->singleshoot; - - switch(Bp->type) + memset(bridge, 0, sizeof(BRIDGEBP)); + bridge->active = bp->active; + bridge->addr = bp->addr; + bridge->enabled = bp->enabled; + strcpy_s(bridge->mod, bp->mod); + strcpy_s(bridge->name, bp->name); + bridge->singleshoot = bp->singleshoot; + switch(bp->type) { case BPNORMAL: - BridgeBp->type = bp_normal; + bridge->type = bp_normal; break; case BPHARDWARE: - BridgeBp->type = bp_hardware; + bridge->type = bp_hardware; break; case BPMEMORY: - BridgeBp->type = bp_memory; - break; + bridge->type = bp_memory; + break; //so that's why it didn't show in the gui. default: - BridgeBp->type = bp_none; + bridge->type = bp_none; break; } } -void BpCacheSave(JSON Root) +void bpcachesave(JSON root) { - EXCLUSIVE_ACQUIRE(LockBreakpoints); - - // Create a JSON array to store each sub-object with a breakpoint - const JSON jsonBreakpoints = json_array(); - - // Loop all breakpoints - for(auto & i : breakpoints) + CriticalSectionLocker locker(LockBreakpoints); + const JSON jsonbreakpoints = json_array(); + for(BreakpointsInfo::iterator i = breakpoints.begin(); i != breakpoints.end(); ++i) { - auto & breakpoint = i.second; - - // Ignore single-shot breakpoints - if(breakpoint.singleshoot) - continue; - - JSON jsonObj = json_object(); - json_object_set_new(jsonObj, "address", json_hex(breakpoint.addr)); - json_object_set_new(jsonObj, "enabled", json_boolean(breakpoint.enabled)); - - // "Normal" breakpoints save the old data - if(breakpoint.type == BPNORMAL) - json_object_set_new(jsonObj, "oldbytes", json_hex(breakpoint.oldbytes)); - - json_object_set_new(jsonObj, "type", json_integer(breakpoint.type)); - json_object_set_new(jsonObj, "titantype", json_hex(breakpoint.titantype)); - json_object_set_new(jsonObj, "name", json_string(breakpoint.name)); - json_object_set_new(jsonObj, "module", json_string(breakpoint.mod)); - json_array_append_new(jsonBreakpoints, jsonObj); + const BREAKPOINT curBreakpoint = i->second; + if(curBreakpoint.singleshoot) + continue; //skip + JSON curjsonbreakpoint = json_object(); + json_object_set_new(curjsonbreakpoint, "address", json_hex(curBreakpoint.addr)); + json_object_set_new(curjsonbreakpoint, "enabled", json_boolean(curBreakpoint.enabled)); + if(curBreakpoint.type == BPNORMAL) + json_object_set_new(curjsonbreakpoint, "oldbytes", json_hex(curBreakpoint.oldbytes)); + json_object_set_new(curjsonbreakpoint, "type", json_integer(curBreakpoint.type)); + json_object_set_new(curjsonbreakpoint, "titantype", json_hex(curBreakpoint.titantype)); + json_object_set_new(curjsonbreakpoint, "name", json_string(curBreakpoint.name)); + json_object_set_new(curjsonbreakpoint, "module", json_string(curBreakpoint.mod)); + json_array_append_new(jsonbreakpoints, curjsonbreakpoint); } - - if(json_array_size(jsonBreakpoints)) - json_object_set(Root, "breakpoints", jsonBreakpoints); - - // Notify garbage collector - json_decref(jsonBreakpoints); + if(json_array_size(jsonbreakpoints)) + json_object_set(root, "breakpoints", jsonbreakpoints); + json_decref(jsonbreakpoints); } -void BpCacheLoad(JSON Root) +void bpcacheload(JSON root) { - EXCLUSIVE_ACQUIRE(LockBreakpoints); - - // Remove all existing elements + CriticalSectionLocker locker(LockBreakpoints); breakpoints.clear(); - - // Get a handle to the root object -> breakpoints subtree - const JSON jsonBreakpoints = json_object_get(Root, "breakpoints"); - - // Return if there was nothing to load - if(!jsonBreakpoints) - return; - - size_t i; - JSON value; - json_array_foreach(jsonBreakpoints, i, value) + const JSON jsonbreakpoints = json_object_get(root, "breakpoints"); + if(jsonbreakpoints) { - BREAKPOINT breakpoint; - memset(&breakpoint, 0, sizeof(BREAKPOINT)); - - if(breakpoint.type == BPNORMAL) - breakpoint.oldbytes = (short)json_hex_value(json_object_get(value, "oldbytes")); - breakpoint.type = (BP_TYPE)json_integer_value(json_object_get(value, "type")); - breakpoint.addr = (uint)json_hex_value(json_object_get(value, "address")); - breakpoint.enabled = json_boolean_value(json_object_get(value, "enabled")); - breakpoint.titantype = (DWORD)json_hex_value(json_object_get(value, "titantype")); - - // Name - const char* name = json_string_value(json_object_get(value, "name")); - - if(name) - strcpy_s(breakpoint.name, name); - - // Module - const char* mod = json_string_value(json_object_get(value, "module")); - - if(mod && *mod && strlen(mod) < MAX_MODULE_SIZE) - strcpy_s(breakpoint.mod, mod); - - // Build the hash map key: MOD_HASH + ADDRESS - const uint key = ModHashFromName(breakpoint.mod) + breakpoint.addr; - breakpoints.insert(std::make_pair(BreakpointKey(breakpoint.type, key), breakpoint)); + size_t i; + JSON value; + json_array_foreach(jsonbreakpoints, i, value) + { + BREAKPOINT curBreakpoint; + memset(&curBreakpoint, 0, sizeof(BREAKPOINT)); + curBreakpoint.type = (BP_TYPE)json_integer_value(json_object_get(value, "type")); + if(curBreakpoint.type == BPNORMAL) + curBreakpoint.oldbytes = (short)json_hex_value(json_object_get(value, "oldbytes")); + curBreakpoint.addr = (uint)json_hex_value(json_object_get(value, "address")); + curBreakpoint.enabled = json_boolean_value(json_object_get(value, "enabled")); + curBreakpoint.titantype = (DWORD)json_hex_value(json_object_get(value, "titantype")); + const char* name = json_string_value(json_object_get(value, "name")); + if(name) + strcpy_s(curBreakpoint.name, name); + const char* mod = json_string_value(json_object_get(value, "module")); + if(mod && *mod && strlen(mod) < MAX_MODULE_SIZE) + strcpy_s(curBreakpoint.mod, mod); + const uint key = modhashfromname(curBreakpoint.mod) + curBreakpoint.addr; + breakpoints.insert(std::make_pair(BreakpointKey(curBreakpoint.type, key), curBreakpoint)); + } } } -void BpClear() +void bpclear() { - EXCLUSIVE_ACQUIRE(LockBreakpoints); - breakpoints.clear(); + CriticalSectionLocker locker(LockBreakpoints); + BreakpointsInfo().swap(breakpoints); } \ No newline at end of file diff --git a/x64_dbg_dbg/breakpoint.h b/x64_dbg_dbg/breakpoint.h index d9806102..bda1828c 100644 --- a/x64_dbg_dbg/breakpoint.h +++ b/x64_dbg_dbg/breakpoint.h @@ -1,8 +1,10 @@ -#pragma once +#ifndef _BREAKPOINT_H +#define _BREAKPOINT_H #include "_global.h" #include "TitanEngine\TitanEngine.h" +//macros #define TITANSETDRX(titantype, drx) titantype &= 0x0FF; titantype |= (drx<<8) #define TITANGETDRX(titantype) (titantype >> 8) & 0xF #define TITANSETTYPE(titantype, type) titantype &= 0xF0F; titantype |= (type<<4) @@ -10,6 +12,7 @@ #define TITANSETSIZE(titantype, size) titantype &= 0xFF0; titantype |= size; #define TITANGETSIZE(titantype) titantype & 0xF +//enums enum BP_TYPE { BPNORMAL = 0, @@ -17,6 +20,7 @@ enum BP_TYPE BPMEMORY = 2 }; +//structs struct BREAKPOINT { uint addr; @@ -30,21 +34,23 @@ struct BREAKPOINT char mod[MAX_MODULE_SIZE]; }; -// Breakpoint enumeration callback +//typedefs typedef bool (*BPENUMCALLBACK)(const BREAKPOINT* bp); -BREAKPOINT* BpInfoFromAddr(BP_TYPE Type, uint Address); -int BpGetList(std::vector* List); -bool BpNew(uint Address, bool Enable, bool Singleshot, short OldBytes, BP_TYPE Type, DWORD TitanType, const char* Name); -bool BpGet(uint Address, BP_TYPE Type, const char* Name, BREAKPOINT* Bp); -bool BpDelete(uint Address, BP_TYPE Type); -bool BpEnable(uint Address, BP_TYPE Type, bool Enable); -bool BpSetName(uint Address, BP_TYPE Type, const char* Name); -bool BpSetTitanType(uint Address, BP_TYPE Type, int TitanType); -bool BpEnumAll(BPENUMCALLBACK EnumCallback, const char* Module); -bool BpEnumAll(BPENUMCALLBACK EnumCallback); -int BpGetCount(BP_TYPE Type, bool EnabledOnly = false); -void BpToBridge(const BREAKPOINT* Bp, BRIDGEBP* BridgeBp); -void BpCacheSave(JSON Root); -void BpCacheLoad(JSON Root); -void BpClear(); \ No newline at end of file +//functions +int bpgetlist(std::vector* list); +bool bpnew(uint addr, bool enabled, bool singleshoot, short oldbytes, BP_TYPE type, DWORD titantype, const char* name); +bool bpget(uint addr, BP_TYPE type, const char* name, BREAKPOINT* bp); +bool bpdel(uint addr, BP_TYPE type); +bool bpenable(uint addr, BP_TYPE type, bool enable); +bool bpsetname(uint addr, BP_TYPE type, const char* name); +bool bpsettitantype(uint addr, BP_TYPE type, int titantype); +bool bpenumall(BPENUMCALLBACK cbEnum); +bool bpenumall(BPENUMCALLBACK cbEnum, const char* module); +int bpgetcount(BP_TYPE type, bool enabledonly = false); +void bptobridge(const BREAKPOINT* bp, BRIDGEBP* bridge); +void bpcachesave(JSON root); +void bpcacheload(JSON root); +void bpclear(); + +#endif // _BREAKPOINT_H diff --git a/x64_dbg_dbg/comment.cpp b/x64_dbg_dbg/comment.cpp index 704cb83e..ab9c1db8 100644 --- a/x64_dbg_dbg/comment.cpp +++ b/x64_dbg_dbg/comment.cpp @@ -4,245 +4,179 @@ #include "debugger.h" #include "memory.h" -typedef std::unordered_map CommentsInfo; +typedef std::map CommentsInfo; static CommentsInfo comments; -bool CommentSet(uint Address, const char* Text, bool Manual) +bool commentset(uint addr, const char* text, bool manual) { - // CHECK: Exported/Command function - if(!DbgIsDebugging()) + if(!DbgIsDebugging() or !memisvalidreadptr(fdProcessInfo->hProcess, addr) or !text or text[0] == '\1' or strlen(text) >= MAX_COMMENT_SIZE - 1) return false; - - // A valid memory address must be supplied - if(!MemIsValidReadPtr(Address)) - return false; - - // Make sure the string is supplied, within bounds, and not a special delimiter - if(!Text || Text[0] == '\1' || strlen(Text) >= MAX_COMMENT_SIZE - 1) - return false; - - // Delete the comment if no text was supplied - if(Text[0] == '\0') + if(!*text) //NOTE: delete when there is no text { - CommentDelete(Address); + commentdel(addr); return true; } - - // Fill out the structure COMMENTSINFO comment; - strcpy_s(comment.text, Text); - ModNameFromAddr(Address, comment.mod, true); - - comment.manual = Manual; - comment.addr = Address; - - EXCLUSIVE_ACQUIRE(LockComments); - - // Insert if possible, otherwise replace - if (!comments.insert(std::make_pair(Address, comment)).second) - comments[Address] = comment; - + comment.manual = manual; + strcpy_s(comment.text, text); + modnamefromaddr(addr, comment.mod, true); + comment.addr = addr - modbasefromaddr(addr); + const uint key = modhashfromva(addr); + CriticalSectionLocker locker(LockComments); + if(!comments.insert(std::make_pair(key, comment)).second) //key already present + comments[key] = comment; return true; } -bool CommentGet(uint Address, char* Text) +bool commentget(uint addr, char* text) { - // CHECK: Exported/Command function if(!DbgIsDebugging()) return false; - - SHARED_ACQUIRE(LockComments); - - // Get an existing comment and copy the string buffer - auto found = comments.find(Address); - - // Was it found? - if(found == comments.end()) + CriticalSectionLocker locker(LockComments); + const CommentsInfo::iterator found = comments.find(modhashfromva(addr)); + if(found == comments.end()) //not found return false; - - strcpy_s(Text, MAX_COMMENT_SIZE, found->second.text); + strcpy_s(text, MAX_COMMENT_SIZE, found->second.text); return true; } -bool CommentDelete(uint Address) +bool commentdel(uint addr) { - // CHECK: Command/Sub function if(!DbgIsDebugging()) return false; - - EXCLUSIVE_ACQUIRE(LockComments); - return (comments.erase(Address) > 0); + CriticalSectionLocker locker(LockComments); + return (comments.erase(modhashfromva(addr)) == 1); } -void CommentDelRange(uint Start, uint End) +void commentdelrange(uint start, uint end) { - // CHECK: Export function if(!DbgIsDebugging()) return; - - // Are all comments going to be deleted? - // 0x00000000 - 0xFFFFFFFF - if(Start == 0 && End == ~0) + bool bDelAll = (start == 0 && end == ~0); //0x00000000-0xFFFFFFFF + uint modbase = modbasefromaddr(start); + if(modbase != modbasefromaddr(end)) + return; + start -= modbase; + end -= modbase; + CriticalSectionLocker locker(LockComments); + CommentsInfo::iterator i = comments.begin(); + while(i != comments.end()) { - EXCLUSIVE_ACQUIRE(LockComments); - comments.clear(); - } - else - { - // Make sure 'Start' and 'End' reference the same module - uint moduleBase = ModBaseFromAddr(Start); - - if(moduleBase != ModBaseFromAddr(End)) - return; - - EXCLUSIVE_ACQUIRE(LockComments); - for(auto itr = comments.begin(); itr != comments.end();) + if(i->second.manual) //ignore manual { - // Ignore manually set entries - if(itr->second.manual) - { - itr++; - continue; - } - - // [Start, End) - if(itr->second.addr >= Start && itr->second.addr < End) - itr = comments.erase(itr); - else - itr++; + i++; + continue; } - } -} - -void CommentCacheSave(JSON Root) -{ - EXCLUSIVE_ACQUIRE(LockComments); - - const JSON jsonComments = json_array(); - const JSON jsonAutoComments = json_array(); - - // Build the JSON array - for(auto & itr : comments) - { - JSON currentComment = json_object(); - - // OFFSET = ADDRESS - MOD_BASE - uint virtualOffset = itr.second.addr - ModBaseFromAddr(itr.second.addr); - - json_object_set_new(currentComment, "module", json_string(itr.second.mod)); - json_object_set_new(currentComment, "address", json_hex(virtualOffset)); - json_object_set_new(currentComment, "text", json_string(itr.second.text)); - - if(itr.second.manual) - json_array_append_new(jsonComments, currentComment); + if(bDelAll || (i->second.addr >= start && i->second.addr < end)) + comments.erase(i++); else - json_array_append_new(jsonAutoComments, currentComment); + i++; } - - // Save to the JSON root - if(json_array_size(jsonComments)) - json_object_set(Root, "comments", jsonComments); - - if(json_array_size(jsonAutoComments)) - json_object_set(Root, "autocomments", jsonAutoComments); - - json_decref(jsonComments); - json_decref(jsonAutoComments); } -void CommentCacheLoad(JSON Root) +void commentcachesave(JSON root) { - EXCLUSIVE_ACQUIRE(LockBookmarks); + CriticalSectionLocker locker(LockComments); + const JSON jsoncomments = json_array(); + const JSON jsonautocomments = json_array(); + for(CommentsInfo::iterator i = comments.begin(); i != comments.end(); ++i) + { + const COMMENTSINFO curComment = i->second; + JSON curjsoncomment = json_object(); + json_object_set_new(curjsoncomment, "module", json_string(curComment.mod)); + json_object_set_new(curjsoncomment, "address", json_hex(curComment.addr)); + json_object_set_new(curjsoncomment, "text", json_string(curComment.text)); + if(curComment.manual) + json_array_append_new(jsoncomments, curjsoncomment); + else + json_array_append_new(jsonautocomments, curjsoncomment); + } + if(json_array_size(jsoncomments)) + json_object_set(root, "comments", jsoncomments); + json_decref(jsoncomments); + if(json_array_size(jsonautocomments)) + json_object_set(root, "autocomments", jsonautocomments); + json_decref(jsonautocomments); +} - // Inline lambda to parse each JSON entry - auto AddBookmarks = [](const JSON Object, bool Manual) +void commentcacheload(JSON root) +{ + CriticalSectionLocker locker(LockComments); + comments.clear(); + const JSON jsoncomments = json_object_get(root, "comments"); + if(jsoncomments) { size_t i; JSON value; - - json_array_foreach(Object, i, value) + json_array_foreach(jsoncomments, i, value) { - COMMENTSINFO commentInfo; - - // Module + COMMENTSINFO curComment; const char* mod = json_string_value(json_object_get(value, "module")); - if(mod && *mod && strlen(mod) < MAX_MODULE_SIZE) - strcpy_s(commentInfo.mod, mod); + strcpy_s(curComment.mod, mod); else - commentInfo.mod[0] = '\0'; - - // Address/Manual - commentInfo.addr = (uint)json_hex_value(json_object_get(value, "address")); - commentInfo.manual = Manual; - - // String value + *curComment.mod = '\0'; + curComment.addr = (uint)json_hex_value(json_object_get(value, "address")); + curComment.manual = true; const char* text = json_string_value(json_object_get(value, "text")); - if(text) - strcpy_s(commentInfo.text, text); + strcpy_s(curComment.text, text); else - { - // Skip blank comments - continue; - } - - // ADDRESS = OFFSET + MOD_BASE - commentInfo.addr += ModBaseFromName(commentInfo.mod); - - comments.insert(std::make_pair(commentInfo.addr, commentInfo)); + continue; //skip + const uint key = modhashfromname(curComment.mod) + curComment.addr; + comments.insert(std::make_pair(key, curComment)); } - }; - - // Remove existing entries - comments.clear(); - - const JSON jsonComments = json_object_get(Root, "comments"); - const JSON jsonAutoComments = json_object_get(Root, "autocomments"); - - // Load user-set comments - if(jsonComments) - AddBookmarks(jsonComments, true); - - // Load auto-set comments - if(jsonAutoComments) - AddBookmarks(jsonAutoComments, false); + } + JSON jsonautocomments = json_object_get(root, "autocomments"); + if(jsonautocomments) + { + size_t i; + JSON value; + json_array_foreach(jsonautocomments, i, value) + { + COMMENTSINFO curComment; + const char* mod = json_string_value(json_object_get(value, "module")); + if(mod && *mod && strlen(mod) < MAX_MODULE_SIZE) + strcpy_s(curComment.mod, mod); + else + *curComment.mod = '\0'; + curComment.addr = (uint)json_hex_value(json_object_get(value, "address")); + curComment.manual = false; + const char* text = json_string_value(json_object_get(value, "text")); + if(text) + strcpy_s(curComment.text, text); + else + continue; //skip + const uint key = modhashfromname(curComment.mod) + curComment.addr; + comments.insert(std::make_pair(key, curComment)); + } + } } -bool CommentEnum(COMMENTSINFO* List, size_t* Size) +bool commentenum(COMMENTSINFO* commentlist, size_t* cbsize) { - // CHECK: Command function if(!DbgIsDebugging()) return false; - - // At least 1 parameter must be supplied - if(!List && !Size) + if(!commentlist && !cbsize) return false; - - SHARED_ACQUIRE(LockComments); - - // Check if the user requested size only - if(Size) + CriticalSectionLocker locker(LockComments); + if(!commentlist && cbsize) { - *Size = comments.size() * sizeof(COMMENTSINFO); - - if(!List) - return true; + *cbsize = comments.size() * sizeof(COMMENTSINFO); + return true; } - - // Populate the returned array - for(auto & itr : comments) + int j = 0; + for(CommentsInfo::iterator i = comments.begin(); i != comments.end(); ++i, j++) { - *List = itr.second; - List++; + commentlist[j] = i->second; + commentlist[j].addr += modbasefromname(commentlist[j].mod); } - return true; } -void CommentClear() +void commentclear() { - EXCLUSIVE_ACQUIRE(LockComments); - comments.clear(); + CriticalSectionLocker locker(LockComments); + CommentsInfo().swap(comments); } \ No newline at end of file diff --git a/x64_dbg_dbg/comment.h b/x64_dbg_dbg/comment.h index 993a63fa..3f25f6ef 100644 --- a/x64_dbg_dbg/comment.h +++ b/x64_dbg_dbg/comment.h @@ -1,4 +1,5 @@ -#pragma once +#ifndef _COMMENT_H +#define _COMMENT_H #include "_global.h" @@ -10,11 +11,13 @@ struct COMMENTSINFO bool manual; }; -bool CommentSet(uint Address, const char* Text, bool Manual); -bool CommentGet(uint Address, char* Text); -bool CommentDelete(uint Address); -void CommentDelRange(uint Start, uint End); -void CommentCacheSave(JSON Root); -void CommentCacheLoad(JSON Root); -bool CommentEnum(COMMENTSINFO* List, size_t* Size); -void CommentClear(); \ No newline at end of file +bool commentset(uint addr, const char* text, bool manual); +bool commentget(uint addr, char* text); +bool commentdel(uint addr); +void commentdelrange(uint start, uint end); +void commentcachesave(JSON root); +void commentcacheload(JSON root); +bool commentenum(COMMENTSINFO* commentlist, size_t* cbsize); +void commentclear(); + +#endif //_COMMENT_H \ No newline at end of file diff --git a/x64_dbg_dbg/console.cpp b/x64_dbg_dbg/console.cpp index cdad80fe..15895114 100644 --- a/x64_dbg_dbg/console.cpp +++ b/x64_dbg_dbg/console.cpp @@ -1,18 +1,18 @@ #include "console.h" +#include "threading.h" -void dputs(const char* Text) +static char msg[66000] = ""; + +void dputs(const char* text) { - dprintf("%s\n", Text); + dprintf("%s\n", text); } -void dprintf(const char* Format, ...) +void dprintf(const char* format, ...) { + CriticalSectionLocker locker(LockDprintf); va_list args; - char buffer[16384]; - - va_start(args, Format); - vsnprintf_s(buffer, _TRUNCATE, Format, args); - va_end(args); - - GuiAddLogMessage(buffer); + va_start(args, format); + vsnprintf(msg, sizeof(msg), format, args); + GuiAddLogMessage(msg); } diff --git a/x64_dbg_dbg/console.h b/x64_dbg_dbg/console.h index 52e4e488..1407ed0d 100644 --- a/x64_dbg_dbg/console.h +++ b/x64_dbg_dbg/console.h @@ -1,6 +1,10 @@ -#pragma once +#ifndef _CONSOLE_H +#define _CONSOLE_H #include "_global.h" -void dputs(const char* Text); -void dprintf(const char* Format, ...); \ No newline at end of file +//functions +void dputs(const char* text); +void dprintf(const char* format, ...); + +#endif // _CONSOLE_H diff --git a/x64_dbg_dbg/dbghelp_safe.cpp b/x64_dbg_dbg/dbghelp_safe.cpp index f8a9d3a0..46bb5ffa 100644 --- a/x64_dbg_dbg/dbghelp_safe.cpp +++ b/x64_dbg_dbg/dbghelp_safe.cpp @@ -10,6 +10,7 @@ DWORD __in DWORD flags ) { + CriticalSectionLocker locker(LockSym); return UnDecorateSymbolName(name, outputString, maxStringLength, flags); } BOOL @@ -18,7 +19,7 @@ BOOL __in DWORD64 BaseOfDll ) { - EXCLUSIVE_ACQUIRE(LockSym); + CriticalSectionLocker locker(LockSym); return SymUnloadModule64(hProcess, BaseOfDll); } BOOL @@ -27,7 +28,7 @@ BOOL __in_opt PCSTR SearchPath ) { - EXCLUSIVE_ACQUIRE(LockSym); + CriticalSectionLocker locker(LockSym); return SymSetSearchPath(hProcess, SearchPath); } DWORD @@ -35,7 +36,7 @@ DWORD __in DWORD SymOptions ) { - EXCLUSIVE_ACQUIRE(LockSym); + CriticalSectionLocker locker(LockSym); return SymSetOptions(SymOptions); } BOOL @@ -45,7 +46,7 @@ BOOL __in BOOL fInvadeProcess ) { - EXCLUSIVE_ACQUIRE(LockSym); + CriticalSectionLocker locker(LockSym); return SymInitialize(hProcess, UserSearchPath, fInvadeProcess); } BOOL @@ -55,7 +56,7 @@ BOOL __in ULONG64 UserContext ) { - EXCLUSIVE_ACQUIRE(LockSym); + CriticalSectionLocker locker(LockSym); return SymRegisterCallback64(hProcess, CallbackFunction, UserContext); } DWORD64 @@ -70,7 +71,7 @@ DWORD64 __in_opt DWORD Flags ) { - EXCLUSIVE_ACQUIRE(LockSym); + CriticalSectionLocker locker(LockSym); return SymLoadModuleEx(hProcess, hFile, ImageName, ModuleName, BaseOfDll, DllSize, Data, Flags); } BOOL @@ -80,7 +81,7 @@ BOOL __out PIMAGEHLP_MODULE64 ModuleInfo ) { - EXCLUSIVE_ACQUIRE(LockSym); + CriticalSectionLocker locker(LockSym); return SymGetModuleInfo64(hProcess, qwAddr, ModuleInfo); } BOOL @@ -90,7 +91,7 @@ BOOL __in DWORD SearchPathLength ) { - EXCLUSIVE_ACQUIRE(LockSym); + CriticalSectionLocker locker(LockSym); return SymGetSearchPath(hProcess, SearchPath, SearchPathLength); } BOOL @@ -102,19 +103,9 @@ BOOL __in_opt PVOID UserContext ) { - EXCLUSIVE_ACQUIRE(LockSym); + CriticalSectionLocker locker(LockSym); return SymEnumSymbols(hProcess, BaseOfDll, Mask, EnumSymbolsCallback, UserContext); } -BOOL - SafeSymEnumerateModules64( - __in HANDLE hProcess, - __in PSYM_ENUMMODULES_CALLBACK64 EnumModulesCallback, - __in_opt PVOID UserContext - ) -{ - EXCLUSIVE_ACQUIRE(LockSym); - return SymEnumerateModules64(hProcess, EnumModulesCallback, UserContext); -} BOOL SafeSymEnumerateModules( __in HANDLE hProcess, @@ -122,7 +113,7 @@ BOOL __in_opt PVOID UserContext ) { - EXCLUSIVE_ACQUIRE(LockSym); + CriticalSectionLocker locker(LockSym); return SymEnumerateModules(hProcess, EnumModulesCallback, UserContext); } BOOL @@ -133,7 +124,7 @@ BOOL __out PIMAGEHLP_LINE64 Line64 ) { - EXCLUSIVE_ACQUIRE(LockSym); + CriticalSectionLocker locker(LockSym); return SymGetLineFromAddr64(hProcess, qwAddr, pdwDisplacement, Line64); } BOOL @@ -143,7 +134,7 @@ BOOL __inout PSYMBOL_INFO Symbol ) { - EXCLUSIVE_ACQUIRE(LockSym); + CriticalSectionLocker locker(LockSym); return SymFromName(hProcess, Name, Symbol); } BOOL @@ -154,7 +145,7 @@ BOOL __inout PSYMBOL_INFO Symbol ) { - EXCLUSIVE_ACQUIRE(LockSym); + CriticalSectionLocker locker(LockSym); return SymFromAddr(hProcess, Address, Displacement, Symbol); } BOOL @@ -162,6 +153,6 @@ BOOL __in HANDLE hProcess ) { - EXCLUSIVE_ACQUIRE(LockSym); + CriticalSectionLocker locker(LockSym); return SymCleanup(hProcess); } \ No newline at end of file diff --git a/x64_dbg_dbg/dbghelp_safe.h b/x64_dbg_dbg/dbghelp_safe.h index 59063992..b6364f33 100644 --- a/x64_dbg_dbg/dbghelp_safe.h +++ b/x64_dbg_dbg/dbghelp_safe.h @@ -71,12 +71,6 @@ BOOL __in PSYM_ENUMERATESYMBOLS_CALLBACK EnumSymbolsCallback, __in_opt PVOID UserContext ); -BOOL - SafeSymEnumerateModules64( - __in HANDLE hProcess, - __in PSYM_ENUMMODULES_CALLBACK64 EnumModulesCallback, - __in_opt PVOID UserContext - ); BOOL SafeSymEnumerateModules( __in HANDLE hProcess, diff --git a/x64_dbg_dbg/debugger.cpp b/x64_dbg_dbg/debugger.cpp index e4dcd674..f9cf4054 100644 --- a/x64_dbg_dbg/debugger.cpp +++ b/x64_dbg_dbg/debugger.cpp @@ -49,7 +49,7 @@ static DWORD WINAPI memMapThread(void* ptr) if(cachePrivateUsage != PrivateUsage && !dbgisrunning()) //update the memory map when { cachePrivateUsage = PrivateUsage; - MemUpdateMap(fdProcessInfo->hProcess); + memupdatemap(fdProcessInfo->hProcess); } Sleep(1000); } @@ -58,8 +58,8 @@ static DWORD WINAPI memMapThread(void* ptr) void dbginit() { - ExceptionCodeInit(); - ErrorCodeInit(); + exceptioninit(); + errorinit(); CloseHandle(CreateThread(0, 0, memMapThread, 0, 0, 0)); } @@ -82,7 +82,7 @@ uint dbgdebuggedbase() void dbgdisablebpx() { std::vector list; - int bpcount = BpGetList(&list); + int bpcount = bpgetlist(&list); for(int i = 0; i < bpcount; i++) { if(list[i].type == BPNORMAL and IsBPXEnabled(list[i].addr)) @@ -93,7 +93,7 @@ void dbgdisablebpx() void dbgenablebpx() { std::vector list; - int bpcount = BpGetList(&list); + int bpcount = bpgetlist(&list); for(int i = 0; i < bpcount; i++) { if(list[i].type == BPNORMAL and !IsBPXEnabled(list[i].addr) and list[i].enabled) @@ -185,7 +185,7 @@ DWORD WINAPI updateCallStackThread(void* ptr) void DebugUpdateGui(uint disasm_addr, bool stack) { uint cip = GetContextDataEx(hActiveThread, UE_CIP); - if(MemIsValidReadPtr(disasm_addr)) + if(memisvalidreadptr(fdProcessInfo->hProcess, disasm_addr)) GuiDisasmAt(disasm_addr, cip); uint csp = GetContextDataEx(hActiveThread, UE_CSP); if(stack) @@ -198,24 +198,24 @@ void DebugUpdateGui(uint disasm_addr, bool stack) } char modname[MAX_MODULE_SIZE] = ""; char modtext[MAX_MODULE_SIZE * 2] = ""; - if(!ModNameFromAddr(disasm_addr, modname, true)) + if(!modnamefromaddr(disasm_addr, modname, true)) *modname = 0; else sprintf(modtext, "Module: %s - ", modname); char title[1024] = ""; - sprintf(title, "File: %s - PID: %X - %sThread: %X", szBaseFileName, fdProcessInfo->dwProcessId, modtext, ThreadGetId(hActiveThread)); + sprintf(title, "File: %s - PID: %X - %sThread: %X", szBaseFileName, fdProcessInfo->dwProcessId, modtext, threadgetid(hActiveThread)); GuiUpdateWindowTitle(title); GuiUpdateAllViews(); } void cbUserBreakpoint() { - hActiveThread = ThreadGetHandle(((DEBUG_EVENT*)GetDebugData())->dwThreadId); + hActiveThread = threadgethandle(((DEBUG_EVENT*)GetDebugData())->dwThreadId); BREAKPOINT bp; BRIDGEBP pluginBp; PLUG_CB_BREAKPOINT bpInfo; bpInfo.breakpoint = 0; - if(!BpGet(GetContextDataEx(hActiveThread, UE_CIP), BPNORMAL, 0, &bp) and bp.enabled) + if(!bpget(GetContextDataEx(hActiveThread, UE_CIP), BPNORMAL, 0, &bp) and bp.enabled) dputs("Breakpoint reached not in list!"); else { @@ -225,7 +225,7 @@ void cbUserBreakpoint() bptype = "UD2"; else if((titantype & UE_BREAKPOINT_TYPE_LONG_INT3) == UE_BREAKPOINT_TYPE_LONG_INT3) bptype = "LONG INT3"; - const char* symbolicname = SymGetSymbolicName(bp.addr); + const char* symbolicname = symgetsymbolicname(bp.addr); if(symbolicname) { if(*bp.name) @@ -241,8 +241,8 @@ void cbUserBreakpoint() dprintf("%s breakpoint at "fhex"!\n", bptype, bp.addr); } if(bp.singleshoot) - BpDelete(bp.addr, BPNORMAL); - BpToBridge(&bp, &pluginBp); + bpdel(bp.addr, BPNORMAL); + bptobridge(&bp, &pluginBp); bpInfo.breakpoint = &pluginBp; } GuiSetDebugState(paused); @@ -260,13 +260,13 @@ void cbUserBreakpoint() void cbHardwareBreakpoint(void* ExceptionAddress) { - hActiveThread = ThreadGetHandle(((DEBUG_EVENT*)GetDebugData())->dwThreadId); + hActiveThread = threadgethandle(((DEBUG_EVENT*)GetDebugData())->dwThreadId); uint cip = GetContextDataEx(hActiveThread, UE_CIP); BREAKPOINT bp; BRIDGEBP pluginBp; PLUG_CB_BREAKPOINT bpInfo; bpInfo.breakpoint = 0; - if(!BpGet((uint)ExceptionAddress, BPHARDWARE, 0, &bp)) + if(!bpget((uint)ExceptionAddress, BPHARDWARE, 0, &bp)) dputs("Hardware breakpoint reached not in list!"); else { @@ -302,7 +302,7 @@ void cbHardwareBreakpoint(void* ExceptionAddress) bptype = "write"; break; } - const char* symbolicname = SymGetSymbolicName(bp.addr); + const char* symbolicname = symgetsymbolicname(bp.addr); if(symbolicname) { if(*bp.name) @@ -317,7 +317,7 @@ void cbHardwareBreakpoint(void* ExceptionAddress) else dprintf("Hardware breakpoint (%s%s) at "fhex"!\n", bpsize, bptype, bp.addr); } - BpToBridge(&bp, &pluginBp); + bptobridge(&bp, &pluginBp); bpInfo.breakpoint = &pluginBp; } GuiSetDebugState(paused); @@ -335,15 +335,15 @@ void cbHardwareBreakpoint(void* ExceptionAddress) void cbMemoryBreakpoint(void* ExceptionAddress) { - hActiveThread = ThreadGetHandle(((DEBUG_EVENT*)GetDebugData())->dwThreadId); + hActiveThread = threadgethandle(((DEBUG_EVENT*)GetDebugData())->dwThreadId); uint cip = GetContextDataEx(hActiveThread, UE_CIP); uint size; - uint base = MemFindBaseAddr((uint)ExceptionAddress, &size, true); + uint base = memfindbaseaddr((uint)ExceptionAddress, &size, true); BREAKPOINT bp; BRIDGEBP pluginBp; PLUG_CB_BREAKPOINT bpInfo; bpInfo.breakpoint = 0; - if(!BpGet(base, BPMEMORY, 0, &bp)) + if(!bpget(base, BPMEMORY, 0, &bp)) dputs("Memory breakpoint reached not in list!"); else { @@ -363,7 +363,7 @@ void cbMemoryBreakpoint(void* ExceptionAddress) bptype = " (read/write/execute)"; break; } - const char* symbolicname = SymGetSymbolicName(bp.addr); + const char* symbolicname = symgetsymbolicname(bp.addr); if(symbolicname) { if(*bp.name) @@ -378,11 +378,11 @@ void cbMemoryBreakpoint(void* ExceptionAddress) else dprintf("Memory breakpoint%s at "fhex" ("fhex")!\n", bptype, bp.addr, ExceptionAddress); } - BpToBridge(&bp, &pluginBp); + bptobridge(&bp, &pluginBp); bpInfo.breakpoint = &pluginBp; } if(bp.singleshoot) - BpDelete(bp.addr, BPMEMORY); //delete from breakpoint list + bpdel(bp.addr, BPMEMORY); //delete from breakpoint list GuiSetDebugState(paused); DebugUpdateGui(cip, true); //lock @@ -487,7 +487,7 @@ static bool cbSetModuleBreakpoints(const BREAKPOINT* bp) case BPMEMORY: { uint size = 0; - MemFindBaseAddr(bp->addr, &size); + memfindbaseaddr(bp->addr, &size); if(!SetMemoryBPXEx(bp->addr, size, bp->titantype, !bp->singleshoot, (void*)cbMemoryBreakpoint)) dprintf("Could not set memory breakpoint "fhex"!\n", bp->addr); } @@ -503,7 +503,7 @@ static bool cbSetModuleBreakpoints(const BREAKPOINT* bp) } int titantype = bp->titantype; TITANSETDRX(titantype, drx); - BpSetTitanType(bp->addr, BPHARDWARE, titantype); + bpsettitantype(bp->addr, BPHARDWARE, titantype); if(!SetHardwareBreakPoint(bp->addr, drx, TITANGETTYPE(bp->titantype), TITANGETSIZE(bp->titantype), (void*)cbHardwareBreakpoint)) dprintf("Could not set hardware breakpoint "fhex"!\n", bp->addr); } @@ -540,7 +540,7 @@ static bool cbRemoveModuleBreakpoints(const BREAKPOINT* bp) void cbStep() { - hActiveThread = ThreadGetHandle(((DEBUG_EVENT*)GetDebugData())->dwThreadId); + hActiveThread = threadgethandle(((DEBUG_EVENT*)GetDebugData())->dwThreadId); isStepping = false; GuiSetDebugState(paused); DebugUpdateGui(GetContextDataEx(hActiveThread, UE_CIP), true); @@ -559,7 +559,7 @@ void cbStep() static void cbRtrFinalStep() { - hActiveThread = ThreadGetHandle(((DEBUG_EVENT*)GetDebugData())->dwThreadId); + hActiveThread = threadgethandle(((DEBUG_EVENT*)GetDebugData())->dwThreadId); GuiSetDebugState(paused); DebugUpdateGui(GetContextDataEx(hActiveThread, UE_CIP), true); //lock @@ -576,7 +576,7 @@ static unsigned char getCIPch() { unsigned char ch = 0x90; uint cip = GetContextDataEx(hActiveThread, UE_CIP); - MemRead((void*)cip, &ch, 1, 0); + memread(fdProcessInfo->hProcess, (void*)cip, &ch, 1, 0); return ch; } @@ -604,8 +604,8 @@ static void cbCreateProcess(CREATE_PROCESS_DEBUG_INFO* CreateProcessInfo) } dprintf("Process Started: "fhex" %s\n", base, DebugFileName); - MemUpdateMap(fdProcessInfo->hProcess); - GuiDumpAt(MemFindBaseAddr(GetContextData(UE_CIP), 0) + PAGE_SIZE); //dump somewhere + memupdatemap(fdProcessInfo->hProcess); + GuiDumpAt(memfindbaseaddr(GetContextData(UE_CIP), 0)+PAGE_SIZE); //dump somewhere //init program database int len = (int)strlen(szFileName); @@ -633,12 +633,12 @@ static void cbCreateProcess(CREATE_PROCESS_DEBUG_INFO* CreateProcessInfo) memset(&modInfo, 0, sizeof(modInfo)); modInfo.SizeOfStruct = sizeof(modInfo); if(SafeSymGetModuleInfo64(fdProcessInfo->hProcess, (DWORD64)base, &modInfo)) - ModLoad((uint)base, modInfo.ImageSize, modInfo.ImageName); + modload((uint)base, modInfo.ImageSize, modInfo.ImageName); dbggetprivateusage(fdProcessInfo->hProcess, true); - MemUpdateMap(fdProcessInfo->hProcess); //update memory map + memupdatemap(fdProcessInfo->hProcess); //update memory map char modname[256] = ""; - if(ModNameFromAddr((uint)base, modname, true)) - BpEnumAll(cbSetModuleBreakpoints, modname); + if(modnamefromaddr((uint)base, modname, true)) + bpenumall(cbSetModuleBreakpoints, modname); GuiUpdateBreakpointsView(); if(!bFileIsDll and !bIsAttached) //Set entry breakpoint { @@ -688,7 +688,7 @@ static void cbCreateProcess(CREATE_PROCESS_DEBUG_INFO* CreateProcessInfo) threadInfo.hThread = CreateProcessInfo->hThread; threadInfo.lpStartAddress = CreateProcessInfo->lpStartAddress; threadInfo.lpThreadLocalBase = CreateProcessInfo->lpThreadLocalBase; - ThreadCreate(&threadInfo); + threadcreate(&threadInfo); } static void cbExitProcess(EXIT_PROCESS_DEBUG_INFO* ExitProcess) @@ -702,9 +702,9 @@ static void cbExitProcess(EXIT_PROCESS_DEBUG_INFO* ExitProcess) static void cbCreateThread(CREATE_THREAD_DEBUG_INFO* CreateThread) { - ThreadCreate(CreateThread); //update thread list + threadcreate(CreateThread); //update thread list DWORD dwThreadId = ((DEBUG_EVENT*)GetDebugData())->dwThreadId; - hActiveThread = ThreadGetHandle(dwThreadId); + hActiveThread = threadgethandle(dwThreadId); if(settingboolget("Events", "ThreadEntry")) { @@ -723,7 +723,7 @@ static void cbCreateThread(CREATE_THREAD_DEBUG_INFO* CreateThread) if(settingboolget("Events", "ThreadStart")) { dbggetprivateusage(fdProcessInfo->hProcess, true); - MemUpdateMap(fdProcessInfo->hProcess); //update memory map + memupdatemap(fdProcessInfo->hProcess); //update memory map //update GUI GuiSetDebugState(paused); DebugUpdateGui(GetContextDataEx(hActiveThread, UE_CIP), true); @@ -739,13 +739,13 @@ static void cbCreateThread(CREATE_THREAD_DEBUG_INFO* CreateThread) static void cbExitThread(EXIT_THREAD_DEBUG_INFO* ExitThread) { - hActiveThread = ThreadGetHandle(((DEBUG_EVENT*)GetDebugData())->dwThreadId); + hActiveThread = threadgethandle(((DEBUG_EVENT*)GetDebugData())->dwThreadId); DWORD dwThreadId = ((DEBUG_EVENT*)GetDebugData())->dwThreadId; PLUG_CB_EXITTHREAD callbackInfo; callbackInfo.ExitThread = ExitThread; callbackInfo.dwThreadId = dwThreadId; plugincbcall(CB_EXITTHREAD, &callbackInfo); - ThreadExit(dwThreadId); + threadexit(dwThreadId); dprintf("Thread %X exit\n", dwThreadId); if(settingboolget("Events", "ThreadEnd")) @@ -765,7 +765,7 @@ static void cbExitThread(EXIT_THREAD_DEBUG_INFO* ExitThread) static void cbSystemBreakpoint(void* ExceptionData) { - hActiveThread = ThreadGetHandle(((DEBUG_EVENT*)GetDebugData())->dwThreadId); + hActiveThread = threadgethandle(((DEBUG_EVENT*)GetDebugData())->dwThreadId); //log message if(bIsAttached) dputs("Attach breakpoint reached!"); @@ -773,7 +773,7 @@ static void cbSystemBreakpoint(void* ExceptionData) dputs("System breakpoint reached!"); bSkipExceptions = false; //we are not skipping first-chance exceptions uint cip = GetContextDataEx(hActiveThread, UE_CIP); - GuiDumpAt(MemFindBaseAddr(cip, 0, true)); //dump somewhere + GuiDumpAt(memfindbaseaddr(cip, 0, true)); //dump somewhere //plugin callbacks PLUG_CB_SYSTEMBREAKPOINT callbackInfo; @@ -797,7 +797,7 @@ static void cbSystemBreakpoint(void* ExceptionData) static void cbLoadDll(LOAD_DLL_DEBUG_INFO* LoadDll) { - hActiveThread = ThreadGetHandle(((DEBUG_EVENT*)GetDebugData())->dwThreadId); + hActiveThread = threadgethandle(((DEBUG_EVENT*)GetDebugData())->dwThreadId); void* base = LoadDll->lpBaseOfDll; char DLLDebugFileName[deflen] = ""; if(!GetFileNameFromHandle(LoadDll->hFile, DLLDebugFileName)) @@ -813,12 +813,12 @@ static void cbLoadDll(LOAD_DLL_DEBUG_INFO* LoadDll) memset(&modInfo, 0, sizeof(modInfo)); modInfo.SizeOfStruct = sizeof(IMAGEHLP_MODULE64); if(SafeSymGetModuleInfo64(fdProcessInfo->hProcess, (DWORD64)base, &modInfo)) - ModLoad((uint)base, modInfo.ImageSize, modInfo.ImageName); + modload((uint)base, modInfo.ImageSize, modInfo.ImageName); dbggetprivateusage(fdProcessInfo->hProcess, true); - MemUpdateMap(fdProcessInfo->hProcess); //update memory map + memupdatemap(fdProcessInfo->hProcess); //update memory map char modname[256] = ""; - if(ModNameFromAddr((uint)base, modname, true)) - BpEnumAll(cbSetModuleBreakpoints, modname); + if(modnamefromaddr((uint)base, modname, true)) + bpenumall(cbSetModuleBreakpoints, modname); GuiUpdateBreakpointsView(); bool bAlreadySetEntry = false; @@ -900,15 +900,15 @@ static void cbLoadDll(LOAD_DLL_DEBUG_INFO* LoadDll) static void cbUnloadDll(UNLOAD_DLL_DEBUG_INFO* UnloadDll) { - hActiveThread = ThreadGetHandle(((DEBUG_EVENT*)GetDebugData())->dwThreadId); + hActiveThread = threadgethandle(((DEBUG_EVENT*)GetDebugData())->dwThreadId); PLUG_CB_UNLOADDLL callbackInfo; callbackInfo.UnloadDll = UnloadDll; plugincbcall(CB_UNLOADDLL, &callbackInfo); void* base = UnloadDll->lpBaseOfDll; char modname[256] = "???"; - if(ModNameFromAddr((uint)base, modname, true)) - BpEnumAll(cbRemoveModuleBreakpoints, modname); + if(modnamefromaddr((uint)base, modname, true)) + bpenumall(cbRemoveModuleBreakpoints, modname); GuiUpdateBreakpointsView(); SafeSymUnloadModule64(fdProcessInfo->hProcess, (DWORD64)base); dprintf("DLL Unloaded: "fhex" %s\n", base, modname); @@ -928,12 +928,13 @@ static void cbUnloadDll(UNLOAD_DLL_DEBUG_INFO* UnloadDll) wait(WAITID_RUN); } - ModUnload((uint)base); + modunload((uint)base); } static void cbOutputDebugString(OUTPUT_DEBUG_STRING_INFO* DebugString) { - hActiveThread = ThreadGetHandle(((DEBUG_EVENT*)GetDebugData())->dwThreadId); + + hActiveThread = threadgethandle(((DEBUG_EVENT*)GetDebugData())->dwThreadId); PLUG_CB_OUTPUTDEBUGSTRING callbackInfo; callbackInfo.DebugString = DebugString; plugincbcall(CB_OUTPUTDEBUGSTRING, &callbackInfo); @@ -941,7 +942,7 @@ static void cbOutputDebugString(OUTPUT_DEBUG_STRING_INFO* DebugString) if(!DebugString->fUnicode) //ASCII { Memory DebugText(DebugString->nDebugStringLength + 1, "cbOutputDebugString:DebugText"); - if(MemRead(DebugString->lpDebugStringData, DebugText, DebugString->nDebugStringLength, 0)) + if(memread(fdProcessInfo->hProcess, DebugString->lpDebugStringData, DebugText, DebugString->nDebugStringLength, 0)) { String str = String(DebugText); if(str != lastDebugText) //fix for every string being printed twice @@ -972,7 +973,7 @@ static void cbOutputDebugString(OUTPUT_DEBUG_STRING_INFO* DebugString) static void cbException(EXCEPTION_DEBUG_INFO* ExceptionData) { - hActiveThread = ThreadGetHandle(((DEBUG_EVENT*)GetDebugData())->dwThreadId); + hActiveThread = threadgethandle(((DEBUG_EVENT*)GetDebugData())->dwThreadId); PLUG_CB_EXCEPTION callbackInfo; callbackInfo.Exception = ExceptionData; unsigned int ExceptionCode = ExceptionData->ExceptionRecord.ExceptionCode; @@ -1018,18 +1019,18 @@ static void cbException(EXCEPTION_DEBUG_INFO* ExceptionData) memcpy(&nameInfo, ExceptionData->ExceptionRecord.ExceptionInformation, sizeof(THREADNAME_INFO)); if(nameInfo.dwThreadID == -1) //current thread nameInfo.dwThreadID = ((DEBUG_EVENT*)GetDebugData())->dwThreadId; - if(nameInfo.dwType == 0x1000 and nameInfo.dwFlags == 0 and ThreadIsValid(nameInfo.dwThreadID)) //passed basic checks + if(nameInfo.dwType == 0x1000 and nameInfo.dwFlags == 0 and threadisvalid(nameInfo.dwThreadID)) //passed basic checks { Memory ThreadName(MAX_THREAD_NAME_SIZE, "cbException:ThreadName"); - if(MemRead((void*)nameInfo.szName, ThreadName, MAX_THREAD_NAME_SIZE - 1, 0)) + if(memread(fdProcessInfo->hProcess, nameInfo.szName, ThreadName, MAX_THREAD_NAME_SIZE - 1, 0)) { String ThreadNameEscaped = StringUtils::Escape(ThreadName); dprintf("SetThreadName(%X, \"%s\")\n", nameInfo.dwThreadID, ThreadNameEscaped.c_str()); - ThreadSetName(nameInfo.dwThreadID, ThreadNameEscaped.c_str()); + threadsetname(nameInfo.dwThreadID, ThreadNameEscaped.c_str()); } } } - const char* exceptionName = ExceptionCodeToName(ExceptionCode); + const char* exceptionName = exceptionnamefromcode(ExceptionCode); if(ExceptionData->dwFirstChance) //first chance exception { if(exceptionName) @@ -1150,8 +1151,8 @@ DWORD WINAPI threadDebugLoop(void* lpParameter) RemoveAllBreakPoints(UE_OPTION_REMOVEALL); //remove all breakpoints //cleanup dbclose(); - ModClear(); - ThreadClear(); + modclear(); + threadclear(); GuiSetDebugState(stopped); dputs("debugging stopped!"); varset("$hp", (uint)0, true); @@ -1162,7 +1163,7 @@ DWORD WINAPI threadDebugLoop(void* lpParameter) bool cbDeleteAllBreakpoints(const BREAKPOINT* bp) { - if(BpDelete(bp->addr, BPNORMAL) and (!bp->enabled or DeleteBPX(bp->addr))) + if(bpdel(bp->addr, BPNORMAL) and (!bp->enabled or DeleteBPX(bp->addr))) return true; dprintf("Delete breakpoint failed: "fhex"\n", bp->addr); @@ -1174,7 +1175,7 @@ bool cbEnableAllBreakpoints(const BREAKPOINT* bp) if(bp->type != BPNORMAL or bp->enabled) return true; - if(!BpEnable(bp->addr, BPNORMAL, true) or !SetBPX(bp->addr, bp->titantype, (void*)cbUserBreakpoint)) + if(!bpenable(bp->addr, BPNORMAL, true) or !SetBPX(bp->addr, bp->titantype, (void*)cbUserBreakpoint)) { dprintf("Could not enable breakpoint "fhex"\n", bp->addr); return false; @@ -1187,7 +1188,7 @@ bool cbDisableAllBreakpoints(const BREAKPOINT* bp) if(bp->type != BPNORMAL or !bp->enabled) return true; - if(!BpEnable(bp->addr, BPNORMAL, false) or !DeleteBPX(bp->addr)) + if(!bpenable(bp->addr, BPNORMAL, false) or !DeleteBPX(bp->addr)) { dprintf("Could not disable breakpoint "fhex"\n", bp->addr); return false; @@ -1207,8 +1208,8 @@ bool cbEnableAllHardwareBreakpoints(const BREAKPOINT* bp) } int titantype = bp->titantype; TITANSETDRX(titantype, drx); - BpSetTitanType(bp->addr, BPHARDWARE, titantype); - if(!BpEnable(bp->addr, BPHARDWARE, true) or !SetHardwareBreakPoint(bp->addr, drx, TITANGETTYPE(bp->titantype), TITANGETSIZE(bp->titantype), (void*)cbHardwareBreakpoint)) + bpsettitantype(bp->addr, BPHARDWARE, titantype); + if(!bpenable(bp->addr, BPHARDWARE, true) or !SetHardwareBreakPoint(bp->addr, drx, TITANGETTYPE(bp->titantype), TITANGETSIZE(bp->titantype), (void*)cbHardwareBreakpoint)) { dprintf("could not enable hardware breakpoint "fhex"\n", bp->addr); return false; @@ -1220,7 +1221,7 @@ bool cbDisableAllHardwareBreakpoints(const BREAKPOINT* bp) { if(bp->type != BPHARDWARE or !bp->enabled) return true; - if(!BpEnable(bp->addr, BPHARDWARE, false) or !DeleteHardwareBreakPoint(TITANGETDRX(bp->titantype))) + if(!bpenable(bp->addr, BPHARDWARE, false) or !DeleteHardwareBreakPoint(TITANGETDRX(bp->titantype))) { dprintf("Could not disable hardware breakpoint "fhex"\n", bp->addr); return false; @@ -1233,8 +1234,8 @@ bool cbEnableAllMemoryBreakpoints(const BREAKPOINT* bp) if(bp->type != BPMEMORY or bp->enabled) return true; uint size = 0; - MemFindBaseAddr(bp->addr, &size); - if(!BpEnable(bp->addr, BPMEMORY, true) or !SetMemoryBPXEx(bp->addr, size, bp->titantype, !bp->singleshoot, (void*)cbMemoryBreakpoint)) + memfindbaseaddr(bp->addr, &size); + if(!bpenable(bp->addr, BPMEMORY, true) or !SetMemoryBPXEx(bp->addr, size, bp->titantype, !bp->singleshoot, (void*)cbMemoryBreakpoint)) { dprintf("Could not enable memory breakpoint "fhex"\n", bp->addr); return false; @@ -1246,7 +1247,7 @@ bool cbDisableAllMemoryBreakpoints(const BREAKPOINT* bp) { if(bp->type != BPMEMORY or !bp->enabled) return true; - if(!BpEnable(bp->addr, BPMEMORY, false) or !DeleteHardwareBreakPoint(TITANGETDRX(bp->titantype))) + if(!bpenable(bp->addr, BPMEMORY, false) or !DeleteHardwareBreakPoint(TITANGETDRX(bp->titantype))) { dprintf("Could not disable memory breakpoint "fhex"\n", bp->addr); return false; @@ -1281,8 +1282,8 @@ bool cbDeleteAllMemoryBreakpoints(const BREAKPOINT* bp) if(!bp->enabled) return true; uint size; - MemFindBaseAddr(bp->addr, &size); - if(!BpDelete(bp->addr, BPMEMORY) or !RemoveMemoryBPX(bp->addr, size)) + memfindbaseaddr(bp->addr, &size); + if(!bpdel(bp->addr, BPMEMORY) or !RemoveMemoryBPX(bp->addr, size)) { dprintf("Delete memory breakpoint failed: "fhex"\n", bp->addr); return STATUS_ERROR; @@ -1294,7 +1295,7 @@ bool cbDeleteAllHardwareBreakpoints(const BREAKPOINT* bp) { if(!bp->enabled) return true; - if(!BpDelete(bp->addr, BPHARDWARE) or !DeleteHardwareBreakPoint(TITANGETDRX(bp->titantype))) + if(!bpdel(bp->addr, BPHARDWARE) or !DeleteHardwareBreakPoint(TITANGETDRX(bp->titantype))) { dprintf("Delete hardware breakpoint failed: "fhex"\n", bp->addr); return STATUS_ERROR; @@ -1366,8 +1367,8 @@ DWORD WINAPI threadAttachLoop(void* lpParameter) RemoveAllBreakPoints(UE_OPTION_REMOVEALL); //remove all breakpoints //cleanup dbclose(); - ModClear(); - ThreadClear(); + modclear(); + threadclear(); GuiSetDebugState(stopped); dputs("debugging stopped!"); varset("$hp", (uint)0, true); @@ -1742,7 +1743,7 @@ static bool getcommandlineaddr(uint* addr, cmdline_error_t* cmd_line_error) //cast-trick to calculate the address of the remote peb field ProcessParameters cmd_line_error->addr = (uint) & (((PPEB) cmd_line_error->addr)->ProcessParameters); - if(!MemRead((void*)cmd_line_error->addr, &pprocess_parameters, sizeof(pprocess_parameters), &size)) + if(!memread(fdProcessInfo->hProcess, (const void*)cmd_line_error->addr, &pprocess_parameters, sizeof(pprocess_parameters), &size)) { cmd_line_error->type = CMDL_ERR_READ_PEBBASE; return false; @@ -1761,7 +1762,7 @@ static bool patchcmdline(uint getcommandline, uint new_command_line, cmdline_err unsigned char data[100]; cmd_line_error->addr = getcommandline; - if(!MemRead((void*) cmd_line_error->addr, & data, sizeof(data), & size)) + if(!memread(fdProcessInfo->hProcess, (const void*) cmd_line_error->addr, & data, sizeof(data), & size)) { cmd_line_error->type = CMDL_ERR_READ_GETCOMMANDLINEBASE; return false; @@ -1795,7 +1796,7 @@ static bool patchcmdline(uint getcommandline, uint new_command_line, cmdline_err #endif //update the pointer in the debuggee - if(!MemWrite((void*)command_line_stored, &new_command_line, sizeof(new_command_line), &size)) + if(!memwrite(fdProcessInfo->hProcess, (void*)command_line_stored, &new_command_line, sizeof(new_command_line), &size)) { cmd_line_error->addr = command_line_stored; cmd_line_error->type = CMDL_ERR_WRITE_GETCOMMANDLINESTORED; @@ -1864,21 +1865,21 @@ bool dbgsetcmdline(const char* cmd_line, cmdline_error_t* cmd_line_error) new_command_line.Buffer = command_linewstr; - uint mem = (uint)MemAllocRemote(0, new_command_line.Length * 2, PAGE_READWRITE); + uint mem = (uint)memalloc(fdProcessInfo->hProcess, 0, new_command_line.Length * 2, PAGE_READWRITE); if(!mem) { cmd_line_error->type = CMDL_ERR_ALLOC_UNICODEANSI_COMMANDLINE; return false; } - if(!MemWrite((void*)mem, new_command_line.Buffer, new_command_line.Length, &size)) + if(!memwrite(fdProcessInfo->hProcess, (void*)mem, new_command_line.Buffer, new_command_line.Length, &size)) { cmd_line_error->addr = mem; cmd_line_error->type = CMDL_ERR_WRITE_UNICODE_COMMANDLINE; return false; } - if(!MemWrite((void*)(mem + new_command_line.Length), (void*)cmd_line, strlen(cmd_line) + 1, &size)) + if(!memwrite(fdProcessInfo->hProcess, (void*)(mem + new_command_line.Length), cmd_line, strlen(cmd_line) + 1, &size)) { cmd_line_error->addr = mem + new_command_line.Length; cmd_line_error->type = CMDL_ERR_WRITE_ANSI_COMMANDLINE; @@ -1889,7 +1890,7 @@ bool dbgsetcmdline(const char* cmd_line, cmdline_error_t* cmd_line_error) return false; new_command_line.Buffer = (PWSTR) mem; - if(!MemWrite((void*)command_line_addr, &new_command_line, sizeof(new_command_line), &size)) + if(!memwrite(fdProcessInfo->hProcess, (void*)command_line_addr, &new_command_line, sizeof(new_command_line), &size)) { cmd_line_error->addr = command_line_addr; cmd_line_error->type = CMDL_ERR_WRITE_PEBUNICODE_COMMANDLINE; @@ -1911,7 +1912,7 @@ bool dbggetcmdline(char** cmd_line, cmdline_error_t* cmd_line_error) if(!getcommandlineaddr(&cmd_line_error->addr, cmd_line_error)) return false; - if(!MemRead((void*)cmd_line_error->addr, &CommandLine, sizeof(CommandLine), &size)) + if(!memread(fdProcessInfo->hProcess, (const void*)cmd_line_error->addr, &CommandLine, sizeof(CommandLine), &size)) { cmd_line_error->type = CMDL_ERR_READ_PROCPARM_PTR; return false; @@ -1920,7 +1921,7 @@ bool dbggetcmdline(char** cmd_line, cmdline_error_t* cmd_line_error) Memory wstr_cmd(CommandLine.Length + sizeof(wchar_t)); cmd_line_error->addr = (uint) CommandLine.Buffer; - if(!MemRead((void*)cmd_line_error->addr, wstr_cmd, CommandLine.Length, &size)) + if(!memread(fdProcessInfo->hProcess, (const void*)cmd_line_error->addr, wstr_cmd, CommandLine.Length, &size)) { cmd_line_error->type = CMDL_ERR_READ_PROCPARM_CMDLINE; return false; diff --git a/x64_dbg_dbg/debugger_commands.cpp b/x64_dbg_dbg/debugger_commands.cpp index 128e24c2..6da4a30a 100644 --- a/x64_dbg_dbg/debugger_commands.cpp +++ b/x64_dbg_dbg/debugger_commands.cpp @@ -209,7 +209,7 @@ CMDRESULT cbDebugSetBPX(int argc, char* argv[]) //bp addr [,name [,type]] const char* bpname = 0; if(*argname) bpname = argname; - if(BpGet(addr, BPNORMAL, bpname, 0)) + if(bpget(addr, BPNORMAL, bpname, 0)) { dputs("Breakpoint already set!"); return STATUS_CONTINUE; @@ -219,12 +219,12 @@ CMDRESULT cbDebugSetBPX(int argc, char* argv[]) //bp addr [,name [,type]] dprintf("Error setting breakpoint at "fhex"! (IsBPXEnabled)\n", addr); return STATUS_ERROR; } - else if(!MemRead((void*)addr, &oldbytes, sizeof(short), 0)) + else if(!memread(fdProcessInfo->hProcess, (void*)addr, &oldbytes, sizeof(short), 0)) { dprintf("Error setting breakpoint at "fhex"! (memread)\n", addr); return STATUS_ERROR; } - else if(!BpNew(addr, true, singleshoot, oldbytes, BPNORMAL, type, bpname)) + else if(!bpnew(addr, true, singleshoot, oldbytes, BPNORMAL, type, bpname)) { dprintf("Error setting breakpoint at "fhex"! (bpnew)\n", addr); return STATUS_ERROR; @@ -244,21 +244,21 @@ CMDRESULT cbDebugDeleteBPX(int argc, char* argv[]) char arg1[deflen] = ""; if(!argget(*argv, arg1, 0, true)) //delete all breakpoints { - if(!BpGetCount(BPNORMAL)) + if(!bpgetcount(BPNORMAL)) { dputs("No breakpoints to delete!"); return STATUS_CONTINUE; } - if(!BpEnumAll(cbDeleteAllBreakpoints)) //at least one deletion failed + if(!bpenumall(cbDeleteAllBreakpoints)) //at least one deletion failed return STATUS_ERROR; dputs("All breakpoints deleted!"); GuiUpdateAllViews(); return STATUS_CONTINUE; } BREAKPOINT found; - if(BpGet(0, BPNORMAL, arg1, &found)) //found a breakpoint with name + if(bpget(0, BPNORMAL, arg1, &found)) //found a breakpoint with name { - if(!BpDelete(found.addr, BPNORMAL)) + if(!bpdel(found.addr, BPNORMAL)) { dprintf("Delete breakpoint failed (bpdel): "fhex"\n", found.addr); return STATUS_ERROR; @@ -272,12 +272,12 @@ CMDRESULT cbDebugDeleteBPX(int argc, char* argv[]) return STATUS_CONTINUE; } uint addr = 0; - if(!valfromstring(arg1, &addr) or !BpGet(addr, BPNORMAL, 0, &found)) //invalid breakpoint + if(!valfromstring(arg1, &addr) or !bpget(addr, BPNORMAL, 0, &found)) //invalid breakpoint { dprintf("No such breakpoint \"%s\"\n", arg1); return STATUS_ERROR; } - if(!BpDelete(found.addr, BPNORMAL)) + if(!bpdel(found.addr, BPNORMAL)) { dprintf("Delete breakpoint failed (bpdel): "fhex"\n", found.addr); return STATUS_ERROR; @@ -298,21 +298,21 @@ CMDRESULT cbDebugEnableBPX(int argc, char* argv[]) char arg1[deflen] = ""; if(!argget(*argv, arg1, 0, true)) //enable all breakpoints { - if(!BpGetCount(BPNORMAL)) + if(!bpgetcount(BPNORMAL)) { dputs("No breakpoints to enable!"); return STATUS_CONTINUE; } - if(!BpEnumAll(cbEnableAllBreakpoints)) //at least one enable failed + if(!bpenumall(cbEnableAllBreakpoints)) //at least one enable failed return STATUS_ERROR; dputs("All breakpoints enabled!"); GuiUpdateAllViews(); return STATUS_CONTINUE; } BREAKPOINT found; - if(BpGet(0, BPNORMAL, arg1, &found)) //found a breakpoint with name + if(bpget(0, BPNORMAL, arg1, &found)) //found a breakpoint with name { - if(!BpEnable(found.addr, BPNORMAL, true) or !SetBPX(found.addr, found.titantype, (void*)cbUserBreakpoint)) + if(!bpenable(found.addr, BPNORMAL, true) or !SetBPX(found.addr, found.titantype, (void*)cbUserBreakpoint)) { dprintf("Could not enable breakpoint "fhex"\n", found.addr); return STATUS_ERROR; @@ -321,7 +321,7 @@ CMDRESULT cbDebugEnableBPX(int argc, char* argv[]) return STATUS_CONTINUE; } uint addr = 0; - if(!valfromstring(arg1, &addr) or !BpGet(addr, BPNORMAL, 0, &found)) //invalid breakpoint + if(!valfromstring(arg1, &addr) or !bpget(addr, BPNORMAL, 0, &found)) //invalid breakpoint { dprintf("No such breakpoint \"%s\"\n", arg1); return STATUS_ERROR; @@ -332,7 +332,7 @@ CMDRESULT cbDebugEnableBPX(int argc, char* argv[]) GuiUpdateAllViews(); return STATUS_CONTINUE; } - if(!BpEnable(found.addr, BPNORMAL, true) or !SetBPX(found.addr, found.titantype, (void*)cbUserBreakpoint)) + if(!bpenable(found.addr, BPNORMAL, true) or !SetBPX(found.addr, found.titantype, (void*)cbUserBreakpoint)) { dprintf("Could not enable breakpoint "fhex"\n", found.addr); return STATUS_ERROR; @@ -347,21 +347,21 @@ CMDRESULT cbDebugDisableBPX(int argc, char* argv[]) char arg1[deflen] = ""; if(!argget(*argv, arg1, 0, true)) //delete all breakpoints { - if(!BpGetCount(BPNORMAL)) + if(!bpgetcount(BPNORMAL)) { dputs("No breakpoints to disable!"); return STATUS_CONTINUE; } - if(!BpEnumAll(cbDisableAllBreakpoints)) //at least one deletion failed + if(!bpenumall(cbDisableAllBreakpoints)) //at least one deletion failed return STATUS_ERROR; dputs("All breakpoints disabled!"); GuiUpdateAllViews(); return STATUS_CONTINUE; } BREAKPOINT found; - if(BpGet(0, BPNORMAL, arg1, &found)) //found a breakpoint with name + if(bpget(0, BPNORMAL, arg1, &found)) //found a breakpoint with name { - if(!BpEnable(found.addr, BPNORMAL, false) or !DeleteBPX(found.addr)) + if(!bpenable(found.addr, BPNORMAL, false) or !DeleteBPX(found.addr)) { dprintf("Could not disable breakpoint "fhex"\n", found.addr); return STATUS_ERROR; @@ -370,7 +370,7 @@ CMDRESULT cbDebugDisableBPX(int argc, char* argv[]) return STATUS_CONTINUE; } uint addr = 0; - if(!valfromstring(arg1, &addr) or !BpGet(addr, BPNORMAL, 0, &found)) //invalid breakpoint + if(!valfromstring(arg1, &addr) or !bpget(addr, BPNORMAL, 0, &found)) //invalid breakpoint { dprintf("No such breakpoint \"%s\"\n", arg1); return STATUS_ERROR; @@ -380,7 +380,7 @@ CMDRESULT cbDebugDisableBPX(int argc, char* argv[]) dputs("Breakpoint already disabled!"); return STATUS_CONTINUE; } - if(!BpEnable(found.addr, BPNORMAL, false) or !DeleteBPX(found.addr)) + if(!bpenable(found.addr, BPNORMAL, false) or !DeleteBPX(found.addr)) { dprintf("Could not disable breakpoint "fhex"\n", found.addr); return STATUS_ERROR; @@ -392,7 +392,7 @@ CMDRESULT cbDebugDisableBPX(int argc, char* argv[]) CMDRESULT cbDebugBplist(int argc, char* argv[]) { - BpEnumAll(cbBreakpointList); + bpenumall(cbBreakpointList); return STATUS_CONTINUE; } @@ -458,7 +458,7 @@ CMDRESULT cbDebugDisasm(int argc, char* argv[]) if(argget(*argv, arg1, 0, true)) if(!valfromstring(arg1, &addr)) addr = GetContextDataEx(hActiveThread, UE_CIP); - if(!MemIsValidReadPtr(addr)) + if(!memisvalidreadptr(fdProcessInfo->hProcess, addr)) return STATUS_CONTINUE; DebugUpdateGui(addr, false); return STATUS_CONTINUE; @@ -505,16 +505,16 @@ CMDRESULT cbDebugSetMemoryBpx(int argc, char* argv[]) } } uint size = 0; - uint base = MemFindBaseAddr(addr, &size, true); + uint base = memfindbaseaddr(addr, &size, true); bool singleshoot = false; if(!restore) singleshoot = true; - if(BpGet(base, BPMEMORY, 0, 0)) + if(bpget(base, BPMEMORY, 0, 0)) { dputs("Hardware breakpoint already set!"); return STATUS_CONTINUE; } - if(!BpNew(base, true, singleshoot, 0, BPMEMORY, type, 0) or !SetMemoryBPXEx(base, size, type, restore, (void*)cbMemoryBreakpoint)) + if(!bpnew(base, true, singleshoot, 0, BPMEMORY, type, 0) or !SetMemoryBPXEx(base, size, type, restore, (void*)cbMemoryBreakpoint)) { dputs("Error setting memory breakpoint!"); return STATUS_ERROR; @@ -529,23 +529,23 @@ CMDRESULT cbDebugDeleteMemoryBreakpoint(int argc, char* argv[]) char arg1[deflen] = ""; if(!argget(*argv, arg1, 0, true)) //delete all breakpoints { - if(!BpGetCount(BPMEMORY)) + if(!bpgetcount(BPMEMORY)) { dputs("no memory breakpoints to delete!"); return STATUS_CONTINUE; } - if(!BpEnumAll(cbDeleteAllMemoryBreakpoints)) //at least one deletion failed + if(!bpenumall(cbDeleteAllMemoryBreakpoints)) //at least one deletion failed return STATUS_ERROR; dputs("All memory breakpoints deleted!"); GuiUpdateAllViews(); return STATUS_CONTINUE; } BREAKPOINT found; - if(BpGet(0, BPMEMORY, arg1, &found)) //found a breakpoint with name + if(bpget(0, BPMEMORY, arg1, &found)) //found a breakpoint with name { uint size; - MemFindBaseAddr(found.addr, &size); - if(!BpDelete(found.addr, BPMEMORY) or !RemoveMemoryBPX(found.addr, size)) + memfindbaseaddr(found.addr, &size); + if(!bpdel(found.addr, BPMEMORY) or !RemoveMemoryBPX(found.addr, size)) { dprintf("Delete memory breakpoint failed: "fhex"\n", found.addr); return STATUS_ERROR; @@ -553,14 +553,14 @@ CMDRESULT cbDebugDeleteMemoryBreakpoint(int argc, char* argv[]) return STATUS_CONTINUE; } uint addr = 0; - if(!valfromstring(arg1, &addr) or !BpGet(addr, BPMEMORY, 0, &found)) //invalid breakpoint + if(!valfromstring(arg1, &addr) or !bpget(addr, BPMEMORY, 0, &found)) //invalid breakpoint { dprintf("No such memory breakpoint \"%s\"\n", arg1); return STATUS_ERROR; } uint size; - MemFindBaseAddr(found.addr, &size); - if(!BpDelete(found.addr, BPMEMORY) or !RemoveMemoryBPX(found.addr, size)) + memfindbaseaddr(found.addr, &size); + if(!bpdel(found.addr, BPMEMORY) or !RemoveMemoryBPX(found.addr, size)) { dprintf("Delete memory breakpoint failed: "fhex"\n", found.addr); return STATUS_ERROR; @@ -655,12 +655,12 @@ CMDRESULT cbDebugSetHardwareBreakpoint(int argc, char* argv[]) TITANSETTYPE(titantype, type); TITANSETSIZE(titantype, titsize); //TODO: hwbp in multiple threads TEST - if(BpGet(addr, BPHARDWARE, 0, 0)) + if(bpget(addr, BPHARDWARE, 0, 0)) { dputs("Hardware breakpoint already set!"); return STATUS_CONTINUE; } - if(!BpNew(addr, true, false, 0, BPHARDWARE, titantype, 0)) + if(!bpnew(addr, true, false, 0, BPHARDWARE, titantype, 0)) { dputs("error setting hardware breakpoint (bpnew)!"); return STATUS_ERROR; @@ -680,21 +680,21 @@ CMDRESULT cbDebugDeleteHardwareBreakpoint(int argc, char* argv[]) char arg1[deflen] = ""; if(!argget(*argv, arg1, 0, true)) //delete all breakpoints { - if(!BpGetCount(BPHARDWARE)) + if(!bpgetcount(BPHARDWARE)) { dputs("No hardware breakpoints to delete!"); return STATUS_CONTINUE; } - if(!BpEnumAll(cbDeleteAllHardwareBreakpoints)) //at least one deletion failed + if(!bpenumall(cbDeleteAllHardwareBreakpoints)) //at least one deletion failed return STATUS_ERROR; dputs("All hardware breakpoints deleted!"); GuiUpdateAllViews(); return STATUS_CONTINUE; } BREAKPOINT found; - if(BpGet(0, BPHARDWARE, arg1, &found)) //found a breakpoint with name + if(bpget(0, BPHARDWARE, arg1, &found)) //found a breakpoint with name { - if(!BpDelete(found.addr, BPHARDWARE) or !DeleteHardwareBreakPoint(TITANGETDRX(found.titantype))) + if(!bpdel(found.addr, BPHARDWARE) or !DeleteHardwareBreakPoint(TITANGETDRX(found.titantype))) { dprintf("Delete hardware breakpoint failed: "fhex"\n", found.addr); return STATUS_ERROR; @@ -702,12 +702,12 @@ CMDRESULT cbDebugDeleteHardwareBreakpoint(int argc, char* argv[]) return STATUS_CONTINUE; } uint addr = 0; - if(!valfromstring(arg1, &addr) or !BpGet(addr, BPHARDWARE, 0, &found)) //invalid breakpoint + if(!valfromstring(arg1, &addr) or !bpget(addr, BPHARDWARE, 0, &found)) //invalid breakpoint { dprintf("No such hardware breakpoint \"%s\"\n", arg1); return STATUS_ERROR; } - if(!BpDelete(found.addr, BPHARDWARE) or !DeleteHardwareBreakPoint(TITANGETDRX(found.titantype))) + if(!bpdel(found.addr, BPHARDWARE) or !DeleteHardwareBreakPoint(TITANGETDRX(found.titantype))) { dprintf("Delete hardware breakpoint failed: "fhex"\n", found.addr); return STATUS_ERROR; @@ -724,7 +724,7 @@ CMDRESULT cbDebugAlloc(int argc, char* argv[]) if(argget(*argv, arg1, 0, true)) if(!valfromstring(arg1, &size, false)) return STATUS_ERROR; - uint mem = (uint)MemAllocRemote(0, size, PAGE_EXECUTE_READWRITE); + uint mem = (uint)memalloc(fdProcessInfo->hProcess, 0, size, PAGE_EXECUTE_READWRITE); if(!mem) dputs("VirtualAllocEx failed"); else @@ -732,7 +732,7 @@ CMDRESULT cbDebugAlloc(int argc, char* argv[]) if(mem) varset("$lastalloc", mem, true); dbggetprivateusage(fdProcessInfo->hProcess, true); - MemUpdateMap(fdProcessInfo->hProcess); + memupdatemap(fdProcessInfo->hProcess); GuiUpdateMemoryView(); varset("$res", mem, false); return STATUS_CONTINUE; @@ -760,7 +760,7 @@ CMDRESULT cbDebugFree(int argc, char* argv[]) if(!ok) dputs("VirtualFreeEx failed"); dbggetprivateusage(fdProcessInfo->hProcess, true); - MemUpdateMap(fdProcessInfo->hProcess); + memupdatemap(fdProcessInfo->hProcess); GuiUpdateMemoryView(); varset("$res", ok, false); return STATUS_CONTINUE; @@ -786,7 +786,7 @@ CMDRESULT cbDebugMemset(int argc, char* argv[]) } else { - uint base = MemFindBaseAddr(addr, &size, true); + uint base = memfindbaseaddr(addr, &size, true); if(!base) { dputs("invalid address specified"); @@ -806,15 +806,15 @@ CMDRESULT cbDebugMemset(int argc, char* argv[]) CMDRESULT cbDebugBenchmark(int argc, char* argv[]) { - uint addr = MemFindBaseAddr(GetContextDataEx(hActiveThread, UE_CIP), 0); + uint addr = memfindbaseaddr(GetContextDataEx(hActiveThread, UE_CIP), 0); DWORD ticks = GetTickCount(); char comment[MAX_COMMENT_SIZE] = ""; for(uint i = addr; i < addr + 100000; i++) { - CommentSet(i, "test", false); + commentset(i, "test", false); labelset(i, "test", false); - BookmarkSet(i, false); - FunctionAdd(i, i, false); + bookmarkset(i, false); + functionadd(i, i, false); } dprintf("%ums\n", GetTickCount() - ticks); return STATUS_CONTINUE; @@ -962,7 +962,7 @@ CMDRESULT cbDebugStackDump(int argc, char* argv[]) } duint csp = GetContextDataEx(hActiveThread, UE_CSP); duint size = 0; - duint base = MemFindBaseAddr(csp, &size); + duint base = memfindbaseaddr(csp, &size); if(base && addr >= base && addr < (base + size)) GuiStackDumpAt(addr, csp); else @@ -1035,13 +1035,13 @@ CMDRESULT cbDebugSwitchthread(int argc, char* argv[]) if(argc > 1) if(!valfromstring(argv[1], &threadid, false)) return STATUS_ERROR; - if(!ThreadIsValid((DWORD)threadid)) //check if the thread is valid + if(!threadisvalid((DWORD)threadid)) //check if the thread is valid { dprintf("Invalid thread %X\n", threadid); return STATUS_ERROR; } //switch thread - hActiveThread = ThreadGetHandle((DWORD)threadid); + hActiveThread = threadgethandle((DWORD)threadid); DebugUpdateGui(GetContextDataEx(hActiveThread, UE_CIP), true); dputs("Thread switched!"); return STATUS_CONTINUE; @@ -1053,13 +1053,13 @@ CMDRESULT cbDebugSuspendthread(int argc, char* argv[]) if(argc > 1) if(!valfromstring(argv[1], &threadid, false)) return STATUS_ERROR; - if(!ThreadIsValid((DWORD)threadid)) //check if the thread is valid + if(!threadisvalid((DWORD)threadid)) //check if the thread is valid { dprintf("Invalid thread %X\n", threadid); return STATUS_ERROR; } //suspend thread - if(SuspendThread(ThreadGetHandle((DWORD)threadid)) == -1) + if(SuspendThread(threadgethandle((DWORD)threadid)) == -1) { dputs("Error suspending thread"); return STATUS_ERROR; @@ -1075,13 +1075,13 @@ CMDRESULT cbDebugResumethread(int argc, char* argv[]) if(argc > 1) if(!valfromstring(argv[1], &threadid, false)) return STATUS_ERROR; - if(!ThreadIsValid((DWORD)threadid)) //check if the thread is valid + if(!threadisvalid((DWORD)threadid)) //check if the thread is valid { dprintf("Invalid thread %X\n", threadid); return STATUS_ERROR; } //resume thread - if(ResumeThread(ThreadGetHandle((DWORD)threadid)) == -1) + if(ResumeThread(threadgethandle((DWORD)threadid)) == -1) { dputs("Error resuming thread"); return STATUS_ERROR; @@ -1101,13 +1101,13 @@ CMDRESULT cbDebugKillthread(int argc, char* argv[]) if(argc > 2) if(!valfromstring(argv[2], &exitcode, false)) return STATUS_ERROR; - if(!ThreadIsValid((DWORD)threadid)) //check if the thread is valid + if(!threadisvalid((DWORD)threadid)) //check if the thread is valid { dprintf("Invalid thread %X\n", threadid); return STATUS_ERROR; } //terminate thread - if(TerminateThread(ThreadGetHandle((DWORD)threadid), (DWORD)exitcode) != 0) + if(TerminateThread(threadgethandle((DWORD)threadid), (DWORD)exitcode) != 0) { GuiUpdateAllViews(); dputs("Thread terminated"); @@ -1119,16 +1119,18 @@ CMDRESULT cbDebugKillthread(int argc, char* argv[]) CMDRESULT cbDebugSuspendAllThreads(int argc, char* argv[]) { - dprintf("%d/%d thread(s) suspended\n", ThreadSuspendAll(), ThreadGetCount()); - + int threadCount = threadgetcount(); + int suspendedCount = threadsuspendall(); + dprintf("%d/%d thread(s) suspended\n", suspendedCount, threadCount); GuiUpdateAllViews(); return STATUS_CONTINUE; } CMDRESULT cbDebugResumeAllThreads(int argc, char* argv[]) { - dprintf("%d/%d thread(s) resumed\n", ThreadResumeAll(), ThreadGetCount()); - + int threadCount = threadgetcount(); + int resumeCount = threadresumeall(); + dprintf("%d/%d thread(s) resumed\n", resumeCount, threadCount); GuiUpdateAllViews(); return STATUS_CONTINUE; } @@ -1183,13 +1185,13 @@ CMDRESULT cbDebugSetPriority(int argc, char* argv[]) return STATUS_ERROR; } } - if(!ThreadIsValid((DWORD)threadid)) //check if the thread is valid + if(!threadisvalid((DWORD)threadid)) //check if the thread is valid { dprintf("Invalid thread %X\n", threadid); return STATUS_ERROR; } //set thread priority - if(SetThreadPriority(ThreadGetHandle((DWORD)threadid), (int)priority) == 0) + if(SetThreadPriority(threadgethandle((DWORD)threadid), (int)priority) == 0) { dputs("Error setting thread priority"); return STATUS_ERROR; @@ -1210,12 +1212,12 @@ CMDRESULT cbDebugEnableHardwareBreakpoint(int argc, char* argv[]) } if(!argget(*argv, arg1, 0, true)) //enable all hardware breakpoints { - if(!BpGetCount(BPHARDWARE)) + if(!bpgetcount(BPHARDWARE)) { dputs("No hardware breakpoints to enable!"); return STATUS_CONTINUE; } - if(!BpEnumAll(cbEnableAllHardwareBreakpoints)) //at least one enable failed + if(!bpenumall(cbEnableAllHardwareBreakpoints)) //at least one enable failed return STATUS_ERROR; dputs("All hardware breakpoints enabled!"); GuiUpdateAllViews(); @@ -1223,7 +1225,7 @@ CMDRESULT cbDebugEnableHardwareBreakpoint(int argc, char* argv[]) } BREAKPOINT found; uint addr = 0; - if(!valfromstring(arg1, &addr) or !BpGet(addr, BPHARDWARE, 0, &found)) //invalid hardware breakpoint + if(!valfromstring(arg1, &addr) or !bpget(addr, BPHARDWARE, 0, &found)) //invalid hardware breakpoint { dprintf("No such hardware breakpoint \"%s\"\n", arg1); return STATUS_ERROR; @@ -1235,8 +1237,8 @@ CMDRESULT cbDebugEnableHardwareBreakpoint(int argc, char* argv[]) return STATUS_CONTINUE; } TITANSETDRX(found.titantype, drx); - BpSetTitanType(found.addr, BPHARDWARE, found.titantype); - if(!BpEnable(found.addr, BPHARDWARE, true) or !SetHardwareBreakPoint(found.addr, drx, TITANGETTYPE(found.titantype), TITANGETSIZE(found.titantype), (void*)cbHardwareBreakpoint)) + bpsettitantype(found.addr, BPHARDWARE, found.titantype); + if(!bpenable(found.addr, BPHARDWARE, true) or !SetHardwareBreakPoint(found.addr, drx, TITANGETTYPE(found.titantype), TITANGETSIZE(found.titantype), (void*)cbHardwareBreakpoint)) { dprintf("Could not enable hardware breakpoint "fhex"\n", found.addr); return STATUS_ERROR; @@ -1251,12 +1253,12 @@ CMDRESULT cbDebugDisableHardwareBreakpoint(int argc, char* argv[]) char arg1[deflen] = ""; if(!argget(*argv, arg1, 0, true)) //delete all hardware breakpoints { - if(!BpGetCount(BPHARDWARE)) + if(!bpgetcount(BPHARDWARE)) { dputs("No hardware breakpoints to disable!"); return STATUS_CONTINUE; } - if(!BpEnumAll(cbDisableAllHardwareBreakpoints)) //at least one deletion failed + if(!bpenumall(cbDisableAllHardwareBreakpoints)) //at least one deletion failed return STATUS_ERROR; dputs("All hardware breakpoints disabled!"); GuiUpdateAllViews(); @@ -1264,7 +1266,7 @@ CMDRESULT cbDebugDisableHardwareBreakpoint(int argc, char* argv[]) } BREAKPOINT found; uint addr = 0; - if(!valfromstring(arg1, &addr) or !BpGet(addr, BPHARDWARE, 0, &found)) //invalid hardware breakpoint + if(!valfromstring(arg1, &addr) or !bpget(addr, BPHARDWARE, 0, &found)) //invalid hardware breakpoint { dprintf("No such hardware breakpoint \"%s\"\n", arg1); return STATUS_ERROR; @@ -1274,7 +1276,7 @@ CMDRESULT cbDebugDisableHardwareBreakpoint(int argc, char* argv[]) dputs("Hardware breakpoint already disabled!"); return STATUS_CONTINUE; } - if(!BpEnable(found.addr, BPHARDWARE, false) or !DeleteHardwareBreakPoint(TITANGETDRX(found.titantype))) + if(!bpenable(found.addr, BPHARDWARE, false) or !DeleteHardwareBreakPoint(TITANGETDRX(found.titantype))) { dprintf("Could not disable hardware breakpoint "fhex"\n", found.addr); return STATUS_ERROR; @@ -1295,12 +1297,12 @@ CMDRESULT cbDebugEnableMemoryBreakpoint(int argc, char* argv[]) } if(!argget(*argv, arg1, 0, true)) //enable all memory breakpoints { - if(!BpGetCount(BPMEMORY)) + if(!bpgetcount(BPMEMORY)) { dputs("No hardware breakpoints to enable!"); return STATUS_CONTINUE; } - if(!BpEnumAll(cbEnableAllHardwareBreakpoints)) //at least one enable failed + if(!bpenumall(cbEnableAllHardwareBreakpoints)) //at least one enable failed return STATUS_ERROR; dputs("All memory breakpoints enabled!"); GuiUpdateAllViews(); @@ -1308,7 +1310,7 @@ CMDRESULT cbDebugEnableMemoryBreakpoint(int argc, char* argv[]) } BREAKPOINT found; uint addr = 0; - if(!valfromstring(arg1, &addr) or !BpGet(addr, BPMEMORY, 0, &found)) //invalid memory breakpoint + if(!valfromstring(arg1, &addr) or !bpget(addr, BPMEMORY, 0, &found)) //invalid memory breakpoint { dprintf("No such memory breakpoint \"%s\"\n", arg1); return STATUS_ERROR; @@ -1320,8 +1322,8 @@ CMDRESULT cbDebugEnableMemoryBreakpoint(int argc, char* argv[]) return STATUS_CONTINUE; } uint size = 0; - MemFindBaseAddr(found.addr, &size); - if(!BpEnable(found.addr, BPMEMORY, true) or !SetMemoryBPXEx(found.addr, size, found.titantype, !found.singleshoot, (void*)cbMemoryBreakpoint)) + memfindbaseaddr(found.addr, &size); + if(!bpenable(found.addr, BPMEMORY, true) or !SetMemoryBPXEx(found.addr, size, found.titantype, !found.singleshoot, (void*)cbMemoryBreakpoint)) { dprintf("Could not enable memory breakpoint "fhex"\n", found.addr); return STATUS_ERROR; @@ -1336,12 +1338,12 @@ CMDRESULT cbDebugDisableMemoryBreakpoint(int argc, char* argv[]) char arg1[deflen] = ""; if(!argget(*argv, arg1, 0, true)) //delete all memory breakpoints { - if(!BpGetCount(BPMEMORY)) + if(!bpgetcount(BPMEMORY)) { dputs("No memory breakpoints to disable!"); return STATUS_CONTINUE; } - if(!BpEnumAll(cbDisableAllMemoryBreakpoints)) //at least one deletion failed + if(!bpenumall(cbDisableAllMemoryBreakpoints)) //at least one deletion failed return STATUS_ERROR; dputs("All memory breakpoints disabled!"); GuiUpdateAllViews(); @@ -1349,7 +1351,7 @@ CMDRESULT cbDebugDisableMemoryBreakpoint(int argc, char* argv[]) } BREAKPOINT found; uint addr = 0; - if(!valfromstring(arg1, &addr) or !BpGet(addr, BPMEMORY, 0, &found)) //invalid memory breakpoint + if(!valfromstring(arg1, &addr) or !bpget(addr, BPMEMORY, 0, &found)) //invalid memory breakpoint { dprintf("No such memory breakpoint \"%s\"\n", arg1); return STATUS_ERROR; @@ -1360,8 +1362,8 @@ CMDRESULT cbDebugDisableMemoryBreakpoint(int argc, char* argv[]) return STATUS_CONTINUE; } uint size = 0; - MemFindBaseAddr(found.addr, &size); - if(!BpEnable(found.addr, BPMEMORY, false) or !RemoveMemoryBPX(found.addr, size)) + memfindbaseaddr(found.addr, &size); + if(!bpenable(found.addr, BPMEMORY, false) or !RemoveMemoryBPX(found.addr, size)) { dprintf("Could not disable memory breakpoint "fhex"\n", found.addr); return STATUS_ERROR; @@ -1382,13 +1384,13 @@ CMDRESULT cbDebugDownloadSymbol(int argc, char* argv[]) } if(argc < 2) //no arguments { - SymDownloadAllSymbols(szSymbolStore); //download symbols for all modules + symdownloadallsymbols(szSymbolStore); //download symbols for all modules GuiSymbolRefreshCurrent(); dputs("Done! See symbol log for more information"); return STATUS_CONTINUE; } //get some module information - uint modbase = ModBaseFromName(argv[1]); + uint modbase = modbasefromname(argv[1]); if(!modbase) { dprintf("Invalid module \"%s\"!\n", argv[1]); @@ -1798,7 +1800,7 @@ CMDRESULT cbDebugSetPageRights(int argc, char* argv[]) //update the memory map dbggetprivateusage(fdProcessInfo->hProcess, true); - MemUpdateMap(fdProcessInfo->hProcess); + memupdatemap(fdProcessInfo->hProcess); GuiUpdateMemoryView(); dprintf("New rights of "fhex": %s\n", addr, rights); @@ -1815,7 +1817,7 @@ CMDRESULT cbDebugLoadLib(int argc, char* argv[]) } LoadLibThreadID = fdProcessInfo->dwThreadId; - HANDLE LoadLibThread = ThreadGetHandle((DWORD)LoadLibThreadID); + HANDLE LoadLibThread = threadgethandle((DWORD)LoadLibThreadID); DLLNameMem = VirtualAllocEx(fdProcessInfo->hProcess, NULL, strlen(argv[1]) + 1, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); ASMAddr = VirtualAllocEx(fdProcessInfo->hProcess, NULL, 0x1000, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); @@ -1826,7 +1828,7 @@ CMDRESULT cbDebugLoadLib(int argc, char* argv[]) return STATUS_ERROR; } - if(!MemWrite(DLLNameMem, argv[1], strlen(argv[1]), NULL)) + if(!memwrite(fdProcessInfo->hProcess, DLLNameMem, argv[1], strlen(argv[1]), NULL)) { dprintf("Error: couldn't write process memory"); return STATUS_ERROR; @@ -1867,7 +1869,7 @@ CMDRESULT cbDebugLoadLib(int argc, char* argv[]) SetContextDataEx(LoadLibThread, UE_CIP, (uint)ASMAddr); SetBPX((uint)ASMAddr + counter, UE_SINGLESHOOT | UE_BREAKPOINT_TYPE_INT3, (void*)cbLoadLibBPX); - ThreadSuspendAll(); + threadsuspendall(); ResumeThread(LoadLibThread); unlock(WAITID_RUN); @@ -1878,7 +1880,7 @@ CMDRESULT cbDebugLoadLib(int argc, char* argv[]) void cbLoadLibBPX() { uint LibAddr = 0; - HANDLE LoadLibThread = ThreadGetHandle((DWORD)LoadLibThreadID); + HANDLE LoadLibThread = threadgethandle((DWORD)LoadLibThreadID); #ifdef _WIN64 LibAddr = GetContextDataEx(LoadLibThread, UE_RAX); #else @@ -1889,7 +1891,7 @@ void cbLoadLibBPX() SetFullContextDataEx(LoadLibThread, &backupctx); VirtualFreeEx(fdProcessInfo->hProcess, DLLNameMem, 0, MEM_RELEASE); VirtualFreeEx(fdProcessInfo->hProcess, ASMAddr, 0, MEM_RELEASE); - ThreadResumeAll(); + threadresumeall(); //update GUI GuiSetDebugState(paused); DebugUpdateGui(GetContextDataEx(hActiveThread, UE_CIP), true); @@ -2000,7 +2002,7 @@ CMDRESULT cbDebugSetCmdline(int argc, char* argv[]) //update the memory map dbggetprivateusage(fdProcessInfo->hProcess, true); - MemUpdateMap(fdProcessInfo->hProcess); + memupdatemap(fdProcessInfo->hProcess); GuiUpdateMemoryView(); dprintf("New command line: %s\n", argv[1]); diff --git a/x64_dbg_dbg/disasm_fast.cpp b/x64_dbg_dbg/disasm_fast.cpp index 137f30fa..c68e5052 100644 --- a/x64_dbg_dbg/disasm_fast.cpp +++ b/x64_dbg_dbg/disasm_fast.cpp @@ -117,7 +117,7 @@ bool disasmfast(unsigned char* data, uint addr, BASIC_INSTRUCTION_INFO* basicinf bool disasmfast(uint addr, BASIC_INSTRUCTION_INFO* basicinfo) { unsigned int data[16]; - if(!MemRead((void*)addr, data, sizeof(data), 0)) + if(!memread(fdProcessInfo->hProcess, (const void*)addr, data, sizeof(data), 0)) return false; return disasmfast((unsigned char*)data, addr, basicinfo); } \ No newline at end of file diff --git a/x64_dbg_dbg/disasm_helper.cpp b/x64_dbg_dbg/disasm_helper.cpp index ca179165..cdee9c63 100644 --- a/x64_dbg_dbg/disasm_helper.cpp +++ b/x64_dbg_dbg/disasm_helper.cpp @@ -321,11 +321,11 @@ bool disasmispossiblestring(uint addr) { unsigned char data[11]; memset(data, 0, sizeof(data)); - if(!MemRead((void*)addr, data, sizeof(data) - 3, 0)) + if(!memread(fdProcessInfo->hProcess, (const void*)addr, data, sizeof(data) - 3, 0)) return false; uint test = 0; memcpy(&test, data, sizeof(uint)); - if(MemIsValidReadPtr(test)) //imports/pointers + if(memisvalidreadptr(fdProcessInfo->hProcess, test)) //imports/pointers return false; if(isasciistring(data, sizeof(data)) or isunicodestring(data, _countof(data))) return true; @@ -340,11 +340,11 @@ bool disasmgetstringat(uint addr, STRING_TYPE* type, char* ascii, char* unicode, return false; Memory data((maxlen + 1) * 2, "disasmgetstringat:data"); memset(data, 0, (maxlen + 1) * 2); - if(!MemRead((void*)addr, data, (maxlen + 1) * 2, 0)) + if(!memread(fdProcessInfo->hProcess, (const void*)addr, data, (maxlen + 1) * 2, 0)) return false; uint test = 0; memcpy(&test, data, sizeof(uint)); - if(MemIsValidReadPtr(test)) + if(memisvalidreadptr(fdProcessInfo->hProcess, test)) return false; if(isasciistring(data, maxlen)) { @@ -442,7 +442,7 @@ int disasmgetsize(uint addr, unsigned char* data) int disasmgetsize(uint addr) { char data[16]; - if(!MemRead((void*)addr, data, sizeof(data), 0)) + if(!memread(fdProcessInfo->hProcess, (const void*)addr, data, sizeof(data), 0)) return 1; return disasmgetsize(addr, (unsigned char*)data); } \ No newline at end of file diff --git a/x64_dbg_dbg/dynamicmem.h b/x64_dbg_dbg/dynamicmem.h index 69bbb89e..1e251e44 100644 --- a/x64_dbg_dbg/dynamicmem.h +++ b/x64_dbg_dbg/dynamicmem.h @@ -1,73 +1,64 @@ -#pragma once +#ifndef _DYNAMICMEM_H +#define _DYNAMICMEM_H template class Memory { public: - // - // This class guarantees that the returned allocated memory - // will always be zeroed - // - Memory(const char* Reason = "Memory:???") + Memory(const char* reason = "Memory:???") { - m_Ptr = nullptr; - m_Size = 0; - m_Reason = Reason; + mPtr = 0; + mSize = 0; + mReason = reason; } - Memory(size_t Size, const char* Reason = "Memory:???") + Memory(size_t size, const char* reason = "Memory:???") { - m_Ptr = reinterpret_cast(emalloc(Size)); - m_Size = Size; - m_Reason = Reason; - - memset(m_Ptr, 0, Size); + mPtr = reinterpret_cast(emalloc(size)); + mSize = size; + mReason = reason; + memset(mPtr, 0, size); } ~Memory() { - if (m_Ptr) - efree(m_Ptr); + efree(mPtr); } - T realloc(size_t Size, const char* Reason = "Memory:???") + T realloc(size_t size, const char* reason = "Memory:???") { - m_Ptr = reinterpret_cast(erealloc(m_Ptr, Size)); - m_Size = Size; - m_Reason = Reason; - - return (T)memset(m_Ptr, 0, m_Size); + mPtr = reinterpret_cast(erealloc(mPtr, size)); + mSize = size; + mReason = reason; + memset(mPtr, 0, size); + return mPtr; } - size_t size() - { - return m_Size; - } - template operator U() { - return (U)m_Ptr; + return (U)mPtr; } operator T() { - return m_Ptr; + return mPtr; } T operator()() { - return m_Ptr; + return mPtr; } - template - T operator+(const U& Other) - { - return m_Ptr + Other; - } + size_t size() + { + return mSize; + } private: - T m_Ptr; - size_t m_Size; - const char* m_Reason; -}; \ No newline at end of file + T mPtr; + size_t mSize; + const char* mReason; +}; + +#endif //_DYNAMICMEM_H \ No newline at end of file diff --git a/x64_dbg_dbg/error.cpp b/x64_dbg_dbg/error.cpp index 80d0da73..c950011d 100644 --- a/x64_dbg_dbg/error.cpp +++ b/x64_dbg_dbg/error.cpp @@ -1,2204 +1,2202 @@ #include "error.h" -#include +#include -std::unordered_map ErrorNames; +static std::map errorNames; -void ErrorCodeInit() +void errorinit() { - ErrorNames.clear(); - ErrorNames.insert(std::make_pair(0, "ERROR_SUCCESS")); - ErrorNames.insert(std::make_pair(1, "ERROR_INVALID_FUNCTION")); - ErrorNames.insert(std::make_pair(2, "ERROR_FILE_NOT_FOUND")); - ErrorNames.insert(std::make_pair(3, "ERROR_PATH_NOT_FOUND")); - ErrorNames.insert(std::make_pair(4, "ERROR_TOO_MANY_OPEN_FILES")); - ErrorNames.insert(std::make_pair(5, "ERROR_ACCESS_DENIED")); - ErrorNames.insert(std::make_pair(6, "ERROR_INVALID_HANDLE")); - ErrorNames.insert(std::make_pair(7, "ERROR_ARENA_TRASHED")); - ErrorNames.insert(std::make_pair(8, "ERROR_NOT_ENOUGH_MEMORY")); - ErrorNames.insert(std::make_pair(9, "ERROR_INVALID_BLOCK")); - ErrorNames.insert(std::make_pair(10, "ERROR_BAD_ENVIRONMENT")); - ErrorNames.insert(std::make_pair(11, "ERROR_BAD_FORMAT")); - ErrorNames.insert(std::make_pair(12, "ERROR_INVALID_ACCESS")); - ErrorNames.insert(std::make_pair(13, "ERROR_INVALID_DATA")); - ErrorNames.insert(std::make_pair(14, "ERROR_OUTOFMEMORY")); - ErrorNames.insert(std::make_pair(15, "ERROR_INVALID_DRIVE")); - ErrorNames.insert(std::make_pair(16, "ERROR_CURRENT_DIRECTORY")); - ErrorNames.insert(std::make_pair(17, "ERROR_NOT_SAME_DEVICE")); - ErrorNames.insert(std::make_pair(18, "ERROR_NO_MORE_FILES")); - ErrorNames.insert(std::make_pair(19, "ERROR_WRITE_PROTECT")); - ErrorNames.insert(std::make_pair(20, "ERROR_BAD_UNIT")); - ErrorNames.insert(std::make_pair(21, "ERROR_NOT_READY")); - ErrorNames.insert(std::make_pair(22, "ERROR_BAD_COMMAND")); - ErrorNames.insert(std::make_pair(23, "ERROR_CRC")); - ErrorNames.insert(std::make_pair(24, "ERROR_BAD_LENGTH")); - ErrorNames.insert(std::make_pair(25, "ERROR_SEEK")); - ErrorNames.insert(std::make_pair(26, "ERROR_NOT_DOS_DISK")); - ErrorNames.insert(std::make_pair(27, "ERROR_SECTOR_NOT_FOUND")); - ErrorNames.insert(std::make_pair(28, "ERROR_OUT_OF_PAPER")); - ErrorNames.insert(std::make_pair(29, "ERROR_WRITE_FAULT")); - ErrorNames.insert(std::make_pair(30, "ERROR_READ_FAULT")); - ErrorNames.insert(std::make_pair(31, "ERROR_GEN_FAILURE")); - ErrorNames.insert(std::make_pair(32, "ERROR_SHARING_VIOLATION")); - ErrorNames.insert(std::make_pair(33, "ERROR_LOCK_VIOLATION")); - ErrorNames.insert(std::make_pair(34, "ERROR_WRONG_DISK")); - ErrorNames.insert(std::make_pair(36, "ERROR_SHARING_BUFFER_EXCEEDED")); - ErrorNames.insert(std::make_pair(38, "ERROR_HANDLE_EOF")); - ErrorNames.insert(std::make_pair(39, "ERROR_HANDLE_DISK_FULL")); - ErrorNames.insert(std::make_pair(50, "ERROR_NOT_SUPPORTED")); - ErrorNames.insert(std::make_pair(51, "ERROR_REM_NOT_LIST")); - ErrorNames.insert(std::make_pair(52, "ERROR_DUP_NAME")); - ErrorNames.insert(std::make_pair(53, "ERROR_BAD_NETPATH")); - ErrorNames.insert(std::make_pair(54, "ERROR_NETWORK_BUSY")); - ErrorNames.insert(std::make_pair(55, "ERROR_DEV_NOT_EXIST")); - ErrorNames.insert(std::make_pair(56, "ERROR_TOO_MANY_CMDS")); - ErrorNames.insert(std::make_pair(57, "ERROR_ADAP_HDW_ERR")); - ErrorNames.insert(std::make_pair(58, "ERROR_BAD_NET_RESP")); - ErrorNames.insert(std::make_pair(59, "ERROR_UNEXP_NET_ERR")); - ErrorNames.insert(std::make_pair(60, "ERROR_BAD_REM_ADAP")); - ErrorNames.insert(std::make_pair(61, "ERROR_PRINTQ_FULL")); - ErrorNames.insert(std::make_pair(62, "ERROR_NO_SPOOL_SPACE")); - ErrorNames.insert(std::make_pair(63, "ERROR_PRINT_CANCELLED")); - ErrorNames.insert(std::make_pair(64, "ERROR_NETNAME_DELETED")); - ErrorNames.insert(std::make_pair(65, "ERROR_NETWORK_ACCESS_DENIED")); - ErrorNames.insert(std::make_pair(66, "ERROR_BAD_DEV_TYPE")); - ErrorNames.insert(std::make_pair(67, "ERROR_BAD_NET_NAME")); - ErrorNames.insert(std::make_pair(68, "ERROR_TOO_MANY_NAMES")); - ErrorNames.insert(std::make_pair(69, "ERROR_TOO_MANY_SESS")); - ErrorNames.insert(std::make_pair(70, "ERROR_SHARING_PAUSED")); - ErrorNames.insert(std::make_pair(71, "ERROR_REQ_NOT_ACCEP")); - ErrorNames.insert(std::make_pair(72, "ERROR_REDIR_PAUSED")); - ErrorNames.insert(std::make_pair(80, "ERROR_FILE_EXISTS")); - ErrorNames.insert(std::make_pair(82, "ERROR_CANNOT_MAKE")); - ErrorNames.insert(std::make_pair(83, "ERROR_FAIL_I24")); - ErrorNames.insert(std::make_pair(84, "ERROR_OUT_OF_STRUCTURES")); - ErrorNames.insert(std::make_pair(85, "ERROR_ALREADY_ASSIGNED")); - ErrorNames.insert(std::make_pair(86, "ERROR_INVALID_PASSWORD")); - ErrorNames.insert(std::make_pair(87, "ERROR_INVALID_PARAMETER")); - ErrorNames.insert(std::make_pair(88, "ERROR_NET_WRITE_FAULT")); - ErrorNames.insert(std::make_pair(89, "ERROR_NO_PROC_SLOTS")); - ErrorNames.insert(std::make_pair(100, "ERROR_TOO_MANY_SEMAPHORES")); - ErrorNames.insert(std::make_pair(101, "ERROR_EXCL_SEM_ALREADY_OWNED")); - ErrorNames.insert(std::make_pair(102, "ERROR_SEM_IS_SET")); - ErrorNames.insert(std::make_pair(103, "ERROR_TOO_MANY_SEM_REQUESTS")); - ErrorNames.insert(std::make_pair(104, "ERROR_INVALID_AT_INTERRUPT_TIME")); - ErrorNames.insert(std::make_pair(105, "ERROR_SEM_OWNER_DIED")); - ErrorNames.insert(std::make_pair(106, "ERROR_SEM_USER_LIMIT")); - ErrorNames.insert(std::make_pair(107, "ERROR_DISK_CHANGE")); - ErrorNames.insert(std::make_pair(108, "ERROR_DRIVE_LOCKED")); - ErrorNames.insert(std::make_pair(109, "ERROR_BROKEN_PIPE")); - ErrorNames.insert(std::make_pair(110, "ERROR_OPEN_FAILED")); - ErrorNames.insert(std::make_pair(111, "ERROR_BUFFER_OVERFLOW")); - ErrorNames.insert(std::make_pair(112, "ERROR_DISK_FULL")); - ErrorNames.insert(std::make_pair(113, "ERROR_NO_MORE_SEARCH_HANDLES")); - ErrorNames.insert(std::make_pair(114, "ERROR_INVALID_TARGET_HANDLE")); - ErrorNames.insert(std::make_pair(117, "ERROR_INVALID_CATEGORY")); - ErrorNames.insert(std::make_pair(118, "ERROR_INVALID_VERIFY_SWITCH")); - ErrorNames.insert(std::make_pair(119, "ERROR_BAD_DRIVER_LEVEL")); - ErrorNames.insert(std::make_pair(120, "ERROR_CALL_NOT_IMPLEMENTED")); - ErrorNames.insert(std::make_pair(121, "ERROR_SEM_TIMEOUT")); - ErrorNames.insert(std::make_pair(122, "ERROR_INSUFFICIENT_BUFFER")); - ErrorNames.insert(std::make_pair(123, "ERROR_INVALID_NAME")); - ErrorNames.insert(std::make_pair(124, "ERROR_INVALID_LEVEL")); - ErrorNames.insert(std::make_pair(125, "ERROR_NO_VOLUME_LABEL")); - ErrorNames.insert(std::make_pair(126, "ERROR_MOD_NOT_FOUND")); - ErrorNames.insert(std::make_pair(127, "ERROR_PROC_NOT_FOUND")); - ErrorNames.insert(std::make_pair(128, "ERROR_WAIT_NO_CHILDREN")); - ErrorNames.insert(std::make_pair(129, "ERROR_CHILD_NOT_COMPLETE")); - ErrorNames.insert(std::make_pair(130, "ERROR_DIRECT_ACCESS_HANDLE")); - ErrorNames.insert(std::make_pair(131, "ERROR_NEGATIVE_SEEK")); - ErrorNames.insert(std::make_pair(132, "ERROR_SEEK_ON_DEVICE")); - ErrorNames.insert(std::make_pair(133, "ERROR_IS_JOIN_TARGET")); - ErrorNames.insert(std::make_pair(134, "ERROR_IS_JOINED")); - ErrorNames.insert(std::make_pair(135, "ERROR_IS_SUBSTED")); - ErrorNames.insert(std::make_pair(136, "ERROR_NOT_JOINED")); - ErrorNames.insert(std::make_pair(137, "ERROR_NOT_SUBSTED")); - ErrorNames.insert(std::make_pair(138, "ERROR_JOIN_TO_JOIN")); - ErrorNames.insert(std::make_pair(139, "ERROR_SUBST_TO_SUBST")); - ErrorNames.insert(std::make_pair(140, "ERROR_JOIN_TO_SUBST")); - ErrorNames.insert(std::make_pair(141, "ERROR_SUBST_TO_JOIN")); - ErrorNames.insert(std::make_pair(142, "ERROR_BUSY_DRIVE")); - ErrorNames.insert(std::make_pair(143, "ERROR_SAME_DRIVE")); - ErrorNames.insert(std::make_pair(144, "ERROR_DIR_NOT_ROOT")); - ErrorNames.insert(std::make_pair(145, "ERROR_DIR_NOT_EMPTY")); - ErrorNames.insert(std::make_pair(146, "ERROR_IS_SUBST_PATH")); - ErrorNames.insert(std::make_pair(147, "ERROR_IS_JOIN_PATH")); - ErrorNames.insert(std::make_pair(148, "ERROR_PATH_BUSY")); - ErrorNames.insert(std::make_pair(149, "ERROR_IS_SUBST_TARGET")); - ErrorNames.insert(std::make_pair(150, "ERROR_SYSTEM_TRACE")); - ErrorNames.insert(std::make_pair(151, "ERROR_INVALID_EVENT_COUNT")); - ErrorNames.insert(std::make_pair(152, "ERROR_TOO_MANY_MUXWAITERS")); - ErrorNames.insert(std::make_pair(153, "ERROR_INVALID_LIST_FORMAT")); - ErrorNames.insert(std::make_pair(154, "ERROR_LABEL_TOO_LONG")); - ErrorNames.insert(std::make_pair(155, "ERROR_TOO_MANY_TCBS")); - ErrorNames.insert(std::make_pair(156, "ERROR_SIGNAL_REFUSED")); - ErrorNames.insert(std::make_pair(157, "ERROR_DISCARDED")); - ErrorNames.insert(std::make_pair(158, "ERROR_NOT_LOCKED")); - ErrorNames.insert(std::make_pair(159, "ERROR_BAD_THREADID_ADDR")); - ErrorNames.insert(std::make_pair(160, "ERROR_BAD_ARGUMENTS")); - ErrorNames.insert(std::make_pair(161, "ERROR_BAD_PATHNAME")); - ErrorNames.insert(std::make_pair(162, "ERROR_SIGNAL_PENDING")); - ErrorNames.insert(std::make_pair(164, "ERROR_MAX_THRDS_REACHED")); - ErrorNames.insert(std::make_pair(167, "ERROR_LOCK_FAILED")); - ErrorNames.insert(std::make_pair(170, "ERROR_BUSY")); - ErrorNames.insert(std::make_pair(173, "ERROR_CANCEL_VIOLATION")); - ErrorNames.insert(std::make_pair(174, "ERROR_ATOMIC_LOCKS_NOT_SUPPORTED")); - ErrorNames.insert(std::make_pair(180, "ERROR_INVALID_SEGMENT_NUMBER")); - ErrorNames.insert(std::make_pair(182, "ERROR_INVALID_ORDINAL")); - ErrorNames.insert(std::make_pair(183, "ERROR_ALREADY_EXISTS")); - ErrorNames.insert(std::make_pair(186, "ERROR_INVALID_FLAG_NUMBER")); - ErrorNames.insert(std::make_pair(187, "ERROR_SEM_NOT_FOUND")); - ErrorNames.insert(std::make_pair(188, "ERROR_INVALID_STARTING_CODESEG")); - ErrorNames.insert(std::make_pair(189, "ERROR_INVALID_STACKSEG")); - ErrorNames.insert(std::make_pair(190, "ERROR_INVALID_MODULETYPE")); - ErrorNames.insert(std::make_pair(191, "ERROR_INVALID_EXE_SIGNATURE")); - ErrorNames.insert(std::make_pair(192, "ERROR_EXE_MARKED_INVALID")); - ErrorNames.insert(std::make_pair(193, "ERROR_BAD_EXE_FORMAT")); - ErrorNames.insert(std::make_pair(194, "ERROR_ITERATED_DATA_EXCEEDS_64k")); - ErrorNames.insert(std::make_pair(195, "ERROR_INVALID_MINALLOCSIZE")); - ErrorNames.insert(std::make_pair(196, "ERROR_DYNLINK_FROM_INVALID_RING")); - ErrorNames.insert(std::make_pair(197, "ERROR_IOPL_NOT_ENABLED")); - ErrorNames.insert(std::make_pair(198, "ERROR_INVALID_SEGDPL")); - ErrorNames.insert(std::make_pair(199, "ERROR_AUTODATASEG_EXCEEDS_64k")); - ErrorNames.insert(std::make_pair(200, "ERROR_RING2SEG_MUST_BE_MOVABLE")); - ErrorNames.insert(std::make_pair(201, "ERROR_RELOC_CHAIN_XEEDS_SEGLIM")); - ErrorNames.insert(std::make_pair(202, "ERROR_INFLOOP_IN_RELOC_CHAIN")); - ErrorNames.insert(std::make_pair(203, "ERROR_ENVVAR_NOT_FOUND")); - ErrorNames.insert(std::make_pair(205, "ERROR_NO_SIGNAL_SENT")); - ErrorNames.insert(std::make_pair(206, "ERROR_FILENAME_EXCED_RANGE")); - ErrorNames.insert(std::make_pair(207, "ERROR_RING2_STACK_IN_USE")); - ErrorNames.insert(std::make_pair(208, "ERROR_META_EXPANSION_TOO_LONG")); - ErrorNames.insert(std::make_pair(209, "ERROR_INVALID_SIGNAL_NUMBER")); - ErrorNames.insert(std::make_pair(210, "ERROR_THREAD_1_INACTIVE")); - ErrorNames.insert(std::make_pair(212, "ERROR_LOCKED")); - ErrorNames.insert(std::make_pair(214, "ERROR_TOO_MANY_MODULES")); - ErrorNames.insert(std::make_pair(215, "ERROR_NESTING_NOT_ALLOWED")); - ErrorNames.insert(std::make_pair(216, "ERROR_EXE_MACHINE_TYPE_MISMATCH")); - ErrorNames.insert(std::make_pair(217, "ERROR_EXE_CANNOT_MODIFY_SIGNED_BINARY")); - ErrorNames.insert(std::make_pair(218, "ERROR_EXE_CANNOT_MODIFY_STRONG_SIGNED_BINARY")); - ErrorNames.insert(std::make_pair(220, "ERROR_FILE_CHECKED_OUT")); - ErrorNames.insert(std::make_pair(221, "ERROR_CHECKOUT_REQUIRED")); - ErrorNames.insert(std::make_pair(222, "ERROR_BAD_FILE_TYPE")); - ErrorNames.insert(std::make_pair(223, "ERROR_FILE_TOO_LARGE")); - ErrorNames.insert(std::make_pair(224, "ERROR_FORMS_AUTH_REQUIRED")); - ErrorNames.insert(std::make_pair(225, "ERROR_VIRUS_INFECTED")); - ErrorNames.insert(std::make_pair(226, "ERROR_VIRUS_DELETED")); - ErrorNames.insert(std::make_pair(229, "ERROR_PIPE_LOCAL")); - ErrorNames.insert(std::make_pair(230, "ERROR_BAD_PIPE")); - ErrorNames.insert(std::make_pair(231, "ERROR_PIPE_BUSY")); - ErrorNames.insert(std::make_pair(232, "ERROR_NO_DATA")); - ErrorNames.insert(std::make_pair(233, "ERROR_PIPE_NOT_CONNECTED")); - ErrorNames.insert(std::make_pair(234, "ERROR_MORE_DATA")); - ErrorNames.insert(std::make_pair(240, "ERROR_VC_DISCONNECTED")); - ErrorNames.insert(std::make_pair(254, "ERROR_INVALID_EA_NAME")); - ErrorNames.insert(std::make_pair(255, "ERROR_EA_LIST_INCONSISTENT")); - ErrorNames.insert(std::make_pair(259, "ERROR_NO_MORE_ITEMS")); - ErrorNames.insert(std::make_pair(266, "ERROR_CANNOT_COPY")); - ErrorNames.insert(std::make_pair(267, "ERROR_DIRECTORY")); - ErrorNames.insert(std::make_pair(275, "ERROR_EAS_DIDNT_FIT")); - ErrorNames.insert(std::make_pair(276, "ERROR_EA_FILE_CORRUPT")); - ErrorNames.insert(std::make_pair(277, "ERROR_EA_TABLE_FULL")); - ErrorNames.insert(std::make_pair(278, "ERROR_INVALID_EA_HANDLE")); - ErrorNames.insert(std::make_pair(282, "ERROR_EAS_NOT_SUPPORTED")); - ErrorNames.insert(std::make_pair(288, "ERROR_NOT_OWNER")); - ErrorNames.insert(std::make_pair(298, "ERROR_TOO_MANY_POSTS")); - ErrorNames.insert(std::make_pair(299, "ERROR_PARTIAL_COPY")); - ErrorNames.insert(std::make_pair(300, "ERROR_OPLOCK_NOT_GRANTED")); - ErrorNames.insert(std::make_pair(301, "ERROR_INVALID_OPLOCK_PROTOCOL")); - ErrorNames.insert(std::make_pair(302, "ERROR_DISK_TOO_FRAGMENTED")); - ErrorNames.insert(std::make_pair(303, "ERROR_DELETE_PENDING")); - ErrorNames.insert(std::make_pair(304, "ERROR_INCOMPATIBLE_WITH_GLOBAL_SHORT_NAME_REGISTRY_SETTING")); - ErrorNames.insert(std::make_pair(305, "ERROR_SHORT_NAMES_NOT_ENABLED_ON_VOLUME")); - ErrorNames.insert(std::make_pair(306, "ERROR_SECURITY_STREAM_IS_INCONSISTENT")); - ErrorNames.insert(std::make_pair(307, "ERROR_INVALID_LOCK_RANGE")); - ErrorNames.insert(std::make_pair(308, "ERROR_IMAGE_SUBSYSTEM_NOT_PRESENT")); - ErrorNames.insert(std::make_pair(309, "ERROR_NOTIFICATION_GUID_ALREADY_DEFINED")); - ErrorNames.insert(std::make_pair(317, "ERROR_MR_MID_NOT_FOUND")); - ErrorNames.insert(std::make_pair(318, "ERROR_SCOPE_NOT_FOUND")); - ErrorNames.insert(std::make_pair(350, "ERROR_FAIL_NOACTION_REBOOT")); - ErrorNames.insert(std::make_pair(351, "ERROR_FAIL_SHUTDOWN")); - ErrorNames.insert(std::make_pair(352, "ERROR_FAIL_RESTART")); - ErrorNames.insert(std::make_pair(353, "ERROR_MAX_SESSIONS_REACHED")); - ErrorNames.insert(std::make_pair(400, "ERROR_THREAD_MODE_ALREADY_BACKGROUND")); - ErrorNames.insert(std::make_pair(401, "ERROR_THREAD_MODE_NOT_BACKGROUND")); - ErrorNames.insert(std::make_pair(402, "ERROR_PROCESS_MODE_ALREADY_BACKGROUND")); - ErrorNames.insert(std::make_pair(403, "ERROR_PROCESS_MODE_NOT_BACKGROUND")); - ErrorNames.insert(std::make_pair(487, "ERROR_INVALID_ADDRESS")); - ErrorNames.insert(std::make_pair(500, "ERROR_USER_PROFILE_LOAD")); - ErrorNames.insert(std::make_pair(534, "ERROR_ARITHMETIC_OVERFLOW")); - ErrorNames.insert(std::make_pair(535, "ERROR_PIPE_CONNECTED")); - ErrorNames.insert(std::make_pair(536, "ERROR_PIPE_LISTENING")); - ErrorNames.insert(std::make_pair(537, "ERROR_VERIFIER_STOP")); - ErrorNames.insert(std::make_pair(538, "ERROR_ABIOS_ERROR")); - ErrorNames.insert(std::make_pair(539, "ERROR_WX86_WARNING")); - ErrorNames.insert(std::make_pair(540, "ERROR_WX86_ERROR")); - ErrorNames.insert(std::make_pair(541, "ERROR_TIMER_NOT_CANCELED")); - ErrorNames.insert(std::make_pair(542, "ERROR_UNWIND")); - ErrorNames.insert(std::make_pair(543, "ERROR_BAD_STACK")); - ErrorNames.insert(std::make_pair(544, "ERROR_INVALID_UNWIND_TARGET")); - ErrorNames.insert(std::make_pair(545, "ERROR_INVALID_PORT_ATTRIBUTES")); - ErrorNames.insert(std::make_pair(546, "ERROR_PORT_MESSAGE_TOO_LONG")); - ErrorNames.insert(std::make_pair(547, "ERROR_INVALID_QUOTA_LOWER")); - ErrorNames.insert(std::make_pair(548, "ERROR_DEVICE_ALREADY_ATTACHED")); - ErrorNames.insert(std::make_pair(549, "ERROR_INSTRUCTION_MISALIGNMENT")); - ErrorNames.insert(std::make_pair(550, "ERROR_PROFILING_NOT_STARTED")); - ErrorNames.insert(std::make_pair(551, "ERROR_PROFILING_NOT_STOPPED")); - ErrorNames.insert(std::make_pair(552, "ERROR_COULD_NOT_INTERPRET")); - ErrorNames.insert(std::make_pair(553, "ERROR_PROFILING_AT_LIMIT")); - ErrorNames.insert(std::make_pair(554, "ERROR_CANT_WAIT")); - ErrorNames.insert(std::make_pair(555, "ERROR_CANT_TERMINATE_SELF")); - ErrorNames.insert(std::make_pair(556, "ERROR_UNEXPECTED_MM_CREATE_ERR")); - ErrorNames.insert(std::make_pair(557, "ERROR_UNEXPECTED_MM_MAP_ERROR")); - ErrorNames.insert(std::make_pair(558, "ERROR_UNEXPECTED_MM_EXTEND_ERR")); - ErrorNames.insert(std::make_pair(559, "ERROR_BAD_FUNCTION_TABLE")); - ErrorNames.insert(std::make_pair(560, "ERROR_NO_GUID_TRANSLATION")); - ErrorNames.insert(std::make_pair(561, "ERROR_INVALID_LDT_SIZE")); - ErrorNames.insert(std::make_pair(563, "ERROR_INVALID_LDT_OFFSET")); - ErrorNames.insert(std::make_pair(564, "ERROR_INVALID_LDT_DESCRIPTOR")); - ErrorNames.insert(std::make_pair(565, "ERROR_TOO_MANY_THREADS")); - ErrorNames.insert(std::make_pair(566, "ERROR_THREAD_NOT_IN_PROCESS")); - ErrorNames.insert(std::make_pair(567, "ERROR_PAGEFILE_QUOTA_EXCEEDED")); - ErrorNames.insert(std::make_pair(568, "ERROR_LOGON_SERVER_CONFLICT")); - ErrorNames.insert(std::make_pair(569, "ERROR_SYNCHRONIZATION_REQUIRED")); - ErrorNames.insert(std::make_pair(570, "ERROR_NET_OPEN_FAILED")); - ErrorNames.insert(std::make_pair(571, "ERROR_IO_PRIVILEGE_FAILED")); - ErrorNames.insert(std::make_pair(572, "ERROR_CONTROL_C_EXIT")); - ErrorNames.insert(std::make_pair(573, "ERROR_MISSING_SYSTEMFILE")); - ErrorNames.insert(std::make_pair(574, "ERROR_UNHANDLED_EXCEPTION")); - ErrorNames.insert(std::make_pair(575, "ERROR_APP_INIT_FAILURE")); - ErrorNames.insert(std::make_pair(576, "ERROR_PAGEFILE_CREATE_FAILED")); - ErrorNames.insert(std::make_pair(577, "ERROR_INVALID_IMAGE_HASH")); - ErrorNames.insert(std::make_pair(578, "ERROR_NO_PAGEFILE")); - ErrorNames.insert(std::make_pair(579, "ERROR_ILLEGAL_FLOAT_CONTEXT")); - ErrorNames.insert(std::make_pair(580, "ERROR_NO_EVENT_PAIR")); - ErrorNames.insert(std::make_pair(581, "ERROR_DOMAIN_CTRLR_CONFIG_ERROR")); - ErrorNames.insert(std::make_pair(582, "ERROR_ILLEGAL_CHARACTER")); - ErrorNames.insert(std::make_pair(583, "ERROR_UNDEFINED_CHARACTER")); - ErrorNames.insert(std::make_pair(584, "ERROR_FLOPPY_VOLUME")); - ErrorNames.insert(std::make_pair(585, "ERROR_BIOS_FAILED_TO_CONNECT_INTERRUPT")); - ErrorNames.insert(std::make_pair(586, "ERROR_BACKUP_CONTROLLER")); - ErrorNames.insert(std::make_pair(587, "ERROR_MUTANT_LIMIT_EXCEEDED")); - ErrorNames.insert(std::make_pair(588, "ERROR_FS_DRIVER_REQUIRED")); - ErrorNames.insert(std::make_pair(589, "ERROR_CANNOT_LOAD_REGISTRY_FILE")); - ErrorNames.insert(std::make_pair(590, "ERROR_DEBUG_ATTACH_FAILED")); - ErrorNames.insert(std::make_pair(591, "ERROR_SYSTEM_PROCESS_TERMINATED")); - ErrorNames.insert(std::make_pair(592, "ERROR_DATA_NOT_ACCEPTED")); - ErrorNames.insert(std::make_pair(593, "ERROR_VDM_HARD_ERROR")); - ErrorNames.insert(std::make_pair(594, "ERROR_DRIVER_CANCEL_TIMEOUT")); - ErrorNames.insert(std::make_pair(595, "ERROR_REPLY_MESSAGE_MISMATCH")); - ErrorNames.insert(std::make_pair(596, "ERROR_LOST_WRITEBEHIND_DATA")); - ErrorNames.insert(std::make_pair(597, "ERROR_CLIENT_SERVER_PARAMETERS_INVALID")); - ErrorNames.insert(std::make_pair(598, "ERROR_NOT_TINY_STREAM")); - ErrorNames.insert(std::make_pair(599, "ERROR_STACK_OVERFLOW_READ")); - ErrorNames.insert(std::make_pair(600, "ERROR_CONVERT_TO_LARGE")); - ErrorNames.insert(std::make_pair(601, "ERROR_FOUND_OUT_OF_SCOPE")); - ErrorNames.insert(std::make_pair(602, "ERROR_ALLOCATE_BUCKET")); - ErrorNames.insert(std::make_pair(603, "ERROR_MARSHALL_OVERFLOW")); - ErrorNames.insert(std::make_pair(604, "ERROR_INVALID_VARIANT")); - ErrorNames.insert(std::make_pair(605, "ERROR_BAD_COMPRESSION_BUFFER")); - ErrorNames.insert(std::make_pair(606, "ERROR_AUDIT_FAILED")); - ErrorNames.insert(std::make_pair(607, "ERROR_TIMER_RESOLUTION_NOT_SET")); - ErrorNames.insert(std::make_pair(608, "ERROR_INSUFFICIENT_LOGON_INFO")); - ErrorNames.insert(std::make_pair(609, "ERROR_BAD_DLL_ENTRYPOINT")); - ErrorNames.insert(std::make_pair(610, "ERROR_BAD_SERVICE_ENTRYPOINT")); - ErrorNames.insert(std::make_pair(611, "ERROR_IP_ADDRESS_CONFLICT1")); - ErrorNames.insert(std::make_pair(612, "ERROR_IP_ADDRESS_CONFLICT2")); - ErrorNames.insert(std::make_pair(613, "ERROR_REGISTRY_QUOTA_LIMIT")); - ErrorNames.insert(std::make_pair(614, "ERROR_NO_CALLBACK_ACTIVE")); - ErrorNames.insert(std::make_pair(615, "ERROR_PWD_TOO_SHORT")); - ErrorNames.insert(std::make_pair(616, "ERROR_PWD_TOO_RECENT")); - ErrorNames.insert(std::make_pair(617, "ERROR_PWD_HISTORY_CONFLICT")); - ErrorNames.insert(std::make_pair(618, "ERROR_UNSUPPORTED_COMPRESSION")); - ErrorNames.insert(std::make_pair(619, "ERROR_INVALID_HW_PROFILE")); - ErrorNames.insert(std::make_pair(620, "ERROR_INVALID_PLUGPLAY_DEVICE_PATH")); - ErrorNames.insert(std::make_pair(621, "ERROR_QUOTA_LIST_INCONSISTENT")); - ErrorNames.insert(std::make_pair(622, "ERROR_EVALUATION_EXPIRATION")); - ErrorNames.insert(std::make_pair(623, "ERROR_ILLEGAL_DLL_RELOCATION")); - ErrorNames.insert(std::make_pair(624, "ERROR_DLL_INIT_FAILED_LOGOFF")); - ErrorNames.insert(std::make_pair(625, "ERROR_VALIDATE_CONTINUE")); - ErrorNames.insert(std::make_pair(626, "ERROR_NO_MORE_MATCHES")); - ErrorNames.insert(std::make_pair(627, "ERROR_RANGE_LIST_CONFLICT")); - ErrorNames.insert(std::make_pair(628, "ERROR_SERVER_SID_MISMATCH")); - ErrorNames.insert(std::make_pair(629, "ERROR_CANT_ENABLE_DENY_ONLY")); - ErrorNames.insert(std::make_pair(630, "ERROR_FLOAT_MULTIPLE_FAULTS")); - ErrorNames.insert(std::make_pair(631, "ERROR_FLOAT_MULTIPLE_TRAPS")); - ErrorNames.insert(std::make_pair(632, "ERROR_NOINTERFACE")); - ErrorNames.insert(std::make_pair(633, "ERROR_DRIVER_FAILED_SLEEP")); - ErrorNames.insert(std::make_pair(634, "ERROR_CORRUPT_SYSTEM_FILE")); - ErrorNames.insert(std::make_pair(635, "ERROR_COMMITMENT_MINIMUM")); - ErrorNames.insert(std::make_pair(636, "ERROR_PNP_RESTART_ENUMERATION")); - ErrorNames.insert(std::make_pair(637, "ERROR_SYSTEM_IMAGE_BAD_SIGNATURE")); - ErrorNames.insert(std::make_pair(638, "ERROR_PNP_REBOOT_REQUIRED")); - ErrorNames.insert(std::make_pair(639, "ERROR_INSUFFICIENT_POWER")); - ErrorNames.insert(std::make_pair(640, "ERROR_MULTIPLE_FAULT_VIOLATION")); - ErrorNames.insert(std::make_pair(641, "ERROR_SYSTEM_SHUTDOWN")); - ErrorNames.insert(std::make_pair(642, "ERROR_PORT_NOT_SET")); - ErrorNames.insert(std::make_pair(643, "ERROR_DS_VERSION_CHECK_FAILURE")); - ErrorNames.insert(std::make_pair(644, "ERROR_RANGE_NOT_FOUND")); - ErrorNames.insert(std::make_pair(646, "ERROR_NOT_SAFE_MODE_DRIVER")); - ErrorNames.insert(std::make_pair(647, "ERROR_FAILED_DRIVER_ENTRY")); - ErrorNames.insert(std::make_pair(648, "ERROR_DEVICE_ENUMERATION_ERROR")); - ErrorNames.insert(std::make_pair(649, "ERROR_MOUNT_POINT_NOT_RESOLVED")); - ErrorNames.insert(std::make_pair(650, "ERROR_INVALID_DEVICE_OBJECT_PARAMETER")); - ErrorNames.insert(std::make_pair(651, "ERROR_MCA_OCCURED")); - ErrorNames.insert(std::make_pair(652, "ERROR_DRIVER_DATABASE_ERROR")); - ErrorNames.insert(std::make_pair(653, "ERROR_SYSTEM_HIVE_TOO_LARGE")); - ErrorNames.insert(std::make_pair(654, "ERROR_DRIVER_FAILED_PRIOR_UNLOAD")); - ErrorNames.insert(std::make_pair(655, "ERROR_VOLSNAP_PREPARE_HIBERNATE")); - ErrorNames.insert(std::make_pair(656, "ERROR_HIBERNATION_FAILURE")); - ErrorNames.insert(std::make_pair(665, "ERROR_FILE_SYSTEM_LIMITATION")); - ErrorNames.insert(std::make_pair(668, "ERROR_ASSERTION_FAILURE")); - ErrorNames.insert(std::make_pair(669, "ERROR_ACPI_ERROR")); - ErrorNames.insert(std::make_pair(670, "ERROR_WOW_ASSERTION")); - ErrorNames.insert(std::make_pair(671, "ERROR_PNP_BAD_MPS_TABLE")); - ErrorNames.insert(std::make_pair(672, "ERROR_PNP_TRANSLATION_FAILED")); - ErrorNames.insert(std::make_pair(673, "ERROR_PNP_IRQ_TRANSLATION_FAILED")); - ErrorNames.insert(std::make_pair(674, "ERROR_PNP_INVALID_ID")); - ErrorNames.insert(std::make_pair(675, "ERROR_WAKE_SYSTEM_DEBUGGER")); - ErrorNames.insert(std::make_pair(676, "ERROR_HANDLES_CLOSED")); - ErrorNames.insert(std::make_pair(677, "ERROR_EXTRANEOUS_INFORMATION")); - ErrorNames.insert(std::make_pair(678, "ERROR_RXACT_COMMIT_NECESSARY")); - ErrorNames.insert(std::make_pair(679, "ERROR_MEDIA_CHECK")); - ErrorNames.insert(std::make_pair(680, "ERROR_GUID_SUBSTITUTION_MADE")); - ErrorNames.insert(std::make_pair(681, "ERROR_STOPPED_ON_SYMLINK")); - ErrorNames.insert(std::make_pair(682, "ERROR_LONGJUMP")); - ErrorNames.insert(std::make_pair(683, "ERROR_PLUGPLAY_QUERY_VETOED")); - ErrorNames.insert(std::make_pair(684, "ERROR_UNWIND_CONSOLIDATE")); - ErrorNames.insert(std::make_pair(685, "ERROR_REGISTRY_HIVE_RECOVERED")); - ErrorNames.insert(std::make_pair(686, "ERROR_DLL_MIGHT_BE_INSECURE")); - ErrorNames.insert(std::make_pair(687, "ERROR_DLL_MIGHT_BE_INCOMPATIBLE")); - ErrorNames.insert(std::make_pair(688, "ERROR_DBG_EXCEPTION_NOT_HANDLED")); - ErrorNames.insert(std::make_pair(689, "ERROR_DBG_REPLY_LATER")); - ErrorNames.insert(std::make_pair(690, "ERROR_DBG_UNABLE_TO_PROVIDE_HANDLE")); - ErrorNames.insert(std::make_pair(691, "ERROR_DBG_TERMINATE_THREAD")); - ErrorNames.insert(std::make_pair(692, "ERROR_DBG_TERMINATE_PROCESS")); - ErrorNames.insert(std::make_pair(693, "ERROR_DBG_CONTROL_C")); - ErrorNames.insert(std::make_pair(694, "ERROR_DBG_PRINTEXCEPTION_C")); - ErrorNames.insert(std::make_pair(695, "ERROR_DBG_RIPEXCEPTION")); - ErrorNames.insert(std::make_pair(696, "ERROR_DBG_CONTROL_BREAK")); - ErrorNames.insert(std::make_pair(697, "ERROR_DBG_COMMAND_EXCEPTION")); - ErrorNames.insert(std::make_pair(698, "ERROR_OBJECT_NAME_EXISTS")); - ErrorNames.insert(std::make_pair(699, "ERROR_THREAD_WAS_SUSPENDED")); - ErrorNames.insert(std::make_pair(700, "ERROR_IMAGE_NOT_AT_BASE")); - ErrorNames.insert(std::make_pair(701, "ERROR_RXACT_STATE_CREATED")); - ErrorNames.insert(std::make_pair(702, "ERROR_SEGMENT_NOTIFICATION")); - ErrorNames.insert(std::make_pair(703, "ERROR_BAD_CURRENT_DIRECTORY")); - ErrorNames.insert(std::make_pair(704, "ERROR_FT_READ_RECOVERY_FROM_BACKUP")); - ErrorNames.insert(std::make_pair(705, "ERROR_FT_WRITE_RECOVERY")); - ErrorNames.insert(std::make_pair(706, "ERROR_IMAGE_MACHINE_TYPE_MISMATCH")); - ErrorNames.insert(std::make_pair(707, "ERROR_RECEIVE_PARTIAL")); - ErrorNames.insert(std::make_pair(708, "ERROR_RECEIVE_EXPEDITED")); - ErrorNames.insert(std::make_pair(709, "ERROR_RECEIVE_PARTIAL_EXPEDITED")); - ErrorNames.insert(std::make_pair(710, "ERROR_EVENT_DONE")); - ErrorNames.insert(std::make_pair(711, "ERROR_EVENT_PENDING")); - ErrorNames.insert(std::make_pair(712, "ERROR_CHECKING_FILE_SYSTEM")); - ErrorNames.insert(std::make_pair(713, "ERROR_FATAL_APP_EXIT")); - ErrorNames.insert(std::make_pair(714, "ERROR_PREDEFINED_HANDLE")); - ErrorNames.insert(std::make_pair(715, "ERROR_WAS_UNLOCKED")); - ErrorNames.insert(std::make_pair(716, "ERROR_SERVICE_NOTIFICATION")); - ErrorNames.insert(std::make_pair(717, "ERROR_WAS_LOCKED")); - ErrorNames.insert(std::make_pair(718, "ERROR_LOG_HARD_ERROR")); - ErrorNames.insert(std::make_pair(719, "ERROR_ALREADY_WIN32")); - ErrorNames.insert(std::make_pair(720, "ERROR_IMAGE_MACHINE_TYPE_MISMATCH_EXE")); - ErrorNames.insert(std::make_pair(721, "ERROR_NO_YIELD_PERFORMED")); - ErrorNames.insert(std::make_pair(722, "ERROR_TIMER_RESUME_IGNORED")); - ErrorNames.insert(std::make_pair(723, "ERROR_ARBITRATION_UNHANDLED")); - ErrorNames.insert(std::make_pair(724, "ERROR_CARDBUS_NOT_SUPPORTED")); - ErrorNames.insert(std::make_pair(725, "ERROR_MP_PROCESSOR_MISMATCH")); - ErrorNames.insert(std::make_pair(726, "ERROR_HIBERNATED")); - ErrorNames.insert(std::make_pair(727, "ERROR_RESUME_HIBERNATION")); - ErrorNames.insert(std::make_pair(728, "ERROR_FIRMWARE_UPDATED")); - ErrorNames.insert(std::make_pair(729, "ERROR_DRIVERS_LEAKING_LOCKED_PAGES")); - ErrorNames.insert(std::make_pair(730, "ERROR_WAKE_SYSTEM")); - ErrorNames.insert(std::make_pair(731, "ERROR_WAIT_1")); - ErrorNames.insert(std::make_pair(732, "ERROR_WAIT_2")); - ErrorNames.insert(std::make_pair(733, "ERROR_WAIT_3")); - ErrorNames.insert(std::make_pair(734, "ERROR_WAIT_63")); - ErrorNames.insert(std::make_pair(735, "ERROR_ABANDONED_WAIT_0")); - ErrorNames.insert(std::make_pair(736, "ERROR_ABANDONED_WAIT_63")); - ErrorNames.insert(std::make_pair(737, "ERROR_USER_APC")); - ErrorNames.insert(std::make_pair(738, "ERROR_KERNEL_APC")); - ErrorNames.insert(std::make_pair(739, "ERROR_ALERTED")); - ErrorNames.insert(std::make_pair(740, "ERROR_ELEVATION_REQUIRED")); - ErrorNames.insert(std::make_pair(741, "ERROR_REPARSE")); - ErrorNames.insert(std::make_pair(742, "ERROR_OPLOCK_BREAK_IN_PROGRESS")); - ErrorNames.insert(std::make_pair(743, "ERROR_VOLUME_MOUNTED")); - ErrorNames.insert(std::make_pair(744, "ERROR_RXACT_COMMITTED")); - ErrorNames.insert(std::make_pair(745, "ERROR_NOTIFY_CLEANUP")); - ErrorNames.insert(std::make_pair(746, "ERROR_PRIMARY_TRANSPORT_CONNECT_FAILED")); - ErrorNames.insert(std::make_pair(747, "ERROR_PAGE_FAULT_TRANSITION")); - ErrorNames.insert(std::make_pair(748, "ERROR_PAGE_FAULT_DEMAND_ZERO")); - ErrorNames.insert(std::make_pair(749, "ERROR_PAGE_FAULT_COPY_ON_WRITE")); - ErrorNames.insert(std::make_pair(750, "ERROR_PAGE_FAULT_GUARD_PAGE")); - ErrorNames.insert(std::make_pair(751, "ERROR_PAGE_FAULT_PAGING_FILE")); - ErrorNames.insert(std::make_pair(752, "ERROR_CACHE_PAGE_LOCKED")); - ErrorNames.insert(std::make_pair(753, "ERROR_CRASH_DUMP")); - ErrorNames.insert(std::make_pair(754, "ERROR_BUFFER_ALL_ZEROS")); - ErrorNames.insert(std::make_pair(755, "ERROR_REPARSE_OBJECT")); - ErrorNames.insert(std::make_pair(756, "ERROR_RESOURCE_REQUIREMENTS_CHANGED")); - ErrorNames.insert(std::make_pair(757, "ERROR_TRANSLATION_COMPLETE")); - ErrorNames.insert(std::make_pair(758, "ERROR_NOTHING_TO_TERMINATE")); - ErrorNames.insert(std::make_pair(759, "ERROR_PROCESS_NOT_IN_JOB")); - ErrorNames.insert(std::make_pair(760, "ERROR_PROCESS_IN_JOB")); - ErrorNames.insert(std::make_pair(761, "ERROR_VOLSNAP_HIBERNATE_READY")); - ErrorNames.insert(std::make_pair(762, "ERROR_FSFILTER_OP_COMPLETED_SUCCESSFULLY")); - ErrorNames.insert(std::make_pair(763, "ERROR_INTERRUPT_VECTOR_ALREADY_CONNECTED")); - ErrorNames.insert(std::make_pair(764, "ERROR_INTERRUPT_STILL_CONNECTED")); - ErrorNames.insert(std::make_pair(765, "ERROR_WAIT_FOR_OPLOCK")); - ErrorNames.insert(std::make_pair(766, "ERROR_DBG_EXCEPTION_HANDLED")); - ErrorNames.insert(std::make_pair(767, "ERROR_DBG_CONTINUE")); - ErrorNames.insert(std::make_pair(768, "ERROR_CALLBACK_POP_STACK")); - ErrorNames.insert(std::make_pair(769, "ERROR_COMPRESSION_DISABLED")); - ErrorNames.insert(std::make_pair(770, "ERROR_CANTFETCHBACKWARDS")); - ErrorNames.insert(std::make_pair(771, "ERROR_CANTSCROLLBACKWARDS")); - ErrorNames.insert(std::make_pair(772, "ERROR_ROWSNOTRELEASED")); - ErrorNames.insert(std::make_pair(773, "ERROR_BAD_ACCESSOR_FLAGS")); - ErrorNames.insert(std::make_pair(774, "ERROR_ERRORS_ENCOUNTERED")); - ErrorNames.insert(std::make_pair(775, "ERROR_NOT_CAPABLE")); - ErrorNames.insert(std::make_pair(776, "ERROR_REQUEST_OUT_OF_SEQUENCE")); - ErrorNames.insert(std::make_pair(777, "ERROR_VERSION_PARSE_ERROR")); - ErrorNames.insert(std::make_pair(778, "ERROR_BADSTARTPOSITION")); - ErrorNames.insert(std::make_pair(779, "ERROR_MEMORY_HARDWARE")); - ErrorNames.insert(std::make_pair(780, "ERROR_DISK_REPAIR_DISABLED")); - ErrorNames.insert(std::make_pair(781, "ERROR_INSUFFICIENT_RESOURCE_FOR_SPECIFIED_SHARED_SECTION_SIZE")); - ErrorNames.insert(std::make_pair(782, "ERROR_SYSTEM_POWERSTATE_TRANSITION")); - ErrorNames.insert(std::make_pair(783, "ERROR_SYSTEM_POWERSTATE_COMPLEX_TRANSITION")); - ErrorNames.insert(std::make_pair(784, "ERROR_MCA_EXCEPTION")); - ErrorNames.insert(std::make_pair(785, "ERROR_ACCESS_AUDIT_BY_POLICY")); - ErrorNames.insert(std::make_pair(786, "ERROR_ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY")); - ErrorNames.insert(std::make_pair(787, "ERROR_ABANDON_HIBERFILE")); - ErrorNames.insert(std::make_pair(788, "ERROR_LOST_WRITEBEHIND_DATA_NETWORK_DISCONNECTED")); - ErrorNames.insert(std::make_pair(789, "ERROR_LOST_WRITEBEHIND_DATA_NETWORK_SERVER_ERROR")); - ErrorNames.insert(std::make_pair(790, "ERROR_LOST_WRITEBEHIND_DATA_LOCAL_DISK_ERROR")); - ErrorNames.insert(std::make_pair(791, "ERROR_BAD_MCFG_TABLE")); - ErrorNames.insert(std::make_pair(800, "ERROR_OPLOCK_SWITCHED_TO_NEW_HANDLE")); - ErrorNames.insert(std::make_pair(801, "ERROR_CANNOT_GRANT_REQUESTED_OPLOCK")); - ErrorNames.insert(std::make_pair(802, "ERROR_CANNOT_BREAK_OPLOCK")); - ErrorNames.insert(std::make_pair(803, "ERROR_OPLOCK_HANDLE_CLOSED")); - ErrorNames.insert(std::make_pair(804, "ERROR_NO_ACE_CONDITION")); - ErrorNames.insert(std::make_pair(805, "ERROR_INVALID_ACE_CONDITION")); - ErrorNames.insert(std::make_pair(994, "ERROR_EA_ACCESS_DENIED")); - ErrorNames.insert(std::make_pair(995, "ERROR_OPERATION_ABORTED")); - ErrorNames.insert(std::make_pair(996, "ERROR_IO_INCOMPLETE")); - ErrorNames.insert(std::make_pair(997, "ERROR_IO_PENDING")); - ErrorNames.insert(std::make_pair(998, "ERROR_NOACCESS")); - ErrorNames.insert(std::make_pair(999, "ERROR_SWAPERROR")); - ErrorNames.insert(std::make_pair(1001, "ERROR_STACK_OVERFLOW")); - ErrorNames.insert(std::make_pair(1002, "ERROR_INVALID_MESSAGE")); - ErrorNames.insert(std::make_pair(1003, "ERROR_CAN_NOT_COMPLETE")); - ErrorNames.insert(std::make_pair(1004, "ERROR_INVALID_FLAGS")); - ErrorNames.insert(std::make_pair(1005, "ERROR_UNRECOGNIZED_VOLUME")); - ErrorNames.insert(std::make_pair(1006, "ERROR_FILE_INVALID")); - ErrorNames.insert(std::make_pair(1007, "ERROR_FULLSCREEN_MODE")); - ErrorNames.insert(std::make_pair(1008, "ERROR_NO_TOKEN")); - ErrorNames.insert(std::make_pair(1009, "ERROR_BADDB")); - ErrorNames.insert(std::make_pair(1010, "ERROR_BADKEY")); - ErrorNames.insert(std::make_pair(1011, "ERROR_CANTOPEN")); - ErrorNames.insert(std::make_pair(1012, "ERROR_CANTREAD")); - ErrorNames.insert(std::make_pair(1013, "ERROR_CANTWRITE")); - ErrorNames.insert(std::make_pair(1014, "ERROR_REGISTRY_RECOVERED")); - ErrorNames.insert(std::make_pair(1015, "ERROR_REGISTRY_CORRUPT")); - ErrorNames.insert(std::make_pair(1016, "ERROR_REGISTRY_IO_FAILED")); - ErrorNames.insert(std::make_pair(1017, "ERROR_NOT_REGISTRY_FILE")); - ErrorNames.insert(std::make_pair(1018, "ERROR_KEY_DELETED")); - ErrorNames.insert(std::make_pair(1019, "ERROR_NO_LOG_SPACE")); - ErrorNames.insert(std::make_pair(1020, "ERROR_KEY_HAS_CHILDREN")); - ErrorNames.insert(std::make_pair(1021, "ERROR_CHILD_MUST_BE_VOLATILE")); - ErrorNames.insert(std::make_pair(1022, "ERROR_NOTIFY_ENUM_DIR")); - ErrorNames.insert(std::make_pair(1051, "ERROR_DEPENDENT_SERVICES_RUNNING")); - ErrorNames.insert(std::make_pair(1052, "ERROR_INVALID_SERVICE_CONTROL")); - ErrorNames.insert(std::make_pair(1053, "ERROR_SERVICE_REQUEST_TIMEOUT")); - ErrorNames.insert(std::make_pair(1054, "ERROR_SERVICE_NO_THREAD")); - ErrorNames.insert(std::make_pair(1055, "ERROR_SERVICE_DATABASE_LOCKED")); - ErrorNames.insert(std::make_pair(1056, "ERROR_SERVICE_ALREADY_RUNNING")); - ErrorNames.insert(std::make_pair(1057, "ERROR_INVALID_SERVICE_ACCOUNT")); - ErrorNames.insert(std::make_pair(1058, "ERROR_SERVICE_DISABLED")); - ErrorNames.insert(std::make_pair(1059, "ERROR_CIRCULAR_DEPENDENCY")); - ErrorNames.insert(std::make_pair(1060, "ERROR_SERVICE_DOES_NOT_EXIST")); - ErrorNames.insert(std::make_pair(1061, "ERROR_SERVICE_CANNOT_ACCEPT_CTRL")); - ErrorNames.insert(std::make_pair(1062, "ERROR_SERVICE_NOT_ACTIVE")); - ErrorNames.insert(std::make_pair(1063, "ERROR_FAILED_SERVICE_CONTROLLER_CONNECT")); - ErrorNames.insert(std::make_pair(1064, "ERROR_EXCEPTION_IN_SERVICE")); - ErrorNames.insert(std::make_pair(1065, "ERROR_DATABASE_DOES_NOT_EXIST")); - ErrorNames.insert(std::make_pair(1066, "ERROR_SERVICE_SPECIFIC_ERROR")); - ErrorNames.insert(std::make_pair(1067, "ERROR_PROCESS_ABORTED")); - ErrorNames.insert(std::make_pair(1068, "ERROR_SERVICE_DEPENDENCY_FAIL")); - ErrorNames.insert(std::make_pair(1069, "ERROR_SERVICE_LOGON_FAILED")); - ErrorNames.insert(std::make_pair(1070, "ERROR_SERVICE_START_HANG")); - ErrorNames.insert(std::make_pair(1071, "ERROR_INVALID_SERVICE_LOCK")); - ErrorNames.insert(std::make_pair(1072, "ERROR_SERVICE_MARKED_FOR_DELETE")); - ErrorNames.insert(std::make_pair(1073, "ERROR_SERVICE_EXISTS")); - ErrorNames.insert(std::make_pair(1074, "ERROR_ALREADY_RUNNING_LKG")); - ErrorNames.insert(std::make_pair(1075, "ERROR_SERVICE_DEPENDENCY_DELETED")); - ErrorNames.insert(std::make_pair(1076, "ERROR_BOOT_ALREADY_ACCEPTED")); - ErrorNames.insert(std::make_pair(1077, "ERROR_SERVICE_NEVER_STARTED")); - ErrorNames.insert(std::make_pair(1078, "ERROR_DUPLICATE_SERVICE_NAME")); - ErrorNames.insert(std::make_pair(1079, "ERROR_DIFFERENT_SERVICE_ACCOUNT")); - ErrorNames.insert(std::make_pair(1080, "ERROR_CANNOT_DETECT_DRIVER_FAILURE")); - ErrorNames.insert(std::make_pair(1081, "ERROR_CANNOT_DETECT_PROCESS_ABORT")); - ErrorNames.insert(std::make_pair(1082, "ERROR_NO_RECOVERY_PROGRAM")); - ErrorNames.insert(std::make_pair(1083, "ERROR_SERVICE_NOT_IN_EXE")); - ErrorNames.insert(std::make_pair(1084, "ERROR_NOT_SAFEBOOT_SERVICE")); - ErrorNames.insert(std::make_pair(1100, "ERROR_END_OF_MEDIA")); - ErrorNames.insert(std::make_pair(1101, "ERROR_FILEMARK_DETECTED")); - ErrorNames.insert(std::make_pair(1102, "ERROR_BEGINNING_OF_MEDIA")); - ErrorNames.insert(std::make_pair(1103, "ERROR_SETMARK_DETECTED")); - ErrorNames.insert(std::make_pair(1104, "ERROR_NO_DATA_DETECTED")); - ErrorNames.insert(std::make_pair(1105, "ERROR_PARTITION_FAILURE")); - ErrorNames.insert(std::make_pair(1106, "ERROR_INVALID_BLOCK_LENGTH")); - ErrorNames.insert(std::make_pair(1107, "ERROR_DEVICE_NOT_PARTITIONED")); - ErrorNames.insert(std::make_pair(1108, "ERROR_UNABLE_TO_LOCK_MEDIA")); - ErrorNames.insert(std::make_pair(1109, "ERROR_UNABLE_TO_UNLOAD_MEDIA")); - ErrorNames.insert(std::make_pair(1110, "ERROR_MEDIA_CHANGED")); - ErrorNames.insert(std::make_pair(1111, "ERROR_BUS_RESET")); - ErrorNames.insert(std::make_pair(1112, "ERROR_NO_MEDIA_IN_DRIVE")); - ErrorNames.insert(std::make_pair(1113, "ERROR_NO_UNICODE_TRANSLATION")); - ErrorNames.insert(std::make_pair(1114, "ERROR_DLL_INIT_FAILED")); - ErrorNames.insert(std::make_pair(1115, "ERROR_SHUTDOWN_IN_PROGRESS")); - ErrorNames.insert(std::make_pair(1116, "ERROR_NO_SHUTDOWN_IN_PROGRESS")); - ErrorNames.insert(std::make_pair(1117, "ERROR_IO_DEVICE")); - ErrorNames.insert(std::make_pair(1118, "ERROR_SERIAL_NO_DEVICE")); - ErrorNames.insert(std::make_pair(1119, "ERROR_IRQ_BUSY")); - ErrorNames.insert(std::make_pair(1120, "ERROR_MORE_WRITES")); - ErrorNames.insert(std::make_pair(1121, "ERROR_COUNTER_TIMEOUT")); - ErrorNames.insert(std::make_pair(1122, "ERROR_FLOPPY_ID_MARK_NOT_FOUND")); - ErrorNames.insert(std::make_pair(1123, "ERROR_FLOPPY_WRONG_CYLINDER")); - ErrorNames.insert(std::make_pair(1124, "ERROR_FLOPPY_UNKNOWN_ERROR")); - ErrorNames.insert(std::make_pair(1125, "ERROR_FLOPPY_BAD_REGISTERS")); - ErrorNames.insert(std::make_pair(1126, "ERROR_DISK_RECALIBRATE_FAILED")); - ErrorNames.insert(std::make_pair(1127, "ERROR_DISK_OPERATION_FAILED")); - ErrorNames.insert(std::make_pair(1128, "ERROR_DISK_RESET_FAILED")); - ErrorNames.insert(std::make_pair(1129, "ERROR_EOM_OVERFLOW")); - ErrorNames.insert(std::make_pair(1130, "ERROR_NOT_ENOUGH_SERVER_MEMORY")); - ErrorNames.insert(std::make_pair(1131, "ERROR_POSSIBLE_DEADLOCK")); - ErrorNames.insert(std::make_pair(1132, "ERROR_MAPPED_ALIGNMENT")); - ErrorNames.insert(std::make_pair(1140, "ERROR_SET_POWER_STATE_VETOED")); - ErrorNames.insert(std::make_pair(1141, "ERROR_SET_POWER_STATE_FAILED")); - ErrorNames.insert(std::make_pair(1142, "ERROR_TOO_MANY_LINKS")); - ErrorNames.insert(std::make_pair(1150, "ERROR_OLD_WIN_VERSION")); - ErrorNames.insert(std::make_pair(1151, "ERROR_APP_WRONG_OS")); - ErrorNames.insert(std::make_pair(1152, "ERROR_SINGLE_INSTANCE_APP")); - ErrorNames.insert(std::make_pair(1153, "ERROR_RMODE_APP")); - ErrorNames.insert(std::make_pair(1154, "ERROR_INVALID_DLL")); - ErrorNames.insert(std::make_pair(1155, "ERROR_NO_ASSOCIATION")); - ErrorNames.insert(std::make_pair(1156, "ERROR_DDE_FAIL")); - ErrorNames.insert(std::make_pair(1157, "ERROR_DLL_NOT_FOUND")); - ErrorNames.insert(std::make_pair(1158, "ERROR_NO_MORE_USER_HANDLES")); - ErrorNames.insert(std::make_pair(1159, "ERROR_MESSAGE_SYNC_ONLY")); - ErrorNames.insert(std::make_pair(1160, "ERROR_SOURCE_ELEMENT_EMPTY")); - ErrorNames.insert(std::make_pair(1161, "ERROR_DESTINATION_ELEMENT_FULL")); - ErrorNames.insert(std::make_pair(1162, "ERROR_ILLEGAL_ELEMENT_ADDRESS")); - ErrorNames.insert(std::make_pair(1163, "ERROR_MAGAZINE_NOT_PRESENT")); - ErrorNames.insert(std::make_pair(1164, "ERROR_DEVICE_REINITIALIZATION_NEEDED")); - ErrorNames.insert(std::make_pair(1165, "ERROR_DEVICE_REQUIRES_CLEANING")); - ErrorNames.insert(std::make_pair(1166, "ERROR_DEVICE_DOOR_OPEN")); - ErrorNames.insert(std::make_pair(1167, "ERROR_DEVICE_NOT_CONNECTED")); - ErrorNames.insert(std::make_pair(1168, "ERROR_NOT_FOUND")); - ErrorNames.insert(std::make_pair(1169, "ERROR_NO_MATCH")); - ErrorNames.insert(std::make_pair(1170, "ERROR_SET_NOT_FOUND")); - ErrorNames.insert(std::make_pair(1171, "ERROR_POINT_NOT_FOUND")); - ErrorNames.insert(std::make_pair(1172, "ERROR_NO_TRACKING_SERVICE")); - ErrorNames.insert(std::make_pair(1173, "ERROR_NO_VOLUME_ID")); - ErrorNames.insert(std::make_pair(1175, "ERROR_UNABLE_TO_REMOVE_REPLACED")); - ErrorNames.insert(std::make_pair(1176, "ERROR_UNABLE_TO_MOVE_REPLACEMENT")); - ErrorNames.insert(std::make_pair(1177, "ERROR_UNABLE_TO_MOVE_REPLACEMENT_2")); - ErrorNames.insert(std::make_pair(1178, "ERROR_JOURNAL_DELETE_IN_PROGRESS")); - ErrorNames.insert(std::make_pair(1179, "ERROR_JOURNAL_NOT_ACTIVE")); - ErrorNames.insert(std::make_pair(1180, "ERROR_POTENTIAL_FILE_FOUND")); - ErrorNames.insert(std::make_pair(1181, "ERROR_JOURNAL_ENTRY_DELETED")); - ErrorNames.insert(std::make_pair(1190, "ERROR_SHUTDOWN_IS_SCHEDULED")); - ErrorNames.insert(std::make_pair(1191, "ERROR_SHUTDOWN_USERS_LOGGED_ON")); - ErrorNames.insert(std::make_pair(1200, "ERROR_BAD_DEVICE")); - ErrorNames.insert(std::make_pair(1201, "ERROR_CONNECTION_UNAVAIL")); - ErrorNames.insert(std::make_pair(1202, "ERROR_DEVICE_ALREADY_REMEMBERED")); - ErrorNames.insert(std::make_pair(1203, "ERROR_NO_NET_OR_BAD_PATH")); - ErrorNames.insert(std::make_pair(1204, "ERROR_BAD_PROVIDER")); - ErrorNames.insert(std::make_pair(1205, "ERROR_CANNOT_OPEN_PROFILE")); - ErrorNames.insert(std::make_pair(1206, "ERROR_BAD_PROFILE")); - ErrorNames.insert(std::make_pair(1207, "ERROR_NOT_CONTAINER")); - ErrorNames.insert(std::make_pair(1208, "ERROR_EXTENDED_ERROR")); - ErrorNames.insert(std::make_pair(1209, "ERROR_INVALID_GROUPNAME")); - ErrorNames.insert(std::make_pair(1210, "ERROR_INVALID_COMPUTERNAME")); - ErrorNames.insert(std::make_pair(1211, "ERROR_INVALID_EVENTNAME")); - ErrorNames.insert(std::make_pair(1212, "ERROR_INVALID_DOMAINNAME")); - ErrorNames.insert(std::make_pair(1213, "ERROR_INVALID_SERVICENAME")); - ErrorNames.insert(std::make_pair(1214, "ERROR_INVALID_NETNAME")); - ErrorNames.insert(std::make_pair(1215, "ERROR_INVALID_SHARENAME")); - ErrorNames.insert(std::make_pair(1216, "ERROR_INVALID_PASSWORDNAME")); - ErrorNames.insert(std::make_pair(1217, "ERROR_INVALID_MESSAGENAME")); - ErrorNames.insert(std::make_pair(1218, "ERROR_INVALID_MESSAGEDEST")); - ErrorNames.insert(std::make_pair(1219, "ERROR_SESSION_CREDENTIAL_CONFLICT")); - ErrorNames.insert(std::make_pair(1220, "ERROR_REMOTE_SESSION_LIMIT_EXCEEDED")); - ErrorNames.insert(std::make_pair(1221, "ERROR_DUP_DOMAINNAME")); - ErrorNames.insert(std::make_pair(1222, "ERROR_NO_NETWORK")); - ErrorNames.insert(std::make_pair(1223, "ERROR_CANCELLED")); - ErrorNames.insert(std::make_pair(1224, "ERROR_USER_MAPPED_FILE")); - ErrorNames.insert(std::make_pair(1225, "ERROR_CONNECTION_REFUSED")); - ErrorNames.insert(std::make_pair(1226, "ERROR_GRACEFUL_DISCONNECT")); - ErrorNames.insert(std::make_pair(1227, "ERROR_ADDRESS_ALREADY_ASSOCIATED")); - ErrorNames.insert(std::make_pair(1228, "ERROR_ADDRESS_NOT_ASSOCIATED")); - ErrorNames.insert(std::make_pair(1229, "ERROR_CONNECTION_INVALID")); - ErrorNames.insert(std::make_pair(1230, "ERROR_CONNECTION_ACTIVE")); - ErrorNames.insert(std::make_pair(1231, "ERROR_NETWORK_UNREACHABLE")); - ErrorNames.insert(std::make_pair(1232, "ERROR_HOST_UNREACHABLE")); - ErrorNames.insert(std::make_pair(1233, "ERROR_PROTOCOL_UNREACHABLE")); - ErrorNames.insert(std::make_pair(1234, "ERROR_PORT_UNREACHABLE")); - ErrorNames.insert(std::make_pair(1235, "ERROR_REQUEST_ABORTED")); - ErrorNames.insert(std::make_pair(1236, "ERROR_CONNECTION_ABORTED")); - ErrorNames.insert(std::make_pair(1237, "ERROR_RETRY")); - ErrorNames.insert(std::make_pair(1238, "ERROR_CONNECTION_COUNT_LIMIT")); - ErrorNames.insert(std::make_pair(1239, "ERROR_LOGIN_TIME_RESTRICTION")); - ErrorNames.insert(std::make_pair(1240, "ERROR_LOGIN_WKSTA_RESTRICTION")); - ErrorNames.insert(std::make_pair(1241, "ERROR_INCORRECT_ADDRESS")); - ErrorNames.insert(std::make_pair(1242, "ERROR_ALREADY_REGISTERED")); - ErrorNames.insert(std::make_pair(1243, "ERROR_SERVICE_NOT_FOUND")); - ErrorNames.insert(std::make_pair(1244, "ERROR_NOT_AUTHENTICATED")); - ErrorNames.insert(std::make_pair(1245, "ERROR_NOT_LOGGED_ON")); - ErrorNames.insert(std::make_pair(1246, "ERROR_CONTINUE")); - ErrorNames.insert(std::make_pair(1247, "ERROR_ALREADY_INITIALIZED")); - ErrorNames.insert(std::make_pair(1248, "ERROR_NO_MORE_DEVICES")); - ErrorNames.insert(std::make_pair(1249, "ERROR_NO_SUCH_SITE")); - ErrorNames.insert(std::make_pair(1250, "ERROR_DOMAIN_CONTROLLER_EXISTS")); - ErrorNames.insert(std::make_pair(1251, "ERROR_ONLY_IF_CONNECTED")); - ErrorNames.insert(std::make_pair(1252, "ERROR_OVERRIDE_NOCHANGES")); - ErrorNames.insert(std::make_pair(1253, "ERROR_BAD_USER_PROFILE")); - ErrorNames.insert(std::make_pair(1254, "ERROR_NOT_SUPPORTED_ON_SBS")); - ErrorNames.insert(std::make_pair(1255, "ERROR_SERVER_SHUTDOWN_IN_PROGRESS")); - ErrorNames.insert(std::make_pair(1256, "ERROR_HOST_DOWN")); - ErrorNames.insert(std::make_pair(1257, "ERROR_NON_ACCOUNT_SID")); - ErrorNames.insert(std::make_pair(1258, "ERROR_NON_DOMAIN_SID")); - ErrorNames.insert(std::make_pair(1259, "ERROR_APPHELP_BLOCK")); - ErrorNames.insert(std::make_pair(1260, "ERROR_ACCESS_DISABLED_BY_POLICY")); - ErrorNames.insert(std::make_pair(1261, "ERROR_REG_NAT_CONSUMPTION")); - ErrorNames.insert(std::make_pair(1262, "ERROR_CSCSHARE_OFFLINE")); - ErrorNames.insert(std::make_pair(1263, "ERROR_PKINIT_FAILURE")); - ErrorNames.insert(std::make_pair(1264, "ERROR_SMARTCARD_SUBSYSTEM_FAILURE")); - ErrorNames.insert(std::make_pair(1265, "ERROR_DOWNGRADE_DETECTED")); - ErrorNames.insert(std::make_pair(1271, "ERROR_MACHINE_LOCKED")); - ErrorNames.insert(std::make_pair(1273, "ERROR_CALLBACK_SUPPLIED_INVALID_DATA")); - ErrorNames.insert(std::make_pair(1274, "ERROR_SYNC_FOREGROUND_REFRESH_REQUIRED")); - ErrorNames.insert(std::make_pair(1275, "ERROR_DRIVER_BLOCKED")); - ErrorNames.insert(std::make_pair(1276, "ERROR_INVALID_IMPORT_OF_NON_DLL")); - ErrorNames.insert(std::make_pair(1277, "ERROR_ACCESS_DISABLED_WEBBLADE")); - ErrorNames.insert(std::make_pair(1278, "ERROR_ACCESS_DISABLED_WEBBLADE_TAMPER")); - ErrorNames.insert(std::make_pair(1279, "ERROR_RECOVERY_FAILURE")); - ErrorNames.insert(std::make_pair(1280, "ERROR_ALREADY_FIBER")); - ErrorNames.insert(std::make_pair(1281, "ERROR_ALREADY_THREAD")); - ErrorNames.insert(std::make_pair(1282, "ERROR_STACK_BUFFER_OVERRUN")); - ErrorNames.insert(std::make_pair(1283, "ERROR_PARAMETER_QUOTA_EXCEEDED")); - ErrorNames.insert(std::make_pair(1284, "ERROR_DEBUGGER_INACTIVE")); - ErrorNames.insert(std::make_pair(1285, "ERROR_DELAY_LOAD_FAILED")); - ErrorNames.insert(std::make_pair(1286, "ERROR_VDM_DISALLOWED")); - ErrorNames.insert(std::make_pair(1287, "ERROR_UNIDENTIFIED_ERROR")); - ErrorNames.insert(std::make_pair(1288, "ERROR_INVALID_CRUNTIME_PARAMETER")); - ErrorNames.insert(std::make_pair(1289, "ERROR_BEYOND_VDL")); - ErrorNames.insert(std::make_pair(1290, "ERROR_INCOMPATIBLE_SERVICE_SID_TYPE")); - ErrorNames.insert(std::make_pair(1291, "ERROR_DRIVER_PROCESS_TERMINATED")); - ErrorNames.insert(std::make_pair(1292, "ERROR_IMPLEMENTATION_LIMIT")); - ErrorNames.insert(std::make_pair(1293, "ERROR_PROCESS_IS_PROTECTED")); - ErrorNames.insert(std::make_pair(1294, "ERROR_SERVICE_NOTIFY_CLIENT_LAGGING")); - ErrorNames.insert(std::make_pair(1295, "ERROR_DISK_QUOTA_EXCEEDED")); - ErrorNames.insert(std::make_pair(1296, "ERROR_CONTENT_BLOCKED")); - ErrorNames.insert(std::make_pair(1297, "ERROR_INCOMPATIBLE_SERVICE_PRIVILEGE")); - ErrorNames.insert(std::make_pair(1298, "ERROR_APP_HANG")); - ErrorNames.insert(std::make_pair(1299, "ERROR_INVALID_LABEL")); - ErrorNames.insert(std::make_pair(1300, "ERROR_NOT_ALL_ASSIGNED")); - ErrorNames.insert(std::make_pair(1301, "ERROR_SOME_NOT_MAPPED")); - ErrorNames.insert(std::make_pair(1302, "ERROR_NO_QUOTAS_FOR_ACCOUNT")); - ErrorNames.insert(std::make_pair(1303, "ERROR_LOCAL_USER_SESSION_KEY")); - ErrorNames.insert(std::make_pair(1304, "ERROR_NULL_LM_PASSWORD")); - ErrorNames.insert(std::make_pair(1305, "ERROR_UNKNOWN_REVISION")); - ErrorNames.insert(std::make_pair(1306, "ERROR_REVISION_MISMATCH")); - ErrorNames.insert(std::make_pair(1307, "ERROR_INVALID_OWNER")); - ErrorNames.insert(std::make_pair(1308, "ERROR_INVALID_PRIMARY_GROUP")); - ErrorNames.insert(std::make_pair(1309, "ERROR_NO_IMPERSONATION_TOKEN")); - ErrorNames.insert(std::make_pair(1310, "ERROR_CANT_DISABLE_MANDATORY")); - ErrorNames.insert(std::make_pair(1311, "ERROR_NO_LOGON_SERVERS")); - ErrorNames.insert(std::make_pair(1312, "ERROR_NO_SUCH_LOGON_SESSION")); - ErrorNames.insert(std::make_pair(1313, "ERROR_NO_SUCH_PRIVILEGE")); - ErrorNames.insert(std::make_pair(1314, "ERROR_PRIVILEGE_NOT_HELD")); - ErrorNames.insert(std::make_pair(1315, "ERROR_INVALID_ACCOUNT_NAME")); - ErrorNames.insert(std::make_pair(1316, "ERROR_USER_EXISTS")); - ErrorNames.insert(std::make_pair(1317, "ERROR_NO_SUCH_USER")); - ErrorNames.insert(std::make_pair(1318, "ERROR_GROUP_EXISTS")); - ErrorNames.insert(std::make_pair(1319, "ERROR_NO_SUCH_GROUP")); - ErrorNames.insert(std::make_pair(1320, "ERROR_MEMBER_IN_GROUP")); - ErrorNames.insert(std::make_pair(1321, "ERROR_MEMBER_NOT_IN_GROUP")); - ErrorNames.insert(std::make_pair(1322, "ERROR_LAST_ADMIN")); - ErrorNames.insert(std::make_pair(1323, "ERROR_WRONG_PASSWORD")); - ErrorNames.insert(std::make_pair(1324, "ERROR_ILL_FORMED_PASSWORD")); - ErrorNames.insert(std::make_pair(1325, "ERROR_PASSWORD_RESTRICTION")); - ErrorNames.insert(std::make_pair(1326, "ERROR_LOGON_FAILURE")); - ErrorNames.insert(std::make_pair(1327, "ERROR_ACCOUNT_RESTRICTION")); - ErrorNames.insert(std::make_pair(1328, "ERROR_INVALID_LOGON_HOURS")); - ErrorNames.insert(std::make_pair(1329, "ERROR_INVALID_WORKSTATION")); - ErrorNames.insert(std::make_pair(1330, "ERROR_PASSWORD_EXPIRED")); - ErrorNames.insert(std::make_pair(1331, "ERROR_ACCOUNT_DISABLED")); - ErrorNames.insert(std::make_pair(1332, "ERROR_NONE_MAPPED")); - ErrorNames.insert(std::make_pair(1333, "ERROR_TOO_MANY_LUIDS_REQUESTED")); - ErrorNames.insert(std::make_pair(1334, "ERROR_LUIDS_EXHAUSTED")); - ErrorNames.insert(std::make_pair(1335, "ERROR_INVALID_SUB_AUTHORITY")); - ErrorNames.insert(std::make_pair(1336, "ERROR_INVALID_ACL")); - ErrorNames.insert(std::make_pair(1337, "ERROR_INVALID_SID")); - ErrorNames.insert(std::make_pair(1338, "ERROR_INVALID_SECURITY_DESCR")); - ErrorNames.insert(std::make_pair(1340, "ERROR_BAD_INHERITANCE_ACL")); - ErrorNames.insert(std::make_pair(1341, "ERROR_SERVER_DISABLED")); - ErrorNames.insert(std::make_pair(1342, "ERROR_SERVER_NOT_DISABLED")); - ErrorNames.insert(std::make_pair(1343, "ERROR_INVALID_ID_AUTHORITY")); - ErrorNames.insert(std::make_pair(1344, "ERROR_ALLOTTED_SPACE_EXCEEDED")); - ErrorNames.insert(std::make_pair(1345, "ERROR_INVALID_GROUP_ATTRIBUTES")); - ErrorNames.insert(std::make_pair(1346, "ERROR_BAD_IMPERSONATION_LEVEL")); - ErrorNames.insert(std::make_pair(1347, "ERROR_CANT_OPEN_ANONYMOUS")); - ErrorNames.insert(std::make_pair(1348, "ERROR_BAD_VALIDATION_CLASS")); - ErrorNames.insert(std::make_pair(1349, "ERROR_BAD_TOKEN_TYPE")); - ErrorNames.insert(std::make_pair(1350, "ERROR_NO_SECURITY_ON_OBJECT")); - ErrorNames.insert(std::make_pair(1351, "ERROR_CANT_ACCESS_DOMAIN_INFO")); - ErrorNames.insert(std::make_pair(1352, "ERROR_INVALID_SERVER_STATE")); - ErrorNames.insert(std::make_pair(1353, "ERROR_INVALID_DOMAIN_STATE")); - ErrorNames.insert(std::make_pair(1354, "ERROR_INVALID_DOMAIN_ROLE")); - ErrorNames.insert(std::make_pair(1355, "ERROR_NO_SUCH_DOMAIN")); - ErrorNames.insert(std::make_pair(1356, "ERROR_DOMAIN_EXISTS")); - ErrorNames.insert(std::make_pair(1357, "ERROR_DOMAIN_LIMIT_EXCEEDED")); - ErrorNames.insert(std::make_pair(1358, "ERROR_INTERNAL_DB_CORRUPTION")); - ErrorNames.insert(std::make_pair(1359, "ERROR_INTERNAL_ERROR")); - ErrorNames.insert(std::make_pair(1360, "ERROR_GENERIC_NOT_MAPPED")); - ErrorNames.insert(std::make_pair(1361, "ERROR_BAD_DESCRIPTOR_FORMAT")); - ErrorNames.insert(std::make_pair(1362, "ERROR_NOT_LOGON_PROCESS")); - ErrorNames.insert(std::make_pair(1363, "ERROR_LOGON_SESSION_EXISTS")); - ErrorNames.insert(std::make_pair(1364, "ERROR_NO_SUCH_PACKAGE")); - ErrorNames.insert(std::make_pair(1365, "ERROR_BAD_LOGON_SESSION_STATE")); - ErrorNames.insert(std::make_pair(1366, "ERROR_LOGON_SESSION_COLLISION")); - ErrorNames.insert(std::make_pair(1367, "ERROR_INVALID_LOGON_TYPE")); - ErrorNames.insert(std::make_pair(1368, "ERROR_CANNOT_IMPERSONATE")); - ErrorNames.insert(std::make_pair(1369, "ERROR_RXACT_INVALID_STATE")); - ErrorNames.insert(std::make_pair(1370, "ERROR_RXACT_COMMIT_FAILURE")); - ErrorNames.insert(std::make_pair(1371, "ERROR_SPECIAL_ACCOUNT")); - ErrorNames.insert(std::make_pair(1372, "ERROR_SPECIAL_GROUP")); - ErrorNames.insert(std::make_pair(1373, "ERROR_SPECIAL_USER")); - ErrorNames.insert(std::make_pair(1374, "ERROR_MEMBERS_PRIMARY_GROUP")); - ErrorNames.insert(std::make_pair(1375, "ERROR_TOKEN_ALREADY_IN_USE")); - ErrorNames.insert(std::make_pair(1376, "ERROR_NO_SUCH_ALIAS")); - ErrorNames.insert(std::make_pair(1377, "ERROR_MEMBER_NOT_IN_ALIAS")); - ErrorNames.insert(std::make_pair(1378, "ERROR_MEMBER_IN_ALIAS")); - ErrorNames.insert(std::make_pair(1379, "ERROR_ALIAS_EXISTS")); - ErrorNames.insert(std::make_pair(1380, "ERROR_LOGON_NOT_GRANTED")); - ErrorNames.insert(std::make_pair(1381, "ERROR_TOO_MANY_SECRETS")); - ErrorNames.insert(std::make_pair(1382, "ERROR_SECRET_TOO_LONG")); - ErrorNames.insert(std::make_pair(1383, "ERROR_INTERNAL_DB_ERROR")); - ErrorNames.insert(std::make_pair(1384, "ERROR_TOO_MANY_CONTEXT_IDS")); - ErrorNames.insert(std::make_pair(1385, "ERROR_LOGON_TYPE_NOT_GRANTED")); - ErrorNames.insert(std::make_pair(1386, "ERROR_NT_CROSS_ENCRYPTION_REQUIRED")); - ErrorNames.insert(std::make_pair(1387, "ERROR_NO_SUCH_MEMBER")); - ErrorNames.insert(std::make_pair(1388, "ERROR_INVALID_MEMBER")); - ErrorNames.insert(std::make_pair(1389, "ERROR_TOO_MANY_SIDS")); - ErrorNames.insert(std::make_pair(1390, "ERROR_LM_CROSS_ENCRYPTION_REQUIRED")); - ErrorNames.insert(std::make_pair(1391, "ERROR_NO_INHERITANCE")); - ErrorNames.insert(std::make_pair(1392, "ERROR_FILE_CORRUPT")); - ErrorNames.insert(std::make_pair(1393, "ERROR_DISK_CORRUPT")); - ErrorNames.insert(std::make_pair(1394, "ERROR_NO_USER_SESSION_KEY")); - ErrorNames.insert(std::make_pair(1395, "ERROR_LICENSE_QUOTA_EXCEEDED")); - ErrorNames.insert(std::make_pair(1396, "ERROR_WRONG_TARGET_NAME")); - ErrorNames.insert(std::make_pair(1397, "ERROR_MUTUAL_AUTH_FAILED")); - ErrorNames.insert(std::make_pair(1398, "ERROR_TIME_SKEW")); - ErrorNames.insert(std::make_pair(1399, "ERROR_CURRENT_DOMAIN_NOT_ALLOWED")); - ErrorNames.insert(std::make_pair(1400, "ERROR_INVALID_WINDOW_HANDLE")); - ErrorNames.insert(std::make_pair(1401, "ERROR_INVALID_MENU_HANDLE")); - ErrorNames.insert(std::make_pair(1402, "ERROR_INVALID_CURSOR_HANDLE")); - ErrorNames.insert(std::make_pair(1403, "ERROR_INVALID_ACCEL_HANDLE")); - ErrorNames.insert(std::make_pair(1404, "ERROR_INVALID_HOOK_HANDLE")); - ErrorNames.insert(std::make_pair(1405, "ERROR_INVALID_DWP_HANDLE")); - ErrorNames.insert(std::make_pair(1406, "ERROR_TLW_WITH_WSCHILD")); - ErrorNames.insert(std::make_pair(1407, "ERROR_CANNOT_FIND_WND_CLASS")); - ErrorNames.insert(std::make_pair(1408, "ERROR_WINDOW_OF_OTHER_THREAD")); - ErrorNames.insert(std::make_pair(1409, "ERROR_HOTKEY_ALREADY_REGISTERED")); - ErrorNames.insert(std::make_pair(1410, "ERROR_CLASS_ALREADY_EXISTS")); - ErrorNames.insert(std::make_pair(1411, "ERROR_CLASS_DOES_NOT_EXIST")); - ErrorNames.insert(std::make_pair(1412, "ERROR_CLASS_HAS_WINDOWS")); - ErrorNames.insert(std::make_pair(1413, "ERROR_INVALID_INDEX")); - ErrorNames.insert(std::make_pair(1414, "ERROR_INVALID_ICON_HANDLE")); - ErrorNames.insert(std::make_pair(1415, "ERROR_PRIVATE_DIALOG_INDEX")); - ErrorNames.insert(std::make_pair(1416, "ERROR_LISTBOX_ID_NOT_FOUND")); - ErrorNames.insert(std::make_pair(1417, "ERROR_NO_WILDCARD_CHARACTERS")); - ErrorNames.insert(std::make_pair(1418, "ERROR_CLIPBOARD_NOT_OPEN")); - ErrorNames.insert(std::make_pair(1419, "ERROR_HOTKEY_NOT_REGISTERED")); - ErrorNames.insert(std::make_pair(1420, "ERROR_WINDOW_NOT_DIALOG")); - ErrorNames.insert(std::make_pair(1421, "ERROR_CONTROL_ID_NOT_FOUND")); - ErrorNames.insert(std::make_pair(1422, "ERROR_INVALID_COMBOBOX_MESSAGE")); - ErrorNames.insert(std::make_pair(1423, "ERROR_WINDOW_NOT_COMBOBOX")); - ErrorNames.insert(std::make_pair(1424, "ERROR_INVALID_EDIT_HEIGHT")); - ErrorNames.insert(std::make_pair(1425, "ERROR_DC_NOT_FOUND")); - ErrorNames.insert(std::make_pair(1426, "ERROR_INVALID_HOOK_FILTER")); - ErrorNames.insert(std::make_pair(1427, "ERROR_INVALID_FILTER_PROC")); - ErrorNames.insert(std::make_pair(1428, "ERROR_HOOK_NEEDS_HMOD")); - ErrorNames.insert(std::make_pair(1429, "ERROR_GLOBAL_ONLY_HOOK")); - ErrorNames.insert(std::make_pair(1430, "ERROR_JOURNAL_HOOK_SET")); - ErrorNames.insert(std::make_pair(1431, "ERROR_HOOK_NOT_INSTALLED")); - ErrorNames.insert(std::make_pair(1432, "ERROR_INVALID_LB_MESSAGE")); - ErrorNames.insert(std::make_pair(1433, "ERROR_SETCOUNT_ON_BAD_LB")); - ErrorNames.insert(std::make_pair(1434, "ERROR_LB_WITHOUT_TABSTOPS")); - ErrorNames.insert(std::make_pair(1435, "ERROR_DESTROY_OBJECT_OF_OTHER_THREAD")); - ErrorNames.insert(std::make_pair(1436, "ERROR_CHILD_WINDOW_MENU")); - ErrorNames.insert(std::make_pair(1437, "ERROR_NO_SYSTEM_MENU")); - ErrorNames.insert(std::make_pair(1438, "ERROR_INVALID_MSGBOX_STYLE")); - ErrorNames.insert(std::make_pair(1439, "ERROR_INVALID_SPI_VALUE")); - ErrorNames.insert(std::make_pair(1440, "ERROR_SCREEN_ALREADY_LOCKED")); - ErrorNames.insert(std::make_pair(1441, "ERROR_HWNDS_HAVE_DIFF_PARENT")); - ErrorNames.insert(std::make_pair(1442, "ERROR_NOT_CHILD_WINDOW")); - ErrorNames.insert(std::make_pair(1443, "ERROR_INVALID_GW_COMMAND")); - ErrorNames.insert(std::make_pair(1444, "ERROR_INVALID_THREAD_ID")); - ErrorNames.insert(std::make_pair(1445, "ERROR_NON_MDICHILD_WINDOW")); - ErrorNames.insert(std::make_pair(1446, "ERROR_POPUP_ALREADY_ACTIVE")); - ErrorNames.insert(std::make_pair(1447, "ERROR_NO_SCROLLBARS")); - ErrorNames.insert(std::make_pair(1448, "ERROR_INVALID_SCROLLBAR_RANGE")); - ErrorNames.insert(std::make_pair(1449, "ERROR_INVALID_SHOWWIN_COMMAND")); - ErrorNames.insert(std::make_pair(1450, "ERROR_NO_SYSTEM_RESOURCES")); - ErrorNames.insert(std::make_pair(1451, "ERROR_NONPAGED_SYSTEM_RESOURCES")); - ErrorNames.insert(std::make_pair(1452, "ERROR_PAGED_SYSTEM_RESOURCES")); - ErrorNames.insert(std::make_pair(1453, "ERROR_WORKING_SET_QUOTA")); - ErrorNames.insert(std::make_pair(1454, "ERROR_PAGEFILE_QUOTA")); - ErrorNames.insert(std::make_pair(1455, "ERROR_COMMITMENT_LIMIT")); - ErrorNames.insert(std::make_pair(1456, "ERROR_MENU_ITEM_NOT_FOUND")); - ErrorNames.insert(std::make_pair(1457, "ERROR_INVALID_KEYBOARD_HANDLE")); - ErrorNames.insert(std::make_pair(1458, "ERROR_HOOK_TYPE_NOT_ALLOWED")); - ErrorNames.insert(std::make_pair(1459, "ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION")); - ErrorNames.insert(std::make_pair(1460, "ERROR_TIMEOUT")); - ErrorNames.insert(std::make_pair(1461, "ERROR_INVALID_MONITOR_HANDLE")); - ErrorNames.insert(std::make_pair(1462, "ERROR_INCORRECT_SIZE")); - ErrorNames.insert(std::make_pair(1463, "ERROR_SYMLINK_CLASS_DISABLED")); - ErrorNames.insert(std::make_pair(1464, "ERROR_SYMLINK_NOT_SUPPORTED")); - ErrorNames.insert(std::make_pair(1465, "ERROR_XML_PARSE_ERROR")); - ErrorNames.insert(std::make_pair(1466, "ERROR_XMLDSIG_ERROR")); - ErrorNames.insert(std::make_pair(1467, "ERROR_RESTART_APPLICATION")); - ErrorNames.insert(std::make_pair(1468, "ERROR_WRONG_COMPARTMENT")); - ErrorNames.insert(std::make_pair(1469, "ERROR_AUTHIP_FAILURE")); - ErrorNames.insert(std::make_pair(1470, "ERROR_NO_NVRAM_RESOURCES")); - ErrorNames.insert(std::make_pair(1500, "ERROR_EVENTLOG_FILE_CORRUPT")); - ErrorNames.insert(std::make_pair(1501, "ERROR_EVENTLOG_CANT_START")); - ErrorNames.insert(std::make_pair(1502, "ERROR_LOG_FILE_FULL")); - ErrorNames.insert(std::make_pair(1503, "ERROR_EVENTLOG_FILE_CHANGED")); - ErrorNames.insert(std::make_pair(1550, "ERROR_INVALID_TASK_NAME")); - ErrorNames.insert(std::make_pair(1551, "ERROR_INVALID_TASK_INDEX")); - ErrorNames.insert(std::make_pair(1552, "ERROR_THREAD_ALREADY_IN_TASK")); - ErrorNames.insert(std::make_pair(1601, "ERROR_INSTALL_SERVICE_FAILURE")); - ErrorNames.insert(std::make_pair(1602, "ERROR_INSTALL_USEREXIT")); - ErrorNames.insert(std::make_pair(1603, "ERROR_INSTALL_FAILURE")); - ErrorNames.insert(std::make_pair(1604, "ERROR_INSTALL_SUSPEND")); - ErrorNames.insert(std::make_pair(1605, "ERROR_UNKNOWN_PRODUCT")); - ErrorNames.insert(std::make_pair(1606, "ERROR_UNKNOWN_FEATURE")); - ErrorNames.insert(std::make_pair(1607, "ERROR_UNKNOWN_COMPONENT")); - ErrorNames.insert(std::make_pair(1608, "ERROR_UNKNOWN_PROPERTY")); - ErrorNames.insert(std::make_pair(1609, "ERROR_INVALID_HANDLE_STATE")); - ErrorNames.insert(std::make_pair(1610, "ERROR_BAD_CONFIGURATION")); - ErrorNames.insert(std::make_pair(1611, "ERROR_INDEX_ABSENT")); - ErrorNames.insert(std::make_pair(1612, "ERROR_INSTALL_SOURCE_ABSENT")); - ErrorNames.insert(std::make_pair(1613, "ERROR_INSTALL_PACKAGE_VERSION")); - ErrorNames.insert(std::make_pair(1614, "ERROR_PRODUCT_UNINSTALLED")); - ErrorNames.insert(std::make_pair(1615, "ERROR_BAD_QUERY_SYNTAX")); - ErrorNames.insert(std::make_pair(1616, "ERROR_INVALID_FIELD")); - ErrorNames.insert(std::make_pair(1617, "ERROR_DEVICE_REMOVED")); - ErrorNames.insert(std::make_pair(1618, "ERROR_INSTALL_ALREADY_RUNNING")); - ErrorNames.insert(std::make_pair(1619, "ERROR_INSTALL_PACKAGE_OPEN_FAILED")); - ErrorNames.insert(std::make_pair(1620, "ERROR_INSTALL_PACKAGE_INVALID")); - ErrorNames.insert(std::make_pair(1621, "ERROR_INSTALL_UI_FAILURE")); - ErrorNames.insert(std::make_pair(1622, "ERROR_INSTALL_LOG_FAILURE")); - ErrorNames.insert(std::make_pair(1623, "ERROR_INSTALL_LANGUAGE_UNSUPPORTED")); - ErrorNames.insert(std::make_pair(1624, "ERROR_INSTALL_TRANSFORM_FAILURE")); - ErrorNames.insert(std::make_pair(1625, "ERROR_INSTALL_PACKAGE_REJECTED")); - ErrorNames.insert(std::make_pair(1626, "ERROR_FUNCTION_NOT_CALLED")); - ErrorNames.insert(std::make_pair(1627, "ERROR_FUNCTION_FAILED")); - ErrorNames.insert(std::make_pair(1628, "ERROR_INVALID_TABLE")); - ErrorNames.insert(std::make_pair(1629, "ERROR_DATATYPE_MISMATCH")); - ErrorNames.insert(std::make_pair(1630, "ERROR_UNSUPPORTED_TYPE")); - ErrorNames.insert(std::make_pair(1631, "ERROR_CREATE_FAILED")); - ErrorNames.insert(std::make_pair(1632, "ERROR_INSTALL_TEMP_UNWRITABLE")); - ErrorNames.insert(std::make_pair(1633, "ERROR_INSTALL_PLATFORM_UNSUPPORTED")); - ErrorNames.insert(std::make_pair(1634, "ERROR_INSTALL_NOTUSED")); - ErrorNames.insert(std::make_pair(1635, "ERROR_PATCH_PACKAGE_OPEN_FAILED")); - ErrorNames.insert(std::make_pair(1636, "ERROR_PATCH_PACKAGE_INVALID")); - ErrorNames.insert(std::make_pair(1637, "ERROR_PATCH_PACKAGE_UNSUPPORTED")); - ErrorNames.insert(std::make_pair(1638, "ERROR_PRODUCT_VERSION")); - ErrorNames.insert(std::make_pair(1639, "ERROR_INVALID_COMMAND_LINE")); - ErrorNames.insert(std::make_pair(1640, "ERROR_INSTALL_REMOTE_DISALLOWED")); - ErrorNames.insert(std::make_pair(1641, "ERROR_SUCCESS_REBOOT_INITIATED")); - ErrorNames.insert(std::make_pair(1642, "ERROR_PATCH_TARGET_NOT_FOUND")); - ErrorNames.insert(std::make_pair(1643, "ERROR_PATCH_PACKAGE_REJECTED")); - ErrorNames.insert(std::make_pair(1644, "ERROR_INSTALL_TRANSFORM_REJECTED")); - ErrorNames.insert(std::make_pair(1645, "ERROR_INSTALL_REMOTE_PROHIBITED")); - ErrorNames.insert(std::make_pair(1646, "ERROR_PATCH_REMOVAL_UNSUPPORTED")); - ErrorNames.insert(std::make_pair(1647, "ERROR_UNKNOWN_PATCH")); - ErrorNames.insert(std::make_pair(1648, "ERROR_PATCH_NO_SEQUENCE")); - ErrorNames.insert(std::make_pair(1649, "ERROR_PATCH_REMOVAL_DISALLOWED")); - ErrorNames.insert(std::make_pair(1650, "ERROR_INVALID_PATCH_XML")); - ErrorNames.insert(std::make_pair(1651, "ERROR_PATCH_MANAGED_ADVERTISED_PRODUCT")); - ErrorNames.insert(std::make_pair(1652, "ERROR_INSTALL_SERVICE_SAFEBOOT")); - ErrorNames.insert(std::make_pair(1653, "ERROR_FAIL_FAST_EXCEPTION")); - ErrorNames.insert(std::make_pair(1784, "ERROR_INVALID_USER_BUFFER")); - ErrorNames.insert(std::make_pair(1785, "ERROR_UNRECOGNIZED_MEDIA")); - ErrorNames.insert(std::make_pair(1786, "ERROR_NO_TRUST_LSA_SECRET")); - ErrorNames.insert(std::make_pair(1787, "ERROR_NO_TRUST_SAM_ACCOUNT")); - ErrorNames.insert(std::make_pair(1788, "ERROR_TRUSTED_DOMAIN_FAILURE")); - ErrorNames.insert(std::make_pair(1789, "ERROR_TRUSTED_RELATIONSHIP_FAILURE")); - ErrorNames.insert(std::make_pair(1790, "ERROR_TRUST_FAILURE")); - ErrorNames.insert(std::make_pair(1792, "ERROR_NETLOGON_NOT_STARTED")); - ErrorNames.insert(std::make_pair(1793, "ERROR_ACCOUNT_EXPIRED")); - ErrorNames.insert(std::make_pair(1794, "ERROR_REDIRECTOR_HAS_OPEN_HANDLES")); - ErrorNames.insert(std::make_pair(1795, "ERROR_PRINTER_DRIVER_ALREADY_INSTALLED")); - ErrorNames.insert(std::make_pair(1796, "ERROR_UNKNOWN_PORT")); - ErrorNames.insert(std::make_pair(1797, "ERROR_UNKNOWN_PRINTER_DRIVER")); - ErrorNames.insert(std::make_pair(1798, "ERROR_UNKNOWN_PRINTPROCESSOR")); - ErrorNames.insert(std::make_pair(1799, "ERROR_INVALID_SEPARATOR_FILE")); - ErrorNames.insert(std::make_pair(1800, "ERROR_INVALID_PRIORITY")); - ErrorNames.insert(std::make_pair(1801, "ERROR_INVALID_PRINTER_NAME")); - ErrorNames.insert(std::make_pair(1802, "ERROR_PRINTER_ALREADY_EXISTS")); - ErrorNames.insert(std::make_pair(1803, "ERROR_INVALID_PRINTER_COMMAND")); - ErrorNames.insert(std::make_pair(1804, "ERROR_INVALID_DATATYPE")); - ErrorNames.insert(std::make_pair(1805, "ERROR_INVALID_ENVIRONMENT")); - ErrorNames.insert(std::make_pair(1807, "ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT")); - ErrorNames.insert(std::make_pair(1808, "ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT")); - ErrorNames.insert(std::make_pair(1809, "ERROR_NOLOGON_SERVER_TRUST_ACCOUNT")); - ErrorNames.insert(std::make_pair(1810, "ERROR_DOMAIN_TRUST_INCONSISTENT")); - ErrorNames.insert(std::make_pair(1811, "ERROR_SERVER_HAS_OPEN_HANDLES")); - ErrorNames.insert(std::make_pair(1812, "ERROR_RESOURCE_DATA_NOT_FOUND")); - ErrorNames.insert(std::make_pair(1813, "ERROR_RESOURCE_TYPE_NOT_FOUND")); - ErrorNames.insert(std::make_pair(1814, "ERROR_RESOURCE_NAME_NOT_FOUND")); - ErrorNames.insert(std::make_pair(1815, "ERROR_RESOURCE_LANG_NOT_FOUND")); - ErrorNames.insert(std::make_pair(1816, "ERROR_NOT_ENOUGH_QUOTA")); - ErrorNames.insert(std::make_pair(1901, "ERROR_INVALID_TIME")); - ErrorNames.insert(std::make_pair(1902, "ERROR_INVALID_FORM_NAME")); - ErrorNames.insert(std::make_pair(1903, "ERROR_INVALID_FORM_SIZE")); - ErrorNames.insert(std::make_pair(1904, "ERROR_ALREADY_WAITING")); - ErrorNames.insert(std::make_pair(1905, "ERROR_PRINTER_DELETED")); - ErrorNames.insert(std::make_pair(1906, "ERROR_INVALID_PRINTER_STATE")); - ErrorNames.insert(std::make_pair(1907, "ERROR_PASSWORD_MUST_CHANGE")); - ErrorNames.insert(std::make_pair(1908, "ERROR_DOMAIN_CONTROLLER_NOT_FOUND")); - ErrorNames.insert(std::make_pair(1909, "ERROR_ACCOUNT_LOCKED_OUT")); - ErrorNames.insert(std::make_pair(1919, "ERROR_NO_SITENAME")); - ErrorNames.insert(std::make_pair(1920, "ERROR_CANT_ACCESS_FILE")); - ErrorNames.insert(std::make_pair(1921, "ERROR_CANT_RESOLVE_FILENAME")); - ErrorNames.insert(std::make_pair(1930, "ERROR_KM_DRIVER_BLOCKED")); - ErrorNames.insert(std::make_pair(1931, "ERROR_CONTEXT_EXPIRED")); - ErrorNames.insert(std::make_pair(1932, "ERROR_PER_USER_TRUST_QUOTA_EXCEEDED")); - ErrorNames.insert(std::make_pair(1933, "ERROR_ALL_USER_TRUST_QUOTA_EXCEEDED")); - ErrorNames.insert(std::make_pair(1934, "ERROR_USER_DELETE_TRUST_QUOTA_EXCEEDED")); - ErrorNames.insert(std::make_pair(1935, "ERROR_AUTHENTICATION_FIREWALL_FAILED")); - ErrorNames.insert(std::make_pair(1936, "ERROR_REMOTE_PRINT_CONNECTIONS_BLOCKED")); - ErrorNames.insert(std::make_pair(1937, "ERROR_NTLM_BLOCKED")); - ErrorNames.insert(std::make_pair(2000, "ERROR_INVALID_PIXEL_FORMAT")); - ErrorNames.insert(std::make_pair(2001, "ERROR_BAD_DRIVER")); - ErrorNames.insert(std::make_pair(2002, "ERROR_INVALID_WINDOW_STYLE")); - ErrorNames.insert(std::make_pair(2003, "ERROR_METAFILE_NOT_SUPPORTED")); - ErrorNames.insert(std::make_pair(2004, "ERROR_TRANSFORM_NOT_SUPPORTED")); - ErrorNames.insert(std::make_pair(2005, "ERROR_CLIPPING_NOT_SUPPORTED")); - ErrorNames.insert(std::make_pair(2010, "ERROR_INVALID_CMM")); - ErrorNames.insert(std::make_pair(2011, "ERROR_INVALID_PROFILE")); - ErrorNames.insert(std::make_pair(2012, "ERROR_TAG_NOT_FOUND")); - ErrorNames.insert(std::make_pair(2013, "ERROR_TAG_NOT_PRESENT")); - ErrorNames.insert(std::make_pair(2014, "ERROR_DUPLICATE_TAG")); - ErrorNames.insert(std::make_pair(2015, "ERROR_PROFILE_NOT_ASSOCIATED_WITH_DEVICE")); - ErrorNames.insert(std::make_pair(2016, "ERROR_PROFILE_NOT_FOUND")); - ErrorNames.insert(std::make_pair(2017, "ERROR_INVALID_COLORSPACE")); - ErrorNames.insert(std::make_pair(2018, "ERROR_ICM_NOT_ENABLED")); - ErrorNames.insert(std::make_pair(2019, "ERROR_DELETING_ICM_XFORM")); - ErrorNames.insert(std::make_pair(2020, "ERROR_INVALID_TRANSFORM")); - ErrorNames.insert(std::make_pair(2021, "ERROR_COLORSPACE_MISMATCH")); - ErrorNames.insert(std::make_pair(2022, "ERROR_INVALID_COLORINDEX")); - ErrorNames.insert(std::make_pair(2023, "ERROR_PROFILE_DOES_NOT_MATCH_DEVICE")); - ErrorNames.insert(std::make_pair(2108, "ERROR_CONNECTED_OTHER_PASSWORD")); - ErrorNames.insert(std::make_pair(2109, "ERROR_CONNECTED_OTHER_PASSWORD_DEFAULT")); - ErrorNames.insert(std::make_pair(2202, "ERROR_BAD_USERNAME")); - ErrorNames.insert(std::make_pair(2250, "ERROR_NOT_CONNECTED")); - ErrorNames.insert(std::make_pair(2401, "ERROR_OPEN_FILES")); - ErrorNames.insert(std::make_pair(2402, "ERROR_ACTIVE_CONNECTIONS")); - ErrorNames.insert(std::make_pair(2404, "ERROR_DEVICE_IN_USE")); - ErrorNames.insert(std::make_pair(3000, "ERROR_UNKNOWN_PRINT_MONITOR")); - ErrorNames.insert(std::make_pair(3001, "ERROR_PRINTER_DRIVER_IN_USE")); - ErrorNames.insert(std::make_pair(3002, "ERROR_SPOOL_FILE_NOT_FOUND")); - ErrorNames.insert(std::make_pair(3003, "ERROR_SPL_NO_STARTDOC")); - ErrorNames.insert(std::make_pair(3004, "ERROR_SPL_NO_ADDJOB")); - ErrorNames.insert(std::make_pair(3005, "ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED")); - ErrorNames.insert(std::make_pair(3006, "ERROR_PRINT_MONITOR_ALREADY_INSTALLED")); - ErrorNames.insert(std::make_pair(3007, "ERROR_INVALID_PRINT_MONITOR")); - ErrorNames.insert(std::make_pair(3008, "ERROR_PRINT_MONITOR_IN_USE")); - ErrorNames.insert(std::make_pair(3009, "ERROR_PRINTER_HAS_JOBS_QUEUED")); - ErrorNames.insert(std::make_pair(3010, "ERROR_SUCCESS_REBOOT_REQUIRED")); - ErrorNames.insert(std::make_pair(3011, "ERROR_SUCCESS_RESTART_REQUIRED")); - ErrorNames.insert(std::make_pair(3012, "ERROR_PRINTER_NOT_FOUND")); - ErrorNames.insert(std::make_pair(3013, "ERROR_PRINTER_DRIVER_WARNED")); - ErrorNames.insert(std::make_pair(3014, "ERROR_PRINTER_DRIVER_BLOCKED")); - ErrorNames.insert(std::make_pair(3015, "ERROR_PRINTER_DRIVER_PACKAGE_IN_USE")); - ErrorNames.insert(std::make_pair(3016, "ERROR_CORE_DRIVER_PACKAGE_NOT_FOUND")); - ErrorNames.insert(std::make_pair(3017, "ERROR_FAIL_REBOOT_REQUIRED")); - ErrorNames.insert(std::make_pair(3018, "ERROR_FAIL_REBOOT_INITIATED")); - ErrorNames.insert(std::make_pair(3019, "ERROR_PRINTER_DRIVER_DOWNLOAD_NEEDED")); - ErrorNames.insert(std::make_pair(3020, "ERROR_PRINT_JOB_RESTART_REQUIRED")); - ErrorNames.insert(std::make_pair(3950, "ERROR_IO_REISSUE_AS_CACHED")); - ErrorNames.insert(std::make_pair(4000, "ERROR_WINS_INTERNAL")); - ErrorNames.insert(std::make_pair(4001, "ERROR_CAN_NOT_DEL_LOCAL_WINS")); - ErrorNames.insert(std::make_pair(4002, "ERROR_STATIC_INIT")); - ErrorNames.insert(std::make_pair(4003, "ERROR_INC_BACKUP")); - ErrorNames.insert(std::make_pair(4004, "ERROR_FULL_BACKUP")); - ErrorNames.insert(std::make_pair(4005, "ERROR_REC_NON_EXISTENT")); - ErrorNames.insert(std::make_pair(4006, "ERROR_RPL_NOT_ALLOWED")); - ErrorNames.insert(std::make_pair(4100, "ERROR_DHCP_ADDRESS_CONFLICT")); - ErrorNames.insert(std::make_pair(4200, "ERROR_WMI_GUID_NOT_FOUND")); - ErrorNames.insert(std::make_pair(4201, "ERROR_WMI_INSTANCE_NOT_FOUND")); - ErrorNames.insert(std::make_pair(4202, "ERROR_WMI_ITEMID_NOT_FOUND")); - ErrorNames.insert(std::make_pair(4203, "ERROR_WMI_TRY_AGAIN")); - ErrorNames.insert(std::make_pair(4204, "ERROR_WMI_DP_NOT_FOUND")); - ErrorNames.insert(std::make_pair(4205, "ERROR_WMI_UNRESOLVED_INSTANCE_REF")); - ErrorNames.insert(std::make_pair(4206, "ERROR_WMI_ALREADY_ENABLED")); - ErrorNames.insert(std::make_pair(4207, "ERROR_WMI_GUID_DISCONNECTED")); - ErrorNames.insert(std::make_pair(4208, "ERROR_WMI_SERVER_UNAVAILABLE")); - ErrorNames.insert(std::make_pair(4209, "ERROR_WMI_DP_FAILED")); - ErrorNames.insert(std::make_pair(4210, "ERROR_WMI_INVALID_MOF")); - ErrorNames.insert(std::make_pair(4211, "ERROR_WMI_INVALID_REGINFO")); - ErrorNames.insert(std::make_pair(4212, "ERROR_WMI_ALREADY_DISABLED")); - ErrorNames.insert(std::make_pair(4213, "ERROR_WMI_READ_ONLY")); - ErrorNames.insert(std::make_pair(4214, "ERROR_WMI_SET_FAILURE")); - ErrorNames.insert(std::make_pair(4300, "ERROR_INVALID_MEDIA")); - ErrorNames.insert(std::make_pair(4301, "ERROR_INVALID_LIBRARY")); - ErrorNames.insert(std::make_pair(4302, "ERROR_INVALID_MEDIA_POOL")); - ErrorNames.insert(std::make_pair(4303, "ERROR_DRIVE_MEDIA_MISMATCH")); - ErrorNames.insert(std::make_pair(4304, "ERROR_MEDIA_OFFLINE")); - ErrorNames.insert(std::make_pair(4305, "ERROR_LIBRARY_OFFLINE")); - ErrorNames.insert(std::make_pair(4306, "ERROR_EMPTY")); - ErrorNames.insert(std::make_pair(4307, "ERROR_NOT_EMPTY")); - ErrorNames.insert(std::make_pair(4308, "ERROR_MEDIA_UNAVAILABLE")); - ErrorNames.insert(std::make_pair(4309, "ERROR_RESOURCE_DISABLED")); - ErrorNames.insert(std::make_pair(4310, "ERROR_INVALID_CLEANER")); - ErrorNames.insert(std::make_pair(4311, "ERROR_UNABLE_TO_CLEAN")); - ErrorNames.insert(std::make_pair(4312, "ERROR_OBJECT_NOT_FOUND")); - ErrorNames.insert(std::make_pair(4313, "ERROR_DATABASE_FAILURE")); - ErrorNames.insert(std::make_pair(4314, "ERROR_DATABASE_FULL")); - ErrorNames.insert(std::make_pair(4315, "ERROR_MEDIA_INCOMPATIBLE")); - ErrorNames.insert(std::make_pair(4316, "ERROR_RESOURCE_NOT_PRESENT")); - ErrorNames.insert(std::make_pair(4317, "ERROR_INVALID_OPERATION")); - ErrorNames.insert(std::make_pair(4318, "ERROR_MEDIA_NOT_AVAILABLE")); - ErrorNames.insert(std::make_pair(4319, "ERROR_DEVICE_NOT_AVAILABLE")); - ErrorNames.insert(std::make_pair(4320, "ERROR_REQUEST_REFUSED")); - ErrorNames.insert(std::make_pair(4321, "ERROR_INVALID_DRIVE_OBJECT")); - ErrorNames.insert(std::make_pair(4322, "ERROR_LIBRARY_FULL")); - ErrorNames.insert(std::make_pair(4323, "ERROR_MEDIUM_NOT_ACCESSIBLE")); - ErrorNames.insert(std::make_pair(4324, "ERROR_UNABLE_TO_LOAD_MEDIUM")); - ErrorNames.insert(std::make_pair(4325, "ERROR_UNABLE_TO_INVENTORY_DRIVE")); - ErrorNames.insert(std::make_pair(4326, "ERROR_UNABLE_TO_INVENTORY_SLOT")); - ErrorNames.insert(std::make_pair(4327, "ERROR_UNABLE_TO_INVENTORY_TRANSPORT")); - ErrorNames.insert(std::make_pair(4328, "ERROR_TRANSPORT_FULL")); - ErrorNames.insert(std::make_pair(4329, "ERROR_CONTROLLING_IEPORT")); - ErrorNames.insert(std::make_pair(4330, "ERROR_UNABLE_TO_EJECT_MOUNTED_MEDIA")); - ErrorNames.insert(std::make_pair(4331, "ERROR_CLEANER_SLOT_SET")); - ErrorNames.insert(std::make_pair(4332, "ERROR_CLEANER_SLOT_NOT_SET")); - ErrorNames.insert(std::make_pair(4333, "ERROR_CLEANER_CARTRIDGE_SPENT")); - ErrorNames.insert(std::make_pair(4334, "ERROR_UNEXPECTED_OMID")); - ErrorNames.insert(std::make_pair(4335, "ERROR_CANT_DELETE_LAST_ITEM")); - ErrorNames.insert(std::make_pair(4336, "ERROR_MESSAGE_EXCEEDS_MAX_SIZE")); - ErrorNames.insert(std::make_pair(4337, "ERROR_VOLUME_CONTAINS_SYS_FILES")); - ErrorNames.insert(std::make_pair(4338, "ERROR_INDIGENOUS_TYPE")); - ErrorNames.insert(std::make_pair(4339, "ERROR_NO_SUPPORTING_DRIVES")); - ErrorNames.insert(std::make_pair(4340, "ERROR_CLEANER_CARTRIDGE_INSTALLED")); - ErrorNames.insert(std::make_pair(4341, "ERROR_IEPORT_FULL")); - ErrorNames.insert(std::make_pair(4350, "ERROR_FILE_OFFLINE")); - ErrorNames.insert(std::make_pair(4351, "ERROR_REMOTE_STORAGE_NOT_ACTIVE")); - ErrorNames.insert(std::make_pair(4352, "ERROR_REMOTE_STORAGE_MEDIA_ERROR")); - ErrorNames.insert(std::make_pair(4390, "ERROR_NOT_A_REPARSE_POINT")); - ErrorNames.insert(std::make_pair(4391, "ERROR_REPARSE_ATTRIBUTE_CONFLICT")); - ErrorNames.insert(std::make_pair(4392, "ERROR_INVALID_REPARSE_DATA")); - ErrorNames.insert(std::make_pair(4393, "ERROR_REPARSE_TAG_INVALID")); - ErrorNames.insert(std::make_pair(4394, "ERROR_REPARSE_TAG_MISMATCH")); - ErrorNames.insert(std::make_pair(4500, "ERROR_VOLUME_NOT_SIS_ENABLED")); - ErrorNames.insert(std::make_pair(5001, "ERROR_DEPENDENT_RESOURCE_EXISTS")); - ErrorNames.insert(std::make_pair(5002, "ERROR_DEPENDENCY_NOT_FOUND")); - ErrorNames.insert(std::make_pair(5003, "ERROR_DEPENDENCY_ALREADY_EXISTS")); - ErrorNames.insert(std::make_pair(5004, "ERROR_RESOURCE_NOT_ONLINE")); - ErrorNames.insert(std::make_pair(5005, "ERROR_HOST_NODE_NOT_AVAILABLE")); - ErrorNames.insert(std::make_pair(5006, "ERROR_RESOURCE_NOT_AVAILABLE")); - ErrorNames.insert(std::make_pair(5007, "ERROR_RESOURCE_NOT_FOUND")); - ErrorNames.insert(std::make_pair(5008, "ERROR_SHUTDOWN_CLUSTER")); - ErrorNames.insert(std::make_pair(5009, "ERROR_CANT_EVICT_ACTIVE_NODE")); - ErrorNames.insert(std::make_pair(5010, "ERROR_OBJECT_ALREADY_EXISTS")); - ErrorNames.insert(std::make_pair(5011, "ERROR_OBJECT_IN_LIST")); - ErrorNames.insert(std::make_pair(5012, "ERROR_GROUP_NOT_AVAILABLE")); - ErrorNames.insert(std::make_pair(5013, "ERROR_GROUP_NOT_FOUND")); - ErrorNames.insert(std::make_pair(5014, "ERROR_GROUP_NOT_ONLINE")); - ErrorNames.insert(std::make_pair(5015, "ERROR_HOST_NODE_NOT_RESOURCE_OWNER")); - ErrorNames.insert(std::make_pair(5016, "ERROR_HOST_NODE_NOT_GROUP_OWNER")); - ErrorNames.insert(std::make_pair(5017, "ERROR_RESMON_CREATE_FAILED")); - ErrorNames.insert(std::make_pair(5018, "ERROR_RESMON_ONLINE_FAILED")); - ErrorNames.insert(std::make_pair(5019, "ERROR_RESOURCE_ONLINE")); - ErrorNames.insert(std::make_pair(5020, "ERROR_QUORUM_RESOURCE")); - ErrorNames.insert(std::make_pair(5021, "ERROR_NOT_QUORUM_CAPABLE")); - ErrorNames.insert(std::make_pair(5022, "ERROR_CLUSTER_SHUTTING_DOWN")); - ErrorNames.insert(std::make_pair(5023, "ERROR_INVALID_STATE")); - ErrorNames.insert(std::make_pair(5024, "ERROR_RESOURCE_PROPERTIES_STORED")); - ErrorNames.insert(std::make_pair(5025, "ERROR_NOT_QUORUM_CLASS")); - ErrorNames.insert(std::make_pair(5026, "ERROR_CORE_RESOURCE")); - ErrorNames.insert(std::make_pair(5027, "ERROR_QUORUM_RESOURCE_ONLINE_FAILED")); - ErrorNames.insert(std::make_pair(5028, "ERROR_QUORUMLOG_OPEN_FAILED")); - ErrorNames.insert(std::make_pair(5029, "ERROR_CLUSTERLOG_CORRUPT")); - ErrorNames.insert(std::make_pair(5030, "ERROR_CLUSTERLOG_RECORD_EXCEEDS_MAXSIZE")); - ErrorNames.insert(std::make_pair(5031, "ERROR_CLUSTERLOG_EXCEEDS_MAXSIZE")); - ErrorNames.insert(std::make_pair(5032, "ERROR_CLUSTERLOG_CHKPOINT_NOT_FOUND")); - ErrorNames.insert(std::make_pair(5033, "ERROR_CLUSTERLOG_NOT_ENOUGH_SPACE")); - ErrorNames.insert(std::make_pair(5034, "ERROR_QUORUM_OWNER_ALIVE")); - ErrorNames.insert(std::make_pair(5035, "ERROR_NETWORK_NOT_AVAILABLE")); - ErrorNames.insert(std::make_pair(5036, "ERROR_NODE_NOT_AVAILABLE")); - ErrorNames.insert(std::make_pair(5037, "ERROR_ALL_NODES_NOT_AVAILABLE")); - ErrorNames.insert(std::make_pair(5038, "ERROR_RESOURCE_FAILED")); - ErrorNames.insert(std::make_pair(5039, "ERROR_CLUSTER_INVALID_NODE")); - ErrorNames.insert(std::make_pair(5040, "ERROR_CLUSTER_NODE_EXISTS")); - ErrorNames.insert(std::make_pair(5041, "ERROR_CLUSTER_JOIN_IN_PROGRESS")); - ErrorNames.insert(std::make_pair(5042, "ERROR_CLUSTER_NODE_NOT_FOUND")); - ErrorNames.insert(std::make_pair(5043, "ERROR_CLUSTER_LOCAL_NODE_NOT_FOUND")); - ErrorNames.insert(std::make_pair(5044, "ERROR_CLUSTER_NETWORK_EXISTS")); - ErrorNames.insert(std::make_pair(5045, "ERROR_CLUSTER_NETWORK_NOT_FOUND")); - ErrorNames.insert(std::make_pair(5046, "ERROR_CLUSTER_NETINTERFACE_EXISTS")); - ErrorNames.insert(std::make_pair(5047, "ERROR_CLUSTER_NETINTERFACE_NOT_FOUND")); - ErrorNames.insert(std::make_pair(5048, "ERROR_CLUSTER_INVALID_REQUEST")); - ErrorNames.insert(std::make_pair(5049, "ERROR_CLUSTER_INVALID_NETWORK_PROVIDER")); - ErrorNames.insert(std::make_pair(5050, "ERROR_CLUSTER_NODE_DOWN")); - ErrorNames.insert(std::make_pair(5051, "ERROR_CLUSTER_NODE_UNREACHABLE")); - ErrorNames.insert(std::make_pair(5052, "ERROR_CLUSTER_NODE_NOT_MEMBER")); - ErrorNames.insert(std::make_pair(5053, "ERROR_CLUSTER_JOIN_NOT_IN_PROGRESS")); - ErrorNames.insert(std::make_pair(5054, "ERROR_CLUSTER_INVALID_NETWORK")); - ErrorNames.insert(std::make_pair(5056, "ERROR_CLUSTER_NODE_UP")); - ErrorNames.insert(std::make_pair(5057, "ERROR_CLUSTER_IPADDR_IN_USE")); - ErrorNames.insert(std::make_pair(5058, "ERROR_CLUSTER_NODE_NOT_PAUSED")); - ErrorNames.insert(std::make_pair(5059, "ERROR_CLUSTER_NO_SECURITY_CONTEXT")); - ErrorNames.insert(std::make_pair(5060, "ERROR_CLUSTER_NETWORK_NOT_INTERNAL")); - ErrorNames.insert(std::make_pair(5061, "ERROR_CLUSTER_NODE_ALREADY_UP")); - ErrorNames.insert(std::make_pair(5062, "ERROR_CLUSTER_NODE_ALREADY_DOWN")); - ErrorNames.insert(std::make_pair(5063, "ERROR_CLUSTER_NETWORK_ALREADY_ONLINE")); - ErrorNames.insert(std::make_pair(5064, "ERROR_CLUSTER_NETWORK_ALREADY_OFFLINE")); - ErrorNames.insert(std::make_pair(5065, "ERROR_CLUSTER_NODE_ALREADY_MEMBER")); - ErrorNames.insert(std::make_pair(5066, "ERROR_CLUSTER_LAST_INTERNAL_NETWORK")); - ErrorNames.insert(std::make_pair(5067, "ERROR_CLUSTER_NETWORK_HAS_DEPENDENTS")); - ErrorNames.insert(std::make_pair(5068, "ERROR_INVALID_OPERATION_ON_QUORUM")); - ErrorNames.insert(std::make_pair(5069, "ERROR_DEPENDENCY_NOT_ALLOWED")); - ErrorNames.insert(std::make_pair(5070, "ERROR_CLUSTER_NODE_PAUSED")); - ErrorNames.insert(std::make_pair(5071, "ERROR_NODE_CANT_HOST_RESOURCE")); - ErrorNames.insert(std::make_pair(5072, "ERROR_CLUSTER_NODE_NOT_READY")); - ErrorNames.insert(std::make_pair(5073, "ERROR_CLUSTER_NODE_SHUTTING_DOWN")); - ErrorNames.insert(std::make_pair(5074, "ERROR_CLUSTER_JOIN_ABORTED")); - ErrorNames.insert(std::make_pair(5075, "ERROR_CLUSTER_INCOMPATIBLE_VERSIONS")); - ErrorNames.insert(std::make_pair(5076, "ERROR_CLUSTER_MAXNUM_OF_RESOURCES_EXCEEDED")); - ErrorNames.insert(std::make_pair(5077, "ERROR_CLUSTER_SYSTEM_CONFIG_CHANGED")); - ErrorNames.insert(std::make_pair(5078, "ERROR_CLUSTER_RESOURCE_TYPE_NOT_FOUND")); - ErrorNames.insert(std::make_pair(5079, "ERROR_CLUSTER_RESTYPE_NOT_SUPPORTED")); - ErrorNames.insert(std::make_pair(5080, "ERROR_CLUSTER_RESNAME_NOT_FOUND")); - ErrorNames.insert(std::make_pair(5081, "ERROR_CLUSTER_NO_RPC_PACKAGES_REGISTERED")); - ErrorNames.insert(std::make_pair(5082, "ERROR_CLUSTER_OWNER_NOT_IN_PREFLIST")); - ErrorNames.insert(std::make_pair(5083, "ERROR_CLUSTER_DATABASE_SEQMISMATCH")); - ErrorNames.insert(std::make_pair(5084, "ERROR_RESMON_INVALID_STATE")); - ErrorNames.insert(std::make_pair(5085, "ERROR_CLUSTER_GUM_NOT_LOCKER")); - ErrorNames.insert(std::make_pair(5086, "ERROR_QUORUM_DISK_NOT_FOUND")); - ErrorNames.insert(std::make_pair(5087, "ERROR_DATABASE_BACKUP_CORRUPT")); - ErrorNames.insert(std::make_pair(5088, "ERROR_CLUSTER_NODE_ALREADY_HAS_DFS_ROOT")); - ErrorNames.insert(std::make_pair(5089, "ERROR_RESOURCE_PROPERTY_UNCHANGEABLE")); - ErrorNames.insert(std::make_pair(5890, "ERROR_CLUSTER_MEMBERSHIP_INVALID_STATE")); - ErrorNames.insert(std::make_pair(5891, "ERROR_CLUSTER_QUORUMLOG_NOT_FOUND")); - ErrorNames.insert(std::make_pair(5892, "ERROR_CLUSTER_MEMBERSHIP_HALT")); - ErrorNames.insert(std::make_pair(5893, "ERROR_CLUSTER_INSTANCE_ID_MISMATCH")); - ErrorNames.insert(std::make_pair(5894, "ERROR_CLUSTER_NETWORK_NOT_FOUND_FOR_IP")); - ErrorNames.insert(std::make_pair(5895, "ERROR_CLUSTER_PROPERTY_DATA_TYPE_MISMATCH")); - ErrorNames.insert(std::make_pair(5896, "ERROR_CLUSTER_EVICT_WITHOUT_CLEANUP")); - ErrorNames.insert(std::make_pair(5897, "ERROR_CLUSTER_PARAMETER_MISMATCH")); - ErrorNames.insert(std::make_pair(5898, "ERROR_NODE_CANNOT_BE_CLUSTERED")); - ErrorNames.insert(std::make_pair(5899, "ERROR_CLUSTER_WRONG_OS_VERSION")); - ErrorNames.insert(std::make_pair(5900, "ERROR_CLUSTER_CANT_CREATE_DUP_CLUSTER_NAME")); - ErrorNames.insert(std::make_pair(5901, "ERROR_CLUSCFG_ALREADY_COMMITTED")); - ErrorNames.insert(std::make_pair(5902, "ERROR_CLUSCFG_ROLLBACK_FAILED")); - ErrorNames.insert(std::make_pair(5903, "ERROR_CLUSCFG_SYSTEM_DISK_DRIVE_LETTER_CONFLICT")); - ErrorNames.insert(std::make_pair(5904, "ERROR_CLUSTER_OLD_VERSION")); - ErrorNames.insert(std::make_pair(5905, "ERROR_CLUSTER_MISMATCHED_COMPUTER_ACCT_NAME")); - ErrorNames.insert(std::make_pair(5906, "ERROR_CLUSTER_NO_NET_ADAPTERS")); - ErrorNames.insert(std::make_pair(5907, "ERROR_CLUSTER_POISONED")); - ErrorNames.insert(std::make_pair(5908, "ERROR_CLUSTER_GROUP_MOVING")); - ErrorNames.insert(std::make_pair(5909, "ERROR_CLUSTER_RESOURCE_TYPE_BUSY")); - ErrorNames.insert(std::make_pair(5910, "ERROR_RESOURCE_CALL_TIMED_OUT")); - ErrorNames.insert(std::make_pair(5911, "ERROR_INVALID_CLUSTER_IPV6_ADDRESS")); - ErrorNames.insert(std::make_pair(5912, "ERROR_CLUSTER_INTERNAL_INVALID_FUNCTION")); - ErrorNames.insert(std::make_pair(5913, "ERROR_CLUSTER_PARAMETER_OUT_OF_BOUNDS")); - ErrorNames.insert(std::make_pair(5914, "ERROR_CLUSTER_PARTIAL_SEND")); - ErrorNames.insert(std::make_pair(5915, "ERROR_CLUSTER_REGISTRY_INVALID_FUNCTION")); - ErrorNames.insert(std::make_pair(5916, "ERROR_CLUSTER_INVALID_STRING_TERMINATION")); - ErrorNames.insert(std::make_pair(5917, "ERROR_CLUSTER_INVALID_STRING_FORMAT")); - ErrorNames.insert(std::make_pair(5918, "ERROR_CLUSTER_DATABASE_TRANSACTION_IN_PROGRESS")); - ErrorNames.insert(std::make_pair(5919, "ERROR_CLUSTER_DATABASE_TRANSACTION_NOT_IN_PROGRESS")); - ErrorNames.insert(std::make_pair(5920, "ERROR_CLUSTER_NULL_DATA")); - ErrorNames.insert(std::make_pair(5921, "ERROR_CLUSTER_PARTIAL_READ")); - ErrorNames.insert(std::make_pair(5922, "ERROR_CLUSTER_PARTIAL_WRITE")); - ErrorNames.insert(std::make_pair(5923, "ERROR_CLUSTER_CANT_DESERIALIZE_DATA")); - ErrorNames.insert(std::make_pair(5924, "ERROR_DEPENDENT_RESOURCE_PROPERTY_CONFLICT")); - ErrorNames.insert(std::make_pair(5925, "ERROR_CLUSTER_NO_QUORUM")); - ErrorNames.insert(std::make_pair(5926, "ERROR_CLUSTER_INVALID_IPV6_NETWORK")); - ErrorNames.insert(std::make_pair(5927, "ERROR_CLUSTER_INVALID_IPV6_TUNNEL_NETWORK")); - ErrorNames.insert(std::make_pair(5928, "ERROR_QUORUM_NOT_ALLOWED_IN_THIS_GROUP")); - ErrorNames.insert(std::make_pair(5929, "ERROR_DEPENDENCY_TREE_TOO_COMPLEX")); - ErrorNames.insert(std::make_pair(5930, "ERROR_EXCEPTION_IN_RESOURCE_CALL")); - ErrorNames.insert(std::make_pair(5931, "ERROR_CLUSTER_RHS_FAILED_INITIALIZATION")); - ErrorNames.insert(std::make_pair(5932, "ERROR_CLUSTER_NOT_INSTALLED")); - ErrorNames.insert(std::make_pair(5933, "ERROR_CLUSTER_RESOURCES_MUST_BE_ONLINE_ON_THE_SAME_NODE")); - ErrorNames.insert(std::make_pair(5934, "ERROR_CLUSTER_MAX_NODES_IN_CLUSTER")); - ErrorNames.insert(std::make_pair(5935, "ERROR_CLUSTER_TOO_MANY_NODES")); - ErrorNames.insert(std::make_pair(5936, "ERROR_CLUSTER_OBJECT_ALREADY_USED")); - ErrorNames.insert(std::make_pair(5937, "ERROR_NONCORE_GROUPS_FOUND")); - ErrorNames.insert(std::make_pair(5938, "ERROR_FILE_SHARE_RESOURCE_CONFLICT")); - ErrorNames.insert(std::make_pair(5939, "ERROR_CLUSTER_EVICT_INVALID_REQUEST")); - ErrorNames.insert(std::make_pair(5940, "ERROR_CLUSTER_SINGLETON_RESOURCE")); - ErrorNames.insert(std::make_pair(5941, "ERROR_CLUSTER_GROUP_SINGLETON_RESOURCE")); - ErrorNames.insert(std::make_pair(5942, "ERROR_CLUSTER_RESOURCE_PROVIDER_FAILED")); - ErrorNames.insert(std::make_pair(5943, "ERROR_CLUSTER_RESOURCE_CONFIGURATION_ERROR")); - ErrorNames.insert(std::make_pair(5944, "ERROR_CLUSTER_GROUP_BUSY")); - ErrorNames.insert(std::make_pair(5945, "ERROR_CLUSTER_NOT_SHARED_VOLUME")); - ErrorNames.insert(std::make_pair(5946, "ERROR_CLUSTER_INVALID_SECURITY_DESCRIPTOR")); - ErrorNames.insert(std::make_pair(5947, "ERROR_CLUSTER_SHARED_VOLUMES_IN_USE")); - ErrorNames.insert(std::make_pair(5948, "ERROR_CLUSTER_USE_SHARED_VOLUMES_API")); - ErrorNames.insert(std::make_pair(5949, "ERROR_CLUSTER_BACKUP_IN_PROGRESS")); - ErrorNames.insert(std::make_pair(5950, "ERROR_NON_CSV_PATH")); - ErrorNames.insert(std::make_pair(5951, "ERROR_CSV_VOLUME_NOT_LOCAL")); - ErrorNames.insert(std::make_pair(5952, "ERROR_CLUSTER_WATCHDOG_TERMINATING")); - ErrorNames.insert(std::make_pair(6000, "ERROR_ENCRYPTION_FAILED")); - ErrorNames.insert(std::make_pair(6001, "ERROR_DECRYPTION_FAILED")); - ErrorNames.insert(std::make_pair(6002, "ERROR_FILE_ENCRYPTED")); - ErrorNames.insert(std::make_pair(6003, "ERROR_NO_RECOVERY_POLICY")); - ErrorNames.insert(std::make_pair(6004, "ERROR_NO_EFS")); - ErrorNames.insert(std::make_pair(6005, "ERROR_WRONG_EFS")); - ErrorNames.insert(std::make_pair(6006, "ERROR_NO_USER_KEYS")); - ErrorNames.insert(std::make_pair(6007, "ERROR_FILE_NOT_ENCRYPTED")); - ErrorNames.insert(std::make_pair(6008, "ERROR_NOT_EXPORT_FORMAT")); - ErrorNames.insert(std::make_pair(6009, "ERROR_FILE_READ_ONLY")); - ErrorNames.insert(std::make_pair(6010, "ERROR_DIR_EFS_DISALLOWED")); - ErrorNames.insert(std::make_pair(6011, "ERROR_EFS_SERVER_NOT_TRUSTED")); - ErrorNames.insert(std::make_pair(6012, "ERROR_BAD_RECOVERY_POLICY")); - ErrorNames.insert(std::make_pair(6013, "ERROR_EFS_ALG_BLOB_TOO_BIG")); - ErrorNames.insert(std::make_pair(6014, "ERROR_VOLUME_NOT_SUPPORT_EFS")); - ErrorNames.insert(std::make_pair(6015, "ERROR_EFS_DISABLED")); - ErrorNames.insert(std::make_pair(6016, "ERROR_EFS_VERSION_NOT_SUPPORT")); - ErrorNames.insert(std::make_pair(6017, "ERROR_CS_ENCRYPTION_INVALID_SERVER_RESPONSE")); - ErrorNames.insert(std::make_pair(6018, "ERROR_CS_ENCRYPTION_UNSUPPORTED_SERVER")); - ErrorNames.insert(std::make_pair(6019, "ERROR_CS_ENCRYPTION_EXISTING_ENCRYPTED_FILE")); - ErrorNames.insert(std::make_pair(6020, "ERROR_CS_ENCRYPTION_NEW_ENCRYPTED_FILE")); - ErrorNames.insert(std::make_pair(6021, "ERROR_CS_ENCRYPTION_FILE_NOT_CSE")); - ErrorNames.insert(std::make_pair(6022, "ERROR_ENCRYPTION_POLICY_DENIES_OPERATION")); - ErrorNames.insert(std::make_pair(6118, "ERROR_NO_BROWSER_SERVERS_FOUND")); - ErrorNames.insert(std::make_pair(6600, "ERROR_LOG_SECTOR_INVALID")); - ErrorNames.insert(std::make_pair(6601, "ERROR_LOG_SECTOR_PARITY_INVALID")); - ErrorNames.insert(std::make_pair(6602, "ERROR_LOG_SECTOR_REMAPPED")); - ErrorNames.insert(std::make_pair(6603, "ERROR_LOG_BLOCK_INCOMPLETE")); - ErrorNames.insert(std::make_pair(6604, "ERROR_LOG_INVALID_RANGE")); - ErrorNames.insert(std::make_pair(6605, "ERROR_LOG_BLOCKS_EXHAUSTED")); - ErrorNames.insert(std::make_pair(6606, "ERROR_LOG_READ_CONTEXT_INVALID")); - ErrorNames.insert(std::make_pair(6607, "ERROR_LOG_RESTART_INVALID")); - ErrorNames.insert(std::make_pair(6608, "ERROR_LOG_BLOCK_VERSION")); - ErrorNames.insert(std::make_pair(6609, "ERROR_LOG_BLOCK_INVALID")); - ErrorNames.insert(std::make_pair(6610, "ERROR_LOG_READ_MODE_INVALID")); - ErrorNames.insert(std::make_pair(6611, "ERROR_LOG_NO_RESTART")); - ErrorNames.insert(std::make_pair(6612, "ERROR_LOG_METADATA_CORRUPT")); - ErrorNames.insert(std::make_pair(6613, "ERROR_LOG_METADATA_INVALID")); - ErrorNames.insert(std::make_pair(6614, "ERROR_LOG_METADATA_INCONSISTENT")); - ErrorNames.insert(std::make_pair(6615, "ERROR_LOG_RESERVATION_INVALID")); - ErrorNames.insert(std::make_pair(6616, "ERROR_LOG_CANT_DELETE")); - ErrorNames.insert(std::make_pair(6617, "ERROR_LOG_CONTAINER_LIMIT_EXCEEDED")); - ErrorNames.insert(std::make_pair(6618, "ERROR_LOG_START_OF_LOG")); - ErrorNames.insert(std::make_pair(6619, "ERROR_LOG_POLICY_ALREADY_INSTALLED")); - ErrorNames.insert(std::make_pair(6620, "ERROR_LOG_POLICY_NOT_INSTALLED")); - ErrorNames.insert(std::make_pair(6621, "ERROR_LOG_POLICY_INVALID")); - ErrorNames.insert(std::make_pair(6622, "ERROR_LOG_POLICY_CONFLICT")); - ErrorNames.insert(std::make_pair(6623, "ERROR_LOG_PINNED_ARCHIVE_TAIL")); - ErrorNames.insert(std::make_pair(6624, "ERROR_LOG_RECORD_NONEXISTENT")); - ErrorNames.insert(std::make_pair(6625, "ERROR_LOG_RECORDS_RESERVED_INVALID")); - ErrorNames.insert(std::make_pair(6626, "ERROR_LOG_SPACE_RESERVED_INVALID")); - ErrorNames.insert(std::make_pair(6627, "ERROR_LOG_TAIL_INVALID")); - ErrorNames.insert(std::make_pair(6628, "ERROR_LOG_FULL")); - ErrorNames.insert(std::make_pair(6629, "ERROR_COULD_NOT_RESIZE_LOG")); - ErrorNames.insert(std::make_pair(6630, "ERROR_LOG_MULTIPLEXED")); - ErrorNames.insert(std::make_pair(6631, "ERROR_LOG_DEDICATED")); - ErrorNames.insert(std::make_pair(6632, "ERROR_LOG_ARCHIVE_NOT_IN_PROGRESS")); - ErrorNames.insert(std::make_pair(6633, "ERROR_LOG_ARCHIVE_IN_PROGRESS")); - ErrorNames.insert(std::make_pair(6634, "ERROR_LOG_EPHEMERAL")); - ErrorNames.insert(std::make_pair(6635, "ERROR_LOG_NOT_ENOUGH_CONTAINERS")); - ErrorNames.insert(std::make_pair(6636, "ERROR_LOG_CLIENT_ALREADY_REGISTERED")); - ErrorNames.insert(std::make_pair(6637, "ERROR_LOG_CLIENT_NOT_REGISTERED")); - ErrorNames.insert(std::make_pair(6638, "ERROR_LOG_FULL_HANDLER_IN_PROGRESS")); - ErrorNames.insert(std::make_pair(6639, "ERROR_LOG_CONTAINER_READ_FAILED")); - ErrorNames.insert(std::make_pair(6640, "ERROR_LOG_CONTAINER_WRITE_FAILED")); - ErrorNames.insert(std::make_pair(6641, "ERROR_LOG_CONTAINER_OPEN_FAILED")); - ErrorNames.insert(std::make_pair(6642, "ERROR_LOG_CONTAINER_STATE_INVALID")); - ErrorNames.insert(std::make_pair(6643, "ERROR_LOG_STATE_INVALID")); - ErrorNames.insert(std::make_pair(6644, "ERROR_LOG_PINNED")); - ErrorNames.insert(std::make_pair(6645, "ERROR_LOG_METADATA_FLUSH_FAILED")); - ErrorNames.insert(std::make_pair(6646, "ERROR_LOG_INCONSISTENT_SECURITY")); - ErrorNames.insert(std::make_pair(6647, "ERROR_LOG_APPENDED_FLUSH_FAILED")); - ErrorNames.insert(std::make_pair(6648, "ERROR_LOG_PINNED_RESERVATION")); - ErrorNames.insert(std::make_pair(6700, "ERROR_INVALID_TRANSACTION")); - ErrorNames.insert(std::make_pair(6701, "ERROR_TRANSACTION_NOT_ACTIVE")); - ErrorNames.insert(std::make_pair(6702, "ERROR_TRANSACTION_REQUEST_NOT_VALID")); - ErrorNames.insert(std::make_pair(6703, "ERROR_TRANSACTION_NOT_REQUESTED")); - ErrorNames.insert(std::make_pair(6704, "ERROR_TRANSACTION_ALREADY_ABORTED")); - ErrorNames.insert(std::make_pair(6705, "ERROR_TRANSACTION_ALREADY_COMMITTED")); - ErrorNames.insert(std::make_pair(6706, "ERROR_TM_INITIALIZATION_FAILED")); - ErrorNames.insert(std::make_pair(6707, "ERROR_RESOURCEMANAGER_READ_ONLY")); - ErrorNames.insert(std::make_pair(6708, "ERROR_TRANSACTION_NOT_JOINED")); - ErrorNames.insert(std::make_pair(6709, "ERROR_TRANSACTION_SUPERIOR_EXISTS")); - ErrorNames.insert(std::make_pair(6710, "ERROR_CRM_PROTOCOL_ALREADY_EXISTS")); - ErrorNames.insert(std::make_pair(6711, "ERROR_TRANSACTION_PROPAGATION_FAILED")); - ErrorNames.insert(std::make_pair(6712, "ERROR_CRM_PROTOCOL_NOT_FOUND")); - ErrorNames.insert(std::make_pair(6713, "ERROR_TRANSACTION_INVALID_MARSHALL_BUFFER")); - ErrorNames.insert(std::make_pair(6714, "ERROR_CURRENT_TRANSACTION_NOT_VALID")); - ErrorNames.insert(std::make_pair(6715, "ERROR_TRANSACTION_NOT_FOUND")); - ErrorNames.insert(std::make_pair(6716, "ERROR_RESOURCEMANAGER_NOT_FOUND")); - ErrorNames.insert(std::make_pair(6717, "ERROR_ENLISTMENT_NOT_FOUND")); - ErrorNames.insert(std::make_pair(6718, "ERROR_TRANSACTIONMANAGER_NOT_FOUND")); - ErrorNames.insert(std::make_pair(6719, "ERROR_TRANSACTIONMANAGER_NOT_ONLINE")); - ErrorNames.insert(std::make_pair(6720, "ERROR_TRANSACTIONMANAGER_RECOVERY_NAME_COLLISION")); - ErrorNames.insert(std::make_pair(6721, "ERROR_TRANSACTION_NOT_ROOT")); - ErrorNames.insert(std::make_pair(6722, "ERROR_TRANSACTION_OBJECT_EXPIRED")); - ErrorNames.insert(std::make_pair(6723, "ERROR_TRANSACTION_RESPONSE_NOT_ENLISTED")); - ErrorNames.insert(std::make_pair(6724, "ERROR_TRANSACTION_RECORD_TOO_LONG")); - ErrorNames.insert(std::make_pair(6725, "ERROR_IMPLICIT_TRANSACTION_NOT_SUPPORTED")); - ErrorNames.insert(std::make_pair(6726, "ERROR_TRANSACTION_INTEGRITY_VIOLATED")); - ErrorNames.insert(std::make_pair(6727, "ERROR_TRANSACTIONMANAGER_IDENTITY_MISMATCH")); - ErrorNames.insert(std::make_pair(6728, "ERROR_RM_CANNOT_BE_FROZEN_FOR_SNAPSHOT")); - ErrorNames.insert(std::make_pair(6729, "ERROR_TRANSACTION_MUST_WRITETHROUGH")); - ErrorNames.insert(std::make_pair(6730, "ERROR_TRANSACTION_NO_SUPERIOR")); - ErrorNames.insert(std::make_pair(6731, "ERROR_HEURISTIC_DAMAGE_POSSIBLE")); - ErrorNames.insert(std::make_pair(6800, "ERROR_TRANSACTIONAL_CONFLICT")); - ErrorNames.insert(std::make_pair(6801, "ERROR_RM_NOT_ACTIVE")); - ErrorNames.insert(std::make_pair(6802, "ERROR_RM_METADATA_CORRUPT")); - ErrorNames.insert(std::make_pair(6803, "ERROR_DIRECTORY_NOT_RM")); - ErrorNames.insert(std::make_pair(6805, "ERROR_TRANSACTIONS_UNSUPPORTED_REMOTE")); - ErrorNames.insert(std::make_pair(6806, "ERROR_LOG_RESIZE_INVALID_SIZE")); - ErrorNames.insert(std::make_pair(6807, "ERROR_OBJECT_NO_LONGER_EXISTS")); - ErrorNames.insert(std::make_pair(6808, "ERROR_STREAM_MINIVERSION_NOT_FOUND")); - ErrorNames.insert(std::make_pair(6809, "ERROR_STREAM_MINIVERSION_NOT_VALID")); - ErrorNames.insert(std::make_pair(6810, "ERROR_MINIVERSION_INACCESSIBLE_FROM_SPECIFIED_TRANSACTION")); - ErrorNames.insert(std::make_pair(6811, "ERROR_CANT_OPEN_MINIVERSION_WITH_MODIFY_INTENT")); - ErrorNames.insert(std::make_pair(6812, "ERROR_CANT_CREATE_MORE_STREAM_MINIVERSIONS")); - ErrorNames.insert(std::make_pair(6814, "ERROR_REMOTE_FILE_VERSION_MISMATCH")); - ErrorNames.insert(std::make_pair(6815, "ERROR_HANDLE_NO_LONGER_VALID")); - ErrorNames.insert(std::make_pair(6816, "ERROR_NO_TXF_METADATA")); - ErrorNames.insert(std::make_pair(6817, "ERROR_LOG_CORRUPTION_DETECTED")); - ErrorNames.insert(std::make_pair(6818, "ERROR_CANT_RECOVER_WITH_HANDLE_OPEN")); - ErrorNames.insert(std::make_pair(6819, "ERROR_RM_DISCONNECTED")); - ErrorNames.insert(std::make_pair(6820, "ERROR_ENLISTMENT_NOT_SUPERIOR")); - ErrorNames.insert(std::make_pair(6821, "ERROR_RECOVERY_NOT_NEEDED")); - ErrorNames.insert(std::make_pair(6822, "ERROR_RM_ALREADY_STARTED")); - ErrorNames.insert(std::make_pair(6823, "ERROR_FILE_IDENTITY_NOT_PERSISTENT")); - ErrorNames.insert(std::make_pair(6824, "ERROR_CANT_BREAK_TRANSACTIONAL_DEPENDENCY")); - ErrorNames.insert(std::make_pair(6825, "ERROR_CANT_CROSS_RM_BOUNDARY")); - ErrorNames.insert(std::make_pair(6826, "ERROR_TXF_DIR_NOT_EMPTY")); - ErrorNames.insert(std::make_pair(6827, "ERROR_INDOUBT_TRANSACTIONS_EXIST")); - ErrorNames.insert(std::make_pair(6828, "ERROR_TM_VOLATILE")); - ErrorNames.insert(std::make_pair(6829, "ERROR_ROLLBACK_TIMER_EXPIRED")); - ErrorNames.insert(std::make_pair(6830, "ERROR_TXF_ATTRIBUTE_CORRUPT")); - ErrorNames.insert(std::make_pair(6831, "ERROR_EFS_NOT_ALLOWED_IN_TRANSACTION")); - ErrorNames.insert(std::make_pair(6832, "ERROR_TRANSACTIONAL_OPEN_NOT_ALLOWED")); - ErrorNames.insert(std::make_pair(6833, "ERROR_LOG_GROWTH_FAILED")); - ErrorNames.insert(std::make_pair(6834, "ERROR_TRANSACTED_MAPPING_UNSUPPORTED_REMOTE")); - ErrorNames.insert(std::make_pair(6835, "ERROR_TXF_METADATA_ALREADY_PRESENT")); - ErrorNames.insert(std::make_pair(6836, "ERROR_TRANSACTION_SCOPE_CALLBACKS_NOT_SET")); - ErrorNames.insert(std::make_pair(6837, "ERROR_TRANSACTION_REQUIRED_PROMOTION")); - ErrorNames.insert(std::make_pair(6838, "ERROR_CANNOT_EXECUTE_FILE_IN_TRANSACTION")); - ErrorNames.insert(std::make_pair(6839, "ERROR_TRANSACTIONS_NOT_FROZEN")); - ErrorNames.insert(std::make_pair(6840, "ERROR_TRANSACTION_FREEZE_IN_PROGRESS")); - ErrorNames.insert(std::make_pair(6841, "ERROR_NOT_SNAPSHOT_VOLUME")); - ErrorNames.insert(std::make_pair(6842, "ERROR_NO_SAVEPOINT_WITH_OPEN_FILES")); - ErrorNames.insert(std::make_pair(6843, "ERROR_DATA_LOST_REPAIR")); - ErrorNames.insert(std::make_pair(6844, "ERROR_SPARSE_NOT_ALLOWED_IN_TRANSACTION")); - ErrorNames.insert(std::make_pair(6845, "ERROR_TM_IDENTITY_MISMATCH")); - ErrorNames.insert(std::make_pair(6846, "ERROR_FLOATED_SECTION")); - ErrorNames.insert(std::make_pair(6847, "ERROR_CANNOT_ACCEPT_TRANSACTED_WORK")); - ErrorNames.insert(std::make_pair(6848, "ERROR_CANNOT_ABORT_TRANSACTIONS")); - ErrorNames.insert(std::make_pair(6849, "ERROR_BAD_CLUSTERS")); - ErrorNames.insert(std::make_pair(6850, "ERROR_COMPRESSION_NOT_ALLOWED_IN_TRANSACTION")); - ErrorNames.insert(std::make_pair(6851, "ERROR_VOLUME_DIRTY")); - ErrorNames.insert(std::make_pair(6852, "ERROR_NO_LINK_TRACKING_IN_TRANSACTION")); - ErrorNames.insert(std::make_pair(6853, "ERROR_OPERATION_NOT_SUPPORTED_IN_TRANSACTION")); - ErrorNames.insert(std::make_pair(6854, "ERROR_EXPIRED_HANDLE")); - ErrorNames.insert(std::make_pair(6855, "ERROR_TRANSACTION_NOT_ENLISTED")); - ErrorNames.insert(std::make_pair(7001, "ERROR_CTX_WINSTATION_NAME_INVALID")); - ErrorNames.insert(std::make_pair(7002, "ERROR_CTX_INVALID_PD")); - ErrorNames.insert(std::make_pair(7003, "ERROR_CTX_PD_NOT_FOUND")); - ErrorNames.insert(std::make_pair(7004, "ERROR_CTX_WD_NOT_FOUND")); - ErrorNames.insert(std::make_pair(7005, "ERROR_CTX_CANNOT_MAKE_EVENTLOG_ENTRY")); - ErrorNames.insert(std::make_pair(7006, "ERROR_CTX_SERVICE_NAME_COLLISION")); - ErrorNames.insert(std::make_pair(7007, "ERROR_CTX_CLOSE_PENDING")); - ErrorNames.insert(std::make_pair(7008, "ERROR_CTX_NO_OUTBUF")); - ErrorNames.insert(std::make_pair(7009, "ERROR_CTX_MODEM_INF_NOT_FOUND")); - ErrorNames.insert(std::make_pair(7010, "ERROR_CTX_INVALID_MODEMNAME")); - ErrorNames.insert(std::make_pair(7011, "ERROR_CTX_MODEM_RESPONSE_ERROR")); - ErrorNames.insert(std::make_pair(7012, "ERROR_CTX_MODEM_RESPONSE_TIMEOUT")); - ErrorNames.insert(std::make_pair(7013, "ERROR_CTX_MODEM_RESPONSE_NO_CARRIER")); - ErrorNames.insert(std::make_pair(7014, "ERROR_CTX_MODEM_RESPONSE_NO_DIALTONE")); - ErrorNames.insert(std::make_pair(7015, "ERROR_CTX_MODEM_RESPONSE_BUSY")); - ErrorNames.insert(std::make_pair(7016, "ERROR_CTX_MODEM_RESPONSE_VOICE")); - ErrorNames.insert(std::make_pair(7017, "ERROR_CTX_TD_ERROR")); - ErrorNames.insert(std::make_pair(7022, "ERROR_CTX_WINSTATION_NOT_FOUND")); - ErrorNames.insert(std::make_pair(7023, "ERROR_CTX_WINSTATION_ALREADY_EXISTS")); - ErrorNames.insert(std::make_pair(7024, "ERROR_CTX_WINSTATION_BUSY")); - ErrorNames.insert(std::make_pair(7025, "ERROR_CTX_BAD_VIDEO_MODE")); - ErrorNames.insert(std::make_pair(7035, "ERROR_CTX_GRAPHICS_INVALID")); - ErrorNames.insert(std::make_pair(7037, "ERROR_CTX_LOGON_DISABLED")); - ErrorNames.insert(std::make_pair(7038, "ERROR_CTX_NOT_CONSOLE")); - ErrorNames.insert(std::make_pair(7040, "ERROR_CTX_CLIENT_QUERY_TIMEOUT")); - ErrorNames.insert(std::make_pair(7041, "ERROR_CTX_CONSOLE_DISCONNECT")); - ErrorNames.insert(std::make_pair(7042, "ERROR_CTX_CONSOLE_CONNECT")); - ErrorNames.insert(std::make_pair(7044, "ERROR_CTX_SHADOW_DENIED")); - ErrorNames.insert(std::make_pair(7045, "ERROR_CTX_WINSTATION_ACCESS_DENIED")); - ErrorNames.insert(std::make_pair(7049, "ERROR_CTX_INVALID_WD")); - ErrorNames.insert(std::make_pair(7050, "ERROR_CTX_SHADOW_INVALID")); - ErrorNames.insert(std::make_pair(7051, "ERROR_CTX_SHADOW_DISABLED")); - ErrorNames.insert(std::make_pair(7052, "ERROR_CTX_CLIENT_LICENSE_IN_USE")); - ErrorNames.insert(std::make_pair(7053, "ERROR_CTX_CLIENT_LICENSE_NOT_SET")); - ErrorNames.insert(std::make_pair(7054, "ERROR_CTX_LICENSE_NOT_AVAILABLE")); - ErrorNames.insert(std::make_pair(7055, "ERROR_CTX_LICENSE_CLIENT_INVALID")); - ErrorNames.insert(std::make_pair(7056, "ERROR_CTX_LICENSE_EXPIRED")); - ErrorNames.insert(std::make_pair(7057, "ERROR_CTX_SHADOW_NOT_RUNNING")); - ErrorNames.insert(std::make_pair(7058, "ERROR_CTX_SHADOW_ENDED_BY_MODE_CHANGE")); - ErrorNames.insert(std::make_pair(7059, "ERROR_ACTIVATION_COUNT_EXCEEDED")); - ErrorNames.insert(std::make_pair(7060, "ERROR_CTX_WINSTATIONS_DISABLED")); - ErrorNames.insert(std::make_pair(7061, "ERROR_CTX_ENCRYPTION_LEVEL_REQUIRED")); - ErrorNames.insert(std::make_pair(7062, "ERROR_CTX_SESSION_IN_USE")); - ErrorNames.insert(std::make_pair(7063, "ERROR_CTX_NO_FORCE_LOGOFF")); - ErrorNames.insert(std::make_pair(7064, "ERROR_CTX_ACCOUNT_RESTRICTION")); - ErrorNames.insert(std::make_pair(7065, "ERROR_RDP_PROTOCOL_ERROR")); - ErrorNames.insert(std::make_pair(7066, "ERROR_CTX_CDM_CONNECT")); - ErrorNames.insert(std::make_pair(7067, "ERROR_CTX_CDM_DISCONNECT")); - ErrorNames.insert(std::make_pair(7068, "ERROR_CTX_SECURITY_LAYER_ERROR")); - ErrorNames.insert(std::make_pair(7069, "ERROR_TS_INCOMPATIBLE_SESSIONS")); - ErrorNames.insert(std::make_pair(7070, "ERROR_TS_VIDEO_SUBSYSTEM_ERROR")); - ErrorNames.insert(std::make_pair(8200, "ERROR_DS_NOT_INSTALLED")); - ErrorNames.insert(std::make_pair(8201, "ERROR_DS_MEMBERSHIP_EVALUATED_LOCALLY")); - ErrorNames.insert(std::make_pair(8202, "ERROR_DS_NO_ATTRIBUTE_OR_VALUE")); - ErrorNames.insert(std::make_pair(8203, "ERROR_DS_INVALID_ATTRIBUTE_SYNTAX")); - ErrorNames.insert(std::make_pair(8204, "ERROR_DS_ATTRIBUTE_TYPE_UNDEFINED")); - ErrorNames.insert(std::make_pair(8205, "ERROR_DS_ATTRIBUTE_OR_VALUE_EXISTS")); - ErrorNames.insert(std::make_pair(8206, "ERROR_DS_BUSY")); - ErrorNames.insert(std::make_pair(8207, "ERROR_DS_UNAVAILABLE")); - ErrorNames.insert(std::make_pair(8208, "ERROR_DS_NO_RIDS_ALLOCATED")); - ErrorNames.insert(std::make_pair(8209, "ERROR_DS_NO_MORE_RIDS")); - ErrorNames.insert(std::make_pair(8210, "ERROR_DS_INCORRECT_ROLE_OWNER")); - ErrorNames.insert(std::make_pair(8211, "ERROR_DS_RIDMGR_INIT_ERROR")); - ErrorNames.insert(std::make_pair(8212, "ERROR_DS_OBJ_CLASS_VIOLATION")); - ErrorNames.insert(std::make_pair(8213, "ERROR_DS_CANT_ON_NON_LEAF")); - ErrorNames.insert(std::make_pair(8214, "ERROR_DS_CANT_ON_RDN")); - ErrorNames.insert(std::make_pair(8215, "ERROR_DS_CANT_MOD_OBJ_CLASS")); - ErrorNames.insert(std::make_pair(8216, "ERROR_DS_CROSS_DOM_MOVE_ERROR")); - ErrorNames.insert(std::make_pair(8217, "ERROR_DS_GC_NOT_AVAILABLE")); - ErrorNames.insert(std::make_pair(8218, "ERROR_SHARED_POLICY")); - ErrorNames.insert(std::make_pair(8219, "ERROR_POLICY_OBJECT_NOT_FOUND")); - ErrorNames.insert(std::make_pair(8220, "ERROR_POLICY_ONLY_IN_DS")); - ErrorNames.insert(std::make_pair(8221, "ERROR_PROMOTION_ACTIVE")); - ErrorNames.insert(std::make_pair(8222, "ERROR_NO_PROMOTION_ACTIVE")); - ErrorNames.insert(std::make_pair(8224, "ERROR_DS_OPERATIONS_ERROR")); - ErrorNames.insert(std::make_pair(8225, "ERROR_DS_PROTOCOL_ERROR")); - ErrorNames.insert(std::make_pair(8226, "ERROR_DS_TIMELIMIT_EXCEEDED")); - ErrorNames.insert(std::make_pair(8227, "ERROR_DS_SIZELIMIT_EXCEEDED")); - ErrorNames.insert(std::make_pair(8228, "ERROR_DS_ADMIN_LIMIT_EXCEEDED")); - ErrorNames.insert(std::make_pair(8229, "ERROR_DS_COMPARE_FALSE")); - ErrorNames.insert(std::make_pair(8230, "ERROR_DS_COMPARE_TRUE")); - ErrorNames.insert(std::make_pair(8231, "ERROR_DS_AUTH_METHOD_NOT_SUPPORTED")); - ErrorNames.insert(std::make_pair(8232, "ERROR_DS_STRONG_AUTH_REQUIRED")); - ErrorNames.insert(std::make_pair(8233, "ERROR_DS_INAPPROPRIATE_AUTH")); - ErrorNames.insert(std::make_pair(8234, "ERROR_DS_AUTH_UNKNOWN")); - ErrorNames.insert(std::make_pair(8235, "ERROR_DS_REFERRAL")); - ErrorNames.insert(std::make_pair(8236, "ERROR_DS_UNAVAILABLE_CRIT_EXTENSION")); - ErrorNames.insert(std::make_pair(8237, "ERROR_DS_CONFIDENTIALITY_REQUIRED")); - ErrorNames.insert(std::make_pair(8238, "ERROR_DS_INAPPROPRIATE_MATCHING")); - ErrorNames.insert(std::make_pair(8239, "ERROR_DS_CONSTRAINT_VIOLATION")); - ErrorNames.insert(std::make_pair(8240, "ERROR_DS_NO_SUCH_OBJECT")); - ErrorNames.insert(std::make_pair(8241, "ERROR_DS_ALIAS_PROBLEM")); - ErrorNames.insert(std::make_pair(8242, "ERROR_DS_INVALID_DN_SYNTAX")); - ErrorNames.insert(std::make_pair(8243, "ERROR_DS_IS_LEAF")); - ErrorNames.insert(std::make_pair(8244, "ERROR_DS_ALIAS_DEREF_PROBLEM")); - ErrorNames.insert(std::make_pair(8245, "ERROR_DS_UNWILLING_TO_PERFORM")); - ErrorNames.insert(std::make_pair(8246, "ERROR_DS_LOOP_DETECT")); - ErrorNames.insert(std::make_pair(8247, "ERROR_DS_NAMING_VIOLATION")); - ErrorNames.insert(std::make_pair(8248, "ERROR_DS_OBJECT_RESULTS_TOO_LARGE")); - ErrorNames.insert(std::make_pair(8249, "ERROR_DS_AFFECTS_MULTIPLE_DSAS")); - ErrorNames.insert(std::make_pair(8250, "ERROR_DS_SERVER_DOWN")); - ErrorNames.insert(std::make_pair(8251, "ERROR_DS_LOCAL_ERROR")); - ErrorNames.insert(std::make_pair(8252, "ERROR_DS_ENCODING_ERROR")); - ErrorNames.insert(std::make_pair(8253, "ERROR_DS_DECODING_ERROR")); - ErrorNames.insert(std::make_pair(8254, "ERROR_DS_FILTER_UNKNOWN")); - ErrorNames.insert(std::make_pair(8255, "ERROR_DS_PARAM_ERROR")); - ErrorNames.insert(std::make_pair(8256, "ERROR_DS_NOT_SUPPORTED")); - ErrorNames.insert(std::make_pair(8257, "ERROR_DS_NO_RESULTS_RETURNED")); - ErrorNames.insert(std::make_pair(8258, "ERROR_DS_CONTROL_NOT_FOUND")); - ErrorNames.insert(std::make_pair(8259, "ERROR_DS_CLIENT_LOOP")); - ErrorNames.insert(std::make_pair(8260, "ERROR_DS_REFERRAL_LIMIT_EXCEEDED")); - ErrorNames.insert(std::make_pair(8261, "ERROR_DS_SORT_CONTROL_MISSING")); - ErrorNames.insert(std::make_pair(8262, "ERROR_DS_OFFSET_RANGE_ERROR")); - ErrorNames.insert(std::make_pair(8301, "ERROR_DS_ROOT_MUST_BE_NC")); - ErrorNames.insert(std::make_pair(8302, "ERROR_DS_ADD_REPLICA_INHIBITED")); - ErrorNames.insert(std::make_pair(8303, "ERROR_DS_ATT_NOT_DEF_IN_SCHEMA")); - ErrorNames.insert(std::make_pair(8304, "ERROR_DS_MAX_OBJ_SIZE_EXCEEDED")); - ErrorNames.insert(std::make_pair(8305, "ERROR_DS_OBJ_STRING_NAME_EXISTS")); - ErrorNames.insert(std::make_pair(8306, "ERROR_DS_NO_RDN_DEFINED_IN_SCHEMA")); - ErrorNames.insert(std::make_pair(8307, "ERROR_DS_RDN_DOESNT_MATCH_SCHEMA")); - ErrorNames.insert(std::make_pair(8308, "ERROR_DS_NO_REQUESTED_ATTS_FOUND")); - ErrorNames.insert(std::make_pair(8309, "ERROR_DS_USER_BUFFER_TO_SMALL")); - ErrorNames.insert(std::make_pair(8310, "ERROR_DS_ATT_IS_NOT_ON_OBJ")); - ErrorNames.insert(std::make_pair(8311, "ERROR_DS_ILLEGAL_MOD_OPERATION")); - ErrorNames.insert(std::make_pair(8312, "ERROR_DS_OBJ_TOO_LARGE")); - ErrorNames.insert(std::make_pair(8313, "ERROR_DS_BAD_INSTANCE_TYPE")); - ErrorNames.insert(std::make_pair(8314, "ERROR_DS_MASTERDSA_REQUIRED")); - ErrorNames.insert(std::make_pair(8315, "ERROR_DS_OBJECT_CLASS_REQUIRED")); - ErrorNames.insert(std::make_pair(8316, "ERROR_DS_MISSING_REQUIRED_ATT")); - ErrorNames.insert(std::make_pair(8317, "ERROR_DS_ATT_NOT_DEF_FOR_CLASS")); - ErrorNames.insert(std::make_pair(8318, "ERROR_DS_ATT_ALREADY_EXISTS")); - ErrorNames.insert(std::make_pair(8320, "ERROR_DS_CANT_ADD_ATT_VALUES")); - ErrorNames.insert(std::make_pair(8321, "ERROR_DS_SINGLE_VALUE_CONSTRAINT")); - ErrorNames.insert(std::make_pair(8322, "ERROR_DS_RANGE_CONSTRAINT")); - ErrorNames.insert(std::make_pair(8323, "ERROR_DS_ATT_VAL_ALREADY_EXISTS")); - ErrorNames.insert(std::make_pair(8324, "ERROR_DS_CANT_REM_MISSING_ATT")); - ErrorNames.insert(std::make_pair(8325, "ERROR_DS_CANT_REM_MISSING_ATT_VAL")); - ErrorNames.insert(std::make_pair(8326, "ERROR_DS_ROOT_CANT_BE_SUBREF")); - ErrorNames.insert(std::make_pair(8327, "ERROR_DS_NO_CHAINING")); - ErrorNames.insert(std::make_pair(8328, "ERROR_DS_NO_CHAINED_EVAL")); - ErrorNames.insert(std::make_pair(8329, "ERROR_DS_NO_PARENT_OBJECT")); - ErrorNames.insert(std::make_pair(8330, "ERROR_DS_PARENT_IS_AN_ALIAS")); - ErrorNames.insert(std::make_pair(8331, "ERROR_DS_CANT_MIX_MASTER_AND_REPS")); - ErrorNames.insert(std::make_pair(8332, "ERROR_DS_CHILDREN_EXIST")); - ErrorNames.insert(std::make_pair(8333, "ERROR_DS_OBJ_NOT_FOUND")); - ErrorNames.insert(std::make_pair(8334, "ERROR_DS_ALIASED_OBJ_MISSING")); - ErrorNames.insert(std::make_pair(8335, "ERROR_DS_BAD_NAME_SYNTAX")); - ErrorNames.insert(std::make_pair(8336, "ERROR_DS_ALIAS_POINTS_TO_ALIAS")); - ErrorNames.insert(std::make_pair(8337, "ERROR_DS_CANT_DEREF_ALIAS")); - ErrorNames.insert(std::make_pair(8338, "ERROR_DS_OUT_OF_SCOPE")); - ErrorNames.insert(std::make_pair(8339, "ERROR_DS_OBJECT_BEING_REMOVED")); - ErrorNames.insert(std::make_pair(8340, "ERROR_DS_CANT_DELETE_DSA_OBJ")); - ErrorNames.insert(std::make_pair(8341, "ERROR_DS_GENERIC_ERROR")); - ErrorNames.insert(std::make_pair(8342, "ERROR_DS_DSA_MUST_BE_INT_MASTER")); - ErrorNames.insert(std::make_pair(8343, "ERROR_DS_CLASS_NOT_DSA")); - ErrorNames.insert(std::make_pair(8344, "ERROR_DS_INSUFF_ACCESS_RIGHTS")); - ErrorNames.insert(std::make_pair(8345, "ERROR_DS_ILLEGAL_SUPERIOR")); - ErrorNames.insert(std::make_pair(8346, "ERROR_DS_ATTRIBUTE_OWNED_BY_SAM")); - ErrorNames.insert(std::make_pair(8347, "ERROR_DS_NAME_TOO_MANY_PARTS")); - ErrorNames.insert(std::make_pair(8348, "ERROR_DS_NAME_TOO_LONG")); - ErrorNames.insert(std::make_pair(8349, "ERROR_DS_NAME_VALUE_TOO_LONG")); - ErrorNames.insert(std::make_pair(8350, "ERROR_DS_NAME_UNPARSEABLE")); - ErrorNames.insert(std::make_pair(8351, "ERROR_DS_NAME_TYPE_UNKNOWN")); - ErrorNames.insert(std::make_pair(8352, "ERROR_DS_NOT_AN_OBJECT")); - ErrorNames.insert(std::make_pair(8353, "ERROR_DS_SEC_DESC_TOO_SHORT")); - ErrorNames.insert(std::make_pair(8354, "ERROR_DS_SEC_DESC_INVALID")); - ErrorNames.insert(std::make_pair(8355, "ERROR_DS_NO_DELETED_NAME")); - ErrorNames.insert(std::make_pair(8356, "ERROR_DS_SUBREF_MUST_HAVE_PARENT")); - ErrorNames.insert(std::make_pair(8357, "ERROR_DS_NCNAME_MUST_BE_NC")); - ErrorNames.insert(std::make_pair(8358, "ERROR_DS_CANT_ADD_SYSTEM_ONLY")); - ErrorNames.insert(std::make_pair(8359, "ERROR_DS_CLASS_MUST_BE_CONCRETE")); - ErrorNames.insert(std::make_pair(8360, "ERROR_DS_INVALID_DMD")); - ErrorNames.insert(std::make_pair(8361, "ERROR_DS_OBJ_GUID_EXISTS")); - ErrorNames.insert(std::make_pair(8362, "ERROR_DS_NOT_ON_BACKLINK")); - ErrorNames.insert(std::make_pair(8363, "ERROR_DS_NO_CROSSREF_FOR_NC")); - ErrorNames.insert(std::make_pair(8364, "ERROR_DS_SHUTTING_DOWN")); - ErrorNames.insert(std::make_pair(8365, "ERROR_DS_UNKNOWN_OPERATION")); - ErrorNames.insert(std::make_pair(8366, "ERROR_DS_INVALID_ROLE_OWNER")); - ErrorNames.insert(std::make_pair(8367, "ERROR_DS_COULDNT_CONTACT_FSMO")); - ErrorNames.insert(std::make_pair(8368, "ERROR_DS_CROSS_NC_DN_RENAME")); - ErrorNames.insert(std::make_pair(8369, "ERROR_DS_CANT_MOD_SYSTEM_ONLY")); - ErrorNames.insert(std::make_pair(8370, "ERROR_DS_REPLICATOR_ONLY")); - ErrorNames.insert(std::make_pair(8371, "ERROR_DS_OBJ_CLASS_NOT_DEFINED")); - ErrorNames.insert(std::make_pair(8372, "ERROR_DS_OBJ_CLASS_NOT_SUBCLASS")); - ErrorNames.insert(std::make_pair(8373, "ERROR_DS_NAME_REFERENCE_INVALID")); - ErrorNames.insert(std::make_pair(8374, "ERROR_DS_CROSS_REF_EXISTS")); - ErrorNames.insert(std::make_pair(8375, "ERROR_DS_CANT_DEL_MASTER_CROSSREF")); - ErrorNames.insert(std::make_pair(8376, "ERROR_DS_SUBTREE_NOTIFY_NOT_NC_HEAD")); - ErrorNames.insert(std::make_pair(8377, "ERROR_DS_NOTIFY_FILTER_TOO_COMPLEX")); - ErrorNames.insert(std::make_pair(8378, "ERROR_DS_DUP_RDN")); - ErrorNames.insert(std::make_pair(8379, "ERROR_DS_DUP_OID")); - ErrorNames.insert(std::make_pair(8380, "ERROR_DS_DUP_MAPI_ID")); - ErrorNames.insert(std::make_pair(8381, "ERROR_DS_DUP_SCHEMA_ID_GUID")); - ErrorNames.insert(std::make_pair(8382, "ERROR_DS_DUP_LDAP_DISPLAY_NAME")); - ErrorNames.insert(std::make_pair(8383, "ERROR_DS_SEMANTIC_ATT_TEST")); - ErrorNames.insert(std::make_pair(8384, "ERROR_DS_SYNTAX_MISMATCH")); - ErrorNames.insert(std::make_pair(8385, "ERROR_DS_EXISTS_IN_MUST_HAVE")); - ErrorNames.insert(std::make_pair(8386, "ERROR_DS_EXISTS_IN_MAY_HAVE")); - ErrorNames.insert(std::make_pair(8387, "ERROR_DS_NONEXISTENT_MAY_HAVE")); - ErrorNames.insert(std::make_pair(8388, "ERROR_DS_NONEXISTENT_MUST_HAVE")); - ErrorNames.insert(std::make_pair(8389, "ERROR_DS_AUX_CLS_TEST_FAIL")); - ErrorNames.insert(std::make_pair(8390, "ERROR_DS_NONEXISTENT_POSS_SUP")); - ErrorNames.insert(std::make_pair(8391, "ERROR_DS_SUB_CLS_TEST_FAIL")); - ErrorNames.insert(std::make_pair(8392, "ERROR_DS_BAD_RDN_ATT_ID_SYNTAX")); - ErrorNames.insert(std::make_pair(8393, "ERROR_DS_EXISTS_IN_AUX_CLS")); - ErrorNames.insert(std::make_pair(8394, "ERROR_DS_EXISTS_IN_SUB_CLS")); - ErrorNames.insert(std::make_pair(8395, "ERROR_DS_EXISTS_IN_POSS_SUP")); - ErrorNames.insert(std::make_pair(8396, "ERROR_DS_RECALCSCHEMA_FAILED")); - ErrorNames.insert(std::make_pair(8397, "ERROR_DS_TREE_DELETE_NOT_FINISHED")); - ErrorNames.insert(std::make_pair(8398, "ERROR_DS_CANT_DELETE")); - ErrorNames.insert(std::make_pair(8399, "ERROR_DS_ATT_SCHEMA_REQ_ID")); - ErrorNames.insert(std::make_pair(8400, "ERROR_DS_BAD_ATT_SCHEMA_SYNTAX")); - ErrorNames.insert(std::make_pair(8401, "ERROR_DS_CANT_CACHE_ATT")); - ErrorNames.insert(std::make_pair(8402, "ERROR_DS_CANT_CACHE_CLASS")); - ErrorNames.insert(std::make_pair(8403, "ERROR_DS_CANT_REMOVE_ATT_CACHE")); - ErrorNames.insert(std::make_pair(8404, "ERROR_DS_CANT_REMOVE_CLASS_CACHE")); - ErrorNames.insert(std::make_pair(8405, "ERROR_DS_CANT_RETRIEVE_DN")); - ErrorNames.insert(std::make_pair(8406, "ERROR_DS_MISSING_SUPREF")); - ErrorNames.insert(std::make_pair(8407, "ERROR_DS_CANT_RETRIEVE_INSTANCE")); - ErrorNames.insert(std::make_pair(8408, "ERROR_DS_CODE_INCONSISTENCY")); - ErrorNames.insert(std::make_pair(8409, "ERROR_DS_DATABASE_ERROR")); - ErrorNames.insert(std::make_pair(8410, "ERROR_DS_GOVERNSID_MISSING")); - ErrorNames.insert(std::make_pair(8411, "ERROR_DS_MISSING_EXPECTED_ATT")); - ErrorNames.insert(std::make_pair(8412, "ERROR_DS_NCNAME_MISSING_CR_REF")); - ErrorNames.insert(std::make_pair(8413, "ERROR_DS_SECURITY_CHECKING_ERROR")); - ErrorNames.insert(std::make_pair(8414, "ERROR_DS_SCHEMA_NOT_LOADED")); - ErrorNames.insert(std::make_pair(8415, "ERROR_DS_SCHEMA_ALLOC_FAILED")); - ErrorNames.insert(std::make_pair(8416, "ERROR_DS_ATT_SCHEMA_REQ_SYNTAX")); - ErrorNames.insert(std::make_pair(8417, "ERROR_DS_GCVERIFY_ERROR")); - ErrorNames.insert(std::make_pair(8418, "ERROR_DS_DRA_SCHEMA_MISMATCH")); - ErrorNames.insert(std::make_pair(8419, "ERROR_DS_CANT_FIND_DSA_OBJ")); - ErrorNames.insert(std::make_pair(8420, "ERROR_DS_CANT_FIND_EXPECTED_NC")); - ErrorNames.insert(std::make_pair(8421, "ERROR_DS_CANT_FIND_NC_IN_CACHE")); - ErrorNames.insert(std::make_pair(8422, "ERROR_DS_CANT_RETRIEVE_CHILD")); - ErrorNames.insert(std::make_pair(8423, "ERROR_DS_SECURITY_ILLEGAL_MODIFY")); - ErrorNames.insert(std::make_pair(8424, "ERROR_DS_CANT_REPLACE_HIDDEN_REC")); - ErrorNames.insert(std::make_pair(8425, "ERROR_DS_BAD_HIERARCHY_FILE")); - ErrorNames.insert(std::make_pair(8426, "ERROR_DS_BUILD_HIERARCHY_TABLE_FAILED")); - ErrorNames.insert(std::make_pair(8427, "ERROR_DS_CONFIG_PARAM_MISSING")); - ErrorNames.insert(std::make_pair(8428, "ERROR_DS_COUNTING_AB_INDICES_FAILED")); - ErrorNames.insert(std::make_pair(8429, "ERROR_DS_HIERARCHY_TABLE_MALLOC_FAILED")); - ErrorNames.insert(std::make_pair(8430, "ERROR_DS_INTERNAL_FAILURE")); - ErrorNames.insert(std::make_pair(8431, "ERROR_DS_UNKNOWN_ERROR")); - ErrorNames.insert(std::make_pair(8432, "ERROR_DS_ROOT_REQUIRES_CLASS_TOP")); - ErrorNames.insert(std::make_pair(8433, "ERROR_DS_REFUSING_FSMO_ROLES")); - ErrorNames.insert(std::make_pair(8434, "ERROR_DS_MISSING_FSMO_SETTINGS")); - ErrorNames.insert(std::make_pair(8435, "ERROR_DS_UNABLE_TO_SURRENDER_ROLES")); - ErrorNames.insert(std::make_pair(8436, "ERROR_DS_DRA_GENERIC")); - ErrorNames.insert(std::make_pair(8437, "ERROR_DS_DRA_INVALID_PARAMETER")); - ErrorNames.insert(std::make_pair(8438, "ERROR_DS_DRA_BUSY")); - ErrorNames.insert(std::make_pair(8439, "ERROR_DS_DRA_BAD_DN")); - ErrorNames.insert(std::make_pair(8440, "ERROR_DS_DRA_BAD_NC")); - ErrorNames.insert(std::make_pair(8441, "ERROR_DS_DRA_DN_EXISTS")); - ErrorNames.insert(std::make_pair(8442, "ERROR_DS_DRA_INTERNAL_ERROR")); - ErrorNames.insert(std::make_pair(8443, "ERROR_DS_DRA_INCONSISTENT_DIT")); - ErrorNames.insert(std::make_pair(8444, "ERROR_DS_DRA_CONNECTION_FAILED")); - ErrorNames.insert(std::make_pair(8445, "ERROR_DS_DRA_BAD_INSTANCE_TYPE")); - ErrorNames.insert(std::make_pair(8446, "ERROR_DS_DRA_OUT_OF_MEM")); - ErrorNames.insert(std::make_pair(8447, "ERROR_DS_DRA_MAIL_PROBLEM")); - ErrorNames.insert(std::make_pair(8448, "ERROR_DS_DRA_REF_ALREADY_EXISTS")); - ErrorNames.insert(std::make_pair(8449, "ERROR_DS_DRA_REF_NOT_FOUND")); - ErrorNames.insert(std::make_pair(8450, "ERROR_DS_DRA_OBJ_IS_REP_SOURCE")); - ErrorNames.insert(std::make_pair(8451, "ERROR_DS_DRA_DB_ERROR")); - ErrorNames.insert(std::make_pair(8452, "ERROR_DS_DRA_NO_REPLICA")); - ErrorNames.insert(std::make_pair(8453, "ERROR_DS_DRA_ACCESS_DENIED")); - ErrorNames.insert(std::make_pair(8454, "ERROR_DS_DRA_NOT_SUPPORTED")); - ErrorNames.insert(std::make_pair(8455, "ERROR_DS_DRA_RPC_CANCELLED")); - ErrorNames.insert(std::make_pair(8456, "ERROR_DS_DRA_SOURCE_DISABLED")); - ErrorNames.insert(std::make_pair(8457, "ERROR_DS_DRA_SINK_DISABLED")); - ErrorNames.insert(std::make_pair(8458, "ERROR_DS_DRA_NAME_COLLISION")); - ErrorNames.insert(std::make_pair(8459, "ERROR_DS_DRA_SOURCE_REINSTALLED")); - ErrorNames.insert(std::make_pair(8460, "ERROR_DS_DRA_MISSING_PARENT")); - ErrorNames.insert(std::make_pair(8461, "ERROR_DS_DRA_PREEMPTED")); - ErrorNames.insert(std::make_pair(8462, "ERROR_DS_DRA_ABANDON_SYNC")); - ErrorNames.insert(std::make_pair(8463, "ERROR_DS_DRA_SHUTDOWN")); - ErrorNames.insert(std::make_pair(8464, "ERROR_DS_DRA_INCOMPATIBLE_PARTIAL_SET")); - ErrorNames.insert(std::make_pair(8465, "ERROR_DS_DRA_SOURCE_IS_PARTIAL_REPLICA")); - ErrorNames.insert(std::make_pair(8466, "ERROR_DS_DRA_EXTN_CONNECTION_FAILED")); - ErrorNames.insert(std::make_pair(8467, "ERROR_DS_INSTALL_SCHEMA_MISMATCH")); - ErrorNames.insert(std::make_pair(8468, "ERROR_DS_DUP_LINK_ID")); - ErrorNames.insert(std::make_pair(8469, "ERROR_DS_NAME_ERROR_RESOLVING")); - ErrorNames.insert(std::make_pair(8470, "ERROR_DS_NAME_ERROR_NOT_FOUND")); - ErrorNames.insert(std::make_pair(8471, "ERROR_DS_NAME_ERROR_NOT_UNIQUE")); - ErrorNames.insert(std::make_pair(8472, "ERROR_DS_NAME_ERROR_NO_MAPPING")); - ErrorNames.insert(std::make_pair(8473, "ERROR_DS_NAME_ERROR_DOMAIN_ONLY")); - ErrorNames.insert(std::make_pair(8474, "ERROR_DS_NAME_ERROR_NO_SYNTACTICAL_MAPPING")); - ErrorNames.insert(std::make_pair(8475, "ERROR_DS_CONSTRUCTED_ATT_MOD")); - ErrorNames.insert(std::make_pair(8476, "ERROR_DS_WRONG_OM_OBJ_CLASS")); - ErrorNames.insert(std::make_pair(8477, "ERROR_DS_DRA_REPL_PENDING")); - ErrorNames.insert(std::make_pair(8478, "ERROR_DS_DS_REQUIRED")); - ErrorNames.insert(std::make_pair(8479, "ERROR_DS_INVALID_LDAP_DISPLAY_NAME")); - ErrorNames.insert(std::make_pair(8480, "ERROR_DS_NON_BASE_SEARCH")); - ErrorNames.insert(std::make_pair(8481, "ERROR_DS_CANT_RETRIEVE_ATTS")); - ErrorNames.insert(std::make_pair(8482, "ERROR_DS_BACKLINK_WITHOUT_LINK")); - ErrorNames.insert(std::make_pair(8483, "ERROR_DS_EPOCH_MISMATCH")); - ErrorNames.insert(std::make_pair(8484, "ERROR_DS_SRC_NAME_MISMATCH")); - ErrorNames.insert(std::make_pair(8485, "ERROR_DS_SRC_AND_DST_NC_IDENTICAL")); - ErrorNames.insert(std::make_pair(8486, "ERROR_DS_DST_NC_MISMATCH")); - ErrorNames.insert(std::make_pair(8487, "ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC")); - ErrorNames.insert(std::make_pair(8488, "ERROR_DS_SRC_GUID_MISMATCH")); - ErrorNames.insert(std::make_pair(8489, "ERROR_DS_CANT_MOVE_DELETED_OBJECT")); - ErrorNames.insert(std::make_pair(8490, "ERROR_DS_PDC_OPERATION_IN_PROGRESS")); - ErrorNames.insert(std::make_pair(8491, "ERROR_DS_CROSS_DOMAIN_CLEANUP_REQD")); - ErrorNames.insert(std::make_pair(8492, "ERROR_DS_ILLEGAL_XDOM_MOVE_OPERATION")); - ErrorNames.insert(std::make_pair(8493, "ERROR_DS_CANT_WITH_ACCT_GROUP_MEMBERSHPS")); - ErrorNames.insert(std::make_pair(8494, "ERROR_DS_NC_MUST_HAVE_NC_PARENT")); - ErrorNames.insert(std::make_pair(8495, "ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE")); - ErrorNames.insert(std::make_pair(8496, "ERROR_DS_DST_DOMAIN_NOT_NATIVE")); - ErrorNames.insert(std::make_pair(8497, "ERROR_DS_MISSING_INFRASTRUCTURE_CONTAINER")); - ErrorNames.insert(std::make_pair(8498, "ERROR_DS_CANT_MOVE_ACCOUNT_GROUP")); - ErrorNames.insert(std::make_pair(8499, "ERROR_DS_CANT_MOVE_RESOURCE_GROUP")); - ErrorNames.insert(std::make_pair(8500, "ERROR_DS_INVALID_SEARCH_FLAG")); - ErrorNames.insert(std::make_pair(8501, "ERROR_DS_NO_TREE_DELETE_ABOVE_NC")); - ErrorNames.insert(std::make_pair(8502, "ERROR_DS_COULDNT_LOCK_TREE_FOR_DELETE")); - ErrorNames.insert(std::make_pair(8503, "ERROR_DS_COULDNT_IDENTIFY_OBJECTS_FOR_TREE_DELETE")); - ErrorNames.insert(std::make_pair(8504, "ERROR_DS_SAM_INIT_FAILURE")); - ErrorNames.insert(std::make_pair(8505, "ERROR_DS_SENSITIVE_GROUP_VIOLATION")); - ErrorNames.insert(std::make_pair(8506, "ERROR_DS_CANT_MOD_PRIMARYGROUPID")); - ErrorNames.insert(std::make_pair(8507, "ERROR_DS_ILLEGAL_BASE_SCHEMA_MOD")); - ErrorNames.insert(std::make_pair(8508, "ERROR_DS_NONSAFE_SCHEMA_CHANGE")); - ErrorNames.insert(std::make_pair(8509, "ERROR_DS_SCHEMA_UPDATE_DISALLOWED")); - ErrorNames.insert(std::make_pair(8510, "ERROR_DS_CANT_CREATE_UNDER_SCHEMA")); - ErrorNames.insert(std::make_pair(8511, "ERROR_DS_INSTALL_NO_SRC_SCH_VERSION")); - ErrorNames.insert(std::make_pair(8512, "ERROR_DS_INSTALL_NO_SCH_VERSION_IN_INIFILE")); - ErrorNames.insert(std::make_pair(8513, "ERROR_DS_INVALID_GROUP_TYPE")); - ErrorNames.insert(std::make_pair(8514, "ERROR_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN")); - ErrorNames.insert(std::make_pair(8515, "ERROR_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN")); - ErrorNames.insert(std::make_pair(8516, "ERROR_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER")); - ErrorNames.insert(std::make_pair(8517, "ERROR_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER")); - ErrorNames.insert(std::make_pair(8518, "ERROR_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER")); - ErrorNames.insert(std::make_pair(8519, "ERROR_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER")); - ErrorNames.insert(std::make_pair(8520, "ERROR_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER")); - ErrorNames.insert(std::make_pair(8521, "ERROR_DS_HAVE_PRIMARY_MEMBERS")); - ErrorNames.insert(std::make_pair(8522, "ERROR_DS_STRING_SD_CONVERSION_FAILED")); - ErrorNames.insert(std::make_pair(8523, "ERROR_DS_NAMING_MASTER_GC")); - ErrorNames.insert(std::make_pair(8524, "ERROR_DS_DNS_LOOKUP_FAILURE")); - ErrorNames.insert(std::make_pair(8525, "ERROR_DS_COULDNT_UPDATE_SPNS")); - ErrorNames.insert(std::make_pair(8526, "ERROR_DS_CANT_RETRIEVE_SD")); - ErrorNames.insert(std::make_pair(8527, "ERROR_DS_KEY_NOT_UNIQUE")); - ErrorNames.insert(std::make_pair(8528, "ERROR_DS_WRONG_LINKED_ATT_SYNTAX")); - ErrorNames.insert(std::make_pair(8529, "ERROR_DS_SAM_NEED_BOOTKEY_PASSWORD")); - ErrorNames.insert(std::make_pair(8530, "ERROR_DS_SAM_NEED_BOOTKEY_FLOPPY")); - ErrorNames.insert(std::make_pair(8531, "ERROR_DS_CANT_START")); - ErrorNames.insert(std::make_pair(8532, "ERROR_DS_INIT_FAILURE")); - ErrorNames.insert(std::make_pair(8533, "ERROR_DS_NO_PKT_PRIVACY_ON_CONNECTION")); - ErrorNames.insert(std::make_pair(8534, "ERROR_DS_SOURCE_DOMAIN_IN_FOREST")); - ErrorNames.insert(std::make_pair(8535, "ERROR_DS_DESTINATION_DOMAIN_NOT_IN_FOREST")); - ErrorNames.insert(std::make_pair(8536, "ERROR_DS_DESTINATION_AUDITING_NOT_ENABLED")); - ErrorNames.insert(std::make_pair(8537, "ERROR_DS_CANT_FIND_DC_FOR_SRC_DOMAIN")); - ErrorNames.insert(std::make_pair(8538, "ERROR_DS_SRC_OBJ_NOT_GROUP_OR_USER")); - ErrorNames.insert(std::make_pair(8539, "ERROR_DS_SRC_SID_EXISTS_IN_FOREST")); - ErrorNames.insert(std::make_pair(8540, "ERROR_DS_SRC_AND_DST_OBJECT_CLASS_MISMATCH")); - ErrorNames.insert(std::make_pair(8541, "ERROR_SAM_INIT_FAILURE")); - ErrorNames.insert(std::make_pair(8542, "ERROR_DS_DRA_SCHEMA_INFO_SHIP")); - ErrorNames.insert(std::make_pair(8543, "ERROR_DS_DRA_SCHEMA_CONFLICT")); - ErrorNames.insert(std::make_pair(8544, "ERROR_DS_DRA_EARLIER_SCHEMA_CONFLICT")); - ErrorNames.insert(std::make_pair(8545, "ERROR_DS_DRA_OBJ_NC_MISMATCH")); - ErrorNames.insert(std::make_pair(8546, "ERROR_DS_NC_STILL_HAS_DSAS")); - ErrorNames.insert(std::make_pair(8547, "ERROR_DS_GC_REQUIRED")); - ErrorNames.insert(std::make_pair(8548, "ERROR_DS_LOCAL_MEMBER_OF_LOCAL_ONLY")); - ErrorNames.insert(std::make_pair(8549, "ERROR_DS_NO_FPO_IN_UNIVERSAL_GROUPS")); - ErrorNames.insert(std::make_pair(8550, "ERROR_DS_CANT_ADD_TO_GC")); - ErrorNames.insert(std::make_pair(8551, "ERROR_DS_NO_CHECKPOINT_WITH_PDC")); - ErrorNames.insert(std::make_pair(8552, "ERROR_DS_SOURCE_AUDITING_NOT_ENABLED")); - ErrorNames.insert(std::make_pair(8553, "ERROR_DS_CANT_CREATE_IN_NONDOMAIN_NC")); - ErrorNames.insert(std::make_pair(8554, "ERROR_DS_INVALID_NAME_FOR_SPN")); - ErrorNames.insert(std::make_pair(8555, "ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS")); - ErrorNames.insert(std::make_pair(8556, "ERROR_DS_UNICODEPWD_NOT_IN_QUOTES")); - ErrorNames.insert(std::make_pair(8557, "ERROR_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED")); - ErrorNames.insert(std::make_pair(8558, "ERROR_DS_MUST_BE_RUN_ON_DST_DC")); - ErrorNames.insert(std::make_pair(8559, "ERROR_DS_SRC_DC_MUST_BE_SP4_OR_GREATER")); - ErrorNames.insert(std::make_pair(8560, "ERROR_DS_CANT_TREE_DELETE_CRITICAL_OBJ")); - ErrorNames.insert(std::make_pair(8561, "ERROR_DS_INIT_FAILURE_CONSOLE")); - ErrorNames.insert(std::make_pair(8562, "ERROR_DS_SAM_INIT_FAILURE_CONSOLE")); - ErrorNames.insert(std::make_pair(8563, "ERROR_DS_FOREST_VERSION_TOO_HIGH")); - ErrorNames.insert(std::make_pair(8564, "ERROR_DS_DOMAIN_VERSION_TOO_HIGH")); - ErrorNames.insert(std::make_pair(8565, "ERROR_DS_FOREST_VERSION_TOO_LOW")); - ErrorNames.insert(std::make_pair(8566, "ERROR_DS_DOMAIN_VERSION_TOO_LOW")); - ErrorNames.insert(std::make_pair(8567, "ERROR_DS_INCOMPATIBLE_VERSION")); - ErrorNames.insert(std::make_pair(8568, "ERROR_DS_LOW_DSA_VERSION")); - ErrorNames.insert(std::make_pair(8569, "ERROR_DS_NO_BEHAVIOR_VERSION_IN_MIXEDDOMAIN")); - ErrorNames.insert(std::make_pair(8570, "ERROR_DS_NOT_SUPPORTED_SORT_ORDER")); - ErrorNames.insert(std::make_pair(8571, "ERROR_DS_NAME_NOT_UNIQUE")); - ErrorNames.insert(std::make_pair(8572, "ERROR_DS_MACHINE_ACCOUNT_CREATED_PRENT4")); - ErrorNames.insert(std::make_pair(8573, "ERROR_DS_OUT_OF_VERSION_STORE")); - ErrorNames.insert(std::make_pair(8574, "ERROR_DS_INCOMPATIBLE_CONTROLS_USED")); - ErrorNames.insert(std::make_pair(8575, "ERROR_DS_NO_REF_DOMAIN")); - ErrorNames.insert(std::make_pair(8576, "ERROR_DS_RESERVED_LINK_ID")); - ErrorNames.insert(std::make_pair(8577, "ERROR_DS_LINK_ID_NOT_AVAILABLE")); - ErrorNames.insert(std::make_pair(8578, "ERROR_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER")); - ErrorNames.insert(std::make_pair(8579, "ERROR_DS_MODIFYDN_DISALLOWED_BY_INSTANCE_TYPE")); - ErrorNames.insert(std::make_pair(8580, "ERROR_DS_NO_OBJECT_MOVE_IN_SCHEMA_NC")); - ErrorNames.insert(std::make_pair(8581, "ERROR_DS_MODIFYDN_DISALLOWED_BY_FLAG")); - ErrorNames.insert(std::make_pair(8582, "ERROR_DS_MODIFYDN_WRONG_GRANDPARENT")); - ErrorNames.insert(std::make_pair(8583, "ERROR_DS_NAME_ERROR_TRUST_REFERRAL")); - ErrorNames.insert(std::make_pair(8584, "ERROR_NOT_SUPPORTED_ON_STANDARD_SERVER")); - ErrorNames.insert(std::make_pair(8585, "ERROR_DS_CANT_ACCESS_REMOTE_PART_OF_AD")); - ErrorNames.insert(std::make_pair(8586, "ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE_V2")); - ErrorNames.insert(std::make_pair(8587, "ERROR_DS_THREAD_LIMIT_EXCEEDED")); - ErrorNames.insert(std::make_pair(8588, "ERROR_DS_NOT_CLOSEST")); - ErrorNames.insert(std::make_pair(8589, "ERROR_DS_CANT_DERIVE_SPN_WITHOUT_SERVER_REF")); - ErrorNames.insert(std::make_pair(8590, "ERROR_DS_SINGLE_USER_MODE_FAILED")); - ErrorNames.insert(std::make_pair(8591, "ERROR_DS_NTDSCRIPT_SYNTAX_ERROR")); - ErrorNames.insert(std::make_pair(8592, "ERROR_DS_NTDSCRIPT_PROCESS_ERROR")); - ErrorNames.insert(std::make_pair(8593, "ERROR_DS_DIFFERENT_REPL_EPOCHS")); - ErrorNames.insert(std::make_pair(8594, "ERROR_DS_DRS_EXTENSIONS_CHANGED")); - ErrorNames.insert(std::make_pair(8595, "ERROR_DS_REPLICA_SET_CHANGE_NOT_ALLOWED_ON_DISABLED_CR")); - ErrorNames.insert(std::make_pair(8596, "ERROR_DS_NO_MSDS_INTID")); - ErrorNames.insert(std::make_pair(8597, "ERROR_DS_DUP_MSDS_INTID")); - ErrorNames.insert(std::make_pair(8598, "ERROR_DS_EXISTS_IN_RDNATTID")); - ErrorNames.insert(std::make_pair(8599, "ERROR_DS_AUTHORIZATION_FAILED")); - ErrorNames.insert(std::make_pair(8600, "ERROR_DS_INVALID_SCRIPT")); - ErrorNames.insert(std::make_pair(8601, "ERROR_DS_REMOTE_CROSSREF_OP_FAILED")); - ErrorNames.insert(std::make_pair(8602, "ERROR_DS_CROSS_REF_BUSY")); - ErrorNames.insert(std::make_pair(8603, "ERROR_DS_CANT_DERIVE_SPN_FOR_DELETED_DOMAIN")); - ErrorNames.insert(std::make_pair(8604, "ERROR_DS_CANT_DEMOTE_WITH_WRITEABLE_NC")); - ErrorNames.insert(std::make_pair(8605, "ERROR_DS_DUPLICATE_ID_FOUND")); - ErrorNames.insert(std::make_pair(8606, "ERROR_DS_INSUFFICIENT_ATTR_TO_CREATE_OBJECT")); - ErrorNames.insert(std::make_pair(8607, "ERROR_DS_GROUP_CONVERSION_ERROR")); - ErrorNames.insert(std::make_pair(8608, "ERROR_DS_CANT_MOVE_APP_BASIC_GROUP")); - ErrorNames.insert(std::make_pair(8609, "ERROR_DS_CANT_MOVE_APP_QUERY_GROUP")); - ErrorNames.insert(std::make_pair(8610, "ERROR_DS_ROLE_NOT_VERIFIED")); - ErrorNames.insert(std::make_pair(8611, "ERROR_DS_WKO_CONTAINER_CANNOT_BE_SPECIAL")); - ErrorNames.insert(std::make_pair(8612, "ERROR_DS_DOMAIN_RENAME_IN_PROGRESS")); - ErrorNames.insert(std::make_pair(8613, "ERROR_DS_EXISTING_AD_CHILD_NC")); - ErrorNames.insert(std::make_pair(8614, "ERROR_DS_REPL_LIFETIME_EXCEEDED")); - ErrorNames.insert(std::make_pair(8615, "ERROR_DS_DISALLOWED_IN_SYSTEM_CONTAINER")); - ErrorNames.insert(std::make_pair(8616, "ERROR_DS_LDAP_SEND_QUEUE_FULL")); - ErrorNames.insert(std::make_pair(8617, "ERROR_DS_DRA_OUT_SCHEDULE_WINDOW")); - ErrorNames.insert(std::make_pair(8618, "ERROR_DS_POLICY_NOT_KNOWN")); - ErrorNames.insert(std::make_pair(8619, "ERROR_NO_SITE_SETTINGS_OBJECT")); - ErrorNames.insert(std::make_pair(8620, "ERROR_NO_SECRETS")); - ErrorNames.insert(std::make_pair(8621, "ERROR_NO_WRITABLE_DC_FOUND")); - ErrorNames.insert(std::make_pair(8622, "ERROR_DS_NO_SERVER_OBJECT")); - ErrorNames.insert(std::make_pair(8623, "ERROR_DS_NO_NTDSA_OBJECT")); - ErrorNames.insert(std::make_pair(8624, "ERROR_DS_NON_ASQ_SEARCH")); - ErrorNames.insert(std::make_pair(8625, "ERROR_DS_AUDIT_FAILURE")); - ErrorNames.insert(std::make_pair(8626, "ERROR_DS_INVALID_SEARCH_FLAG_SUBTREE")); - ErrorNames.insert(std::make_pair(8627, "ERROR_DS_INVALID_SEARCH_FLAG_TUPLE")); - ErrorNames.insert(std::make_pair(8628, "ERROR_DS_HIERARCHY_TABLE_TOO_DEEP")); - ErrorNames.insert(std::make_pair(8629, "ERROR_DS_DRA_CORRUPT_UTD_VECTOR")); - ErrorNames.insert(std::make_pair(8630, "ERROR_DS_DRA_SECRETS_DENIED")); - ErrorNames.insert(std::make_pair(8631, "ERROR_DS_RESERVED_MAPI_ID")); - ErrorNames.insert(std::make_pair(8632, "ERROR_DS_MAPI_ID_NOT_AVAILABLE")); - ErrorNames.insert(std::make_pair(8633, "ERROR_DS_DRA_MISSING_KRBTGT_SECRET")); - ErrorNames.insert(std::make_pair(8634, "ERROR_DS_DOMAIN_NAME_EXISTS_IN_FOREST")); - ErrorNames.insert(std::make_pair(8635, "ERROR_DS_FLAT_NAME_EXISTS_IN_FOREST")); - ErrorNames.insert(std::make_pair(8636, "ERROR_INVALID_USER_PRINCIPAL_NAME")); - ErrorNames.insert(std::make_pair(8637, "ERROR_DS_OID_MAPPED_GROUP_CANT_HAVE_MEMBERS")); - ErrorNames.insert(std::make_pair(8638, "ERROR_DS_OID_NOT_FOUND")); - ErrorNames.insert(std::make_pair(8639, "ERROR_DS_DRA_RECYCLED_TARGET")); - ErrorNames.insert(std::make_pair(13000, "ERROR_IPSEC_QM_POLICY_EXISTS")); - ErrorNames.insert(std::make_pair(13001, "ERROR_IPSEC_QM_POLICY_NOT_FOUND")); - ErrorNames.insert(std::make_pair(13002, "ERROR_IPSEC_QM_POLICY_IN_USE")); - ErrorNames.insert(std::make_pair(13003, "ERROR_IPSEC_MM_POLICY_EXISTS")); - ErrorNames.insert(std::make_pair(13004, "ERROR_IPSEC_MM_POLICY_NOT_FOUND")); - ErrorNames.insert(std::make_pair(13005, "ERROR_IPSEC_MM_POLICY_IN_USE")); - ErrorNames.insert(std::make_pair(13006, "ERROR_IPSEC_MM_FILTER_EXISTS")); - ErrorNames.insert(std::make_pair(13007, "ERROR_IPSEC_MM_FILTER_NOT_FOUND")); - ErrorNames.insert(std::make_pair(13008, "ERROR_IPSEC_TRANSPORT_FILTER_EXISTS")); - ErrorNames.insert(std::make_pair(13009, "ERROR_IPSEC_TRANSPORT_FILTER_NOT_FOUND")); - ErrorNames.insert(std::make_pair(13010, "ERROR_IPSEC_MM_AUTH_EXISTS")); - ErrorNames.insert(std::make_pair(13011, "ERROR_IPSEC_MM_AUTH_NOT_FOUND")); - ErrorNames.insert(std::make_pair(13012, "ERROR_IPSEC_MM_AUTH_IN_USE")); - ErrorNames.insert(std::make_pair(13013, "ERROR_IPSEC_DEFAULT_MM_POLICY_NOT_FOUND")); - ErrorNames.insert(std::make_pair(13014, "ERROR_IPSEC_DEFAULT_MM_AUTH_NOT_FOUND")); - ErrorNames.insert(std::make_pair(13015, "ERROR_IPSEC_DEFAULT_QM_POLICY_NOT_FOUND")); - ErrorNames.insert(std::make_pair(13016, "ERROR_IPSEC_TUNNEL_FILTER_EXISTS")); - ErrorNames.insert(std::make_pair(13017, "ERROR_IPSEC_TUNNEL_FILTER_NOT_FOUND")); - ErrorNames.insert(std::make_pair(13018, "ERROR_IPSEC_MM_FILTER_PENDING_DELETION")); - ErrorNames.insert(std::make_pair(13019, "ERROR_IPSEC_TRANSPORT_FILTER_PENDING_DELETION")); - ErrorNames.insert(std::make_pair(13020, "ERROR_IPSEC_TUNNEL_FILTER_PENDING_DELETION")); - ErrorNames.insert(std::make_pair(13021, "ERROR_IPSEC_MM_POLICY_PENDING_DELETION")); - ErrorNames.insert(std::make_pair(13022, "ERROR_IPSEC_MM_AUTH_PENDING_DELETION")); - ErrorNames.insert(std::make_pair(13023, "ERROR_IPSEC_QM_POLICY_PENDING_DELETION")); - ErrorNames.insert(std::make_pair(13800, "ERROR_IPSEC_IKE_NEG_STATUS_BEGIN")); - ErrorNames.insert(std::make_pair(13801, "ERROR_IPSEC_IKE_AUTH_FAIL")); - ErrorNames.insert(std::make_pair(13802, "ERROR_IPSEC_IKE_ATTRIB_FAIL")); - ErrorNames.insert(std::make_pair(13803, "ERROR_IPSEC_IKE_NEGOTIATION_PENDING")); - ErrorNames.insert(std::make_pair(13804, "ERROR_IPSEC_IKE_GENERAL_PROCESSING_ERROR")); - ErrorNames.insert(std::make_pair(13805, "ERROR_IPSEC_IKE_TIMED_OUT")); - ErrorNames.insert(std::make_pair(13806, "ERROR_IPSEC_IKE_NO_CERT")); - ErrorNames.insert(std::make_pair(13807, "ERROR_IPSEC_IKE_SA_DELETED")); - ErrorNames.insert(std::make_pair(13808, "ERROR_IPSEC_IKE_SA_REAPED")); - ErrorNames.insert(std::make_pair(13809, "ERROR_IPSEC_IKE_MM_ACQUIRE_DROP")); - ErrorNames.insert(std::make_pair(13810, "ERROR_IPSEC_IKE_QM_ACQUIRE_DROP")); - ErrorNames.insert(std::make_pair(13811, "ERROR_IPSEC_IKE_QUEUE_DROP_MM")); - ErrorNames.insert(std::make_pair(13812, "ERROR_IPSEC_IKE_QUEUE_DROP_NO_MM")); - ErrorNames.insert(std::make_pair(13813, "ERROR_IPSEC_IKE_DROP_NO_RESPONSE")); - ErrorNames.insert(std::make_pair(13814, "ERROR_IPSEC_IKE_MM_DELAY_DROP")); - ErrorNames.insert(std::make_pair(13815, "ERROR_IPSEC_IKE_QM_DELAY_DROP")); - ErrorNames.insert(std::make_pair(13816, "ERROR_IPSEC_IKE_ERROR")); - ErrorNames.insert(std::make_pair(13817, "ERROR_IPSEC_IKE_CRL_FAILED")); - ErrorNames.insert(std::make_pair(13818, "ERROR_IPSEC_IKE_INVALID_KEY_USAGE")); - ErrorNames.insert(std::make_pair(13819, "ERROR_IPSEC_IKE_INVALID_CERT_TYPE")); - ErrorNames.insert(std::make_pair(13820, "ERROR_IPSEC_IKE_NO_PRIVATE_KEY")); - ErrorNames.insert(std::make_pair(13821, "ERROR_IPSEC_IKE_SIMULTANEOUS_REKEY")); - ErrorNames.insert(std::make_pair(13822, "ERROR_IPSEC_IKE_DH_FAIL")); - ErrorNames.insert(std::make_pair(13823, "ERROR_IPSEC_IKE_CRITICAL_PAYLOAD_NOT_RECOGNIZED")); - ErrorNames.insert(std::make_pair(13824, "ERROR_IPSEC_IKE_INVALID_HEADER")); - ErrorNames.insert(std::make_pair(13825, "ERROR_IPSEC_IKE_NO_POLICY")); - ErrorNames.insert(std::make_pair(13826, "ERROR_IPSEC_IKE_INVALID_SIGNATURE")); - ErrorNames.insert(std::make_pair(13827, "ERROR_IPSEC_IKE_KERBEROS_ERROR")); - ErrorNames.insert(std::make_pair(13828, "ERROR_IPSEC_IKE_NO_PUBLIC_KEY")); - ErrorNames.insert(std::make_pair(13829, "ERROR_IPSEC_IKE_PROCESS_ERR")); - ErrorNames.insert(std::make_pair(13830, "ERROR_IPSEC_IKE_PROCESS_ERR_SA")); - ErrorNames.insert(std::make_pair(13831, "ERROR_IPSEC_IKE_PROCESS_ERR_PROP")); - ErrorNames.insert(std::make_pair(13832, "ERROR_IPSEC_IKE_PROCESS_ERR_TRANS")); - ErrorNames.insert(std::make_pair(13833, "ERROR_IPSEC_IKE_PROCESS_ERR_KE")); - ErrorNames.insert(std::make_pair(13834, "ERROR_IPSEC_IKE_PROCESS_ERR_ID")); - ErrorNames.insert(std::make_pair(13835, "ERROR_IPSEC_IKE_PROCESS_ERR_CERT")); - ErrorNames.insert(std::make_pair(13836, "ERROR_IPSEC_IKE_PROCESS_ERR_CERT_REQ")); - ErrorNames.insert(std::make_pair(13837, "ERROR_IPSEC_IKE_PROCESS_ERR_HASH")); - ErrorNames.insert(std::make_pair(13838, "ERROR_IPSEC_IKE_PROCESS_ERR_SIG")); - ErrorNames.insert(std::make_pair(13839, "ERROR_IPSEC_IKE_PROCESS_ERR_NONCE")); - ErrorNames.insert(std::make_pair(13840, "ERROR_IPSEC_IKE_PROCESS_ERR_NOTIFY")); - ErrorNames.insert(std::make_pair(13841, "ERROR_IPSEC_IKE_PROCESS_ERR_DELETE")); - ErrorNames.insert(std::make_pair(13842, "ERROR_IPSEC_IKE_PROCESS_ERR_VENDOR")); - ErrorNames.insert(std::make_pair(13843, "ERROR_IPSEC_IKE_INVALID_PAYLOAD")); - ErrorNames.insert(std::make_pair(13844, "ERROR_IPSEC_IKE_LOAD_SOFT_SA")); - ErrorNames.insert(std::make_pair(13845, "ERROR_IPSEC_IKE_SOFT_SA_TORN_DOWN")); - ErrorNames.insert(std::make_pair(13846, "ERROR_IPSEC_IKE_INVALID_COOKIE")); - ErrorNames.insert(std::make_pair(13847, "ERROR_IPSEC_IKE_NO_PEER_CERT")); - ErrorNames.insert(std::make_pair(13848, "ERROR_IPSEC_IKE_PEER_CRL_FAILED")); - ErrorNames.insert(std::make_pair(13849, "ERROR_IPSEC_IKE_POLICY_CHANGE")); - ErrorNames.insert(std::make_pair(13850, "ERROR_IPSEC_IKE_NO_MM_POLICY")); - ErrorNames.insert(std::make_pair(13851, "ERROR_IPSEC_IKE_NOTCBPRIV")); - ErrorNames.insert(std::make_pair(13852, "ERROR_IPSEC_IKE_SECLOADFAIL")); - ErrorNames.insert(std::make_pair(13853, "ERROR_IPSEC_IKE_FAILSSPINIT")); - ErrorNames.insert(std::make_pair(13854, "ERROR_IPSEC_IKE_FAILQUERYSSP")); - ErrorNames.insert(std::make_pair(13855, "ERROR_IPSEC_IKE_SRVACQFAIL")); - ErrorNames.insert(std::make_pair(13856, "ERROR_IPSEC_IKE_SRVQUERYCRED")); - ErrorNames.insert(std::make_pair(13857, "ERROR_IPSEC_IKE_GETSPIFAIL")); - ErrorNames.insert(std::make_pair(13858, "ERROR_IPSEC_IKE_INVALID_FILTER")); - ErrorNames.insert(std::make_pair(13859, "ERROR_IPSEC_IKE_OUT_OF_MEMORY")); - ErrorNames.insert(std::make_pair(13860, "ERROR_IPSEC_IKE_ADD_UPDATE_KEY_FAILED")); - ErrorNames.insert(std::make_pair(13861, "ERROR_IPSEC_IKE_INVALID_POLICY")); - ErrorNames.insert(std::make_pair(13862, "ERROR_IPSEC_IKE_UNKNOWN_DOI")); - ErrorNames.insert(std::make_pair(13863, "ERROR_IPSEC_IKE_INVALID_SITUATION")); - ErrorNames.insert(std::make_pair(13864, "ERROR_IPSEC_IKE_DH_FAILURE")); - ErrorNames.insert(std::make_pair(13865, "ERROR_IPSEC_IKE_INVALID_GROUP")); - ErrorNames.insert(std::make_pair(13866, "ERROR_IPSEC_IKE_ENCRYPT")); - ErrorNames.insert(std::make_pair(13867, "ERROR_IPSEC_IKE_DECRYPT")); - ErrorNames.insert(std::make_pair(13868, "ERROR_IPSEC_IKE_POLICY_MATCH")); - ErrorNames.insert(std::make_pair(13869, "ERROR_IPSEC_IKE_UNSUPPORTED_ID")); - ErrorNames.insert(std::make_pair(13870, "ERROR_IPSEC_IKE_INVALID_HASH")); - ErrorNames.insert(std::make_pair(13871, "ERROR_IPSEC_IKE_INVALID_HASH_ALG")); - ErrorNames.insert(std::make_pair(13872, "ERROR_IPSEC_IKE_INVALID_HASH_SIZE")); - ErrorNames.insert(std::make_pair(13873, "ERROR_IPSEC_IKE_INVALID_ENCRYPT_ALG")); - ErrorNames.insert(std::make_pair(13874, "ERROR_IPSEC_IKE_INVALID_AUTH_ALG")); - ErrorNames.insert(std::make_pair(13875, "ERROR_IPSEC_IKE_INVALID_SIG")); - ErrorNames.insert(std::make_pair(13876, "ERROR_IPSEC_IKE_LOAD_FAILED")); - ErrorNames.insert(std::make_pair(13877, "ERROR_IPSEC_IKE_RPC_DELETE")); - ErrorNames.insert(std::make_pair(13878, "ERROR_IPSEC_IKE_BENIGN_REINIT")); - ErrorNames.insert(std::make_pair(13879, "ERROR_IPSEC_IKE_INVALID_RESPONDER_LIFETIME_NOTIFY")); - ErrorNames.insert(std::make_pair(13880, "ERROR_IPSEC_IKE_INVALID_MAJOR_VERSION")); - ErrorNames.insert(std::make_pair(13881, "ERROR_IPSEC_IKE_INVALID_CERT_KEYLEN")); - ErrorNames.insert(std::make_pair(13882, "ERROR_IPSEC_IKE_MM_LIMIT")); - ErrorNames.insert(std::make_pair(13883, "ERROR_IPSEC_IKE_NEGOTIATION_DISABLED")); - ErrorNames.insert(std::make_pair(13884, "ERROR_IPSEC_IKE_QM_LIMIT")); - ErrorNames.insert(std::make_pair(13885, "ERROR_IPSEC_IKE_MM_EXPIRED")); - ErrorNames.insert(std::make_pair(13886, "ERROR_IPSEC_IKE_PEER_MM_ASSUMED_INVALID")); - ErrorNames.insert(std::make_pair(13887, "ERROR_IPSEC_IKE_CERT_CHAIN_POLICY_MISMATCH")); - ErrorNames.insert(std::make_pair(13888, "ERROR_IPSEC_IKE_UNEXPECTED_MESSAGE_ID")); - ErrorNames.insert(std::make_pair(13889, "ERROR_IPSEC_IKE_INVALID_AUTH_PAYLOAD")); - ErrorNames.insert(std::make_pair(13890, "ERROR_IPSEC_IKE_DOS_COOKIE_SENT")); - ErrorNames.insert(std::make_pair(13891, "ERROR_IPSEC_IKE_SHUTTING_DOWN")); - ErrorNames.insert(std::make_pair(13892, "ERROR_IPSEC_IKE_CGA_AUTH_FAILED")); - ErrorNames.insert(std::make_pair(13893, "ERROR_IPSEC_IKE_PROCESS_ERR_NATOA")); - ErrorNames.insert(std::make_pair(13894, "ERROR_IPSEC_IKE_INVALID_MM_FOR_QM")); - ErrorNames.insert(std::make_pair(13895, "ERROR_IPSEC_IKE_QM_EXPIRED")); - ErrorNames.insert(std::make_pair(13896, "ERROR_IPSEC_IKE_TOO_MANY_FILTERS")); - ErrorNames.insert(std::make_pair(13897, "ERROR_IPSEC_IKE_NEG_STATUS_END")); - ErrorNames.insert(std::make_pair(13898, "ERROR_IPSEC_IKE_KILL_DUMMY_NAP_TUNNEL")); - ErrorNames.insert(std::make_pair(13899, "ERROR_IPSEC_IKE_INNER_IP_ASSIGNMENT_FAILURE")); - ErrorNames.insert(std::make_pair(13900, "ERROR_IPSEC_IKE_REQUIRE_CP_PAYLOAD_MISSING")); - ErrorNames.insert(std::make_pair(13901, "ERROR_IPSEC_KEY_MODULE_IMPERSONATION_NEGOTIATION_PENDING")); - ErrorNames.insert(std::make_pair(13902, "ERROR_IPSEC_IKE_COEXISTENCE_SUPPRESS")); - ErrorNames.insert(std::make_pair(13903, "ERROR_IPSEC_IKE_RATELIMIT_DROP")); - ErrorNames.insert(std::make_pair(13904, "ERROR_IPSEC_IKE_PEER_DOESNT_SUPPORT_MOBIKE")); - ErrorNames.insert(std::make_pair(13905, "ERROR_IPSEC_IKE_AUTHORIZATION_FAILURE")); - ErrorNames.insert(std::make_pair(13906, "ERROR_IPSEC_IKE_STRONG_CRED_AUTHORIZATION_FAILURE")); - ErrorNames.insert(std::make_pair(13907, "ERROR_IPSEC_IKE_AUTHORIZATION_FAILURE_WITH_OPTIONAL_RETRY")); - ErrorNames.insert(std::make_pair(13908, "ERROR_IPSEC_IKE_STRONG_CRED_AUTHORIZATION_AND_CERTMAP_FAILURE")); - ErrorNames.insert(std::make_pair(13909, "ERROR_IPSEC_IKE_NEG_STATUS_EXTENDED_END")); - ErrorNames.insert(std::make_pair(13910, "ERROR_IPSEC_BAD_SPI")); - ErrorNames.insert(std::make_pair(13911, "ERROR_IPSEC_SA_LIFETIME_EXPIRED")); - ErrorNames.insert(std::make_pair(13912, "ERROR_IPSEC_WRONG_SA")); - ErrorNames.insert(std::make_pair(13913, "ERROR_IPSEC_REPLAY_CHECK_FAILED")); - ErrorNames.insert(std::make_pair(13914, "ERROR_IPSEC_INVALID_PACKET")); - ErrorNames.insert(std::make_pair(13915, "ERROR_IPSEC_INTEGRITY_CHECK_FAILED")); - ErrorNames.insert(std::make_pair(13916, "ERROR_IPSEC_CLEAR_TEXT_DROP")); - ErrorNames.insert(std::make_pair(13917, "ERROR_IPSEC_AUTH_FIREWALL_DROP")); - ErrorNames.insert(std::make_pair(13918, "ERROR_IPSEC_THROTTLE_DROP")); - ErrorNames.insert(std::make_pair(13925, "ERROR_IPSEC_DOSP_BLOCK")); - ErrorNames.insert(std::make_pair(13926, "ERROR_IPSEC_DOSP_RECEIVED_MULTICAST")); - ErrorNames.insert(std::make_pair(13927, "ERROR_IPSEC_DOSP_INVALID_PACKET")); - ErrorNames.insert(std::make_pair(13928, "ERROR_IPSEC_DOSP_STATE_LOOKUP_FAILED")); - ErrorNames.insert(std::make_pair(13929, "ERROR_IPSEC_DOSP_MAX_ENTRIES")); - ErrorNames.insert(std::make_pair(13930, "ERROR_IPSEC_DOSP_KEYMOD_NOT_ALLOWED")); - ErrorNames.insert(std::make_pair(13931, "ERROR_IPSEC_DOSP_NOT_INSTALLED")); - ErrorNames.insert(std::make_pair(13932, "ERROR_IPSEC_DOSP_MAX_PER_IP_RATELIMIT_QUEUES")); - ErrorNames.insert(std::make_pair(14000, "ERROR_SXS_SECTION_NOT_FOUND")); - ErrorNames.insert(std::make_pair(14001, "ERROR_SXS_CANT_GEN_ACTCTX")); - ErrorNames.insert(std::make_pair(14002, "ERROR_SXS_INVALID_ACTCTXDATA_FORMAT")); - ErrorNames.insert(std::make_pair(14003, "ERROR_SXS_ASSEMBLY_NOT_FOUND")); - ErrorNames.insert(std::make_pair(14004, "ERROR_SXS_MANIFEST_FORMAT_ERROR")); - ErrorNames.insert(std::make_pair(14005, "ERROR_SXS_MANIFEST_PARSE_ERROR")); - ErrorNames.insert(std::make_pair(14006, "ERROR_SXS_ACTIVATION_CONTEXT_DISABLED")); - ErrorNames.insert(std::make_pair(14007, "ERROR_SXS_KEY_NOT_FOUND")); - ErrorNames.insert(std::make_pair(14008, "ERROR_SXS_VERSION_CONFLICT")); - ErrorNames.insert(std::make_pair(14009, "ERROR_SXS_WRONG_SECTION_TYPE")); - ErrorNames.insert(std::make_pair(14010, "ERROR_SXS_THREAD_QUERIES_DISABLED")); - ErrorNames.insert(std::make_pair(14011, "ERROR_SXS_PROCESS_DEFAULT_ALREADY_SET")); - ErrorNames.insert(std::make_pair(14012, "ERROR_SXS_UNKNOWN_ENCODING_GROUP")); - ErrorNames.insert(std::make_pair(14013, "ERROR_SXS_UNKNOWN_ENCODING")); - ErrorNames.insert(std::make_pair(14014, "ERROR_SXS_INVALID_XML_NAMESPACE_URI")); - ErrorNames.insert(std::make_pair(14015, "ERROR_SXS_ROOT_MANIFEST_DEPENDENCY_NOT_INSTALLED")); - ErrorNames.insert(std::make_pair(14016, "ERROR_SXS_LEAF_MANIFEST_DEPENDENCY_NOT_INSTALLED")); - ErrorNames.insert(std::make_pair(14017, "ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE")); - ErrorNames.insert(std::make_pair(14018, "ERROR_SXS_MANIFEST_MISSING_REQUIRED_DEFAULT_NAMESPACE")); - ErrorNames.insert(std::make_pair(14019, "ERROR_SXS_MANIFEST_INVALID_REQUIRED_DEFAULT_NAMESPACE")); - ErrorNames.insert(std::make_pair(14020, "ERROR_SXS_PRIVATE_MANIFEST_CROSS_PATH_WITH_REPARSE_POINT")); - ErrorNames.insert(std::make_pair(14021, "ERROR_SXS_DUPLICATE_DLL_NAME")); - ErrorNames.insert(std::make_pair(14022, "ERROR_SXS_DUPLICATE_WINDOWCLASS_NAME")); - ErrorNames.insert(std::make_pair(14023, "ERROR_SXS_DUPLICATE_CLSID")); - ErrorNames.insert(std::make_pair(14024, "ERROR_SXS_DUPLICATE_IID")); - ErrorNames.insert(std::make_pair(14025, "ERROR_SXS_DUPLICATE_TLBID")); - ErrorNames.insert(std::make_pair(14026, "ERROR_SXS_DUPLICATE_PROGID")); - ErrorNames.insert(std::make_pair(14027, "ERROR_SXS_DUPLICATE_ASSEMBLY_NAME")); - ErrorNames.insert(std::make_pair(14028, "ERROR_SXS_FILE_HASH_MISMATCH")); - ErrorNames.insert(std::make_pair(14029, "ERROR_SXS_POLICY_PARSE_ERROR")); - ErrorNames.insert(std::make_pair(14030, "ERROR_SXS_XML_E_MISSINGQUOTE")); - ErrorNames.insert(std::make_pair(14031, "ERROR_SXS_XML_E_COMMENTSYNTAX")); - ErrorNames.insert(std::make_pair(14032, "ERROR_SXS_XML_E_BADSTARTNAMECHAR")); - ErrorNames.insert(std::make_pair(14033, "ERROR_SXS_XML_E_BADNAMECHAR")); - ErrorNames.insert(std::make_pair(14034, "ERROR_SXS_XML_E_BADCHARINSTRING")); - ErrorNames.insert(std::make_pair(14035, "ERROR_SXS_XML_E_XMLDECLSYNTAX")); - ErrorNames.insert(std::make_pair(14036, "ERROR_SXS_XML_E_BADCHARDATA")); - ErrorNames.insert(std::make_pair(14037, "ERROR_SXS_XML_E_MISSINGWHITESPACE")); - ErrorNames.insert(std::make_pair(14038, "ERROR_SXS_XML_E_EXPECTINGTAGEND")); - ErrorNames.insert(std::make_pair(14039, "ERROR_SXS_XML_E_MISSINGSEMICOLON")); - ErrorNames.insert(std::make_pair(14040, "ERROR_SXS_XML_E_UNBALANCEDPAREN")); - ErrorNames.insert(std::make_pair(14041, "ERROR_SXS_XML_E_INTERNALERROR")); - ErrorNames.insert(std::make_pair(14042, "ERROR_SXS_XML_E_UNEXPECTED_WHITESPACE")); - ErrorNames.insert(std::make_pair(14043, "ERROR_SXS_XML_E_INCOMPLETE_ENCODING")); - ErrorNames.insert(std::make_pair(14044, "ERROR_SXS_XML_E_MISSING_PAREN")); - ErrorNames.insert(std::make_pair(14045, "ERROR_SXS_XML_E_EXPECTINGCLOSEQUOTE")); - ErrorNames.insert(std::make_pair(14046, "ERROR_SXS_XML_E_MULTIPLE_COLONS")); - ErrorNames.insert(std::make_pair(14047, "ERROR_SXS_XML_E_INVALID_DECIMAL")); - ErrorNames.insert(std::make_pair(14048, "ERROR_SXS_XML_E_INVALID_HEXIDECIMAL")); - ErrorNames.insert(std::make_pair(14049, "ERROR_SXS_XML_E_INVALID_UNICODE")); - ErrorNames.insert(std::make_pair(14050, "ERROR_SXS_XML_E_WHITESPACEORQUESTIONMARK")); - ErrorNames.insert(std::make_pair(14051, "ERROR_SXS_XML_E_UNEXPECTEDENDTAG")); - ErrorNames.insert(std::make_pair(14052, "ERROR_SXS_XML_E_UNCLOSEDTAG")); - ErrorNames.insert(std::make_pair(14053, "ERROR_SXS_XML_E_DUPLICATEATTRIBUTE")); - ErrorNames.insert(std::make_pair(14054, "ERROR_SXS_XML_E_MULTIPLEROOTS")); - ErrorNames.insert(std::make_pair(14055, "ERROR_SXS_XML_E_INVALIDATROOTLEVEL")); - ErrorNames.insert(std::make_pair(14056, "ERROR_SXS_XML_E_BADXMLDECL")); - ErrorNames.insert(std::make_pair(14057, "ERROR_SXS_XML_E_MISSINGROOT")); - ErrorNames.insert(std::make_pair(14058, "ERROR_SXS_XML_E_UNEXPECTEDEOF")); - ErrorNames.insert(std::make_pair(14059, "ERROR_SXS_XML_E_BADPEREFINSUBSET")); - ErrorNames.insert(std::make_pair(14060, "ERROR_SXS_XML_E_UNCLOSEDSTARTTAG")); - ErrorNames.insert(std::make_pair(14061, "ERROR_SXS_XML_E_UNCLOSEDENDTAG")); - ErrorNames.insert(std::make_pair(14062, "ERROR_SXS_XML_E_UNCLOSEDSTRING")); - ErrorNames.insert(std::make_pair(14063, "ERROR_SXS_XML_E_UNCLOSEDCOMMENT")); - ErrorNames.insert(std::make_pair(14064, "ERROR_SXS_XML_E_UNCLOSEDDECL")); - ErrorNames.insert(std::make_pair(14065, "ERROR_SXS_XML_E_UNCLOSEDCDATA")); - ErrorNames.insert(std::make_pair(14066, "ERROR_SXS_XML_E_RESERVEDNAMESPACE")); - ErrorNames.insert(std::make_pair(14067, "ERROR_SXS_XML_E_INVALIDENCODING")); - ErrorNames.insert(std::make_pair(14068, "ERROR_SXS_XML_E_INVALIDSWITCH")); - ErrorNames.insert(std::make_pair(14069, "ERROR_SXS_XML_E_BADXMLCASE")); - ErrorNames.insert(std::make_pair(14070, "ERROR_SXS_XML_E_INVALID_STANDALONE")); - ErrorNames.insert(std::make_pair(14071, "ERROR_SXS_XML_E_UNEXPECTED_STANDALONE")); - ErrorNames.insert(std::make_pair(14072, "ERROR_SXS_XML_E_INVALID_VERSION")); - ErrorNames.insert(std::make_pair(14073, "ERROR_SXS_XML_E_MISSINGEQUALS")); - ErrorNames.insert(std::make_pair(14074, "ERROR_SXS_PROTECTION_RECOVERY_FAILED")); - ErrorNames.insert(std::make_pair(14075, "ERROR_SXS_PROTECTION_PUBLIC_KEY_TOO_SHORT")); - ErrorNames.insert(std::make_pair(14076, "ERROR_SXS_PROTECTION_CATALOG_NOT_VALID")); - ErrorNames.insert(std::make_pair(14077, "ERROR_SXS_UNTRANSLATABLE_HRESULT")); - ErrorNames.insert(std::make_pair(14078, "ERROR_SXS_PROTECTION_CATALOG_FILE_MISSING")); - ErrorNames.insert(std::make_pair(14079, "ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE")); - ErrorNames.insert(std::make_pair(14080, "ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME")); - ErrorNames.insert(std::make_pair(14081, "ERROR_SXS_ASSEMBLY_MISSING")); - ErrorNames.insert(std::make_pair(14082, "ERROR_SXS_CORRUPT_ACTIVATION_STACK")); - ErrorNames.insert(std::make_pair(14083, "ERROR_SXS_CORRUPTION")); - ErrorNames.insert(std::make_pair(14084, "ERROR_SXS_EARLY_DEACTIVATION")); - ErrorNames.insert(std::make_pair(14085, "ERROR_SXS_INVALID_DEACTIVATION")); - ErrorNames.insert(std::make_pair(14086, "ERROR_SXS_MULTIPLE_DEACTIVATION")); - ErrorNames.insert(std::make_pair(14087, "ERROR_SXS_PROCESS_TERMINATION_REQUESTED")); - ErrorNames.insert(std::make_pair(14088, "ERROR_SXS_RELEASE_ACTIVATION_CONTEXT")); - ErrorNames.insert(std::make_pair(14089, "ERROR_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY")); - ErrorNames.insert(std::make_pair(14090, "ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE")); - ErrorNames.insert(std::make_pair(14091, "ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_NAME")); - ErrorNames.insert(std::make_pair(14092, "ERROR_SXS_IDENTITY_DUPLICATE_ATTRIBUTE")); - ErrorNames.insert(std::make_pair(14093, "ERROR_SXS_IDENTITY_PARSE_ERROR")); - ErrorNames.insert(std::make_pair(14094, "ERROR_MALFORMED_SUBSTITUTION_STRING")); - ErrorNames.insert(std::make_pair(14095, "ERROR_SXS_INCORRECT_PUBLIC_KEY_TOKEN")); - ErrorNames.insert(std::make_pair(14096, "ERROR_UNMAPPED_SUBSTITUTION_STRING")); - ErrorNames.insert(std::make_pair(14097, "ERROR_SXS_ASSEMBLY_NOT_LOCKED")); - ErrorNames.insert(std::make_pair(14098, "ERROR_SXS_COMPONENT_STORE_CORRUPT")); - ErrorNames.insert(std::make_pair(14099, "ERROR_ADVANCED_INSTALLER_FAILED")); - ErrorNames.insert(std::make_pair(14100, "ERROR_XML_ENCODING_MISMATCH")); - ErrorNames.insert(std::make_pair(14101, "ERROR_SXS_MANIFEST_IDENTITY_SAME_BUT_CONTENTS_DIFFERENT")); - ErrorNames.insert(std::make_pair(14102, "ERROR_SXS_IDENTITIES_DIFFERENT")); - ErrorNames.insert(std::make_pair(14103, "ERROR_SXS_ASSEMBLY_IS_NOT_A_DEPLOYMENT")); - ErrorNames.insert(std::make_pair(14104, "ERROR_SXS_FILE_NOT_PART_OF_ASSEMBLY")); - ErrorNames.insert(std::make_pair(14105, "ERROR_SXS_MANIFEST_TOO_BIG")); - ErrorNames.insert(std::make_pair(14106, "ERROR_SXS_SETTING_NOT_REGISTERED")); - ErrorNames.insert(std::make_pair(14107, "ERROR_SXS_TRANSACTION_CLOSURE_INCOMPLETE")); - ErrorNames.insert(std::make_pair(14108, "ERROR_SMI_PRIMITIVE_INSTALLER_FAILED")); - ErrorNames.insert(std::make_pair(14109, "ERROR_GENERIC_COMMAND_FAILED")); - ErrorNames.insert(std::make_pair(14110, "ERROR_SXS_FILE_HASH_MISSING")); - ErrorNames.insert(std::make_pair(15000, "ERROR_EVT_INVALID_CHANNEL_PATH")); - ErrorNames.insert(std::make_pair(15001, "ERROR_EVT_INVALID_QUERY")); - ErrorNames.insert(std::make_pair(15002, "ERROR_EVT_PUBLISHER_METADATA_NOT_FOUND")); - ErrorNames.insert(std::make_pair(15003, "ERROR_EVT_EVENT_TEMPLATE_NOT_FOUND")); - ErrorNames.insert(std::make_pair(15004, "ERROR_EVT_INVALID_PUBLISHER_NAME")); - ErrorNames.insert(std::make_pair(15005, "ERROR_EVT_INVALID_EVENT_DATA")); - ErrorNames.insert(std::make_pair(15007, "ERROR_EVT_CHANNEL_NOT_FOUND")); - ErrorNames.insert(std::make_pair(15008, "ERROR_EVT_MALFORMED_XML_TEXT")); - ErrorNames.insert(std::make_pair(15009, "ERROR_EVT_SUBSCRIPTION_TO_DIRECT_CHANNEL")); - ErrorNames.insert(std::make_pair(15010, "ERROR_EVT_CONFIGURATION_ERROR")); - ErrorNames.insert(std::make_pair(15011, "ERROR_EVT_QUERY_RESULT_STALE")); - ErrorNames.insert(std::make_pair(15012, "ERROR_EVT_QUERY_RESULT_INVALID_POSITION")); - ErrorNames.insert(std::make_pair(15013, "ERROR_EVT_NON_VALIDATING_MSXML")); - ErrorNames.insert(std::make_pair(15014, "ERROR_EVT_FILTER_ALREADYSCOPED")); - ErrorNames.insert(std::make_pair(15015, "ERROR_EVT_FILTER_NOTELTSET")); - ErrorNames.insert(std::make_pair(15016, "ERROR_EVT_FILTER_INVARG")); - ErrorNames.insert(std::make_pair(15017, "ERROR_EVT_FILTER_INVTEST")); - ErrorNames.insert(std::make_pair(15018, "ERROR_EVT_FILTER_INVTYPE")); - ErrorNames.insert(std::make_pair(15019, "ERROR_EVT_FILTER_PARSEERR")); - ErrorNames.insert(std::make_pair(15020, "ERROR_EVT_FILTER_UNSUPPORTEDOP")); - ErrorNames.insert(std::make_pair(15021, "ERROR_EVT_FILTER_UNEXPECTEDTOKEN")); - ErrorNames.insert(std::make_pair(15022, "ERROR_EVT_INVALID_OPERATION_OVER_ENABLED_DIRECT_CHANNEL")); - ErrorNames.insert(std::make_pair(15023, "ERROR_EVT_INVALID_CHANNEL_PROPERTY_VALUE")); - ErrorNames.insert(std::make_pair(15024, "ERROR_EVT_INVALID_PUBLISHER_PROPERTY_VALUE")); - ErrorNames.insert(std::make_pair(15025, "ERROR_EVT_CHANNEL_CANNOT_ACTIVATE")); - ErrorNames.insert(std::make_pair(15026, "ERROR_EVT_FILTER_TOO_COMPLEX")); - ErrorNames.insert(std::make_pair(15027, "ERROR_EVT_MESSAGE_NOT_FOUND")); - ErrorNames.insert(std::make_pair(15028, "ERROR_EVT_MESSAGE_ID_NOT_FOUND")); - ErrorNames.insert(std::make_pair(15029, "ERROR_EVT_UNRESOLVED_VALUE_INSERT")); - ErrorNames.insert(std::make_pair(15030, "ERROR_EVT_UNRESOLVED_PARAMETER_INSERT")); - ErrorNames.insert(std::make_pair(15031, "ERROR_EVT_MAX_INSERTS_REACHED")); - ErrorNames.insert(std::make_pair(15032, "ERROR_EVT_EVENT_DEFINITION_NOT_FOUND")); - ErrorNames.insert(std::make_pair(15033, "ERROR_EVT_MESSAGE_LOCALE_NOT_FOUND")); - ErrorNames.insert(std::make_pair(15034, "ERROR_EVT_VERSION_TOO_OLD")); - ErrorNames.insert(std::make_pair(15035, "ERROR_EVT_VERSION_TOO_NEW")); - ErrorNames.insert(std::make_pair(15036, "ERROR_EVT_CANNOT_OPEN_CHANNEL_OF_QUERY")); - ErrorNames.insert(std::make_pair(15037, "ERROR_EVT_PUBLISHER_DISABLED")); - ErrorNames.insert(std::make_pair(15038, "ERROR_EVT_FILTER_OUT_OF_RANGE")); - ErrorNames.insert(std::make_pair(15080, "ERROR_EC_SUBSCRIPTION_CANNOT_ACTIVATE")); - ErrorNames.insert(std::make_pair(15081, "ERROR_EC_LOG_DISABLED")); - ErrorNames.insert(std::make_pair(15082, "ERROR_EC_CIRCULAR_FORWARDING")); - ErrorNames.insert(std::make_pair(15083, "ERROR_EC_CREDSTORE_FULL")); - ErrorNames.insert(std::make_pair(15084, "ERROR_EC_CRED_NOT_FOUND")); - ErrorNames.insert(std::make_pair(15085, "ERROR_EC_NO_ACTIVE_CHANNEL")); - ErrorNames.insert(std::make_pair(15100, "ERROR_MUI_FILE_NOT_FOUND")); - ErrorNames.insert(std::make_pair(15101, "ERROR_MUI_INVALID_FILE")); - ErrorNames.insert(std::make_pair(15102, "ERROR_MUI_INVALID_RC_CONFIG")); - ErrorNames.insert(std::make_pair(15103, "ERROR_MUI_INVALID_LOCALE_NAME")); - ErrorNames.insert(std::make_pair(15104, "ERROR_MUI_INVALID_ULTIMATEFALLBACK_NAME")); - ErrorNames.insert(std::make_pair(15105, "ERROR_MUI_FILE_NOT_LOADED")); - ErrorNames.insert(std::make_pair(15106, "ERROR_RESOURCE_ENUM_USER_STOP")); - ErrorNames.insert(std::make_pair(15107, "ERROR_MUI_INTLSETTINGS_UILANG_NOT_INSTALLED")); - ErrorNames.insert(std::make_pair(15108, "ERROR_MUI_INTLSETTINGS_INVALID_LOCALE_NAME")); - ErrorNames.insert(std::make_pair(15200, "ERROR_MCA_INVALID_CAPABILITIES_STRING")); - ErrorNames.insert(std::make_pair(15201, "ERROR_MCA_INVALID_VCP_VERSION")); - ErrorNames.insert(std::make_pair(15202, "ERROR_MCA_MONITOR_VIOLATES_MCCS_SPECIFICATION")); - ErrorNames.insert(std::make_pair(15203, "ERROR_MCA_MCCS_VERSION_MISMATCH")); - ErrorNames.insert(std::make_pair(15204, "ERROR_MCA_UNSUPPORTED_MCCS_VERSION")); - ErrorNames.insert(std::make_pair(15205, "ERROR_MCA_INTERNAL_ERROR")); - ErrorNames.insert(std::make_pair(15206, "ERROR_MCA_INVALID_TECHNOLOGY_TYPE_RETURNED")); - ErrorNames.insert(std::make_pair(15207, "ERROR_MCA_UNSUPPORTED_COLOR_TEMPERATURE")); - ErrorNames.insert(std::make_pair(15250, "ERROR_AMBIGUOUS_SYSTEM_DEVICE")); - ErrorNames.insert(std::make_pair(15299, "ERROR_SYSTEM_DEVICE_NOT_FOUND")); - ErrorNames.insert(std::make_pair(15300, "ERROR_HASH_NOT_SUPPORTED")); - ErrorNames.insert(std::make_pair(15301, "ERROR_HASH_NOT_PRESENT")); + errorNames.insert(std::make_pair(0, "ERROR_SUCCESS")); + errorNames.insert(std::make_pair(1, "ERROR_INVALID_FUNCTION")); + errorNames.insert(std::make_pair(2, "ERROR_FILE_NOT_FOUND")); + errorNames.insert(std::make_pair(3, "ERROR_PATH_NOT_FOUND")); + errorNames.insert(std::make_pair(4, "ERROR_TOO_MANY_OPEN_FILES")); + errorNames.insert(std::make_pair(5, "ERROR_ACCESS_DENIED")); + errorNames.insert(std::make_pair(6, "ERROR_INVALID_HANDLE")); + errorNames.insert(std::make_pair(7, "ERROR_ARENA_TRASHED")); + errorNames.insert(std::make_pair(8, "ERROR_NOT_ENOUGH_MEMORY")); + errorNames.insert(std::make_pair(9, "ERROR_INVALID_BLOCK")); + errorNames.insert(std::make_pair(10, "ERROR_BAD_ENVIRONMENT")); + errorNames.insert(std::make_pair(11, "ERROR_BAD_FORMAT")); + errorNames.insert(std::make_pair(12, "ERROR_INVALID_ACCESS")); + errorNames.insert(std::make_pair(13, "ERROR_INVALID_DATA")); + errorNames.insert(std::make_pair(14, "ERROR_OUTOFMEMORY")); + errorNames.insert(std::make_pair(15, "ERROR_INVALID_DRIVE")); + errorNames.insert(std::make_pair(16, "ERROR_CURRENT_DIRECTORY")); + errorNames.insert(std::make_pair(17, "ERROR_NOT_SAME_DEVICE")); + errorNames.insert(std::make_pair(18, "ERROR_NO_MORE_FILES")); + errorNames.insert(std::make_pair(19, "ERROR_WRITE_PROTECT")); + errorNames.insert(std::make_pair(20, "ERROR_BAD_UNIT")); + errorNames.insert(std::make_pair(21, "ERROR_NOT_READY")); + errorNames.insert(std::make_pair(22, "ERROR_BAD_COMMAND")); + errorNames.insert(std::make_pair(23, "ERROR_CRC")); + errorNames.insert(std::make_pair(24, "ERROR_BAD_LENGTH")); + errorNames.insert(std::make_pair(25, "ERROR_SEEK")); + errorNames.insert(std::make_pair(26, "ERROR_NOT_DOS_DISK")); + errorNames.insert(std::make_pair(27, "ERROR_SECTOR_NOT_FOUND")); + errorNames.insert(std::make_pair(28, "ERROR_OUT_OF_PAPER")); + errorNames.insert(std::make_pair(29, "ERROR_WRITE_FAULT")); + errorNames.insert(std::make_pair(30, "ERROR_READ_FAULT")); + errorNames.insert(std::make_pair(31, "ERROR_GEN_FAILURE")); + errorNames.insert(std::make_pair(32, "ERROR_SHARING_VIOLATION")); + errorNames.insert(std::make_pair(33, "ERROR_LOCK_VIOLATION")); + errorNames.insert(std::make_pair(34, "ERROR_WRONG_DISK")); + errorNames.insert(std::make_pair(36, "ERROR_SHARING_BUFFER_EXCEEDED")); + errorNames.insert(std::make_pair(38, "ERROR_HANDLE_EOF")); + errorNames.insert(std::make_pair(39, "ERROR_HANDLE_DISK_FULL")); + errorNames.insert(std::make_pair(50, "ERROR_NOT_SUPPORTED")); + errorNames.insert(std::make_pair(51, "ERROR_REM_NOT_LIST")); + errorNames.insert(std::make_pair(52, "ERROR_DUP_NAME")); + errorNames.insert(std::make_pair(53, "ERROR_BAD_NETPATH")); + errorNames.insert(std::make_pair(54, "ERROR_NETWORK_BUSY")); + errorNames.insert(std::make_pair(55, "ERROR_DEV_NOT_EXIST")); + errorNames.insert(std::make_pair(56, "ERROR_TOO_MANY_CMDS")); + errorNames.insert(std::make_pair(57, "ERROR_ADAP_HDW_ERR")); + errorNames.insert(std::make_pair(58, "ERROR_BAD_NET_RESP")); + errorNames.insert(std::make_pair(59, "ERROR_UNEXP_NET_ERR")); + errorNames.insert(std::make_pair(60, "ERROR_BAD_REM_ADAP")); + errorNames.insert(std::make_pair(61, "ERROR_PRINTQ_FULL")); + errorNames.insert(std::make_pair(62, "ERROR_NO_SPOOL_SPACE")); + errorNames.insert(std::make_pair(63, "ERROR_PRINT_CANCELLED")); + errorNames.insert(std::make_pair(64, "ERROR_NETNAME_DELETED")); + errorNames.insert(std::make_pair(65, "ERROR_NETWORK_ACCESS_DENIED")); + errorNames.insert(std::make_pair(66, "ERROR_BAD_DEV_TYPE")); + errorNames.insert(std::make_pair(67, "ERROR_BAD_NET_NAME")); + errorNames.insert(std::make_pair(68, "ERROR_TOO_MANY_NAMES")); + errorNames.insert(std::make_pair(69, "ERROR_TOO_MANY_SESS")); + errorNames.insert(std::make_pair(70, "ERROR_SHARING_PAUSED")); + errorNames.insert(std::make_pair(71, "ERROR_REQ_NOT_ACCEP")); + errorNames.insert(std::make_pair(72, "ERROR_REDIR_PAUSED")); + errorNames.insert(std::make_pair(80, "ERROR_FILE_EXISTS")); + errorNames.insert(std::make_pair(82, "ERROR_CANNOT_MAKE")); + errorNames.insert(std::make_pair(83, "ERROR_FAIL_I24")); + errorNames.insert(std::make_pair(84, "ERROR_OUT_OF_STRUCTURES")); + errorNames.insert(std::make_pair(85, "ERROR_ALREADY_ASSIGNED")); + errorNames.insert(std::make_pair(86, "ERROR_INVALID_PASSWORD")); + errorNames.insert(std::make_pair(87, "ERROR_INVALID_PARAMETER")); + errorNames.insert(std::make_pair(88, "ERROR_NET_WRITE_FAULT")); + errorNames.insert(std::make_pair(89, "ERROR_NO_PROC_SLOTS")); + errorNames.insert(std::make_pair(100, "ERROR_TOO_MANY_SEMAPHORES")); + errorNames.insert(std::make_pair(101, "ERROR_EXCL_SEM_ALREADY_OWNED")); + errorNames.insert(std::make_pair(102, "ERROR_SEM_IS_SET")); + errorNames.insert(std::make_pair(103, "ERROR_TOO_MANY_SEM_REQUESTS")); + errorNames.insert(std::make_pair(104, "ERROR_INVALID_AT_INTERRUPT_TIME")); + errorNames.insert(std::make_pair(105, "ERROR_SEM_OWNER_DIED")); + errorNames.insert(std::make_pair(106, "ERROR_SEM_USER_LIMIT")); + errorNames.insert(std::make_pair(107, "ERROR_DISK_CHANGE")); + errorNames.insert(std::make_pair(108, "ERROR_DRIVE_LOCKED")); + errorNames.insert(std::make_pair(109, "ERROR_BROKEN_PIPE")); + errorNames.insert(std::make_pair(110, "ERROR_OPEN_FAILED")); + errorNames.insert(std::make_pair(111, "ERROR_BUFFER_OVERFLOW")); + errorNames.insert(std::make_pair(112, "ERROR_DISK_FULL")); + errorNames.insert(std::make_pair(113, "ERROR_NO_MORE_SEARCH_HANDLES")); + errorNames.insert(std::make_pair(114, "ERROR_INVALID_TARGET_HANDLE")); + errorNames.insert(std::make_pair(117, "ERROR_INVALID_CATEGORY")); + errorNames.insert(std::make_pair(118, "ERROR_INVALID_VERIFY_SWITCH")); + errorNames.insert(std::make_pair(119, "ERROR_BAD_DRIVER_LEVEL")); + errorNames.insert(std::make_pair(120, "ERROR_CALL_NOT_IMPLEMENTED")); + errorNames.insert(std::make_pair(121, "ERROR_SEM_TIMEOUT")); + errorNames.insert(std::make_pair(122, "ERROR_INSUFFICIENT_BUFFER")); + errorNames.insert(std::make_pair(123, "ERROR_INVALID_NAME")); + errorNames.insert(std::make_pair(124, "ERROR_INVALID_LEVEL")); + errorNames.insert(std::make_pair(125, "ERROR_NO_VOLUME_LABEL")); + errorNames.insert(std::make_pair(126, "ERROR_MOD_NOT_FOUND")); + errorNames.insert(std::make_pair(127, "ERROR_PROC_NOT_FOUND")); + errorNames.insert(std::make_pair(128, "ERROR_WAIT_NO_CHILDREN")); + errorNames.insert(std::make_pair(129, "ERROR_CHILD_NOT_COMPLETE")); + errorNames.insert(std::make_pair(130, "ERROR_DIRECT_ACCESS_HANDLE")); + errorNames.insert(std::make_pair(131, "ERROR_NEGATIVE_SEEK")); + errorNames.insert(std::make_pair(132, "ERROR_SEEK_ON_DEVICE")); + errorNames.insert(std::make_pair(133, "ERROR_IS_JOIN_TARGET")); + errorNames.insert(std::make_pair(134, "ERROR_IS_JOINED")); + errorNames.insert(std::make_pair(135, "ERROR_IS_SUBSTED")); + errorNames.insert(std::make_pair(136, "ERROR_NOT_JOINED")); + errorNames.insert(std::make_pair(137, "ERROR_NOT_SUBSTED")); + errorNames.insert(std::make_pair(138, "ERROR_JOIN_TO_JOIN")); + errorNames.insert(std::make_pair(139, "ERROR_SUBST_TO_SUBST")); + errorNames.insert(std::make_pair(140, "ERROR_JOIN_TO_SUBST")); + errorNames.insert(std::make_pair(141, "ERROR_SUBST_TO_JOIN")); + errorNames.insert(std::make_pair(142, "ERROR_BUSY_DRIVE")); + errorNames.insert(std::make_pair(143, "ERROR_SAME_DRIVE")); + errorNames.insert(std::make_pair(144, "ERROR_DIR_NOT_ROOT")); + errorNames.insert(std::make_pair(145, "ERROR_DIR_NOT_EMPTY")); + errorNames.insert(std::make_pair(146, "ERROR_IS_SUBST_PATH")); + errorNames.insert(std::make_pair(147, "ERROR_IS_JOIN_PATH")); + errorNames.insert(std::make_pair(148, "ERROR_PATH_BUSY")); + errorNames.insert(std::make_pair(149, "ERROR_IS_SUBST_TARGET")); + errorNames.insert(std::make_pair(150, "ERROR_SYSTEM_TRACE")); + errorNames.insert(std::make_pair(151, "ERROR_INVALID_EVENT_COUNT")); + errorNames.insert(std::make_pair(152, "ERROR_TOO_MANY_MUXWAITERS")); + errorNames.insert(std::make_pair(153, "ERROR_INVALID_LIST_FORMAT")); + errorNames.insert(std::make_pair(154, "ERROR_LABEL_TOO_LONG")); + errorNames.insert(std::make_pair(155, "ERROR_TOO_MANY_TCBS")); + errorNames.insert(std::make_pair(156, "ERROR_SIGNAL_REFUSED")); + errorNames.insert(std::make_pair(157, "ERROR_DISCARDED")); + errorNames.insert(std::make_pair(158, "ERROR_NOT_LOCKED")); + errorNames.insert(std::make_pair(159, "ERROR_BAD_THREADID_ADDR")); + errorNames.insert(std::make_pair(160, "ERROR_BAD_ARGUMENTS")); + errorNames.insert(std::make_pair(161, "ERROR_BAD_PATHNAME")); + errorNames.insert(std::make_pair(162, "ERROR_SIGNAL_PENDING")); + errorNames.insert(std::make_pair(164, "ERROR_MAX_THRDS_REACHED")); + errorNames.insert(std::make_pair(167, "ERROR_LOCK_FAILED")); + errorNames.insert(std::make_pair(170, "ERROR_BUSY")); + errorNames.insert(std::make_pair(173, "ERROR_CANCEL_VIOLATION")); + errorNames.insert(std::make_pair(174, "ERROR_ATOMIC_LOCKS_NOT_SUPPORTED")); + errorNames.insert(std::make_pair(180, "ERROR_INVALID_SEGMENT_NUMBER")); + errorNames.insert(std::make_pair(182, "ERROR_INVALID_ORDINAL")); + errorNames.insert(std::make_pair(183, "ERROR_ALREADY_EXISTS")); + errorNames.insert(std::make_pair(186, "ERROR_INVALID_FLAG_NUMBER")); + errorNames.insert(std::make_pair(187, "ERROR_SEM_NOT_FOUND")); + errorNames.insert(std::make_pair(188, "ERROR_INVALID_STARTING_CODESEG")); + errorNames.insert(std::make_pair(189, "ERROR_INVALID_STACKSEG")); + errorNames.insert(std::make_pair(190, "ERROR_INVALID_MODULETYPE")); + errorNames.insert(std::make_pair(191, "ERROR_INVALID_EXE_SIGNATURE")); + errorNames.insert(std::make_pair(192, "ERROR_EXE_MARKED_INVALID")); + errorNames.insert(std::make_pair(193, "ERROR_BAD_EXE_FORMAT")); + errorNames.insert(std::make_pair(194, "ERROR_ITERATED_DATA_EXCEEDS_64k")); + errorNames.insert(std::make_pair(195, "ERROR_INVALID_MINALLOCSIZE")); + errorNames.insert(std::make_pair(196, "ERROR_DYNLINK_FROM_INVALID_RING")); + errorNames.insert(std::make_pair(197, "ERROR_IOPL_NOT_ENABLED")); + errorNames.insert(std::make_pair(198, "ERROR_INVALID_SEGDPL")); + errorNames.insert(std::make_pair(199, "ERROR_AUTODATASEG_EXCEEDS_64k")); + errorNames.insert(std::make_pair(200, "ERROR_RING2SEG_MUST_BE_MOVABLE")); + errorNames.insert(std::make_pair(201, "ERROR_RELOC_CHAIN_XEEDS_SEGLIM")); + errorNames.insert(std::make_pair(202, "ERROR_INFLOOP_IN_RELOC_CHAIN")); + errorNames.insert(std::make_pair(203, "ERROR_ENVVAR_NOT_FOUND")); + errorNames.insert(std::make_pair(205, "ERROR_NO_SIGNAL_SENT")); + errorNames.insert(std::make_pair(206, "ERROR_FILENAME_EXCED_RANGE")); + errorNames.insert(std::make_pair(207, "ERROR_RING2_STACK_IN_USE")); + errorNames.insert(std::make_pair(208, "ERROR_META_EXPANSION_TOO_LONG")); + errorNames.insert(std::make_pair(209, "ERROR_INVALID_SIGNAL_NUMBER")); + errorNames.insert(std::make_pair(210, "ERROR_THREAD_1_INACTIVE")); + errorNames.insert(std::make_pair(212, "ERROR_LOCKED")); + errorNames.insert(std::make_pair(214, "ERROR_TOO_MANY_MODULES")); + errorNames.insert(std::make_pair(215, "ERROR_NESTING_NOT_ALLOWED")); + errorNames.insert(std::make_pair(216, "ERROR_EXE_MACHINE_TYPE_MISMATCH")); + errorNames.insert(std::make_pair(217, "ERROR_EXE_CANNOT_MODIFY_SIGNED_BINARY")); + errorNames.insert(std::make_pair(218, "ERROR_EXE_CANNOT_MODIFY_STRONG_SIGNED_BINARY")); + errorNames.insert(std::make_pair(220, "ERROR_FILE_CHECKED_OUT")); + errorNames.insert(std::make_pair(221, "ERROR_CHECKOUT_REQUIRED")); + errorNames.insert(std::make_pair(222, "ERROR_BAD_FILE_TYPE")); + errorNames.insert(std::make_pair(223, "ERROR_FILE_TOO_LARGE")); + errorNames.insert(std::make_pair(224, "ERROR_FORMS_AUTH_REQUIRED")); + errorNames.insert(std::make_pair(225, "ERROR_VIRUS_INFECTED")); + errorNames.insert(std::make_pair(226, "ERROR_VIRUS_DELETED")); + errorNames.insert(std::make_pair(229, "ERROR_PIPE_LOCAL")); + errorNames.insert(std::make_pair(230, "ERROR_BAD_PIPE")); + errorNames.insert(std::make_pair(231, "ERROR_PIPE_BUSY")); + errorNames.insert(std::make_pair(232, "ERROR_NO_DATA")); + errorNames.insert(std::make_pair(233, "ERROR_PIPE_NOT_CONNECTED")); + errorNames.insert(std::make_pair(234, "ERROR_MORE_DATA")); + errorNames.insert(std::make_pair(240, "ERROR_VC_DISCONNECTED")); + errorNames.insert(std::make_pair(254, "ERROR_INVALID_EA_NAME")); + errorNames.insert(std::make_pair(255, "ERROR_EA_LIST_INCONSISTENT")); + errorNames.insert(std::make_pair(259, "ERROR_NO_MORE_ITEMS")); + errorNames.insert(std::make_pair(266, "ERROR_CANNOT_COPY")); + errorNames.insert(std::make_pair(267, "ERROR_DIRECTORY")); + errorNames.insert(std::make_pair(275, "ERROR_EAS_DIDNT_FIT")); + errorNames.insert(std::make_pair(276, "ERROR_EA_FILE_CORRUPT")); + errorNames.insert(std::make_pair(277, "ERROR_EA_TABLE_FULL")); + errorNames.insert(std::make_pair(278, "ERROR_INVALID_EA_HANDLE")); + errorNames.insert(std::make_pair(282, "ERROR_EAS_NOT_SUPPORTED")); + errorNames.insert(std::make_pair(288, "ERROR_NOT_OWNER")); + errorNames.insert(std::make_pair(298, "ERROR_TOO_MANY_POSTS")); + errorNames.insert(std::make_pair(299, "ERROR_PARTIAL_COPY")); + errorNames.insert(std::make_pair(300, "ERROR_OPLOCK_NOT_GRANTED")); + errorNames.insert(std::make_pair(301, "ERROR_INVALID_OPLOCK_PROTOCOL")); + errorNames.insert(std::make_pair(302, "ERROR_DISK_TOO_FRAGMENTED")); + errorNames.insert(std::make_pair(303, "ERROR_DELETE_PENDING")); + errorNames.insert(std::make_pair(304, "ERROR_INCOMPATIBLE_WITH_GLOBAL_SHORT_NAME_REGISTRY_SETTING")); + errorNames.insert(std::make_pair(305, "ERROR_SHORT_NAMES_NOT_ENABLED_ON_VOLUME")); + errorNames.insert(std::make_pair(306, "ERROR_SECURITY_STREAM_IS_INCONSISTENT")); + errorNames.insert(std::make_pair(307, "ERROR_INVALID_LOCK_RANGE")); + errorNames.insert(std::make_pair(308, "ERROR_IMAGE_SUBSYSTEM_NOT_PRESENT")); + errorNames.insert(std::make_pair(309, "ERROR_NOTIFICATION_GUID_ALREADY_DEFINED")); + errorNames.insert(std::make_pair(317, "ERROR_MR_MID_NOT_FOUND")); + errorNames.insert(std::make_pair(318, "ERROR_SCOPE_NOT_FOUND")); + errorNames.insert(std::make_pair(350, "ERROR_FAIL_NOACTION_REBOOT")); + errorNames.insert(std::make_pair(351, "ERROR_FAIL_SHUTDOWN")); + errorNames.insert(std::make_pair(352, "ERROR_FAIL_RESTART")); + errorNames.insert(std::make_pair(353, "ERROR_MAX_SESSIONS_REACHED")); + errorNames.insert(std::make_pair(400, "ERROR_THREAD_MODE_ALREADY_BACKGROUND")); + errorNames.insert(std::make_pair(401, "ERROR_THREAD_MODE_NOT_BACKGROUND")); + errorNames.insert(std::make_pair(402, "ERROR_PROCESS_MODE_ALREADY_BACKGROUND")); + errorNames.insert(std::make_pair(403, "ERROR_PROCESS_MODE_NOT_BACKGROUND")); + errorNames.insert(std::make_pair(487, "ERROR_INVALID_ADDRESS")); + errorNames.insert(std::make_pair(500, "ERROR_USER_PROFILE_LOAD")); + errorNames.insert(std::make_pair(534, "ERROR_ARITHMETIC_OVERFLOW")); + errorNames.insert(std::make_pair(535, "ERROR_PIPE_CONNECTED")); + errorNames.insert(std::make_pair(536, "ERROR_PIPE_LISTENING")); + errorNames.insert(std::make_pair(537, "ERROR_VERIFIER_STOP")); + errorNames.insert(std::make_pair(538, "ERROR_ABIOS_ERROR")); + errorNames.insert(std::make_pair(539, "ERROR_WX86_WARNING")); + errorNames.insert(std::make_pair(540, "ERROR_WX86_ERROR")); + errorNames.insert(std::make_pair(541, "ERROR_TIMER_NOT_CANCELED")); + errorNames.insert(std::make_pair(542, "ERROR_UNWIND")); + errorNames.insert(std::make_pair(543, "ERROR_BAD_STACK")); + errorNames.insert(std::make_pair(544, "ERROR_INVALID_UNWIND_TARGET")); + errorNames.insert(std::make_pair(545, "ERROR_INVALID_PORT_ATTRIBUTES")); + errorNames.insert(std::make_pair(546, "ERROR_PORT_MESSAGE_TOO_LONG")); + errorNames.insert(std::make_pair(547, "ERROR_INVALID_QUOTA_LOWER")); + errorNames.insert(std::make_pair(548, "ERROR_DEVICE_ALREADY_ATTACHED")); + errorNames.insert(std::make_pair(549, "ERROR_INSTRUCTION_MISALIGNMENT")); + errorNames.insert(std::make_pair(550, "ERROR_PROFILING_NOT_STARTED")); + errorNames.insert(std::make_pair(551, "ERROR_PROFILING_NOT_STOPPED")); + errorNames.insert(std::make_pair(552, "ERROR_COULD_NOT_INTERPRET")); + errorNames.insert(std::make_pair(553, "ERROR_PROFILING_AT_LIMIT")); + errorNames.insert(std::make_pair(554, "ERROR_CANT_WAIT")); + errorNames.insert(std::make_pair(555, "ERROR_CANT_TERMINATE_SELF")); + errorNames.insert(std::make_pair(556, "ERROR_UNEXPECTED_MM_CREATE_ERR")); + errorNames.insert(std::make_pair(557, "ERROR_UNEXPECTED_MM_MAP_ERROR")); + errorNames.insert(std::make_pair(558, "ERROR_UNEXPECTED_MM_EXTEND_ERR")); + errorNames.insert(std::make_pair(559, "ERROR_BAD_FUNCTION_TABLE")); + errorNames.insert(std::make_pair(560, "ERROR_NO_GUID_TRANSLATION")); + errorNames.insert(std::make_pair(561, "ERROR_INVALID_LDT_SIZE")); + errorNames.insert(std::make_pair(563, "ERROR_INVALID_LDT_OFFSET")); + errorNames.insert(std::make_pair(564, "ERROR_INVALID_LDT_DESCRIPTOR")); + errorNames.insert(std::make_pair(565, "ERROR_TOO_MANY_THREADS")); + errorNames.insert(std::make_pair(566, "ERROR_THREAD_NOT_IN_PROCESS")); + errorNames.insert(std::make_pair(567, "ERROR_PAGEFILE_QUOTA_EXCEEDED")); + errorNames.insert(std::make_pair(568, "ERROR_LOGON_SERVER_CONFLICT")); + errorNames.insert(std::make_pair(569, "ERROR_SYNCHRONIZATION_REQUIRED")); + errorNames.insert(std::make_pair(570, "ERROR_NET_OPEN_FAILED")); + errorNames.insert(std::make_pair(571, "ERROR_IO_PRIVILEGE_FAILED")); + errorNames.insert(std::make_pair(572, "ERROR_CONTROL_C_EXIT")); + errorNames.insert(std::make_pair(573, "ERROR_MISSING_SYSTEMFILE")); + errorNames.insert(std::make_pair(574, "ERROR_UNHANDLED_EXCEPTION")); + errorNames.insert(std::make_pair(575, "ERROR_APP_INIT_FAILURE")); + errorNames.insert(std::make_pair(576, "ERROR_PAGEFILE_CREATE_FAILED")); + errorNames.insert(std::make_pair(577, "ERROR_INVALID_IMAGE_HASH")); + errorNames.insert(std::make_pair(578, "ERROR_NO_PAGEFILE")); + errorNames.insert(std::make_pair(579, "ERROR_ILLEGAL_FLOAT_CONTEXT")); + errorNames.insert(std::make_pair(580, "ERROR_NO_EVENT_PAIR")); + errorNames.insert(std::make_pair(581, "ERROR_DOMAIN_CTRLR_CONFIG_ERROR")); + errorNames.insert(std::make_pair(582, "ERROR_ILLEGAL_CHARACTER")); + errorNames.insert(std::make_pair(583, "ERROR_UNDEFINED_CHARACTER")); + errorNames.insert(std::make_pair(584, "ERROR_FLOPPY_VOLUME")); + errorNames.insert(std::make_pair(585, "ERROR_BIOS_FAILED_TO_CONNECT_INTERRUPT")); + errorNames.insert(std::make_pair(586, "ERROR_BACKUP_CONTROLLER")); + errorNames.insert(std::make_pair(587, "ERROR_MUTANT_LIMIT_EXCEEDED")); + errorNames.insert(std::make_pair(588, "ERROR_FS_DRIVER_REQUIRED")); + errorNames.insert(std::make_pair(589, "ERROR_CANNOT_LOAD_REGISTRY_FILE")); + errorNames.insert(std::make_pair(590, "ERROR_DEBUG_ATTACH_FAILED")); + errorNames.insert(std::make_pair(591, "ERROR_SYSTEM_PROCESS_TERMINATED")); + errorNames.insert(std::make_pair(592, "ERROR_DATA_NOT_ACCEPTED")); + errorNames.insert(std::make_pair(593, "ERROR_VDM_HARD_ERROR")); + errorNames.insert(std::make_pair(594, "ERROR_DRIVER_CANCEL_TIMEOUT")); + errorNames.insert(std::make_pair(595, "ERROR_REPLY_MESSAGE_MISMATCH")); + errorNames.insert(std::make_pair(596, "ERROR_LOST_WRITEBEHIND_DATA")); + errorNames.insert(std::make_pair(597, "ERROR_CLIENT_SERVER_PARAMETERS_INVALID")); + errorNames.insert(std::make_pair(598, "ERROR_NOT_TINY_STREAM")); + errorNames.insert(std::make_pair(599, "ERROR_STACK_OVERFLOW_READ")); + errorNames.insert(std::make_pair(600, "ERROR_CONVERT_TO_LARGE")); + errorNames.insert(std::make_pair(601, "ERROR_FOUND_OUT_OF_SCOPE")); + errorNames.insert(std::make_pair(602, "ERROR_ALLOCATE_BUCKET")); + errorNames.insert(std::make_pair(603, "ERROR_MARSHALL_OVERFLOW")); + errorNames.insert(std::make_pair(604, "ERROR_INVALID_VARIANT")); + errorNames.insert(std::make_pair(605, "ERROR_BAD_COMPRESSION_BUFFER")); + errorNames.insert(std::make_pair(606, "ERROR_AUDIT_FAILED")); + errorNames.insert(std::make_pair(607, "ERROR_TIMER_RESOLUTION_NOT_SET")); + errorNames.insert(std::make_pair(608, "ERROR_INSUFFICIENT_LOGON_INFO")); + errorNames.insert(std::make_pair(609, "ERROR_BAD_DLL_ENTRYPOINT")); + errorNames.insert(std::make_pair(610, "ERROR_BAD_SERVICE_ENTRYPOINT")); + errorNames.insert(std::make_pair(611, "ERROR_IP_ADDRESS_CONFLICT1")); + errorNames.insert(std::make_pair(612, "ERROR_IP_ADDRESS_CONFLICT2")); + errorNames.insert(std::make_pair(613, "ERROR_REGISTRY_QUOTA_LIMIT")); + errorNames.insert(std::make_pair(614, "ERROR_NO_CALLBACK_ACTIVE")); + errorNames.insert(std::make_pair(615, "ERROR_PWD_TOO_SHORT")); + errorNames.insert(std::make_pair(616, "ERROR_PWD_TOO_RECENT")); + errorNames.insert(std::make_pair(617, "ERROR_PWD_HISTORY_CONFLICT")); + errorNames.insert(std::make_pair(618, "ERROR_UNSUPPORTED_COMPRESSION")); + errorNames.insert(std::make_pair(619, "ERROR_INVALID_HW_PROFILE")); + errorNames.insert(std::make_pair(620, "ERROR_INVALID_PLUGPLAY_DEVICE_PATH")); + errorNames.insert(std::make_pair(621, "ERROR_QUOTA_LIST_INCONSISTENT")); + errorNames.insert(std::make_pair(622, "ERROR_EVALUATION_EXPIRATION")); + errorNames.insert(std::make_pair(623, "ERROR_ILLEGAL_DLL_RELOCATION")); + errorNames.insert(std::make_pair(624, "ERROR_DLL_INIT_FAILED_LOGOFF")); + errorNames.insert(std::make_pair(625, "ERROR_VALIDATE_CONTINUE")); + errorNames.insert(std::make_pair(626, "ERROR_NO_MORE_MATCHES")); + errorNames.insert(std::make_pair(627, "ERROR_RANGE_LIST_CONFLICT")); + errorNames.insert(std::make_pair(628, "ERROR_SERVER_SID_MISMATCH")); + errorNames.insert(std::make_pair(629, "ERROR_CANT_ENABLE_DENY_ONLY")); + errorNames.insert(std::make_pair(630, "ERROR_FLOAT_MULTIPLE_FAULTS")); + errorNames.insert(std::make_pair(631, "ERROR_FLOAT_MULTIPLE_TRAPS")); + errorNames.insert(std::make_pair(632, "ERROR_NOINTERFACE")); + errorNames.insert(std::make_pair(633, "ERROR_DRIVER_FAILED_SLEEP")); + errorNames.insert(std::make_pair(634, "ERROR_CORRUPT_SYSTEM_FILE")); + errorNames.insert(std::make_pair(635, "ERROR_COMMITMENT_MINIMUM")); + errorNames.insert(std::make_pair(636, "ERROR_PNP_RESTART_ENUMERATION")); + errorNames.insert(std::make_pair(637, "ERROR_SYSTEM_IMAGE_BAD_SIGNATURE")); + errorNames.insert(std::make_pair(638, "ERROR_PNP_REBOOT_REQUIRED")); + errorNames.insert(std::make_pair(639, "ERROR_INSUFFICIENT_POWER")); + errorNames.insert(std::make_pair(640, "ERROR_MULTIPLE_FAULT_VIOLATION")); + errorNames.insert(std::make_pair(641, "ERROR_SYSTEM_SHUTDOWN")); + errorNames.insert(std::make_pair(642, "ERROR_PORT_NOT_SET")); + errorNames.insert(std::make_pair(643, "ERROR_DS_VERSION_CHECK_FAILURE")); + errorNames.insert(std::make_pair(644, "ERROR_RANGE_NOT_FOUND")); + errorNames.insert(std::make_pair(646, "ERROR_NOT_SAFE_MODE_DRIVER")); + errorNames.insert(std::make_pair(647, "ERROR_FAILED_DRIVER_ENTRY")); + errorNames.insert(std::make_pair(648, "ERROR_DEVICE_ENUMERATION_ERROR")); + errorNames.insert(std::make_pair(649, "ERROR_MOUNT_POINT_NOT_RESOLVED")); + errorNames.insert(std::make_pair(650, "ERROR_INVALID_DEVICE_OBJECT_PARAMETER")); + errorNames.insert(std::make_pair(651, "ERROR_MCA_OCCURED")); + errorNames.insert(std::make_pair(652, "ERROR_DRIVER_DATABASE_ERROR")); + errorNames.insert(std::make_pair(653, "ERROR_SYSTEM_HIVE_TOO_LARGE")); + errorNames.insert(std::make_pair(654, "ERROR_DRIVER_FAILED_PRIOR_UNLOAD")); + errorNames.insert(std::make_pair(655, "ERROR_VOLSNAP_PREPARE_HIBERNATE")); + errorNames.insert(std::make_pair(656, "ERROR_HIBERNATION_FAILURE")); + errorNames.insert(std::make_pair(665, "ERROR_FILE_SYSTEM_LIMITATION")); + errorNames.insert(std::make_pair(668, "ERROR_ASSERTION_FAILURE")); + errorNames.insert(std::make_pair(669, "ERROR_ACPI_ERROR")); + errorNames.insert(std::make_pair(670, "ERROR_WOW_ASSERTION")); + errorNames.insert(std::make_pair(671, "ERROR_PNP_BAD_MPS_TABLE")); + errorNames.insert(std::make_pair(672, "ERROR_PNP_TRANSLATION_FAILED")); + errorNames.insert(std::make_pair(673, "ERROR_PNP_IRQ_TRANSLATION_FAILED")); + errorNames.insert(std::make_pair(674, "ERROR_PNP_INVALID_ID")); + errorNames.insert(std::make_pair(675, "ERROR_WAKE_SYSTEM_DEBUGGER")); + errorNames.insert(std::make_pair(676, "ERROR_HANDLES_CLOSED")); + errorNames.insert(std::make_pair(677, "ERROR_EXTRANEOUS_INFORMATION")); + errorNames.insert(std::make_pair(678, "ERROR_RXACT_COMMIT_NECESSARY")); + errorNames.insert(std::make_pair(679, "ERROR_MEDIA_CHECK")); + errorNames.insert(std::make_pair(680, "ERROR_GUID_SUBSTITUTION_MADE")); + errorNames.insert(std::make_pair(681, "ERROR_STOPPED_ON_SYMLINK")); + errorNames.insert(std::make_pair(682, "ERROR_LONGJUMP")); + errorNames.insert(std::make_pair(683, "ERROR_PLUGPLAY_QUERY_VETOED")); + errorNames.insert(std::make_pair(684, "ERROR_UNWIND_CONSOLIDATE")); + errorNames.insert(std::make_pair(685, "ERROR_REGISTRY_HIVE_RECOVERED")); + errorNames.insert(std::make_pair(686, "ERROR_DLL_MIGHT_BE_INSECURE")); + errorNames.insert(std::make_pair(687, "ERROR_DLL_MIGHT_BE_INCOMPATIBLE")); + errorNames.insert(std::make_pair(688, "ERROR_DBG_EXCEPTION_NOT_HANDLED")); + errorNames.insert(std::make_pair(689, "ERROR_DBG_REPLY_LATER")); + errorNames.insert(std::make_pair(690, "ERROR_DBG_UNABLE_TO_PROVIDE_HANDLE")); + errorNames.insert(std::make_pair(691, "ERROR_DBG_TERMINATE_THREAD")); + errorNames.insert(std::make_pair(692, "ERROR_DBG_TERMINATE_PROCESS")); + errorNames.insert(std::make_pair(693, "ERROR_DBG_CONTROL_C")); + errorNames.insert(std::make_pair(694, "ERROR_DBG_PRINTEXCEPTION_C")); + errorNames.insert(std::make_pair(695, "ERROR_DBG_RIPEXCEPTION")); + errorNames.insert(std::make_pair(696, "ERROR_DBG_CONTROL_BREAK")); + errorNames.insert(std::make_pair(697, "ERROR_DBG_COMMAND_EXCEPTION")); + errorNames.insert(std::make_pair(698, "ERROR_OBJECT_NAME_EXISTS")); + errorNames.insert(std::make_pair(699, "ERROR_THREAD_WAS_SUSPENDED")); + errorNames.insert(std::make_pair(700, "ERROR_IMAGE_NOT_AT_BASE")); + errorNames.insert(std::make_pair(701, "ERROR_RXACT_STATE_CREATED")); + errorNames.insert(std::make_pair(702, "ERROR_SEGMENT_NOTIFICATION")); + errorNames.insert(std::make_pair(703, "ERROR_BAD_CURRENT_DIRECTORY")); + errorNames.insert(std::make_pair(704, "ERROR_FT_READ_RECOVERY_FROM_BACKUP")); + errorNames.insert(std::make_pair(705, "ERROR_FT_WRITE_RECOVERY")); + errorNames.insert(std::make_pair(706, "ERROR_IMAGE_MACHINE_TYPE_MISMATCH")); + errorNames.insert(std::make_pair(707, "ERROR_RECEIVE_PARTIAL")); + errorNames.insert(std::make_pair(708, "ERROR_RECEIVE_EXPEDITED")); + errorNames.insert(std::make_pair(709, "ERROR_RECEIVE_PARTIAL_EXPEDITED")); + errorNames.insert(std::make_pair(710, "ERROR_EVENT_DONE")); + errorNames.insert(std::make_pair(711, "ERROR_EVENT_PENDING")); + errorNames.insert(std::make_pair(712, "ERROR_CHECKING_FILE_SYSTEM")); + errorNames.insert(std::make_pair(713, "ERROR_FATAL_APP_EXIT")); + errorNames.insert(std::make_pair(714, "ERROR_PREDEFINED_HANDLE")); + errorNames.insert(std::make_pair(715, "ERROR_WAS_UNLOCKED")); + errorNames.insert(std::make_pair(716, "ERROR_SERVICE_NOTIFICATION")); + errorNames.insert(std::make_pair(717, "ERROR_WAS_LOCKED")); + errorNames.insert(std::make_pair(718, "ERROR_LOG_HARD_ERROR")); + errorNames.insert(std::make_pair(719, "ERROR_ALREADY_WIN32")); + errorNames.insert(std::make_pair(720, "ERROR_IMAGE_MACHINE_TYPE_MISMATCH_EXE")); + errorNames.insert(std::make_pair(721, "ERROR_NO_YIELD_PERFORMED")); + errorNames.insert(std::make_pair(722, "ERROR_TIMER_RESUME_IGNORED")); + errorNames.insert(std::make_pair(723, "ERROR_ARBITRATION_UNHANDLED")); + errorNames.insert(std::make_pair(724, "ERROR_CARDBUS_NOT_SUPPORTED")); + errorNames.insert(std::make_pair(725, "ERROR_MP_PROCESSOR_MISMATCH")); + errorNames.insert(std::make_pair(726, "ERROR_HIBERNATED")); + errorNames.insert(std::make_pair(727, "ERROR_RESUME_HIBERNATION")); + errorNames.insert(std::make_pair(728, "ERROR_FIRMWARE_UPDATED")); + errorNames.insert(std::make_pair(729, "ERROR_DRIVERS_LEAKING_LOCKED_PAGES")); + errorNames.insert(std::make_pair(730, "ERROR_WAKE_SYSTEM")); + errorNames.insert(std::make_pair(731, "ERROR_WAIT_1")); + errorNames.insert(std::make_pair(732, "ERROR_WAIT_2")); + errorNames.insert(std::make_pair(733, "ERROR_WAIT_3")); + errorNames.insert(std::make_pair(734, "ERROR_WAIT_63")); + errorNames.insert(std::make_pair(735, "ERROR_ABANDONED_WAIT_0")); + errorNames.insert(std::make_pair(736, "ERROR_ABANDONED_WAIT_63")); + errorNames.insert(std::make_pair(737, "ERROR_USER_APC")); + errorNames.insert(std::make_pair(738, "ERROR_KERNEL_APC")); + errorNames.insert(std::make_pair(739, "ERROR_ALERTED")); + errorNames.insert(std::make_pair(740, "ERROR_ELEVATION_REQUIRED")); + errorNames.insert(std::make_pair(741, "ERROR_REPARSE")); + errorNames.insert(std::make_pair(742, "ERROR_OPLOCK_BREAK_IN_PROGRESS")); + errorNames.insert(std::make_pair(743, "ERROR_VOLUME_MOUNTED")); + errorNames.insert(std::make_pair(744, "ERROR_RXACT_COMMITTED")); + errorNames.insert(std::make_pair(745, "ERROR_NOTIFY_CLEANUP")); + errorNames.insert(std::make_pair(746, "ERROR_PRIMARY_TRANSPORT_CONNECT_FAILED")); + errorNames.insert(std::make_pair(747, "ERROR_PAGE_FAULT_TRANSITION")); + errorNames.insert(std::make_pair(748, "ERROR_PAGE_FAULT_DEMAND_ZERO")); + errorNames.insert(std::make_pair(749, "ERROR_PAGE_FAULT_COPY_ON_WRITE")); + errorNames.insert(std::make_pair(750, "ERROR_PAGE_FAULT_GUARD_PAGE")); + errorNames.insert(std::make_pair(751, "ERROR_PAGE_FAULT_PAGING_FILE")); + errorNames.insert(std::make_pair(752, "ERROR_CACHE_PAGE_LOCKED")); + errorNames.insert(std::make_pair(753, "ERROR_CRASH_DUMP")); + errorNames.insert(std::make_pair(754, "ERROR_BUFFER_ALL_ZEROS")); + errorNames.insert(std::make_pair(755, "ERROR_REPARSE_OBJECT")); + errorNames.insert(std::make_pair(756, "ERROR_RESOURCE_REQUIREMENTS_CHANGED")); + errorNames.insert(std::make_pair(757, "ERROR_TRANSLATION_COMPLETE")); + errorNames.insert(std::make_pair(758, "ERROR_NOTHING_TO_TERMINATE")); + errorNames.insert(std::make_pair(759, "ERROR_PROCESS_NOT_IN_JOB")); + errorNames.insert(std::make_pair(760, "ERROR_PROCESS_IN_JOB")); + errorNames.insert(std::make_pair(761, "ERROR_VOLSNAP_HIBERNATE_READY")); + errorNames.insert(std::make_pair(762, "ERROR_FSFILTER_OP_COMPLETED_SUCCESSFULLY")); + errorNames.insert(std::make_pair(763, "ERROR_INTERRUPT_VECTOR_ALREADY_CONNECTED")); + errorNames.insert(std::make_pair(764, "ERROR_INTERRUPT_STILL_CONNECTED")); + errorNames.insert(std::make_pair(765, "ERROR_WAIT_FOR_OPLOCK")); + errorNames.insert(std::make_pair(766, "ERROR_DBG_EXCEPTION_HANDLED")); + errorNames.insert(std::make_pair(767, "ERROR_DBG_CONTINUE")); + errorNames.insert(std::make_pair(768, "ERROR_CALLBACK_POP_STACK")); + errorNames.insert(std::make_pair(769, "ERROR_COMPRESSION_DISABLED")); + errorNames.insert(std::make_pair(770, "ERROR_CANTFETCHBACKWARDS")); + errorNames.insert(std::make_pair(771, "ERROR_CANTSCROLLBACKWARDS")); + errorNames.insert(std::make_pair(772, "ERROR_ROWSNOTRELEASED")); + errorNames.insert(std::make_pair(773, "ERROR_BAD_ACCESSOR_FLAGS")); + errorNames.insert(std::make_pair(774, "ERROR_ERRORS_ENCOUNTERED")); + errorNames.insert(std::make_pair(775, "ERROR_NOT_CAPABLE")); + errorNames.insert(std::make_pair(776, "ERROR_REQUEST_OUT_OF_SEQUENCE")); + errorNames.insert(std::make_pair(777, "ERROR_VERSION_PARSE_ERROR")); + errorNames.insert(std::make_pair(778, "ERROR_BADSTARTPOSITION")); + errorNames.insert(std::make_pair(779, "ERROR_MEMORY_HARDWARE")); + errorNames.insert(std::make_pair(780, "ERROR_DISK_REPAIR_DISABLED")); + errorNames.insert(std::make_pair(781, "ERROR_INSUFFICIENT_RESOURCE_FOR_SPECIFIED_SHARED_SECTION_SIZE")); + errorNames.insert(std::make_pair(782, "ERROR_SYSTEM_POWERSTATE_TRANSITION")); + errorNames.insert(std::make_pair(783, "ERROR_SYSTEM_POWERSTATE_COMPLEX_TRANSITION")); + errorNames.insert(std::make_pair(784, "ERROR_MCA_EXCEPTION")); + errorNames.insert(std::make_pair(785, "ERROR_ACCESS_AUDIT_BY_POLICY")); + errorNames.insert(std::make_pair(786, "ERROR_ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY")); + errorNames.insert(std::make_pair(787, "ERROR_ABANDON_HIBERFILE")); + errorNames.insert(std::make_pair(788, "ERROR_LOST_WRITEBEHIND_DATA_NETWORK_DISCONNECTED")); + errorNames.insert(std::make_pair(789, "ERROR_LOST_WRITEBEHIND_DATA_NETWORK_SERVER_ERROR")); + errorNames.insert(std::make_pair(790, "ERROR_LOST_WRITEBEHIND_DATA_LOCAL_DISK_ERROR")); + errorNames.insert(std::make_pair(791, "ERROR_BAD_MCFG_TABLE")); + errorNames.insert(std::make_pair(800, "ERROR_OPLOCK_SWITCHED_TO_NEW_HANDLE")); + errorNames.insert(std::make_pair(801, "ERROR_CANNOT_GRANT_REQUESTED_OPLOCK")); + errorNames.insert(std::make_pair(802, "ERROR_CANNOT_BREAK_OPLOCK")); + errorNames.insert(std::make_pair(803, "ERROR_OPLOCK_HANDLE_CLOSED")); + errorNames.insert(std::make_pair(804, "ERROR_NO_ACE_CONDITION")); + errorNames.insert(std::make_pair(805, "ERROR_INVALID_ACE_CONDITION")); + errorNames.insert(std::make_pair(994, "ERROR_EA_ACCESS_DENIED")); + errorNames.insert(std::make_pair(995, "ERROR_OPERATION_ABORTED")); + errorNames.insert(std::make_pair(996, "ERROR_IO_INCOMPLETE")); + errorNames.insert(std::make_pair(997, "ERROR_IO_PENDING")); + errorNames.insert(std::make_pair(998, "ERROR_NOACCESS")); + errorNames.insert(std::make_pair(999, "ERROR_SWAPERROR")); + errorNames.insert(std::make_pair(1001, "ERROR_STACK_OVERFLOW")); + errorNames.insert(std::make_pair(1002, "ERROR_INVALID_MESSAGE")); + errorNames.insert(std::make_pair(1003, "ERROR_CAN_NOT_COMPLETE")); + errorNames.insert(std::make_pair(1004, "ERROR_INVALID_FLAGS")); + errorNames.insert(std::make_pair(1005, "ERROR_UNRECOGNIZED_VOLUME")); + errorNames.insert(std::make_pair(1006, "ERROR_FILE_INVALID")); + errorNames.insert(std::make_pair(1007, "ERROR_FULLSCREEN_MODE")); + errorNames.insert(std::make_pair(1008, "ERROR_NO_TOKEN")); + errorNames.insert(std::make_pair(1009, "ERROR_BADDB")); + errorNames.insert(std::make_pair(1010, "ERROR_BADKEY")); + errorNames.insert(std::make_pair(1011, "ERROR_CANTOPEN")); + errorNames.insert(std::make_pair(1012, "ERROR_CANTREAD")); + errorNames.insert(std::make_pair(1013, "ERROR_CANTWRITE")); + errorNames.insert(std::make_pair(1014, "ERROR_REGISTRY_RECOVERED")); + errorNames.insert(std::make_pair(1015, "ERROR_REGISTRY_CORRUPT")); + errorNames.insert(std::make_pair(1016, "ERROR_REGISTRY_IO_FAILED")); + errorNames.insert(std::make_pair(1017, "ERROR_NOT_REGISTRY_FILE")); + errorNames.insert(std::make_pair(1018, "ERROR_KEY_DELETED")); + errorNames.insert(std::make_pair(1019, "ERROR_NO_LOG_SPACE")); + errorNames.insert(std::make_pair(1020, "ERROR_KEY_HAS_CHILDREN")); + errorNames.insert(std::make_pair(1021, "ERROR_CHILD_MUST_BE_VOLATILE")); + errorNames.insert(std::make_pair(1022, "ERROR_NOTIFY_ENUM_DIR")); + errorNames.insert(std::make_pair(1051, "ERROR_DEPENDENT_SERVICES_RUNNING")); + errorNames.insert(std::make_pair(1052, "ERROR_INVALID_SERVICE_CONTROL")); + errorNames.insert(std::make_pair(1053, "ERROR_SERVICE_REQUEST_TIMEOUT")); + errorNames.insert(std::make_pair(1054, "ERROR_SERVICE_NO_THREAD")); + errorNames.insert(std::make_pair(1055, "ERROR_SERVICE_DATABASE_LOCKED")); + errorNames.insert(std::make_pair(1056, "ERROR_SERVICE_ALREADY_RUNNING")); + errorNames.insert(std::make_pair(1057, "ERROR_INVALID_SERVICE_ACCOUNT")); + errorNames.insert(std::make_pair(1058, "ERROR_SERVICE_DISABLED")); + errorNames.insert(std::make_pair(1059, "ERROR_CIRCULAR_DEPENDENCY")); + errorNames.insert(std::make_pair(1060, "ERROR_SERVICE_DOES_NOT_EXIST")); + errorNames.insert(std::make_pair(1061, "ERROR_SERVICE_CANNOT_ACCEPT_CTRL")); + errorNames.insert(std::make_pair(1062, "ERROR_SERVICE_NOT_ACTIVE")); + errorNames.insert(std::make_pair(1063, "ERROR_FAILED_SERVICE_CONTROLLER_CONNECT")); + errorNames.insert(std::make_pair(1064, "ERROR_EXCEPTION_IN_SERVICE")); + errorNames.insert(std::make_pair(1065, "ERROR_DATABASE_DOES_NOT_EXIST")); + errorNames.insert(std::make_pair(1066, "ERROR_SERVICE_SPECIFIC_ERROR")); + errorNames.insert(std::make_pair(1067, "ERROR_PROCESS_ABORTED")); + errorNames.insert(std::make_pair(1068, "ERROR_SERVICE_DEPENDENCY_FAIL")); + errorNames.insert(std::make_pair(1069, "ERROR_SERVICE_LOGON_FAILED")); + errorNames.insert(std::make_pair(1070, "ERROR_SERVICE_START_HANG")); + errorNames.insert(std::make_pair(1071, "ERROR_INVALID_SERVICE_LOCK")); + errorNames.insert(std::make_pair(1072, "ERROR_SERVICE_MARKED_FOR_DELETE")); + errorNames.insert(std::make_pair(1073, "ERROR_SERVICE_EXISTS")); + errorNames.insert(std::make_pair(1074, "ERROR_ALREADY_RUNNING_LKG")); + errorNames.insert(std::make_pair(1075, "ERROR_SERVICE_DEPENDENCY_DELETED")); + errorNames.insert(std::make_pair(1076, "ERROR_BOOT_ALREADY_ACCEPTED")); + errorNames.insert(std::make_pair(1077, "ERROR_SERVICE_NEVER_STARTED")); + errorNames.insert(std::make_pair(1078, "ERROR_DUPLICATE_SERVICE_NAME")); + errorNames.insert(std::make_pair(1079, "ERROR_DIFFERENT_SERVICE_ACCOUNT")); + errorNames.insert(std::make_pair(1080, "ERROR_CANNOT_DETECT_DRIVER_FAILURE")); + errorNames.insert(std::make_pair(1081, "ERROR_CANNOT_DETECT_PROCESS_ABORT")); + errorNames.insert(std::make_pair(1082, "ERROR_NO_RECOVERY_PROGRAM")); + errorNames.insert(std::make_pair(1083, "ERROR_SERVICE_NOT_IN_EXE")); + errorNames.insert(std::make_pair(1084, "ERROR_NOT_SAFEBOOT_SERVICE")); + errorNames.insert(std::make_pair(1100, "ERROR_END_OF_MEDIA")); + errorNames.insert(std::make_pair(1101, "ERROR_FILEMARK_DETECTED")); + errorNames.insert(std::make_pair(1102, "ERROR_BEGINNING_OF_MEDIA")); + errorNames.insert(std::make_pair(1103, "ERROR_SETMARK_DETECTED")); + errorNames.insert(std::make_pair(1104, "ERROR_NO_DATA_DETECTED")); + errorNames.insert(std::make_pair(1105, "ERROR_PARTITION_FAILURE")); + errorNames.insert(std::make_pair(1106, "ERROR_INVALID_BLOCK_LENGTH")); + errorNames.insert(std::make_pair(1107, "ERROR_DEVICE_NOT_PARTITIONED")); + errorNames.insert(std::make_pair(1108, "ERROR_UNABLE_TO_LOCK_MEDIA")); + errorNames.insert(std::make_pair(1109, "ERROR_UNABLE_TO_UNLOAD_MEDIA")); + errorNames.insert(std::make_pair(1110, "ERROR_MEDIA_CHANGED")); + errorNames.insert(std::make_pair(1111, "ERROR_BUS_RESET")); + errorNames.insert(std::make_pair(1112, "ERROR_NO_MEDIA_IN_DRIVE")); + errorNames.insert(std::make_pair(1113, "ERROR_NO_UNICODE_TRANSLATION")); + errorNames.insert(std::make_pair(1114, "ERROR_DLL_INIT_FAILED")); + errorNames.insert(std::make_pair(1115, "ERROR_SHUTDOWN_IN_PROGRESS")); + errorNames.insert(std::make_pair(1116, "ERROR_NO_SHUTDOWN_IN_PROGRESS")); + errorNames.insert(std::make_pair(1117, "ERROR_IO_DEVICE")); + errorNames.insert(std::make_pair(1118, "ERROR_SERIAL_NO_DEVICE")); + errorNames.insert(std::make_pair(1119, "ERROR_IRQ_BUSY")); + errorNames.insert(std::make_pair(1120, "ERROR_MORE_WRITES")); + errorNames.insert(std::make_pair(1121, "ERROR_COUNTER_TIMEOUT")); + errorNames.insert(std::make_pair(1122, "ERROR_FLOPPY_ID_MARK_NOT_FOUND")); + errorNames.insert(std::make_pair(1123, "ERROR_FLOPPY_WRONG_CYLINDER")); + errorNames.insert(std::make_pair(1124, "ERROR_FLOPPY_UNKNOWN_ERROR")); + errorNames.insert(std::make_pair(1125, "ERROR_FLOPPY_BAD_REGISTERS")); + errorNames.insert(std::make_pair(1126, "ERROR_DISK_RECALIBRATE_FAILED")); + errorNames.insert(std::make_pair(1127, "ERROR_DISK_OPERATION_FAILED")); + errorNames.insert(std::make_pair(1128, "ERROR_DISK_RESET_FAILED")); + errorNames.insert(std::make_pair(1129, "ERROR_EOM_OVERFLOW")); + errorNames.insert(std::make_pair(1130, "ERROR_NOT_ENOUGH_SERVER_MEMORY")); + errorNames.insert(std::make_pair(1131, "ERROR_POSSIBLE_DEADLOCK")); + errorNames.insert(std::make_pair(1132, "ERROR_MAPPED_ALIGNMENT")); + errorNames.insert(std::make_pair(1140, "ERROR_SET_POWER_STATE_VETOED")); + errorNames.insert(std::make_pair(1141, "ERROR_SET_POWER_STATE_FAILED")); + errorNames.insert(std::make_pair(1142, "ERROR_TOO_MANY_LINKS")); + errorNames.insert(std::make_pair(1150, "ERROR_OLD_WIN_VERSION")); + errorNames.insert(std::make_pair(1151, "ERROR_APP_WRONG_OS")); + errorNames.insert(std::make_pair(1152, "ERROR_SINGLE_INSTANCE_APP")); + errorNames.insert(std::make_pair(1153, "ERROR_RMODE_APP")); + errorNames.insert(std::make_pair(1154, "ERROR_INVALID_DLL")); + errorNames.insert(std::make_pair(1155, "ERROR_NO_ASSOCIATION")); + errorNames.insert(std::make_pair(1156, "ERROR_DDE_FAIL")); + errorNames.insert(std::make_pair(1157, "ERROR_DLL_NOT_FOUND")); + errorNames.insert(std::make_pair(1158, "ERROR_NO_MORE_USER_HANDLES")); + errorNames.insert(std::make_pair(1159, "ERROR_MESSAGE_SYNC_ONLY")); + errorNames.insert(std::make_pair(1160, "ERROR_SOURCE_ELEMENT_EMPTY")); + errorNames.insert(std::make_pair(1161, "ERROR_DESTINATION_ELEMENT_FULL")); + errorNames.insert(std::make_pair(1162, "ERROR_ILLEGAL_ELEMENT_ADDRESS")); + errorNames.insert(std::make_pair(1163, "ERROR_MAGAZINE_NOT_PRESENT")); + errorNames.insert(std::make_pair(1164, "ERROR_DEVICE_REINITIALIZATION_NEEDED")); + errorNames.insert(std::make_pair(1165, "ERROR_DEVICE_REQUIRES_CLEANING")); + errorNames.insert(std::make_pair(1166, "ERROR_DEVICE_DOOR_OPEN")); + errorNames.insert(std::make_pair(1167, "ERROR_DEVICE_NOT_CONNECTED")); + errorNames.insert(std::make_pair(1168, "ERROR_NOT_FOUND")); + errorNames.insert(std::make_pair(1169, "ERROR_NO_MATCH")); + errorNames.insert(std::make_pair(1170, "ERROR_SET_NOT_FOUND")); + errorNames.insert(std::make_pair(1171, "ERROR_POINT_NOT_FOUND")); + errorNames.insert(std::make_pair(1172, "ERROR_NO_TRACKING_SERVICE")); + errorNames.insert(std::make_pair(1173, "ERROR_NO_VOLUME_ID")); + errorNames.insert(std::make_pair(1175, "ERROR_UNABLE_TO_REMOVE_REPLACED")); + errorNames.insert(std::make_pair(1176, "ERROR_UNABLE_TO_MOVE_REPLACEMENT")); + errorNames.insert(std::make_pair(1177, "ERROR_UNABLE_TO_MOVE_REPLACEMENT_2")); + errorNames.insert(std::make_pair(1178, "ERROR_JOURNAL_DELETE_IN_PROGRESS")); + errorNames.insert(std::make_pair(1179, "ERROR_JOURNAL_NOT_ACTIVE")); + errorNames.insert(std::make_pair(1180, "ERROR_POTENTIAL_FILE_FOUND")); + errorNames.insert(std::make_pair(1181, "ERROR_JOURNAL_ENTRY_DELETED")); + errorNames.insert(std::make_pair(1190, "ERROR_SHUTDOWN_IS_SCHEDULED")); + errorNames.insert(std::make_pair(1191, "ERROR_SHUTDOWN_USERS_LOGGED_ON")); + errorNames.insert(std::make_pair(1200, "ERROR_BAD_DEVICE")); + errorNames.insert(std::make_pair(1201, "ERROR_CONNECTION_UNAVAIL")); + errorNames.insert(std::make_pair(1202, "ERROR_DEVICE_ALREADY_REMEMBERED")); + errorNames.insert(std::make_pair(1203, "ERROR_NO_NET_OR_BAD_PATH")); + errorNames.insert(std::make_pair(1204, "ERROR_BAD_PROVIDER")); + errorNames.insert(std::make_pair(1205, "ERROR_CANNOT_OPEN_PROFILE")); + errorNames.insert(std::make_pair(1206, "ERROR_BAD_PROFILE")); + errorNames.insert(std::make_pair(1207, "ERROR_NOT_CONTAINER")); + errorNames.insert(std::make_pair(1208, "ERROR_EXTENDED_ERROR")); + errorNames.insert(std::make_pair(1209, "ERROR_INVALID_GROUPNAME")); + errorNames.insert(std::make_pair(1210, "ERROR_INVALID_COMPUTERNAME")); + errorNames.insert(std::make_pair(1211, "ERROR_INVALID_EVENTNAME")); + errorNames.insert(std::make_pair(1212, "ERROR_INVALID_DOMAINNAME")); + errorNames.insert(std::make_pair(1213, "ERROR_INVALID_SERVICENAME")); + errorNames.insert(std::make_pair(1214, "ERROR_INVALID_NETNAME")); + errorNames.insert(std::make_pair(1215, "ERROR_INVALID_SHARENAME")); + errorNames.insert(std::make_pair(1216, "ERROR_INVALID_PASSWORDNAME")); + errorNames.insert(std::make_pair(1217, "ERROR_INVALID_MESSAGENAME")); + errorNames.insert(std::make_pair(1218, "ERROR_INVALID_MESSAGEDEST")); + errorNames.insert(std::make_pair(1219, "ERROR_SESSION_CREDENTIAL_CONFLICT")); + errorNames.insert(std::make_pair(1220, "ERROR_REMOTE_SESSION_LIMIT_EXCEEDED")); + errorNames.insert(std::make_pair(1221, "ERROR_DUP_DOMAINNAME")); + errorNames.insert(std::make_pair(1222, "ERROR_NO_NETWORK")); + errorNames.insert(std::make_pair(1223, "ERROR_CANCELLED")); + errorNames.insert(std::make_pair(1224, "ERROR_USER_MAPPED_FILE")); + errorNames.insert(std::make_pair(1225, "ERROR_CONNECTION_REFUSED")); + errorNames.insert(std::make_pair(1226, "ERROR_GRACEFUL_DISCONNECT")); + errorNames.insert(std::make_pair(1227, "ERROR_ADDRESS_ALREADY_ASSOCIATED")); + errorNames.insert(std::make_pair(1228, "ERROR_ADDRESS_NOT_ASSOCIATED")); + errorNames.insert(std::make_pair(1229, "ERROR_CONNECTION_INVALID")); + errorNames.insert(std::make_pair(1230, "ERROR_CONNECTION_ACTIVE")); + errorNames.insert(std::make_pair(1231, "ERROR_NETWORK_UNREACHABLE")); + errorNames.insert(std::make_pair(1232, "ERROR_HOST_UNREACHABLE")); + errorNames.insert(std::make_pair(1233, "ERROR_PROTOCOL_UNREACHABLE")); + errorNames.insert(std::make_pair(1234, "ERROR_PORT_UNREACHABLE")); + errorNames.insert(std::make_pair(1235, "ERROR_REQUEST_ABORTED")); + errorNames.insert(std::make_pair(1236, "ERROR_CONNECTION_ABORTED")); + errorNames.insert(std::make_pair(1237, "ERROR_RETRY")); + errorNames.insert(std::make_pair(1238, "ERROR_CONNECTION_COUNT_LIMIT")); + errorNames.insert(std::make_pair(1239, "ERROR_LOGIN_TIME_RESTRICTION")); + errorNames.insert(std::make_pair(1240, "ERROR_LOGIN_WKSTA_RESTRICTION")); + errorNames.insert(std::make_pair(1241, "ERROR_INCORRECT_ADDRESS")); + errorNames.insert(std::make_pair(1242, "ERROR_ALREADY_REGISTERED")); + errorNames.insert(std::make_pair(1243, "ERROR_SERVICE_NOT_FOUND")); + errorNames.insert(std::make_pair(1244, "ERROR_NOT_AUTHENTICATED")); + errorNames.insert(std::make_pair(1245, "ERROR_NOT_LOGGED_ON")); + errorNames.insert(std::make_pair(1246, "ERROR_CONTINUE")); + errorNames.insert(std::make_pair(1247, "ERROR_ALREADY_INITIALIZED")); + errorNames.insert(std::make_pair(1248, "ERROR_NO_MORE_DEVICES")); + errorNames.insert(std::make_pair(1249, "ERROR_NO_SUCH_SITE")); + errorNames.insert(std::make_pair(1250, "ERROR_DOMAIN_CONTROLLER_EXISTS")); + errorNames.insert(std::make_pair(1251, "ERROR_ONLY_IF_CONNECTED")); + errorNames.insert(std::make_pair(1252, "ERROR_OVERRIDE_NOCHANGES")); + errorNames.insert(std::make_pair(1253, "ERROR_BAD_USER_PROFILE")); + errorNames.insert(std::make_pair(1254, "ERROR_NOT_SUPPORTED_ON_SBS")); + errorNames.insert(std::make_pair(1255, "ERROR_SERVER_SHUTDOWN_IN_PROGRESS")); + errorNames.insert(std::make_pair(1256, "ERROR_HOST_DOWN")); + errorNames.insert(std::make_pair(1257, "ERROR_NON_ACCOUNT_SID")); + errorNames.insert(std::make_pair(1258, "ERROR_NON_DOMAIN_SID")); + errorNames.insert(std::make_pair(1259, "ERROR_APPHELP_BLOCK")); + errorNames.insert(std::make_pair(1260, "ERROR_ACCESS_DISABLED_BY_POLICY")); + errorNames.insert(std::make_pair(1261, "ERROR_REG_NAT_CONSUMPTION")); + errorNames.insert(std::make_pair(1262, "ERROR_CSCSHARE_OFFLINE")); + errorNames.insert(std::make_pair(1263, "ERROR_PKINIT_FAILURE")); + errorNames.insert(std::make_pair(1264, "ERROR_SMARTCARD_SUBSYSTEM_FAILURE")); + errorNames.insert(std::make_pair(1265, "ERROR_DOWNGRADE_DETECTED")); + errorNames.insert(std::make_pair(1271, "ERROR_MACHINE_LOCKED")); + errorNames.insert(std::make_pair(1273, "ERROR_CALLBACK_SUPPLIED_INVALID_DATA")); + errorNames.insert(std::make_pair(1274, "ERROR_SYNC_FOREGROUND_REFRESH_REQUIRED")); + errorNames.insert(std::make_pair(1275, "ERROR_DRIVER_BLOCKED")); + errorNames.insert(std::make_pair(1276, "ERROR_INVALID_IMPORT_OF_NON_DLL")); + errorNames.insert(std::make_pair(1277, "ERROR_ACCESS_DISABLED_WEBBLADE")); + errorNames.insert(std::make_pair(1278, "ERROR_ACCESS_DISABLED_WEBBLADE_TAMPER")); + errorNames.insert(std::make_pair(1279, "ERROR_RECOVERY_FAILURE")); + errorNames.insert(std::make_pair(1280, "ERROR_ALREADY_FIBER")); + errorNames.insert(std::make_pair(1281, "ERROR_ALREADY_THREAD")); + errorNames.insert(std::make_pair(1282, "ERROR_STACK_BUFFER_OVERRUN")); + errorNames.insert(std::make_pair(1283, "ERROR_PARAMETER_QUOTA_EXCEEDED")); + errorNames.insert(std::make_pair(1284, "ERROR_DEBUGGER_INACTIVE")); + errorNames.insert(std::make_pair(1285, "ERROR_DELAY_LOAD_FAILED")); + errorNames.insert(std::make_pair(1286, "ERROR_VDM_DISALLOWED")); + errorNames.insert(std::make_pair(1287, "ERROR_UNIDENTIFIED_ERROR")); + errorNames.insert(std::make_pair(1288, "ERROR_INVALID_CRUNTIME_PARAMETER")); + errorNames.insert(std::make_pair(1289, "ERROR_BEYOND_VDL")); + errorNames.insert(std::make_pair(1290, "ERROR_INCOMPATIBLE_SERVICE_SID_TYPE")); + errorNames.insert(std::make_pair(1291, "ERROR_DRIVER_PROCESS_TERMINATED")); + errorNames.insert(std::make_pair(1292, "ERROR_IMPLEMENTATION_LIMIT")); + errorNames.insert(std::make_pair(1293, "ERROR_PROCESS_IS_PROTECTED")); + errorNames.insert(std::make_pair(1294, "ERROR_SERVICE_NOTIFY_CLIENT_LAGGING")); + errorNames.insert(std::make_pair(1295, "ERROR_DISK_QUOTA_EXCEEDED")); + errorNames.insert(std::make_pair(1296, "ERROR_CONTENT_BLOCKED")); + errorNames.insert(std::make_pair(1297, "ERROR_INCOMPATIBLE_SERVICE_PRIVILEGE")); + errorNames.insert(std::make_pair(1298, "ERROR_APP_HANG")); + errorNames.insert(std::make_pair(1299, "ERROR_INVALID_LABEL")); + errorNames.insert(std::make_pair(1300, "ERROR_NOT_ALL_ASSIGNED")); + errorNames.insert(std::make_pair(1301, "ERROR_SOME_NOT_MAPPED")); + errorNames.insert(std::make_pair(1302, "ERROR_NO_QUOTAS_FOR_ACCOUNT")); + errorNames.insert(std::make_pair(1303, "ERROR_LOCAL_USER_SESSION_KEY")); + errorNames.insert(std::make_pair(1304, "ERROR_NULL_LM_PASSWORD")); + errorNames.insert(std::make_pair(1305, "ERROR_UNKNOWN_REVISION")); + errorNames.insert(std::make_pair(1306, "ERROR_REVISION_MISMATCH")); + errorNames.insert(std::make_pair(1307, "ERROR_INVALID_OWNER")); + errorNames.insert(std::make_pair(1308, "ERROR_INVALID_PRIMARY_GROUP")); + errorNames.insert(std::make_pair(1309, "ERROR_NO_IMPERSONATION_TOKEN")); + errorNames.insert(std::make_pair(1310, "ERROR_CANT_DISABLE_MANDATORY")); + errorNames.insert(std::make_pair(1311, "ERROR_NO_LOGON_SERVERS")); + errorNames.insert(std::make_pair(1312, "ERROR_NO_SUCH_LOGON_SESSION")); + errorNames.insert(std::make_pair(1313, "ERROR_NO_SUCH_PRIVILEGE")); + errorNames.insert(std::make_pair(1314, "ERROR_PRIVILEGE_NOT_HELD")); + errorNames.insert(std::make_pair(1315, "ERROR_INVALID_ACCOUNT_NAME")); + errorNames.insert(std::make_pair(1316, "ERROR_USER_EXISTS")); + errorNames.insert(std::make_pair(1317, "ERROR_NO_SUCH_USER")); + errorNames.insert(std::make_pair(1318, "ERROR_GROUP_EXISTS")); + errorNames.insert(std::make_pair(1319, "ERROR_NO_SUCH_GROUP")); + errorNames.insert(std::make_pair(1320, "ERROR_MEMBER_IN_GROUP")); + errorNames.insert(std::make_pair(1321, "ERROR_MEMBER_NOT_IN_GROUP")); + errorNames.insert(std::make_pair(1322, "ERROR_LAST_ADMIN")); + errorNames.insert(std::make_pair(1323, "ERROR_WRONG_PASSWORD")); + errorNames.insert(std::make_pair(1324, "ERROR_ILL_FORMED_PASSWORD")); + errorNames.insert(std::make_pair(1325, "ERROR_PASSWORD_RESTRICTION")); + errorNames.insert(std::make_pair(1326, "ERROR_LOGON_FAILURE")); + errorNames.insert(std::make_pair(1327, "ERROR_ACCOUNT_RESTRICTION")); + errorNames.insert(std::make_pair(1328, "ERROR_INVALID_LOGON_HOURS")); + errorNames.insert(std::make_pair(1329, "ERROR_INVALID_WORKSTATION")); + errorNames.insert(std::make_pair(1330, "ERROR_PASSWORD_EXPIRED")); + errorNames.insert(std::make_pair(1331, "ERROR_ACCOUNT_DISABLED")); + errorNames.insert(std::make_pair(1332, "ERROR_NONE_MAPPED")); + errorNames.insert(std::make_pair(1333, "ERROR_TOO_MANY_LUIDS_REQUESTED")); + errorNames.insert(std::make_pair(1334, "ERROR_LUIDS_EXHAUSTED")); + errorNames.insert(std::make_pair(1335, "ERROR_INVALID_SUB_AUTHORITY")); + errorNames.insert(std::make_pair(1336, "ERROR_INVALID_ACL")); + errorNames.insert(std::make_pair(1337, "ERROR_INVALID_SID")); + errorNames.insert(std::make_pair(1338, "ERROR_INVALID_SECURITY_DESCR")); + errorNames.insert(std::make_pair(1340, "ERROR_BAD_INHERITANCE_ACL")); + errorNames.insert(std::make_pair(1341, "ERROR_SERVER_DISABLED")); + errorNames.insert(std::make_pair(1342, "ERROR_SERVER_NOT_DISABLED")); + errorNames.insert(std::make_pair(1343, "ERROR_INVALID_ID_AUTHORITY")); + errorNames.insert(std::make_pair(1344, "ERROR_ALLOTTED_SPACE_EXCEEDED")); + errorNames.insert(std::make_pair(1345, "ERROR_INVALID_GROUP_ATTRIBUTES")); + errorNames.insert(std::make_pair(1346, "ERROR_BAD_IMPERSONATION_LEVEL")); + errorNames.insert(std::make_pair(1347, "ERROR_CANT_OPEN_ANONYMOUS")); + errorNames.insert(std::make_pair(1348, "ERROR_BAD_VALIDATION_CLASS")); + errorNames.insert(std::make_pair(1349, "ERROR_BAD_TOKEN_TYPE")); + errorNames.insert(std::make_pair(1350, "ERROR_NO_SECURITY_ON_OBJECT")); + errorNames.insert(std::make_pair(1351, "ERROR_CANT_ACCESS_DOMAIN_INFO")); + errorNames.insert(std::make_pair(1352, "ERROR_INVALID_SERVER_STATE")); + errorNames.insert(std::make_pair(1353, "ERROR_INVALID_DOMAIN_STATE")); + errorNames.insert(std::make_pair(1354, "ERROR_INVALID_DOMAIN_ROLE")); + errorNames.insert(std::make_pair(1355, "ERROR_NO_SUCH_DOMAIN")); + errorNames.insert(std::make_pair(1356, "ERROR_DOMAIN_EXISTS")); + errorNames.insert(std::make_pair(1357, "ERROR_DOMAIN_LIMIT_EXCEEDED")); + errorNames.insert(std::make_pair(1358, "ERROR_INTERNAL_DB_CORRUPTION")); + errorNames.insert(std::make_pair(1359, "ERROR_INTERNAL_ERROR")); + errorNames.insert(std::make_pair(1360, "ERROR_GENERIC_NOT_MAPPED")); + errorNames.insert(std::make_pair(1361, "ERROR_BAD_DESCRIPTOR_FORMAT")); + errorNames.insert(std::make_pair(1362, "ERROR_NOT_LOGON_PROCESS")); + errorNames.insert(std::make_pair(1363, "ERROR_LOGON_SESSION_EXISTS")); + errorNames.insert(std::make_pair(1364, "ERROR_NO_SUCH_PACKAGE")); + errorNames.insert(std::make_pair(1365, "ERROR_BAD_LOGON_SESSION_STATE")); + errorNames.insert(std::make_pair(1366, "ERROR_LOGON_SESSION_COLLISION")); + errorNames.insert(std::make_pair(1367, "ERROR_INVALID_LOGON_TYPE")); + errorNames.insert(std::make_pair(1368, "ERROR_CANNOT_IMPERSONATE")); + errorNames.insert(std::make_pair(1369, "ERROR_RXACT_INVALID_STATE")); + errorNames.insert(std::make_pair(1370, "ERROR_RXACT_COMMIT_FAILURE")); + errorNames.insert(std::make_pair(1371, "ERROR_SPECIAL_ACCOUNT")); + errorNames.insert(std::make_pair(1372, "ERROR_SPECIAL_GROUP")); + errorNames.insert(std::make_pair(1373, "ERROR_SPECIAL_USER")); + errorNames.insert(std::make_pair(1374, "ERROR_MEMBERS_PRIMARY_GROUP")); + errorNames.insert(std::make_pair(1375, "ERROR_TOKEN_ALREADY_IN_USE")); + errorNames.insert(std::make_pair(1376, "ERROR_NO_SUCH_ALIAS")); + errorNames.insert(std::make_pair(1377, "ERROR_MEMBER_NOT_IN_ALIAS")); + errorNames.insert(std::make_pair(1378, "ERROR_MEMBER_IN_ALIAS")); + errorNames.insert(std::make_pair(1379, "ERROR_ALIAS_EXISTS")); + errorNames.insert(std::make_pair(1380, "ERROR_LOGON_NOT_GRANTED")); + errorNames.insert(std::make_pair(1381, "ERROR_TOO_MANY_SECRETS")); + errorNames.insert(std::make_pair(1382, "ERROR_SECRET_TOO_LONG")); + errorNames.insert(std::make_pair(1383, "ERROR_INTERNAL_DB_ERROR")); + errorNames.insert(std::make_pair(1384, "ERROR_TOO_MANY_CONTEXT_IDS")); + errorNames.insert(std::make_pair(1385, "ERROR_LOGON_TYPE_NOT_GRANTED")); + errorNames.insert(std::make_pair(1386, "ERROR_NT_CROSS_ENCRYPTION_REQUIRED")); + errorNames.insert(std::make_pair(1387, "ERROR_NO_SUCH_MEMBER")); + errorNames.insert(std::make_pair(1388, "ERROR_INVALID_MEMBER")); + errorNames.insert(std::make_pair(1389, "ERROR_TOO_MANY_SIDS")); + errorNames.insert(std::make_pair(1390, "ERROR_LM_CROSS_ENCRYPTION_REQUIRED")); + errorNames.insert(std::make_pair(1391, "ERROR_NO_INHERITANCE")); + errorNames.insert(std::make_pair(1392, "ERROR_FILE_CORRUPT")); + errorNames.insert(std::make_pair(1393, "ERROR_DISK_CORRUPT")); + errorNames.insert(std::make_pair(1394, "ERROR_NO_USER_SESSION_KEY")); + errorNames.insert(std::make_pair(1395, "ERROR_LICENSE_QUOTA_EXCEEDED")); + errorNames.insert(std::make_pair(1396, "ERROR_WRONG_TARGET_NAME")); + errorNames.insert(std::make_pair(1397, "ERROR_MUTUAL_AUTH_FAILED")); + errorNames.insert(std::make_pair(1398, "ERROR_TIME_SKEW")); + errorNames.insert(std::make_pair(1399, "ERROR_CURRENT_DOMAIN_NOT_ALLOWED")); + errorNames.insert(std::make_pair(1400, "ERROR_INVALID_WINDOW_HANDLE")); + errorNames.insert(std::make_pair(1401, "ERROR_INVALID_MENU_HANDLE")); + errorNames.insert(std::make_pair(1402, "ERROR_INVALID_CURSOR_HANDLE")); + errorNames.insert(std::make_pair(1403, "ERROR_INVALID_ACCEL_HANDLE")); + errorNames.insert(std::make_pair(1404, "ERROR_INVALID_HOOK_HANDLE")); + errorNames.insert(std::make_pair(1405, "ERROR_INVALID_DWP_HANDLE")); + errorNames.insert(std::make_pair(1406, "ERROR_TLW_WITH_WSCHILD")); + errorNames.insert(std::make_pair(1407, "ERROR_CANNOT_FIND_WND_CLASS")); + errorNames.insert(std::make_pair(1408, "ERROR_WINDOW_OF_OTHER_THREAD")); + errorNames.insert(std::make_pair(1409, "ERROR_HOTKEY_ALREADY_REGISTERED")); + errorNames.insert(std::make_pair(1410, "ERROR_CLASS_ALREADY_EXISTS")); + errorNames.insert(std::make_pair(1411, "ERROR_CLASS_DOES_NOT_EXIST")); + errorNames.insert(std::make_pair(1412, "ERROR_CLASS_HAS_WINDOWS")); + errorNames.insert(std::make_pair(1413, "ERROR_INVALID_INDEX")); + errorNames.insert(std::make_pair(1414, "ERROR_INVALID_ICON_HANDLE")); + errorNames.insert(std::make_pair(1415, "ERROR_PRIVATE_DIALOG_INDEX")); + errorNames.insert(std::make_pair(1416, "ERROR_LISTBOX_ID_NOT_FOUND")); + errorNames.insert(std::make_pair(1417, "ERROR_NO_WILDCARD_CHARACTERS")); + errorNames.insert(std::make_pair(1418, "ERROR_CLIPBOARD_NOT_OPEN")); + errorNames.insert(std::make_pair(1419, "ERROR_HOTKEY_NOT_REGISTERED")); + errorNames.insert(std::make_pair(1420, "ERROR_WINDOW_NOT_DIALOG")); + errorNames.insert(std::make_pair(1421, "ERROR_CONTROL_ID_NOT_FOUND")); + errorNames.insert(std::make_pair(1422, "ERROR_INVALID_COMBOBOX_MESSAGE")); + errorNames.insert(std::make_pair(1423, "ERROR_WINDOW_NOT_COMBOBOX")); + errorNames.insert(std::make_pair(1424, "ERROR_INVALID_EDIT_HEIGHT")); + errorNames.insert(std::make_pair(1425, "ERROR_DC_NOT_FOUND")); + errorNames.insert(std::make_pair(1426, "ERROR_INVALID_HOOK_FILTER")); + errorNames.insert(std::make_pair(1427, "ERROR_INVALID_FILTER_PROC")); + errorNames.insert(std::make_pair(1428, "ERROR_HOOK_NEEDS_HMOD")); + errorNames.insert(std::make_pair(1429, "ERROR_GLOBAL_ONLY_HOOK")); + errorNames.insert(std::make_pair(1430, "ERROR_JOURNAL_HOOK_SET")); + errorNames.insert(std::make_pair(1431, "ERROR_HOOK_NOT_INSTALLED")); + errorNames.insert(std::make_pair(1432, "ERROR_INVALID_LB_MESSAGE")); + errorNames.insert(std::make_pair(1433, "ERROR_SETCOUNT_ON_BAD_LB")); + errorNames.insert(std::make_pair(1434, "ERROR_LB_WITHOUT_TABSTOPS")); + errorNames.insert(std::make_pair(1435, "ERROR_DESTROY_OBJECT_OF_OTHER_THREAD")); + errorNames.insert(std::make_pair(1436, "ERROR_CHILD_WINDOW_MENU")); + errorNames.insert(std::make_pair(1437, "ERROR_NO_SYSTEM_MENU")); + errorNames.insert(std::make_pair(1438, "ERROR_INVALID_MSGBOX_STYLE")); + errorNames.insert(std::make_pair(1439, "ERROR_INVALID_SPI_VALUE")); + errorNames.insert(std::make_pair(1440, "ERROR_SCREEN_ALREADY_LOCKED")); + errorNames.insert(std::make_pair(1441, "ERROR_HWNDS_HAVE_DIFF_PARENT")); + errorNames.insert(std::make_pair(1442, "ERROR_NOT_CHILD_WINDOW")); + errorNames.insert(std::make_pair(1443, "ERROR_INVALID_GW_COMMAND")); + errorNames.insert(std::make_pair(1444, "ERROR_INVALID_THREAD_ID")); + errorNames.insert(std::make_pair(1445, "ERROR_NON_MDICHILD_WINDOW")); + errorNames.insert(std::make_pair(1446, "ERROR_POPUP_ALREADY_ACTIVE")); + errorNames.insert(std::make_pair(1447, "ERROR_NO_SCROLLBARS")); + errorNames.insert(std::make_pair(1448, "ERROR_INVALID_SCROLLBAR_RANGE")); + errorNames.insert(std::make_pair(1449, "ERROR_INVALID_SHOWWIN_COMMAND")); + errorNames.insert(std::make_pair(1450, "ERROR_NO_SYSTEM_RESOURCES")); + errorNames.insert(std::make_pair(1451, "ERROR_NONPAGED_SYSTEM_RESOURCES")); + errorNames.insert(std::make_pair(1452, "ERROR_PAGED_SYSTEM_RESOURCES")); + errorNames.insert(std::make_pair(1453, "ERROR_WORKING_SET_QUOTA")); + errorNames.insert(std::make_pair(1454, "ERROR_PAGEFILE_QUOTA")); + errorNames.insert(std::make_pair(1455, "ERROR_COMMITMENT_LIMIT")); + errorNames.insert(std::make_pair(1456, "ERROR_MENU_ITEM_NOT_FOUND")); + errorNames.insert(std::make_pair(1457, "ERROR_INVALID_KEYBOARD_HANDLE")); + errorNames.insert(std::make_pair(1458, "ERROR_HOOK_TYPE_NOT_ALLOWED")); + errorNames.insert(std::make_pair(1459, "ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION")); + errorNames.insert(std::make_pair(1460, "ERROR_TIMEOUT")); + errorNames.insert(std::make_pair(1461, "ERROR_INVALID_MONITOR_HANDLE")); + errorNames.insert(std::make_pair(1462, "ERROR_INCORRECT_SIZE")); + errorNames.insert(std::make_pair(1463, "ERROR_SYMLINK_CLASS_DISABLED")); + errorNames.insert(std::make_pair(1464, "ERROR_SYMLINK_NOT_SUPPORTED")); + errorNames.insert(std::make_pair(1465, "ERROR_XML_PARSE_ERROR")); + errorNames.insert(std::make_pair(1466, "ERROR_XMLDSIG_ERROR")); + errorNames.insert(std::make_pair(1467, "ERROR_RESTART_APPLICATION")); + errorNames.insert(std::make_pair(1468, "ERROR_WRONG_COMPARTMENT")); + errorNames.insert(std::make_pair(1469, "ERROR_AUTHIP_FAILURE")); + errorNames.insert(std::make_pair(1470, "ERROR_NO_NVRAM_RESOURCES")); + errorNames.insert(std::make_pair(1500, "ERROR_EVENTLOG_FILE_CORRUPT")); + errorNames.insert(std::make_pair(1501, "ERROR_EVENTLOG_CANT_START")); + errorNames.insert(std::make_pair(1502, "ERROR_LOG_FILE_FULL")); + errorNames.insert(std::make_pair(1503, "ERROR_EVENTLOG_FILE_CHANGED")); + errorNames.insert(std::make_pair(1550, "ERROR_INVALID_TASK_NAME")); + errorNames.insert(std::make_pair(1551, "ERROR_INVALID_TASK_INDEX")); + errorNames.insert(std::make_pair(1552, "ERROR_THREAD_ALREADY_IN_TASK")); + errorNames.insert(std::make_pair(1601, "ERROR_INSTALL_SERVICE_FAILURE")); + errorNames.insert(std::make_pair(1602, "ERROR_INSTALL_USEREXIT")); + errorNames.insert(std::make_pair(1603, "ERROR_INSTALL_FAILURE")); + errorNames.insert(std::make_pair(1604, "ERROR_INSTALL_SUSPEND")); + errorNames.insert(std::make_pair(1605, "ERROR_UNKNOWN_PRODUCT")); + errorNames.insert(std::make_pair(1606, "ERROR_UNKNOWN_FEATURE")); + errorNames.insert(std::make_pair(1607, "ERROR_UNKNOWN_COMPONENT")); + errorNames.insert(std::make_pair(1608, "ERROR_UNKNOWN_PROPERTY")); + errorNames.insert(std::make_pair(1609, "ERROR_INVALID_HANDLE_STATE")); + errorNames.insert(std::make_pair(1610, "ERROR_BAD_CONFIGURATION")); + errorNames.insert(std::make_pair(1611, "ERROR_INDEX_ABSENT")); + errorNames.insert(std::make_pair(1612, "ERROR_INSTALL_SOURCE_ABSENT")); + errorNames.insert(std::make_pair(1613, "ERROR_INSTALL_PACKAGE_VERSION")); + errorNames.insert(std::make_pair(1614, "ERROR_PRODUCT_UNINSTALLED")); + errorNames.insert(std::make_pair(1615, "ERROR_BAD_QUERY_SYNTAX")); + errorNames.insert(std::make_pair(1616, "ERROR_INVALID_FIELD")); + errorNames.insert(std::make_pair(1617, "ERROR_DEVICE_REMOVED")); + errorNames.insert(std::make_pair(1618, "ERROR_INSTALL_ALREADY_RUNNING")); + errorNames.insert(std::make_pair(1619, "ERROR_INSTALL_PACKAGE_OPEN_FAILED")); + errorNames.insert(std::make_pair(1620, "ERROR_INSTALL_PACKAGE_INVALID")); + errorNames.insert(std::make_pair(1621, "ERROR_INSTALL_UI_FAILURE")); + errorNames.insert(std::make_pair(1622, "ERROR_INSTALL_LOG_FAILURE")); + errorNames.insert(std::make_pair(1623, "ERROR_INSTALL_LANGUAGE_UNSUPPORTED")); + errorNames.insert(std::make_pair(1624, "ERROR_INSTALL_TRANSFORM_FAILURE")); + errorNames.insert(std::make_pair(1625, "ERROR_INSTALL_PACKAGE_REJECTED")); + errorNames.insert(std::make_pair(1626, "ERROR_FUNCTION_NOT_CALLED")); + errorNames.insert(std::make_pair(1627, "ERROR_FUNCTION_FAILED")); + errorNames.insert(std::make_pair(1628, "ERROR_INVALID_TABLE")); + errorNames.insert(std::make_pair(1629, "ERROR_DATATYPE_MISMATCH")); + errorNames.insert(std::make_pair(1630, "ERROR_UNSUPPORTED_TYPE")); + errorNames.insert(std::make_pair(1631, "ERROR_CREATE_FAILED")); + errorNames.insert(std::make_pair(1632, "ERROR_INSTALL_TEMP_UNWRITABLE")); + errorNames.insert(std::make_pair(1633, "ERROR_INSTALL_PLATFORM_UNSUPPORTED")); + errorNames.insert(std::make_pair(1634, "ERROR_INSTALL_NOTUSED")); + errorNames.insert(std::make_pair(1635, "ERROR_PATCH_PACKAGE_OPEN_FAILED")); + errorNames.insert(std::make_pair(1636, "ERROR_PATCH_PACKAGE_INVALID")); + errorNames.insert(std::make_pair(1637, "ERROR_PATCH_PACKAGE_UNSUPPORTED")); + errorNames.insert(std::make_pair(1638, "ERROR_PRODUCT_VERSION")); + errorNames.insert(std::make_pair(1639, "ERROR_INVALID_COMMAND_LINE")); + errorNames.insert(std::make_pair(1640, "ERROR_INSTALL_REMOTE_DISALLOWED")); + errorNames.insert(std::make_pair(1641, "ERROR_SUCCESS_REBOOT_INITIATED")); + errorNames.insert(std::make_pair(1642, "ERROR_PATCH_TARGET_NOT_FOUND")); + errorNames.insert(std::make_pair(1643, "ERROR_PATCH_PACKAGE_REJECTED")); + errorNames.insert(std::make_pair(1644, "ERROR_INSTALL_TRANSFORM_REJECTED")); + errorNames.insert(std::make_pair(1645, "ERROR_INSTALL_REMOTE_PROHIBITED")); + errorNames.insert(std::make_pair(1646, "ERROR_PATCH_REMOVAL_UNSUPPORTED")); + errorNames.insert(std::make_pair(1647, "ERROR_UNKNOWN_PATCH")); + errorNames.insert(std::make_pair(1648, "ERROR_PATCH_NO_SEQUENCE")); + errorNames.insert(std::make_pair(1649, "ERROR_PATCH_REMOVAL_DISALLOWED")); + errorNames.insert(std::make_pair(1650, "ERROR_INVALID_PATCH_XML")); + errorNames.insert(std::make_pair(1651, "ERROR_PATCH_MANAGED_ADVERTISED_PRODUCT")); + errorNames.insert(std::make_pair(1652, "ERROR_INSTALL_SERVICE_SAFEBOOT")); + errorNames.insert(std::make_pair(1653, "ERROR_FAIL_FAST_EXCEPTION")); + errorNames.insert(std::make_pair(1784, "ERROR_INVALID_USER_BUFFER")); + errorNames.insert(std::make_pair(1785, "ERROR_UNRECOGNIZED_MEDIA")); + errorNames.insert(std::make_pair(1786, "ERROR_NO_TRUST_LSA_SECRET")); + errorNames.insert(std::make_pair(1787, "ERROR_NO_TRUST_SAM_ACCOUNT")); + errorNames.insert(std::make_pair(1788, "ERROR_TRUSTED_DOMAIN_FAILURE")); + errorNames.insert(std::make_pair(1789, "ERROR_TRUSTED_RELATIONSHIP_FAILURE")); + errorNames.insert(std::make_pair(1790, "ERROR_TRUST_FAILURE")); + errorNames.insert(std::make_pair(1792, "ERROR_NETLOGON_NOT_STARTED")); + errorNames.insert(std::make_pair(1793, "ERROR_ACCOUNT_EXPIRED")); + errorNames.insert(std::make_pair(1794, "ERROR_REDIRECTOR_HAS_OPEN_HANDLES")); + errorNames.insert(std::make_pair(1795, "ERROR_PRINTER_DRIVER_ALREADY_INSTALLED")); + errorNames.insert(std::make_pair(1796, "ERROR_UNKNOWN_PORT")); + errorNames.insert(std::make_pair(1797, "ERROR_UNKNOWN_PRINTER_DRIVER")); + errorNames.insert(std::make_pair(1798, "ERROR_UNKNOWN_PRINTPROCESSOR")); + errorNames.insert(std::make_pair(1799, "ERROR_INVALID_SEPARATOR_FILE")); + errorNames.insert(std::make_pair(1800, "ERROR_INVALID_PRIORITY")); + errorNames.insert(std::make_pair(1801, "ERROR_INVALID_PRINTER_NAME")); + errorNames.insert(std::make_pair(1802, "ERROR_PRINTER_ALREADY_EXISTS")); + errorNames.insert(std::make_pair(1803, "ERROR_INVALID_PRINTER_COMMAND")); + errorNames.insert(std::make_pair(1804, "ERROR_INVALID_DATATYPE")); + errorNames.insert(std::make_pair(1805, "ERROR_INVALID_ENVIRONMENT")); + errorNames.insert(std::make_pair(1807, "ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT")); + errorNames.insert(std::make_pair(1808, "ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT")); + errorNames.insert(std::make_pair(1809, "ERROR_NOLOGON_SERVER_TRUST_ACCOUNT")); + errorNames.insert(std::make_pair(1810, "ERROR_DOMAIN_TRUST_INCONSISTENT")); + errorNames.insert(std::make_pair(1811, "ERROR_SERVER_HAS_OPEN_HANDLES")); + errorNames.insert(std::make_pair(1812, "ERROR_RESOURCE_DATA_NOT_FOUND")); + errorNames.insert(std::make_pair(1813, "ERROR_RESOURCE_TYPE_NOT_FOUND")); + errorNames.insert(std::make_pair(1814, "ERROR_RESOURCE_NAME_NOT_FOUND")); + errorNames.insert(std::make_pair(1815, "ERROR_RESOURCE_LANG_NOT_FOUND")); + errorNames.insert(std::make_pair(1816, "ERROR_NOT_ENOUGH_QUOTA")); + errorNames.insert(std::make_pair(1901, "ERROR_INVALID_TIME")); + errorNames.insert(std::make_pair(1902, "ERROR_INVALID_FORM_NAME")); + errorNames.insert(std::make_pair(1903, "ERROR_INVALID_FORM_SIZE")); + errorNames.insert(std::make_pair(1904, "ERROR_ALREADY_WAITING")); + errorNames.insert(std::make_pair(1905, "ERROR_PRINTER_DELETED")); + errorNames.insert(std::make_pair(1906, "ERROR_INVALID_PRINTER_STATE")); + errorNames.insert(std::make_pair(1907, "ERROR_PASSWORD_MUST_CHANGE")); + errorNames.insert(std::make_pair(1908, "ERROR_DOMAIN_CONTROLLER_NOT_FOUND")); + errorNames.insert(std::make_pair(1909, "ERROR_ACCOUNT_LOCKED_OUT")); + errorNames.insert(std::make_pair(1919, "ERROR_NO_SITENAME")); + errorNames.insert(std::make_pair(1920, "ERROR_CANT_ACCESS_FILE")); + errorNames.insert(std::make_pair(1921, "ERROR_CANT_RESOLVE_FILENAME")); + errorNames.insert(std::make_pair(1930, "ERROR_KM_DRIVER_BLOCKED")); + errorNames.insert(std::make_pair(1931, "ERROR_CONTEXT_EXPIRED")); + errorNames.insert(std::make_pair(1932, "ERROR_PER_USER_TRUST_QUOTA_EXCEEDED")); + errorNames.insert(std::make_pair(1933, "ERROR_ALL_USER_TRUST_QUOTA_EXCEEDED")); + errorNames.insert(std::make_pair(1934, "ERROR_USER_DELETE_TRUST_QUOTA_EXCEEDED")); + errorNames.insert(std::make_pair(1935, "ERROR_AUTHENTICATION_FIREWALL_FAILED")); + errorNames.insert(std::make_pair(1936, "ERROR_REMOTE_PRINT_CONNECTIONS_BLOCKED")); + errorNames.insert(std::make_pair(1937, "ERROR_NTLM_BLOCKED")); + errorNames.insert(std::make_pair(2000, "ERROR_INVALID_PIXEL_FORMAT")); + errorNames.insert(std::make_pair(2001, "ERROR_BAD_DRIVER")); + errorNames.insert(std::make_pair(2002, "ERROR_INVALID_WINDOW_STYLE")); + errorNames.insert(std::make_pair(2003, "ERROR_METAFILE_NOT_SUPPORTED")); + errorNames.insert(std::make_pair(2004, "ERROR_TRANSFORM_NOT_SUPPORTED")); + errorNames.insert(std::make_pair(2005, "ERROR_CLIPPING_NOT_SUPPORTED")); + errorNames.insert(std::make_pair(2010, "ERROR_INVALID_CMM")); + errorNames.insert(std::make_pair(2011, "ERROR_INVALID_PROFILE")); + errorNames.insert(std::make_pair(2012, "ERROR_TAG_NOT_FOUND")); + errorNames.insert(std::make_pair(2013, "ERROR_TAG_NOT_PRESENT")); + errorNames.insert(std::make_pair(2014, "ERROR_DUPLICATE_TAG")); + errorNames.insert(std::make_pair(2015, "ERROR_PROFILE_NOT_ASSOCIATED_WITH_DEVICE")); + errorNames.insert(std::make_pair(2016, "ERROR_PROFILE_NOT_FOUND")); + errorNames.insert(std::make_pair(2017, "ERROR_INVALID_COLORSPACE")); + errorNames.insert(std::make_pair(2018, "ERROR_ICM_NOT_ENABLED")); + errorNames.insert(std::make_pair(2019, "ERROR_DELETING_ICM_XFORM")); + errorNames.insert(std::make_pair(2020, "ERROR_INVALID_TRANSFORM")); + errorNames.insert(std::make_pair(2021, "ERROR_COLORSPACE_MISMATCH")); + errorNames.insert(std::make_pair(2022, "ERROR_INVALID_COLORINDEX")); + errorNames.insert(std::make_pair(2023, "ERROR_PROFILE_DOES_NOT_MATCH_DEVICE")); + errorNames.insert(std::make_pair(2108, "ERROR_CONNECTED_OTHER_PASSWORD")); + errorNames.insert(std::make_pair(2109, "ERROR_CONNECTED_OTHER_PASSWORD_DEFAULT")); + errorNames.insert(std::make_pair(2202, "ERROR_BAD_USERNAME")); + errorNames.insert(std::make_pair(2250, "ERROR_NOT_CONNECTED")); + errorNames.insert(std::make_pair(2401, "ERROR_OPEN_FILES")); + errorNames.insert(std::make_pair(2402, "ERROR_ACTIVE_CONNECTIONS")); + errorNames.insert(std::make_pair(2404, "ERROR_DEVICE_IN_USE")); + errorNames.insert(std::make_pair(3000, "ERROR_UNKNOWN_PRINT_MONITOR")); + errorNames.insert(std::make_pair(3001, "ERROR_PRINTER_DRIVER_IN_USE")); + errorNames.insert(std::make_pair(3002, "ERROR_SPOOL_FILE_NOT_FOUND")); + errorNames.insert(std::make_pair(3003, "ERROR_SPL_NO_STARTDOC")); + errorNames.insert(std::make_pair(3004, "ERROR_SPL_NO_ADDJOB")); + errorNames.insert(std::make_pair(3005, "ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED")); + errorNames.insert(std::make_pair(3006, "ERROR_PRINT_MONITOR_ALREADY_INSTALLED")); + errorNames.insert(std::make_pair(3007, "ERROR_INVALID_PRINT_MONITOR")); + errorNames.insert(std::make_pair(3008, "ERROR_PRINT_MONITOR_IN_USE")); + errorNames.insert(std::make_pair(3009, "ERROR_PRINTER_HAS_JOBS_QUEUED")); + errorNames.insert(std::make_pair(3010, "ERROR_SUCCESS_REBOOT_REQUIRED")); + errorNames.insert(std::make_pair(3011, "ERROR_SUCCESS_RESTART_REQUIRED")); + errorNames.insert(std::make_pair(3012, "ERROR_PRINTER_NOT_FOUND")); + errorNames.insert(std::make_pair(3013, "ERROR_PRINTER_DRIVER_WARNED")); + errorNames.insert(std::make_pair(3014, "ERROR_PRINTER_DRIVER_BLOCKED")); + errorNames.insert(std::make_pair(3015, "ERROR_PRINTER_DRIVER_PACKAGE_IN_USE")); + errorNames.insert(std::make_pair(3016, "ERROR_CORE_DRIVER_PACKAGE_NOT_FOUND")); + errorNames.insert(std::make_pair(3017, "ERROR_FAIL_REBOOT_REQUIRED")); + errorNames.insert(std::make_pair(3018, "ERROR_FAIL_REBOOT_INITIATED")); + errorNames.insert(std::make_pair(3019, "ERROR_PRINTER_DRIVER_DOWNLOAD_NEEDED")); + errorNames.insert(std::make_pair(3020, "ERROR_PRINT_JOB_RESTART_REQUIRED")); + errorNames.insert(std::make_pair(3950, "ERROR_IO_REISSUE_AS_CACHED")); + errorNames.insert(std::make_pair(4000, "ERROR_WINS_INTERNAL")); + errorNames.insert(std::make_pair(4001, "ERROR_CAN_NOT_DEL_LOCAL_WINS")); + errorNames.insert(std::make_pair(4002, "ERROR_STATIC_INIT")); + errorNames.insert(std::make_pair(4003, "ERROR_INC_BACKUP")); + errorNames.insert(std::make_pair(4004, "ERROR_FULL_BACKUP")); + errorNames.insert(std::make_pair(4005, "ERROR_REC_NON_EXISTENT")); + errorNames.insert(std::make_pair(4006, "ERROR_RPL_NOT_ALLOWED")); + errorNames.insert(std::make_pair(4100, "ERROR_DHCP_ADDRESS_CONFLICT")); + errorNames.insert(std::make_pair(4200, "ERROR_WMI_GUID_NOT_FOUND")); + errorNames.insert(std::make_pair(4201, "ERROR_WMI_INSTANCE_NOT_FOUND")); + errorNames.insert(std::make_pair(4202, "ERROR_WMI_ITEMID_NOT_FOUND")); + errorNames.insert(std::make_pair(4203, "ERROR_WMI_TRY_AGAIN")); + errorNames.insert(std::make_pair(4204, "ERROR_WMI_DP_NOT_FOUND")); + errorNames.insert(std::make_pair(4205, "ERROR_WMI_UNRESOLVED_INSTANCE_REF")); + errorNames.insert(std::make_pair(4206, "ERROR_WMI_ALREADY_ENABLED")); + errorNames.insert(std::make_pair(4207, "ERROR_WMI_GUID_DISCONNECTED")); + errorNames.insert(std::make_pair(4208, "ERROR_WMI_SERVER_UNAVAILABLE")); + errorNames.insert(std::make_pair(4209, "ERROR_WMI_DP_FAILED")); + errorNames.insert(std::make_pair(4210, "ERROR_WMI_INVALID_MOF")); + errorNames.insert(std::make_pair(4211, "ERROR_WMI_INVALID_REGINFO")); + errorNames.insert(std::make_pair(4212, "ERROR_WMI_ALREADY_DISABLED")); + errorNames.insert(std::make_pair(4213, "ERROR_WMI_READ_ONLY")); + errorNames.insert(std::make_pair(4214, "ERROR_WMI_SET_FAILURE")); + errorNames.insert(std::make_pair(4300, "ERROR_INVALID_MEDIA")); + errorNames.insert(std::make_pair(4301, "ERROR_INVALID_LIBRARY")); + errorNames.insert(std::make_pair(4302, "ERROR_INVALID_MEDIA_POOL")); + errorNames.insert(std::make_pair(4303, "ERROR_DRIVE_MEDIA_MISMATCH")); + errorNames.insert(std::make_pair(4304, "ERROR_MEDIA_OFFLINE")); + errorNames.insert(std::make_pair(4305, "ERROR_LIBRARY_OFFLINE")); + errorNames.insert(std::make_pair(4306, "ERROR_EMPTY")); + errorNames.insert(std::make_pair(4307, "ERROR_NOT_EMPTY")); + errorNames.insert(std::make_pair(4308, "ERROR_MEDIA_UNAVAILABLE")); + errorNames.insert(std::make_pair(4309, "ERROR_RESOURCE_DISABLED")); + errorNames.insert(std::make_pair(4310, "ERROR_INVALID_CLEANER")); + errorNames.insert(std::make_pair(4311, "ERROR_UNABLE_TO_CLEAN")); + errorNames.insert(std::make_pair(4312, "ERROR_OBJECT_NOT_FOUND")); + errorNames.insert(std::make_pair(4313, "ERROR_DATABASE_FAILURE")); + errorNames.insert(std::make_pair(4314, "ERROR_DATABASE_FULL")); + errorNames.insert(std::make_pair(4315, "ERROR_MEDIA_INCOMPATIBLE")); + errorNames.insert(std::make_pair(4316, "ERROR_RESOURCE_NOT_PRESENT")); + errorNames.insert(std::make_pair(4317, "ERROR_INVALID_OPERATION")); + errorNames.insert(std::make_pair(4318, "ERROR_MEDIA_NOT_AVAILABLE")); + errorNames.insert(std::make_pair(4319, "ERROR_DEVICE_NOT_AVAILABLE")); + errorNames.insert(std::make_pair(4320, "ERROR_REQUEST_REFUSED")); + errorNames.insert(std::make_pair(4321, "ERROR_INVALID_DRIVE_OBJECT")); + errorNames.insert(std::make_pair(4322, "ERROR_LIBRARY_FULL")); + errorNames.insert(std::make_pair(4323, "ERROR_MEDIUM_NOT_ACCESSIBLE")); + errorNames.insert(std::make_pair(4324, "ERROR_UNABLE_TO_LOAD_MEDIUM")); + errorNames.insert(std::make_pair(4325, "ERROR_UNABLE_TO_INVENTORY_DRIVE")); + errorNames.insert(std::make_pair(4326, "ERROR_UNABLE_TO_INVENTORY_SLOT")); + errorNames.insert(std::make_pair(4327, "ERROR_UNABLE_TO_INVENTORY_TRANSPORT")); + errorNames.insert(std::make_pair(4328, "ERROR_TRANSPORT_FULL")); + errorNames.insert(std::make_pair(4329, "ERROR_CONTROLLING_IEPORT")); + errorNames.insert(std::make_pair(4330, "ERROR_UNABLE_TO_EJECT_MOUNTED_MEDIA")); + errorNames.insert(std::make_pair(4331, "ERROR_CLEANER_SLOT_SET")); + errorNames.insert(std::make_pair(4332, "ERROR_CLEANER_SLOT_NOT_SET")); + errorNames.insert(std::make_pair(4333, "ERROR_CLEANER_CARTRIDGE_SPENT")); + errorNames.insert(std::make_pair(4334, "ERROR_UNEXPECTED_OMID")); + errorNames.insert(std::make_pair(4335, "ERROR_CANT_DELETE_LAST_ITEM")); + errorNames.insert(std::make_pair(4336, "ERROR_MESSAGE_EXCEEDS_MAX_SIZE")); + errorNames.insert(std::make_pair(4337, "ERROR_VOLUME_CONTAINS_SYS_FILES")); + errorNames.insert(std::make_pair(4338, "ERROR_INDIGENOUS_TYPE")); + errorNames.insert(std::make_pair(4339, "ERROR_NO_SUPPORTING_DRIVES")); + errorNames.insert(std::make_pair(4340, "ERROR_CLEANER_CARTRIDGE_INSTALLED")); + errorNames.insert(std::make_pair(4341, "ERROR_IEPORT_FULL")); + errorNames.insert(std::make_pair(4350, "ERROR_FILE_OFFLINE")); + errorNames.insert(std::make_pair(4351, "ERROR_REMOTE_STORAGE_NOT_ACTIVE")); + errorNames.insert(std::make_pair(4352, "ERROR_REMOTE_STORAGE_MEDIA_ERROR")); + errorNames.insert(std::make_pair(4390, "ERROR_NOT_A_REPARSE_POINT")); + errorNames.insert(std::make_pair(4391, "ERROR_REPARSE_ATTRIBUTE_CONFLICT")); + errorNames.insert(std::make_pair(4392, "ERROR_INVALID_REPARSE_DATA")); + errorNames.insert(std::make_pair(4393, "ERROR_REPARSE_TAG_INVALID")); + errorNames.insert(std::make_pair(4394, "ERROR_REPARSE_TAG_MISMATCH")); + errorNames.insert(std::make_pair(4500, "ERROR_VOLUME_NOT_SIS_ENABLED")); + errorNames.insert(std::make_pair(5001, "ERROR_DEPENDENT_RESOURCE_EXISTS")); + errorNames.insert(std::make_pair(5002, "ERROR_DEPENDENCY_NOT_FOUND")); + errorNames.insert(std::make_pair(5003, "ERROR_DEPENDENCY_ALREADY_EXISTS")); + errorNames.insert(std::make_pair(5004, "ERROR_RESOURCE_NOT_ONLINE")); + errorNames.insert(std::make_pair(5005, "ERROR_HOST_NODE_NOT_AVAILABLE")); + errorNames.insert(std::make_pair(5006, "ERROR_RESOURCE_NOT_AVAILABLE")); + errorNames.insert(std::make_pair(5007, "ERROR_RESOURCE_NOT_FOUND")); + errorNames.insert(std::make_pair(5008, "ERROR_SHUTDOWN_CLUSTER")); + errorNames.insert(std::make_pair(5009, "ERROR_CANT_EVICT_ACTIVE_NODE")); + errorNames.insert(std::make_pair(5010, "ERROR_OBJECT_ALREADY_EXISTS")); + errorNames.insert(std::make_pair(5011, "ERROR_OBJECT_IN_LIST")); + errorNames.insert(std::make_pair(5012, "ERROR_GROUP_NOT_AVAILABLE")); + errorNames.insert(std::make_pair(5013, "ERROR_GROUP_NOT_FOUND")); + errorNames.insert(std::make_pair(5014, "ERROR_GROUP_NOT_ONLINE")); + errorNames.insert(std::make_pair(5015, "ERROR_HOST_NODE_NOT_RESOURCE_OWNER")); + errorNames.insert(std::make_pair(5016, "ERROR_HOST_NODE_NOT_GROUP_OWNER")); + errorNames.insert(std::make_pair(5017, "ERROR_RESMON_CREATE_FAILED")); + errorNames.insert(std::make_pair(5018, "ERROR_RESMON_ONLINE_FAILED")); + errorNames.insert(std::make_pair(5019, "ERROR_RESOURCE_ONLINE")); + errorNames.insert(std::make_pair(5020, "ERROR_QUORUM_RESOURCE")); + errorNames.insert(std::make_pair(5021, "ERROR_NOT_QUORUM_CAPABLE")); + errorNames.insert(std::make_pair(5022, "ERROR_CLUSTER_SHUTTING_DOWN")); + errorNames.insert(std::make_pair(5023, "ERROR_INVALID_STATE")); + errorNames.insert(std::make_pair(5024, "ERROR_RESOURCE_PROPERTIES_STORED")); + errorNames.insert(std::make_pair(5025, "ERROR_NOT_QUORUM_CLASS")); + errorNames.insert(std::make_pair(5026, "ERROR_CORE_RESOURCE")); + errorNames.insert(std::make_pair(5027, "ERROR_QUORUM_RESOURCE_ONLINE_FAILED")); + errorNames.insert(std::make_pair(5028, "ERROR_QUORUMLOG_OPEN_FAILED")); + errorNames.insert(std::make_pair(5029, "ERROR_CLUSTERLOG_CORRUPT")); + errorNames.insert(std::make_pair(5030, "ERROR_CLUSTERLOG_RECORD_EXCEEDS_MAXSIZE")); + errorNames.insert(std::make_pair(5031, "ERROR_CLUSTERLOG_EXCEEDS_MAXSIZE")); + errorNames.insert(std::make_pair(5032, "ERROR_CLUSTERLOG_CHKPOINT_NOT_FOUND")); + errorNames.insert(std::make_pair(5033, "ERROR_CLUSTERLOG_NOT_ENOUGH_SPACE")); + errorNames.insert(std::make_pair(5034, "ERROR_QUORUM_OWNER_ALIVE")); + errorNames.insert(std::make_pair(5035, "ERROR_NETWORK_NOT_AVAILABLE")); + errorNames.insert(std::make_pair(5036, "ERROR_NODE_NOT_AVAILABLE")); + errorNames.insert(std::make_pair(5037, "ERROR_ALL_NODES_NOT_AVAILABLE")); + errorNames.insert(std::make_pair(5038, "ERROR_RESOURCE_FAILED")); + errorNames.insert(std::make_pair(5039, "ERROR_CLUSTER_INVALID_NODE")); + errorNames.insert(std::make_pair(5040, "ERROR_CLUSTER_NODE_EXISTS")); + errorNames.insert(std::make_pair(5041, "ERROR_CLUSTER_JOIN_IN_PROGRESS")); + errorNames.insert(std::make_pair(5042, "ERROR_CLUSTER_NODE_NOT_FOUND")); + errorNames.insert(std::make_pair(5043, "ERROR_CLUSTER_LOCAL_NODE_NOT_FOUND")); + errorNames.insert(std::make_pair(5044, "ERROR_CLUSTER_NETWORK_EXISTS")); + errorNames.insert(std::make_pair(5045, "ERROR_CLUSTER_NETWORK_NOT_FOUND")); + errorNames.insert(std::make_pair(5046, "ERROR_CLUSTER_NETINTERFACE_EXISTS")); + errorNames.insert(std::make_pair(5047, "ERROR_CLUSTER_NETINTERFACE_NOT_FOUND")); + errorNames.insert(std::make_pair(5048, "ERROR_CLUSTER_INVALID_REQUEST")); + errorNames.insert(std::make_pair(5049, "ERROR_CLUSTER_INVALID_NETWORK_PROVIDER")); + errorNames.insert(std::make_pair(5050, "ERROR_CLUSTER_NODE_DOWN")); + errorNames.insert(std::make_pair(5051, "ERROR_CLUSTER_NODE_UNREACHABLE")); + errorNames.insert(std::make_pair(5052, "ERROR_CLUSTER_NODE_NOT_MEMBER")); + errorNames.insert(std::make_pair(5053, "ERROR_CLUSTER_JOIN_NOT_IN_PROGRESS")); + errorNames.insert(std::make_pair(5054, "ERROR_CLUSTER_INVALID_NETWORK")); + errorNames.insert(std::make_pair(5056, "ERROR_CLUSTER_NODE_UP")); + errorNames.insert(std::make_pair(5057, "ERROR_CLUSTER_IPADDR_IN_USE")); + errorNames.insert(std::make_pair(5058, "ERROR_CLUSTER_NODE_NOT_PAUSED")); + errorNames.insert(std::make_pair(5059, "ERROR_CLUSTER_NO_SECURITY_CONTEXT")); + errorNames.insert(std::make_pair(5060, "ERROR_CLUSTER_NETWORK_NOT_INTERNAL")); + errorNames.insert(std::make_pair(5061, "ERROR_CLUSTER_NODE_ALREADY_UP")); + errorNames.insert(std::make_pair(5062, "ERROR_CLUSTER_NODE_ALREADY_DOWN")); + errorNames.insert(std::make_pair(5063, "ERROR_CLUSTER_NETWORK_ALREADY_ONLINE")); + errorNames.insert(std::make_pair(5064, "ERROR_CLUSTER_NETWORK_ALREADY_OFFLINE")); + errorNames.insert(std::make_pair(5065, "ERROR_CLUSTER_NODE_ALREADY_MEMBER")); + errorNames.insert(std::make_pair(5066, "ERROR_CLUSTER_LAST_INTERNAL_NETWORK")); + errorNames.insert(std::make_pair(5067, "ERROR_CLUSTER_NETWORK_HAS_DEPENDENTS")); + errorNames.insert(std::make_pair(5068, "ERROR_INVALID_OPERATION_ON_QUORUM")); + errorNames.insert(std::make_pair(5069, "ERROR_DEPENDENCY_NOT_ALLOWED")); + errorNames.insert(std::make_pair(5070, "ERROR_CLUSTER_NODE_PAUSED")); + errorNames.insert(std::make_pair(5071, "ERROR_NODE_CANT_HOST_RESOURCE")); + errorNames.insert(std::make_pair(5072, "ERROR_CLUSTER_NODE_NOT_READY")); + errorNames.insert(std::make_pair(5073, "ERROR_CLUSTER_NODE_SHUTTING_DOWN")); + errorNames.insert(std::make_pair(5074, "ERROR_CLUSTER_JOIN_ABORTED")); + errorNames.insert(std::make_pair(5075, "ERROR_CLUSTER_INCOMPATIBLE_VERSIONS")); + errorNames.insert(std::make_pair(5076, "ERROR_CLUSTER_MAXNUM_OF_RESOURCES_EXCEEDED")); + errorNames.insert(std::make_pair(5077, "ERROR_CLUSTER_SYSTEM_CONFIG_CHANGED")); + errorNames.insert(std::make_pair(5078, "ERROR_CLUSTER_RESOURCE_TYPE_NOT_FOUND")); + errorNames.insert(std::make_pair(5079, "ERROR_CLUSTER_RESTYPE_NOT_SUPPORTED")); + errorNames.insert(std::make_pair(5080, "ERROR_CLUSTER_RESNAME_NOT_FOUND")); + errorNames.insert(std::make_pair(5081, "ERROR_CLUSTER_NO_RPC_PACKAGES_REGISTERED")); + errorNames.insert(std::make_pair(5082, "ERROR_CLUSTER_OWNER_NOT_IN_PREFLIST")); + errorNames.insert(std::make_pair(5083, "ERROR_CLUSTER_DATABASE_SEQMISMATCH")); + errorNames.insert(std::make_pair(5084, "ERROR_RESMON_INVALID_STATE")); + errorNames.insert(std::make_pair(5085, "ERROR_CLUSTER_GUM_NOT_LOCKER")); + errorNames.insert(std::make_pair(5086, "ERROR_QUORUM_DISK_NOT_FOUND")); + errorNames.insert(std::make_pair(5087, "ERROR_DATABASE_BACKUP_CORRUPT")); + errorNames.insert(std::make_pair(5088, "ERROR_CLUSTER_NODE_ALREADY_HAS_DFS_ROOT")); + errorNames.insert(std::make_pair(5089, "ERROR_RESOURCE_PROPERTY_UNCHANGEABLE")); + errorNames.insert(std::make_pair(5890, "ERROR_CLUSTER_MEMBERSHIP_INVALID_STATE")); + errorNames.insert(std::make_pair(5891, "ERROR_CLUSTER_QUORUMLOG_NOT_FOUND")); + errorNames.insert(std::make_pair(5892, "ERROR_CLUSTER_MEMBERSHIP_HALT")); + errorNames.insert(std::make_pair(5893, "ERROR_CLUSTER_INSTANCE_ID_MISMATCH")); + errorNames.insert(std::make_pair(5894, "ERROR_CLUSTER_NETWORK_NOT_FOUND_FOR_IP")); + errorNames.insert(std::make_pair(5895, "ERROR_CLUSTER_PROPERTY_DATA_TYPE_MISMATCH")); + errorNames.insert(std::make_pair(5896, "ERROR_CLUSTER_EVICT_WITHOUT_CLEANUP")); + errorNames.insert(std::make_pair(5897, "ERROR_CLUSTER_PARAMETER_MISMATCH")); + errorNames.insert(std::make_pair(5898, "ERROR_NODE_CANNOT_BE_CLUSTERED")); + errorNames.insert(std::make_pair(5899, "ERROR_CLUSTER_WRONG_OS_VERSION")); + errorNames.insert(std::make_pair(5900, "ERROR_CLUSTER_CANT_CREATE_DUP_CLUSTER_NAME")); + errorNames.insert(std::make_pair(5901, "ERROR_CLUSCFG_ALREADY_COMMITTED")); + errorNames.insert(std::make_pair(5902, "ERROR_CLUSCFG_ROLLBACK_FAILED")); + errorNames.insert(std::make_pair(5903, "ERROR_CLUSCFG_SYSTEM_DISK_DRIVE_LETTER_CONFLICT")); + errorNames.insert(std::make_pair(5904, "ERROR_CLUSTER_OLD_VERSION")); + errorNames.insert(std::make_pair(5905, "ERROR_CLUSTER_MISMATCHED_COMPUTER_ACCT_NAME")); + errorNames.insert(std::make_pair(5906, "ERROR_CLUSTER_NO_NET_ADAPTERS")); + errorNames.insert(std::make_pair(5907, "ERROR_CLUSTER_POISONED")); + errorNames.insert(std::make_pair(5908, "ERROR_CLUSTER_GROUP_MOVING")); + errorNames.insert(std::make_pair(5909, "ERROR_CLUSTER_RESOURCE_TYPE_BUSY")); + errorNames.insert(std::make_pair(5910, "ERROR_RESOURCE_CALL_TIMED_OUT")); + errorNames.insert(std::make_pair(5911, "ERROR_INVALID_CLUSTER_IPV6_ADDRESS")); + errorNames.insert(std::make_pair(5912, "ERROR_CLUSTER_INTERNAL_INVALID_FUNCTION")); + errorNames.insert(std::make_pair(5913, "ERROR_CLUSTER_PARAMETER_OUT_OF_BOUNDS")); + errorNames.insert(std::make_pair(5914, "ERROR_CLUSTER_PARTIAL_SEND")); + errorNames.insert(std::make_pair(5915, "ERROR_CLUSTER_REGISTRY_INVALID_FUNCTION")); + errorNames.insert(std::make_pair(5916, "ERROR_CLUSTER_INVALID_STRING_TERMINATION")); + errorNames.insert(std::make_pair(5917, "ERROR_CLUSTER_INVALID_STRING_FORMAT")); + errorNames.insert(std::make_pair(5918, "ERROR_CLUSTER_DATABASE_TRANSACTION_IN_PROGRESS")); + errorNames.insert(std::make_pair(5919, "ERROR_CLUSTER_DATABASE_TRANSACTION_NOT_IN_PROGRESS")); + errorNames.insert(std::make_pair(5920, "ERROR_CLUSTER_NULL_DATA")); + errorNames.insert(std::make_pair(5921, "ERROR_CLUSTER_PARTIAL_READ")); + errorNames.insert(std::make_pair(5922, "ERROR_CLUSTER_PARTIAL_WRITE")); + errorNames.insert(std::make_pair(5923, "ERROR_CLUSTER_CANT_DESERIALIZE_DATA")); + errorNames.insert(std::make_pair(5924, "ERROR_DEPENDENT_RESOURCE_PROPERTY_CONFLICT")); + errorNames.insert(std::make_pair(5925, "ERROR_CLUSTER_NO_QUORUM")); + errorNames.insert(std::make_pair(5926, "ERROR_CLUSTER_INVALID_IPV6_NETWORK")); + errorNames.insert(std::make_pair(5927, "ERROR_CLUSTER_INVALID_IPV6_TUNNEL_NETWORK")); + errorNames.insert(std::make_pair(5928, "ERROR_QUORUM_NOT_ALLOWED_IN_THIS_GROUP")); + errorNames.insert(std::make_pair(5929, "ERROR_DEPENDENCY_TREE_TOO_COMPLEX")); + errorNames.insert(std::make_pair(5930, "ERROR_EXCEPTION_IN_RESOURCE_CALL")); + errorNames.insert(std::make_pair(5931, "ERROR_CLUSTER_RHS_FAILED_INITIALIZATION")); + errorNames.insert(std::make_pair(5932, "ERROR_CLUSTER_NOT_INSTALLED")); + errorNames.insert(std::make_pair(5933, "ERROR_CLUSTER_RESOURCES_MUST_BE_ONLINE_ON_THE_SAME_NODE")); + errorNames.insert(std::make_pair(5934, "ERROR_CLUSTER_MAX_NODES_IN_CLUSTER")); + errorNames.insert(std::make_pair(5935, "ERROR_CLUSTER_TOO_MANY_NODES")); + errorNames.insert(std::make_pair(5936, "ERROR_CLUSTER_OBJECT_ALREADY_USED")); + errorNames.insert(std::make_pair(5937, "ERROR_NONCORE_GROUPS_FOUND")); + errorNames.insert(std::make_pair(5938, "ERROR_FILE_SHARE_RESOURCE_CONFLICT")); + errorNames.insert(std::make_pair(5939, "ERROR_CLUSTER_EVICT_INVALID_REQUEST")); + errorNames.insert(std::make_pair(5940, "ERROR_CLUSTER_SINGLETON_RESOURCE")); + errorNames.insert(std::make_pair(5941, "ERROR_CLUSTER_GROUP_SINGLETON_RESOURCE")); + errorNames.insert(std::make_pair(5942, "ERROR_CLUSTER_RESOURCE_PROVIDER_FAILED")); + errorNames.insert(std::make_pair(5943, "ERROR_CLUSTER_RESOURCE_CONFIGURATION_ERROR")); + errorNames.insert(std::make_pair(5944, "ERROR_CLUSTER_GROUP_BUSY")); + errorNames.insert(std::make_pair(5945, "ERROR_CLUSTER_NOT_SHARED_VOLUME")); + errorNames.insert(std::make_pair(5946, "ERROR_CLUSTER_INVALID_SECURITY_DESCRIPTOR")); + errorNames.insert(std::make_pair(5947, "ERROR_CLUSTER_SHARED_VOLUMES_IN_USE")); + errorNames.insert(std::make_pair(5948, "ERROR_CLUSTER_USE_SHARED_VOLUMES_API")); + errorNames.insert(std::make_pair(5949, "ERROR_CLUSTER_BACKUP_IN_PROGRESS")); + errorNames.insert(std::make_pair(5950, "ERROR_NON_CSV_PATH")); + errorNames.insert(std::make_pair(5951, "ERROR_CSV_VOLUME_NOT_LOCAL")); + errorNames.insert(std::make_pair(5952, "ERROR_CLUSTER_WATCHDOG_TERMINATING")); + errorNames.insert(std::make_pair(6000, "ERROR_ENCRYPTION_FAILED")); + errorNames.insert(std::make_pair(6001, "ERROR_DECRYPTION_FAILED")); + errorNames.insert(std::make_pair(6002, "ERROR_FILE_ENCRYPTED")); + errorNames.insert(std::make_pair(6003, "ERROR_NO_RECOVERY_POLICY")); + errorNames.insert(std::make_pair(6004, "ERROR_NO_EFS")); + errorNames.insert(std::make_pair(6005, "ERROR_WRONG_EFS")); + errorNames.insert(std::make_pair(6006, "ERROR_NO_USER_KEYS")); + errorNames.insert(std::make_pair(6007, "ERROR_FILE_NOT_ENCRYPTED")); + errorNames.insert(std::make_pair(6008, "ERROR_NOT_EXPORT_FORMAT")); + errorNames.insert(std::make_pair(6009, "ERROR_FILE_READ_ONLY")); + errorNames.insert(std::make_pair(6010, "ERROR_DIR_EFS_DISALLOWED")); + errorNames.insert(std::make_pair(6011, "ERROR_EFS_SERVER_NOT_TRUSTED")); + errorNames.insert(std::make_pair(6012, "ERROR_BAD_RECOVERY_POLICY")); + errorNames.insert(std::make_pair(6013, "ERROR_EFS_ALG_BLOB_TOO_BIG")); + errorNames.insert(std::make_pair(6014, "ERROR_VOLUME_NOT_SUPPORT_EFS")); + errorNames.insert(std::make_pair(6015, "ERROR_EFS_DISABLED")); + errorNames.insert(std::make_pair(6016, "ERROR_EFS_VERSION_NOT_SUPPORT")); + errorNames.insert(std::make_pair(6017, "ERROR_CS_ENCRYPTION_INVALID_SERVER_RESPONSE")); + errorNames.insert(std::make_pair(6018, "ERROR_CS_ENCRYPTION_UNSUPPORTED_SERVER")); + errorNames.insert(std::make_pair(6019, "ERROR_CS_ENCRYPTION_EXISTING_ENCRYPTED_FILE")); + errorNames.insert(std::make_pair(6020, "ERROR_CS_ENCRYPTION_NEW_ENCRYPTED_FILE")); + errorNames.insert(std::make_pair(6021, "ERROR_CS_ENCRYPTION_FILE_NOT_CSE")); + errorNames.insert(std::make_pair(6022, "ERROR_ENCRYPTION_POLICY_DENIES_OPERATION")); + errorNames.insert(std::make_pair(6118, "ERROR_NO_BROWSER_SERVERS_FOUND")); + errorNames.insert(std::make_pair(6600, "ERROR_LOG_SECTOR_INVALID")); + errorNames.insert(std::make_pair(6601, "ERROR_LOG_SECTOR_PARITY_INVALID")); + errorNames.insert(std::make_pair(6602, "ERROR_LOG_SECTOR_REMAPPED")); + errorNames.insert(std::make_pair(6603, "ERROR_LOG_BLOCK_INCOMPLETE")); + errorNames.insert(std::make_pair(6604, "ERROR_LOG_INVALID_RANGE")); + errorNames.insert(std::make_pair(6605, "ERROR_LOG_BLOCKS_EXHAUSTED")); + errorNames.insert(std::make_pair(6606, "ERROR_LOG_READ_CONTEXT_INVALID")); + errorNames.insert(std::make_pair(6607, "ERROR_LOG_RESTART_INVALID")); + errorNames.insert(std::make_pair(6608, "ERROR_LOG_BLOCK_VERSION")); + errorNames.insert(std::make_pair(6609, "ERROR_LOG_BLOCK_INVALID")); + errorNames.insert(std::make_pair(6610, "ERROR_LOG_READ_MODE_INVALID")); + errorNames.insert(std::make_pair(6611, "ERROR_LOG_NO_RESTART")); + errorNames.insert(std::make_pair(6612, "ERROR_LOG_METADATA_CORRUPT")); + errorNames.insert(std::make_pair(6613, "ERROR_LOG_METADATA_INVALID")); + errorNames.insert(std::make_pair(6614, "ERROR_LOG_METADATA_INCONSISTENT")); + errorNames.insert(std::make_pair(6615, "ERROR_LOG_RESERVATION_INVALID")); + errorNames.insert(std::make_pair(6616, "ERROR_LOG_CANT_DELETE")); + errorNames.insert(std::make_pair(6617, "ERROR_LOG_CONTAINER_LIMIT_EXCEEDED")); + errorNames.insert(std::make_pair(6618, "ERROR_LOG_START_OF_LOG")); + errorNames.insert(std::make_pair(6619, "ERROR_LOG_POLICY_ALREADY_INSTALLED")); + errorNames.insert(std::make_pair(6620, "ERROR_LOG_POLICY_NOT_INSTALLED")); + errorNames.insert(std::make_pair(6621, "ERROR_LOG_POLICY_INVALID")); + errorNames.insert(std::make_pair(6622, "ERROR_LOG_POLICY_CONFLICT")); + errorNames.insert(std::make_pair(6623, "ERROR_LOG_PINNED_ARCHIVE_TAIL")); + errorNames.insert(std::make_pair(6624, "ERROR_LOG_RECORD_NONEXISTENT")); + errorNames.insert(std::make_pair(6625, "ERROR_LOG_RECORDS_RESERVED_INVALID")); + errorNames.insert(std::make_pair(6626, "ERROR_LOG_SPACE_RESERVED_INVALID")); + errorNames.insert(std::make_pair(6627, "ERROR_LOG_TAIL_INVALID")); + errorNames.insert(std::make_pair(6628, "ERROR_LOG_FULL")); + errorNames.insert(std::make_pair(6629, "ERROR_COULD_NOT_RESIZE_LOG")); + errorNames.insert(std::make_pair(6630, "ERROR_LOG_MULTIPLEXED")); + errorNames.insert(std::make_pair(6631, "ERROR_LOG_DEDICATED")); + errorNames.insert(std::make_pair(6632, "ERROR_LOG_ARCHIVE_NOT_IN_PROGRESS")); + errorNames.insert(std::make_pair(6633, "ERROR_LOG_ARCHIVE_IN_PROGRESS")); + errorNames.insert(std::make_pair(6634, "ERROR_LOG_EPHEMERAL")); + errorNames.insert(std::make_pair(6635, "ERROR_LOG_NOT_ENOUGH_CONTAINERS")); + errorNames.insert(std::make_pair(6636, "ERROR_LOG_CLIENT_ALREADY_REGISTERED")); + errorNames.insert(std::make_pair(6637, "ERROR_LOG_CLIENT_NOT_REGISTERED")); + errorNames.insert(std::make_pair(6638, "ERROR_LOG_FULL_HANDLER_IN_PROGRESS")); + errorNames.insert(std::make_pair(6639, "ERROR_LOG_CONTAINER_READ_FAILED")); + errorNames.insert(std::make_pair(6640, "ERROR_LOG_CONTAINER_WRITE_FAILED")); + errorNames.insert(std::make_pair(6641, "ERROR_LOG_CONTAINER_OPEN_FAILED")); + errorNames.insert(std::make_pair(6642, "ERROR_LOG_CONTAINER_STATE_INVALID")); + errorNames.insert(std::make_pair(6643, "ERROR_LOG_STATE_INVALID")); + errorNames.insert(std::make_pair(6644, "ERROR_LOG_PINNED")); + errorNames.insert(std::make_pair(6645, "ERROR_LOG_METADATA_FLUSH_FAILED")); + errorNames.insert(std::make_pair(6646, "ERROR_LOG_INCONSISTENT_SECURITY")); + errorNames.insert(std::make_pair(6647, "ERROR_LOG_APPENDED_FLUSH_FAILED")); + errorNames.insert(std::make_pair(6648, "ERROR_LOG_PINNED_RESERVATION")); + errorNames.insert(std::make_pair(6700, "ERROR_INVALID_TRANSACTION")); + errorNames.insert(std::make_pair(6701, "ERROR_TRANSACTION_NOT_ACTIVE")); + errorNames.insert(std::make_pair(6702, "ERROR_TRANSACTION_REQUEST_NOT_VALID")); + errorNames.insert(std::make_pair(6703, "ERROR_TRANSACTION_NOT_REQUESTED")); + errorNames.insert(std::make_pair(6704, "ERROR_TRANSACTION_ALREADY_ABORTED")); + errorNames.insert(std::make_pair(6705, "ERROR_TRANSACTION_ALREADY_COMMITTED")); + errorNames.insert(std::make_pair(6706, "ERROR_TM_INITIALIZATION_FAILED")); + errorNames.insert(std::make_pair(6707, "ERROR_RESOURCEMANAGER_READ_ONLY")); + errorNames.insert(std::make_pair(6708, "ERROR_TRANSACTION_NOT_JOINED")); + errorNames.insert(std::make_pair(6709, "ERROR_TRANSACTION_SUPERIOR_EXISTS")); + errorNames.insert(std::make_pair(6710, "ERROR_CRM_PROTOCOL_ALREADY_EXISTS")); + errorNames.insert(std::make_pair(6711, "ERROR_TRANSACTION_PROPAGATION_FAILED")); + errorNames.insert(std::make_pair(6712, "ERROR_CRM_PROTOCOL_NOT_FOUND")); + errorNames.insert(std::make_pair(6713, "ERROR_TRANSACTION_INVALID_MARSHALL_BUFFER")); + errorNames.insert(std::make_pair(6714, "ERROR_CURRENT_TRANSACTION_NOT_VALID")); + errorNames.insert(std::make_pair(6715, "ERROR_TRANSACTION_NOT_FOUND")); + errorNames.insert(std::make_pair(6716, "ERROR_RESOURCEMANAGER_NOT_FOUND")); + errorNames.insert(std::make_pair(6717, "ERROR_ENLISTMENT_NOT_FOUND")); + errorNames.insert(std::make_pair(6718, "ERROR_TRANSACTIONMANAGER_NOT_FOUND")); + errorNames.insert(std::make_pair(6719, "ERROR_TRANSACTIONMANAGER_NOT_ONLINE")); + errorNames.insert(std::make_pair(6720, "ERROR_TRANSACTIONMANAGER_RECOVERY_NAME_COLLISION")); + errorNames.insert(std::make_pair(6721, "ERROR_TRANSACTION_NOT_ROOT")); + errorNames.insert(std::make_pair(6722, "ERROR_TRANSACTION_OBJECT_EXPIRED")); + errorNames.insert(std::make_pair(6723, "ERROR_TRANSACTION_RESPONSE_NOT_ENLISTED")); + errorNames.insert(std::make_pair(6724, "ERROR_TRANSACTION_RECORD_TOO_LONG")); + errorNames.insert(std::make_pair(6725, "ERROR_IMPLICIT_TRANSACTION_NOT_SUPPORTED")); + errorNames.insert(std::make_pair(6726, "ERROR_TRANSACTION_INTEGRITY_VIOLATED")); + errorNames.insert(std::make_pair(6727, "ERROR_TRANSACTIONMANAGER_IDENTITY_MISMATCH")); + errorNames.insert(std::make_pair(6728, "ERROR_RM_CANNOT_BE_FROZEN_FOR_SNAPSHOT")); + errorNames.insert(std::make_pair(6729, "ERROR_TRANSACTION_MUST_WRITETHROUGH")); + errorNames.insert(std::make_pair(6730, "ERROR_TRANSACTION_NO_SUPERIOR")); + errorNames.insert(std::make_pair(6731, "ERROR_HEURISTIC_DAMAGE_POSSIBLE")); + errorNames.insert(std::make_pair(6800, "ERROR_TRANSACTIONAL_CONFLICT")); + errorNames.insert(std::make_pair(6801, "ERROR_RM_NOT_ACTIVE")); + errorNames.insert(std::make_pair(6802, "ERROR_RM_METADATA_CORRUPT")); + errorNames.insert(std::make_pair(6803, "ERROR_DIRECTORY_NOT_RM")); + errorNames.insert(std::make_pair(6805, "ERROR_TRANSACTIONS_UNSUPPORTED_REMOTE")); + errorNames.insert(std::make_pair(6806, "ERROR_LOG_RESIZE_INVALID_SIZE")); + errorNames.insert(std::make_pair(6807, "ERROR_OBJECT_NO_LONGER_EXISTS")); + errorNames.insert(std::make_pair(6808, "ERROR_STREAM_MINIVERSION_NOT_FOUND")); + errorNames.insert(std::make_pair(6809, "ERROR_STREAM_MINIVERSION_NOT_VALID")); + errorNames.insert(std::make_pair(6810, "ERROR_MINIVERSION_INACCESSIBLE_FROM_SPECIFIED_TRANSACTION")); + errorNames.insert(std::make_pair(6811, "ERROR_CANT_OPEN_MINIVERSION_WITH_MODIFY_INTENT")); + errorNames.insert(std::make_pair(6812, "ERROR_CANT_CREATE_MORE_STREAM_MINIVERSIONS")); + errorNames.insert(std::make_pair(6814, "ERROR_REMOTE_FILE_VERSION_MISMATCH")); + errorNames.insert(std::make_pair(6815, "ERROR_HANDLE_NO_LONGER_VALID")); + errorNames.insert(std::make_pair(6816, "ERROR_NO_TXF_METADATA")); + errorNames.insert(std::make_pair(6817, "ERROR_LOG_CORRUPTION_DETECTED")); + errorNames.insert(std::make_pair(6818, "ERROR_CANT_RECOVER_WITH_HANDLE_OPEN")); + errorNames.insert(std::make_pair(6819, "ERROR_RM_DISCONNECTED")); + errorNames.insert(std::make_pair(6820, "ERROR_ENLISTMENT_NOT_SUPERIOR")); + errorNames.insert(std::make_pair(6821, "ERROR_RECOVERY_NOT_NEEDED")); + errorNames.insert(std::make_pair(6822, "ERROR_RM_ALREADY_STARTED")); + errorNames.insert(std::make_pair(6823, "ERROR_FILE_IDENTITY_NOT_PERSISTENT")); + errorNames.insert(std::make_pair(6824, "ERROR_CANT_BREAK_TRANSACTIONAL_DEPENDENCY")); + errorNames.insert(std::make_pair(6825, "ERROR_CANT_CROSS_RM_BOUNDARY")); + errorNames.insert(std::make_pair(6826, "ERROR_TXF_DIR_NOT_EMPTY")); + errorNames.insert(std::make_pair(6827, "ERROR_INDOUBT_TRANSACTIONS_EXIST")); + errorNames.insert(std::make_pair(6828, "ERROR_TM_VOLATILE")); + errorNames.insert(std::make_pair(6829, "ERROR_ROLLBACK_TIMER_EXPIRED")); + errorNames.insert(std::make_pair(6830, "ERROR_TXF_ATTRIBUTE_CORRUPT")); + errorNames.insert(std::make_pair(6831, "ERROR_EFS_NOT_ALLOWED_IN_TRANSACTION")); + errorNames.insert(std::make_pair(6832, "ERROR_TRANSACTIONAL_OPEN_NOT_ALLOWED")); + errorNames.insert(std::make_pair(6833, "ERROR_LOG_GROWTH_FAILED")); + errorNames.insert(std::make_pair(6834, "ERROR_TRANSACTED_MAPPING_UNSUPPORTED_REMOTE")); + errorNames.insert(std::make_pair(6835, "ERROR_TXF_METADATA_ALREADY_PRESENT")); + errorNames.insert(std::make_pair(6836, "ERROR_TRANSACTION_SCOPE_CALLBACKS_NOT_SET")); + errorNames.insert(std::make_pair(6837, "ERROR_TRANSACTION_REQUIRED_PROMOTION")); + errorNames.insert(std::make_pair(6838, "ERROR_CANNOT_EXECUTE_FILE_IN_TRANSACTION")); + errorNames.insert(std::make_pair(6839, "ERROR_TRANSACTIONS_NOT_FROZEN")); + errorNames.insert(std::make_pair(6840, "ERROR_TRANSACTION_FREEZE_IN_PROGRESS")); + errorNames.insert(std::make_pair(6841, "ERROR_NOT_SNAPSHOT_VOLUME")); + errorNames.insert(std::make_pair(6842, "ERROR_NO_SAVEPOINT_WITH_OPEN_FILES")); + errorNames.insert(std::make_pair(6843, "ERROR_DATA_LOST_REPAIR")); + errorNames.insert(std::make_pair(6844, "ERROR_SPARSE_NOT_ALLOWED_IN_TRANSACTION")); + errorNames.insert(std::make_pair(6845, "ERROR_TM_IDENTITY_MISMATCH")); + errorNames.insert(std::make_pair(6846, "ERROR_FLOATED_SECTION")); + errorNames.insert(std::make_pair(6847, "ERROR_CANNOT_ACCEPT_TRANSACTED_WORK")); + errorNames.insert(std::make_pair(6848, "ERROR_CANNOT_ABORT_TRANSACTIONS")); + errorNames.insert(std::make_pair(6849, "ERROR_BAD_CLUSTERS")); + errorNames.insert(std::make_pair(6850, "ERROR_COMPRESSION_NOT_ALLOWED_IN_TRANSACTION")); + errorNames.insert(std::make_pair(6851, "ERROR_VOLUME_DIRTY")); + errorNames.insert(std::make_pair(6852, "ERROR_NO_LINK_TRACKING_IN_TRANSACTION")); + errorNames.insert(std::make_pair(6853, "ERROR_OPERATION_NOT_SUPPORTED_IN_TRANSACTION")); + errorNames.insert(std::make_pair(6854, "ERROR_EXPIRED_HANDLE")); + errorNames.insert(std::make_pair(6855, "ERROR_TRANSACTION_NOT_ENLISTED")); + errorNames.insert(std::make_pair(7001, "ERROR_CTX_WINSTATION_NAME_INVALID")); + errorNames.insert(std::make_pair(7002, "ERROR_CTX_INVALID_PD")); + errorNames.insert(std::make_pair(7003, "ERROR_CTX_PD_NOT_FOUND")); + errorNames.insert(std::make_pair(7004, "ERROR_CTX_WD_NOT_FOUND")); + errorNames.insert(std::make_pair(7005, "ERROR_CTX_CANNOT_MAKE_EVENTLOG_ENTRY")); + errorNames.insert(std::make_pair(7006, "ERROR_CTX_SERVICE_NAME_COLLISION")); + errorNames.insert(std::make_pair(7007, "ERROR_CTX_CLOSE_PENDING")); + errorNames.insert(std::make_pair(7008, "ERROR_CTX_NO_OUTBUF")); + errorNames.insert(std::make_pair(7009, "ERROR_CTX_MODEM_INF_NOT_FOUND")); + errorNames.insert(std::make_pair(7010, "ERROR_CTX_INVALID_MODEMNAME")); + errorNames.insert(std::make_pair(7011, "ERROR_CTX_MODEM_RESPONSE_ERROR")); + errorNames.insert(std::make_pair(7012, "ERROR_CTX_MODEM_RESPONSE_TIMEOUT")); + errorNames.insert(std::make_pair(7013, "ERROR_CTX_MODEM_RESPONSE_NO_CARRIER")); + errorNames.insert(std::make_pair(7014, "ERROR_CTX_MODEM_RESPONSE_NO_DIALTONE")); + errorNames.insert(std::make_pair(7015, "ERROR_CTX_MODEM_RESPONSE_BUSY")); + errorNames.insert(std::make_pair(7016, "ERROR_CTX_MODEM_RESPONSE_VOICE")); + errorNames.insert(std::make_pair(7017, "ERROR_CTX_TD_ERROR")); + errorNames.insert(std::make_pair(7022, "ERROR_CTX_WINSTATION_NOT_FOUND")); + errorNames.insert(std::make_pair(7023, "ERROR_CTX_WINSTATION_ALREADY_EXISTS")); + errorNames.insert(std::make_pair(7024, "ERROR_CTX_WINSTATION_BUSY")); + errorNames.insert(std::make_pair(7025, "ERROR_CTX_BAD_VIDEO_MODE")); + errorNames.insert(std::make_pair(7035, "ERROR_CTX_GRAPHICS_INVALID")); + errorNames.insert(std::make_pair(7037, "ERROR_CTX_LOGON_DISABLED")); + errorNames.insert(std::make_pair(7038, "ERROR_CTX_NOT_CONSOLE")); + errorNames.insert(std::make_pair(7040, "ERROR_CTX_CLIENT_QUERY_TIMEOUT")); + errorNames.insert(std::make_pair(7041, "ERROR_CTX_CONSOLE_DISCONNECT")); + errorNames.insert(std::make_pair(7042, "ERROR_CTX_CONSOLE_CONNECT")); + errorNames.insert(std::make_pair(7044, "ERROR_CTX_SHADOW_DENIED")); + errorNames.insert(std::make_pair(7045, "ERROR_CTX_WINSTATION_ACCESS_DENIED")); + errorNames.insert(std::make_pair(7049, "ERROR_CTX_INVALID_WD")); + errorNames.insert(std::make_pair(7050, "ERROR_CTX_SHADOW_INVALID")); + errorNames.insert(std::make_pair(7051, "ERROR_CTX_SHADOW_DISABLED")); + errorNames.insert(std::make_pair(7052, "ERROR_CTX_CLIENT_LICENSE_IN_USE")); + errorNames.insert(std::make_pair(7053, "ERROR_CTX_CLIENT_LICENSE_NOT_SET")); + errorNames.insert(std::make_pair(7054, "ERROR_CTX_LICENSE_NOT_AVAILABLE")); + errorNames.insert(std::make_pair(7055, "ERROR_CTX_LICENSE_CLIENT_INVALID")); + errorNames.insert(std::make_pair(7056, "ERROR_CTX_LICENSE_EXPIRED")); + errorNames.insert(std::make_pair(7057, "ERROR_CTX_SHADOW_NOT_RUNNING")); + errorNames.insert(std::make_pair(7058, "ERROR_CTX_SHADOW_ENDED_BY_MODE_CHANGE")); + errorNames.insert(std::make_pair(7059, "ERROR_ACTIVATION_COUNT_EXCEEDED")); + errorNames.insert(std::make_pair(7060, "ERROR_CTX_WINSTATIONS_DISABLED")); + errorNames.insert(std::make_pair(7061, "ERROR_CTX_ENCRYPTION_LEVEL_REQUIRED")); + errorNames.insert(std::make_pair(7062, "ERROR_CTX_SESSION_IN_USE")); + errorNames.insert(std::make_pair(7063, "ERROR_CTX_NO_FORCE_LOGOFF")); + errorNames.insert(std::make_pair(7064, "ERROR_CTX_ACCOUNT_RESTRICTION")); + errorNames.insert(std::make_pair(7065, "ERROR_RDP_PROTOCOL_ERROR")); + errorNames.insert(std::make_pair(7066, "ERROR_CTX_CDM_CONNECT")); + errorNames.insert(std::make_pair(7067, "ERROR_CTX_CDM_DISCONNECT")); + errorNames.insert(std::make_pair(7068, "ERROR_CTX_SECURITY_LAYER_ERROR")); + errorNames.insert(std::make_pair(7069, "ERROR_TS_INCOMPATIBLE_SESSIONS")); + errorNames.insert(std::make_pair(7070, "ERROR_TS_VIDEO_SUBSYSTEM_ERROR")); + errorNames.insert(std::make_pair(8200, "ERROR_DS_NOT_INSTALLED")); + errorNames.insert(std::make_pair(8201, "ERROR_DS_MEMBERSHIP_EVALUATED_LOCALLY")); + errorNames.insert(std::make_pair(8202, "ERROR_DS_NO_ATTRIBUTE_OR_VALUE")); + errorNames.insert(std::make_pair(8203, "ERROR_DS_INVALID_ATTRIBUTE_SYNTAX")); + errorNames.insert(std::make_pair(8204, "ERROR_DS_ATTRIBUTE_TYPE_UNDEFINED")); + errorNames.insert(std::make_pair(8205, "ERROR_DS_ATTRIBUTE_OR_VALUE_EXISTS")); + errorNames.insert(std::make_pair(8206, "ERROR_DS_BUSY")); + errorNames.insert(std::make_pair(8207, "ERROR_DS_UNAVAILABLE")); + errorNames.insert(std::make_pair(8208, "ERROR_DS_NO_RIDS_ALLOCATED")); + errorNames.insert(std::make_pair(8209, "ERROR_DS_NO_MORE_RIDS")); + errorNames.insert(std::make_pair(8210, "ERROR_DS_INCORRECT_ROLE_OWNER")); + errorNames.insert(std::make_pair(8211, "ERROR_DS_RIDMGR_INIT_ERROR")); + errorNames.insert(std::make_pair(8212, "ERROR_DS_OBJ_CLASS_VIOLATION")); + errorNames.insert(std::make_pair(8213, "ERROR_DS_CANT_ON_NON_LEAF")); + errorNames.insert(std::make_pair(8214, "ERROR_DS_CANT_ON_RDN")); + errorNames.insert(std::make_pair(8215, "ERROR_DS_CANT_MOD_OBJ_CLASS")); + errorNames.insert(std::make_pair(8216, "ERROR_DS_CROSS_DOM_MOVE_ERROR")); + errorNames.insert(std::make_pair(8217, "ERROR_DS_GC_NOT_AVAILABLE")); + errorNames.insert(std::make_pair(8218, "ERROR_SHARED_POLICY")); + errorNames.insert(std::make_pair(8219, "ERROR_POLICY_OBJECT_NOT_FOUND")); + errorNames.insert(std::make_pair(8220, "ERROR_POLICY_ONLY_IN_DS")); + errorNames.insert(std::make_pair(8221, "ERROR_PROMOTION_ACTIVE")); + errorNames.insert(std::make_pair(8222, "ERROR_NO_PROMOTION_ACTIVE")); + errorNames.insert(std::make_pair(8224, "ERROR_DS_OPERATIONS_ERROR")); + errorNames.insert(std::make_pair(8225, "ERROR_DS_PROTOCOL_ERROR")); + errorNames.insert(std::make_pair(8226, "ERROR_DS_TIMELIMIT_EXCEEDED")); + errorNames.insert(std::make_pair(8227, "ERROR_DS_SIZELIMIT_EXCEEDED")); + errorNames.insert(std::make_pair(8228, "ERROR_DS_ADMIN_LIMIT_EXCEEDED")); + errorNames.insert(std::make_pair(8229, "ERROR_DS_COMPARE_FALSE")); + errorNames.insert(std::make_pair(8230, "ERROR_DS_COMPARE_TRUE")); + errorNames.insert(std::make_pair(8231, "ERROR_DS_AUTH_METHOD_NOT_SUPPORTED")); + errorNames.insert(std::make_pair(8232, "ERROR_DS_STRONG_AUTH_REQUIRED")); + errorNames.insert(std::make_pair(8233, "ERROR_DS_INAPPROPRIATE_AUTH")); + errorNames.insert(std::make_pair(8234, "ERROR_DS_AUTH_UNKNOWN")); + errorNames.insert(std::make_pair(8235, "ERROR_DS_REFERRAL")); + errorNames.insert(std::make_pair(8236, "ERROR_DS_UNAVAILABLE_CRIT_EXTENSION")); + errorNames.insert(std::make_pair(8237, "ERROR_DS_CONFIDENTIALITY_REQUIRED")); + errorNames.insert(std::make_pair(8238, "ERROR_DS_INAPPROPRIATE_MATCHING")); + errorNames.insert(std::make_pair(8239, "ERROR_DS_CONSTRAINT_VIOLATION")); + errorNames.insert(std::make_pair(8240, "ERROR_DS_NO_SUCH_OBJECT")); + errorNames.insert(std::make_pair(8241, "ERROR_DS_ALIAS_PROBLEM")); + errorNames.insert(std::make_pair(8242, "ERROR_DS_INVALID_DN_SYNTAX")); + errorNames.insert(std::make_pair(8243, "ERROR_DS_IS_LEAF")); + errorNames.insert(std::make_pair(8244, "ERROR_DS_ALIAS_DEREF_PROBLEM")); + errorNames.insert(std::make_pair(8245, "ERROR_DS_UNWILLING_TO_PERFORM")); + errorNames.insert(std::make_pair(8246, "ERROR_DS_LOOP_DETECT")); + errorNames.insert(std::make_pair(8247, "ERROR_DS_NAMING_VIOLATION")); + errorNames.insert(std::make_pair(8248, "ERROR_DS_OBJECT_RESULTS_TOO_LARGE")); + errorNames.insert(std::make_pair(8249, "ERROR_DS_AFFECTS_MULTIPLE_DSAS")); + errorNames.insert(std::make_pair(8250, "ERROR_DS_SERVER_DOWN")); + errorNames.insert(std::make_pair(8251, "ERROR_DS_LOCAL_ERROR")); + errorNames.insert(std::make_pair(8252, "ERROR_DS_ENCODING_ERROR")); + errorNames.insert(std::make_pair(8253, "ERROR_DS_DECODING_ERROR")); + errorNames.insert(std::make_pair(8254, "ERROR_DS_FILTER_UNKNOWN")); + errorNames.insert(std::make_pair(8255, "ERROR_DS_PARAM_ERROR")); + errorNames.insert(std::make_pair(8256, "ERROR_DS_NOT_SUPPORTED")); + errorNames.insert(std::make_pair(8257, "ERROR_DS_NO_RESULTS_RETURNED")); + errorNames.insert(std::make_pair(8258, "ERROR_DS_CONTROL_NOT_FOUND")); + errorNames.insert(std::make_pair(8259, "ERROR_DS_CLIENT_LOOP")); + errorNames.insert(std::make_pair(8260, "ERROR_DS_REFERRAL_LIMIT_EXCEEDED")); + errorNames.insert(std::make_pair(8261, "ERROR_DS_SORT_CONTROL_MISSING")); + errorNames.insert(std::make_pair(8262, "ERROR_DS_OFFSET_RANGE_ERROR")); + errorNames.insert(std::make_pair(8301, "ERROR_DS_ROOT_MUST_BE_NC")); + errorNames.insert(std::make_pair(8302, "ERROR_DS_ADD_REPLICA_INHIBITED")); + errorNames.insert(std::make_pair(8303, "ERROR_DS_ATT_NOT_DEF_IN_SCHEMA")); + errorNames.insert(std::make_pair(8304, "ERROR_DS_MAX_OBJ_SIZE_EXCEEDED")); + errorNames.insert(std::make_pair(8305, "ERROR_DS_OBJ_STRING_NAME_EXISTS")); + errorNames.insert(std::make_pair(8306, "ERROR_DS_NO_RDN_DEFINED_IN_SCHEMA")); + errorNames.insert(std::make_pair(8307, "ERROR_DS_RDN_DOESNT_MATCH_SCHEMA")); + errorNames.insert(std::make_pair(8308, "ERROR_DS_NO_REQUESTED_ATTS_FOUND")); + errorNames.insert(std::make_pair(8309, "ERROR_DS_USER_BUFFER_TO_SMALL")); + errorNames.insert(std::make_pair(8310, "ERROR_DS_ATT_IS_NOT_ON_OBJ")); + errorNames.insert(std::make_pair(8311, "ERROR_DS_ILLEGAL_MOD_OPERATION")); + errorNames.insert(std::make_pair(8312, "ERROR_DS_OBJ_TOO_LARGE")); + errorNames.insert(std::make_pair(8313, "ERROR_DS_BAD_INSTANCE_TYPE")); + errorNames.insert(std::make_pair(8314, "ERROR_DS_MASTERDSA_REQUIRED")); + errorNames.insert(std::make_pair(8315, "ERROR_DS_OBJECT_CLASS_REQUIRED")); + errorNames.insert(std::make_pair(8316, "ERROR_DS_MISSING_REQUIRED_ATT")); + errorNames.insert(std::make_pair(8317, "ERROR_DS_ATT_NOT_DEF_FOR_CLASS")); + errorNames.insert(std::make_pair(8318, "ERROR_DS_ATT_ALREADY_EXISTS")); + errorNames.insert(std::make_pair(8320, "ERROR_DS_CANT_ADD_ATT_VALUES")); + errorNames.insert(std::make_pair(8321, "ERROR_DS_SINGLE_VALUE_CONSTRAINT")); + errorNames.insert(std::make_pair(8322, "ERROR_DS_RANGE_CONSTRAINT")); + errorNames.insert(std::make_pair(8323, "ERROR_DS_ATT_VAL_ALREADY_EXISTS")); + errorNames.insert(std::make_pair(8324, "ERROR_DS_CANT_REM_MISSING_ATT")); + errorNames.insert(std::make_pair(8325, "ERROR_DS_CANT_REM_MISSING_ATT_VAL")); + errorNames.insert(std::make_pair(8326, "ERROR_DS_ROOT_CANT_BE_SUBREF")); + errorNames.insert(std::make_pair(8327, "ERROR_DS_NO_CHAINING")); + errorNames.insert(std::make_pair(8328, "ERROR_DS_NO_CHAINED_EVAL")); + errorNames.insert(std::make_pair(8329, "ERROR_DS_NO_PARENT_OBJECT")); + errorNames.insert(std::make_pair(8330, "ERROR_DS_PARENT_IS_AN_ALIAS")); + errorNames.insert(std::make_pair(8331, "ERROR_DS_CANT_MIX_MASTER_AND_REPS")); + errorNames.insert(std::make_pair(8332, "ERROR_DS_CHILDREN_EXIST")); + errorNames.insert(std::make_pair(8333, "ERROR_DS_OBJ_NOT_FOUND")); + errorNames.insert(std::make_pair(8334, "ERROR_DS_ALIASED_OBJ_MISSING")); + errorNames.insert(std::make_pair(8335, "ERROR_DS_BAD_NAME_SYNTAX")); + errorNames.insert(std::make_pair(8336, "ERROR_DS_ALIAS_POINTS_TO_ALIAS")); + errorNames.insert(std::make_pair(8337, "ERROR_DS_CANT_DEREF_ALIAS")); + errorNames.insert(std::make_pair(8338, "ERROR_DS_OUT_OF_SCOPE")); + errorNames.insert(std::make_pair(8339, "ERROR_DS_OBJECT_BEING_REMOVED")); + errorNames.insert(std::make_pair(8340, "ERROR_DS_CANT_DELETE_DSA_OBJ")); + errorNames.insert(std::make_pair(8341, "ERROR_DS_GENERIC_ERROR")); + errorNames.insert(std::make_pair(8342, "ERROR_DS_DSA_MUST_BE_INT_MASTER")); + errorNames.insert(std::make_pair(8343, "ERROR_DS_CLASS_NOT_DSA")); + errorNames.insert(std::make_pair(8344, "ERROR_DS_INSUFF_ACCESS_RIGHTS")); + errorNames.insert(std::make_pair(8345, "ERROR_DS_ILLEGAL_SUPERIOR")); + errorNames.insert(std::make_pair(8346, "ERROR_DS_ATTRIBUTE_OWNED_BY_SAM")); + errorNames.insert(std::make_pair(8347, "ERROR_DS_NAME_TOO_MANY_PARTS")); + errorNames.insert(std::make_pair(8348, "ERROR_DS_NAME_TOO_LONG")); + errorNames.insert(std::make_pair(8349, "ERROR_DS_NAME_VALUE_TOO_LONG")); + errorNames.insert(std::make_pair(8350, "ERROR_DS_NAME_UNPARSEABLE")); + errorNames.insert(std::make_pair(8351, "ERROR_DS_NAME_TYPE_UNKNOWN")); + errorNames.insert(std::make_pair(8352, "ERROR_DS_NOT_AN_OBJECT")); + errorNames.insert(std::make_pair(8353, "ERROR_DS_SEC_DESC_TOO_SHORT")); + errorNames.insert(std::make_pair(8354, "ERROR_DS_SEC_DESC_INVALID")); + errorNames.insert(std::make_pair(8355, "ERROR_DS_NO_DELETED_NAME")); + errorNames.insert(std::make_pair(8356, "ERROR_DS_SUBREF_MUST_HAVE_PARENT")); + errorNames.insert(std::make_pair(8357, "ERROR_DS_NCNAME_MUST_BE_NC")); + errorNames.insert(std::make_pair(8358, "ERROR_DS_CANT_ADD_SYSTEM_ONLY")); + errorNames.insert(std::make_pair(8359, "ERROR_DS_CLASS_MUST_BE_CONCRETE")); + errorNames.insert(std::make_pair(8360, "ERROR_DS_INVALID_DMD")); + errorNames.insert(std::make_pair(8361, "ERROR_DS_OBJ_GUID_EXISTS")); + errorNames.insert(std::make_pair(8362, "ERROR_DS_NOT_ON_BACKLINK")); + errorNames.insert(std::make_pair(8363, "ERROR_DS_NO_CROSSREF_FOR_NC")); + errorNames.insert(std::make_pair(8364, "ERROR_DS_SHUTTING_DOWN")); + errorNames.insert(std::make_pair(8365, "ERROR_DS_UNKNOWN_OPERATION")); + errorNames.insert(std::make_pair(8366, "ERROR_DS_INVALID_ROLE_OWNER")); + errorNames.insert(std::make_pair(8367, "ERROR_DS_COULDNT_CONTACT_FSMO")); + errorNames.insert(std::make_pair(8368, "ERROR_DS_CROSS_NC_DN_RENAME")); + errorNames.insert(std::make_pair(8369, "ERROR_DS_CANT_MOD_SYSTEM_ONLY")); + errorNames.insert(std::make_pair(8370, "ERROR_DS_REPLICATOR_ONLY")); + errorNames.insert(std::make_pair(8371, "ERROR_DS_OBJ_CLASS_NOT_DEFINED")); + errorNames.insert(std::make_pair(8372, "ERROR_DS_OBJ_CLASS_NOT_SUBCLASS")); + errorNames.insert(std::make_pair(8373, "ERROR_DS_NAME_REFERENCE_INVALID")); + errorNames.insert(std::make_pair(8374, "ERROR_DS_CROSS_REF_EXISTS")); + errorNames.insert(std::make_pair(8375, "ERROR_DS_CANT_DEL_MASTER_CROSSREF")); + errorNames.insert(std::make_pair(8376, "ERROR_DS_SUBTREE_NOTIFY_NOT_NC_HEAD")); + errorNames.insert(std::make_pair(8377, "ERROR_DS_NOTIFY_FILTER_TOO_COMPLEX")); + errorNames.insert(std::make_pair(8378, "ERROR_DS_DUP_RDN")); + errorNames.insert(std::make_pair(8379, "ERROR_DS_DUP_OID")); + errorNames.insert(std::make_pair(8380, "ERROR_DS_DUP_MAPI_ID")); + errorNames.insert(std::make_pair(8381, "ERROR_DS_DUP_SCHEMA_ID_GUID")); + errorNames.insert(std::make_pair(8382, "ERROR_DS_DUP_LDAP_DISPLAY_NAME")); + errorNames.insert(std::make_pair(8383, "ERROR_DS_SEMANTIC_ATT_TEST")); + errorNames.insert(std::make_pair(8384, "ERROR_DS_SYNTAX_MISMATCH")); + errorNames.insert(std::make_pair(8385, "ERROR_DS_EXISTS_IN_MUST_HAVE")); + errorNames.insert(std::make_pair(8386, "ERROR_DS_EXISTS_IN_MAY_HAVE")); + errorNames.insert(std::make_pair(8387, "ERROR_DS_NONEXISTENT_MAY_HAVE")); + errorNames.insert(std::make_pair(8388, "ERROR_DS_NONEXISTENT_MUST_HAVE")); + errorNames.insert(std::make_pair(8389, "ERROR_DS_AUX_CLS_TEST_FAIL")); + errorNames.insert(std::make_pair(8390, "ERROR_DS_NONEXISTENT_POSS_SUP")); + errorNames.insert(std::make_pair(8391, "ERROR_DS_SUB_CLS_TEST_FAIL")); + errorNames.insert(std::make_pair(8392, "ERROR_DS_BAD_RDN_ATT_ID_SYNTAX")); + errorNames.insert(std::make_pair(8393, "ERROR_DS_EXISTS_IN_AUX_CLS")); + errorNames.insert(std::make_pair(8394, "ERROR_DS_EXISTS_IN_SUB_CLS")); + errorNames.insert(std::make_pair(8395, "ERROR_DS_EXISTS_IN_POSS_SUP")); + errorNames.insert(std::make_pair(8396, "ERROR_DS_RECALCSCHEMA_FAILED")); + errorNames.insert(std::make_pair(8397, "ERROR_DS_TREE_DELETE_NOT_FINISHED")); + errorNames.insert(std::make_pair(8398, "ERROR_DS_CANT_DELETE")); + errorNames.insert(std::make_pair(8399, "ERROR_DS_ATT_SCHEMA_REQ_ID")); + errorNames.insert(std::make_pair(8400, "ERROR_DS_BAD_ATT_SCHEMA_SYNTAX")); + errorNames.insert(std::make_pair(8401, "ERROR_DS_CANT_CACHE_ATT")); + errorNames.insert(std::make_pair(8402, "ERROR_DS_CANT_CACHE_CLASS")); + errorNames.insert(std::make_pair(8403, "ERROR_DS_CANT_REMOVE_ATT_CACHE")); + errorNames.insert(std::make_pair(8404, "ERROR_DS_CANT_REMOVE_CLASS_CACHE")); + errorNames.insert(std::make_pair(8405, "ERROR_DS_CANT_RETRIEVE_DN")); + errorNames.insert(std::make_pair(8406, "ERROR_DS_MISSING_SUPREF")); + errorNames.insert(std::make_pair(8407, "ERROR_DS_CANT_RETRIEVE_INSTANCE")); + errorNames.insert(std::make_pair(8408, "ERROR_DS_CODE_INCONSISTENCY")); + errorNames.insert(std::make_pair(8409, "ERROR_DS_DATABASE_ERROR")); + errorNames.insert(std::make_pair(8410, "ERROR_DS_GOVERNSID_MISSING")); + errorNames.insert(std::make_pair(8411, "ERROR_DS_MISSING_EXPECTED_ATT")); + errorNames.insert(std::make_pair(8412, "ERROR_DS_NCNAME_MISSING_CR_REF")); + errorNames.insert(std::make_pair(8413, "ERROR_DS_SECURITY_CHECKING_ERROR")); + errorNames.insert(std::make_pair(8414, "ERROR_DS_SCHEMA_NOT_LOADED")); + errorNames.insert(std::make_pair(8415, "ERROR_DS_SCHEMA_ALLOC_FAILED")); + errorNames.insert(std::make_pair(8416, "ERROR_DS_ATT_SCHEMA_REQ_SYNTAX")); + errorNames.insert(std::make_pair(8417, "ERROR_DS_GCVERIFY_ERROR")); + errorNames.insert(std::make_pair(8418, "ERROR_DS_DRA_SCHEMA_MISMATCH")); + errorNames.insert(std::make_pair(8419, "ERROR_DS_CANT_FIND_DSA_OBJ")); + errorNames.insert(std::make_pair(8420, "ERROR_DS_CANT_FIND_EXPECTED_NC")); + errorNames.insert(std::make_pair(8421, "ERROR_DS_CANT_FIND_NC_IN_CACHE")); + errorNames.insert(std::make_pair(8422, "ERROR_DS_CANT_RETRIEVE_CHILD")); + errorNames.insert(std::make_pair(8423, "ERROR_DS_SECURITY_ILLEGAL_MODIFY")); + errorNames.insert(std::make_pair(8424, "ERROR_DS_CANT_REPLACE_HIDDEN_REC")); + errorNames.insert(std::make_pair(8425, "ERROR_DS_BAD_HIERARCHY_FILE")); + errorNames.insert(std::make_pair(8426, "ERROR_DS_BUILD_HIERARCHY_TABLE_FAILED")); + errorNames.insert(std::make_pair(8427, "ERROR_DS_CONFIG_PARAM_MISSING")); + errorNames.insert(std::make_pair(8428, "ERROR_DS_COUNTING_AB_INDICES_FAILED")); + errorNames.insert(std::make_pair(8429, "ERROR_DS_HIERARCHY_TABLE_MALLOC_FAILED")); + errorNames.insert(std::make_pair(8430, "ERROR_DS_INTERNAL_FAILURE")); + errorNames.insert(std::make_pair(8431, "ERROR_DS_UNKNOWN_ERROR")); + errorNames.insert(std::make_pair(8432, "ERROR_DS_ROOT_REQUIRES_CLASS_TOP")); + errorNames.insert(std::make_pair(8433, "ERROR_DS_REFUSING_FSMO_ROLES")); + errorNames.insert(std::make_pair(8434, "ERROR_DS_MISSING_FSMO_SETTINGS")); + errorNames.insert(std::make_pair(8435, "ERROR_DS_UNABLE_TO_SURRENDER_ROLES")); + errorNames.insert(std::make_pair(8436, "ERROR_DS_DRA_GENERIC")); + errorNames.insert(std::make_pair(8437, "ERROR_DS_DRA_INVALID_PARAMETER")); + errorNames.insert(std::make_pair(8438, "ERROR_DS_DRA_BUSY")); + errorNames.insert(std::make_pair(8439, "ERROR_DS_DRA_BAD_DN")); + errorNames.insert(std::make_pair(8440, "ERROR_DS_DRA_BAD_NC")); + errorNames.insert(std::make_pair(8441, "ERROR_DS_DRA_DN_EXISTS")); + errorNames.insert(std::make_pair(8442, "ERROR_DS_DRA_INTERNAL_ERROR")); + errorNames.insert(std::make_pair(8443, "ERROR_DS_DRA_INCONSISTENT_DIT")); + errorNames.insert(std::make_pair(8444, "ERROR_DS_DRA_CONNECTION_FAILED")); + errorNames.insert(std::make_pair(8445, "ERROR_DS_DRA_BAD_INSTANCE_TYPE")); + errorNames.insert(std::make_pair(8446, "ERROR_DS_DRA_OUT_OF_MEM")); + errorNames.insert(std::make_pair(8447, "ERROR_DS_DRA_MAIL_PROBLEM")); + errorNames.insert(std::make_pair(8448, "ERROR_DS_DRA_REF_ALREADY_EXISTS")); + errorNames.insert(std::make_pair(8449, "ERROR_DS_DRA_REF_NOT_FOUND")); + errorNames.insert(std::make_pair(8450, "ERROR_DS_DRA_OBJ_IS_REP_SOURCE")); + errorNames.insert(std::make_pair(8451, "ERROR_DS_DRA_DB_ERROR")); + errorNames.insert(std::make_pair(8452, "ERROR_DS_DRA_NO_REPLICA")); + errorNames.insert(std::make_pair(8453, "ERROR_DS_DRA_ACCESS_DENIED")); + errorNames.insert(std::make_pair(8454, "ERROR_DS_DRA_NOT_SUPPORTED")); + errorNames.insert(std::make_pair(8455, "ERROR_DS_DRA_RPC_CANCELLED")); + errorNames.insert(std::make_pair(8456, "ERROR_DS_DRA_SOURCE_DISABLED")); + errorNames.insert(std::make_pair(8457, "ERROR_DS_DRA_SINK_DISABLED")); + errorNames.insert(std::make_pair(8458, "ERROR_DS_DRA_NAME_COLLISION")); + errorNames.insert(std::make_pair(8459, "ERROR_DS_DRA_SOURCE_REINSTALLED")); + errorNames.insert(std::make_pair(8460, "ERROR_DS_DRA_MISSING_PARENT")); + errorNames.insert(std::make_pair(8461, "ERROR_DS_DRA_PREEMPTED")); + errorNames.insert(std::make_pair(8462, "ERROR_DS_DRA_ABANDON_SYNC")); + errorNames.insert(std::make_pair(8463, "ERROR_DS_DRA_SHUTDOWN")); + errorNames.insert(std::make_pair(8464, "ERROR_DS_DRA_INCOMPATIBLE_PARTIAL_SET")); + errorNames.insert(std::make_pair(8465, "ERROR_DS_DRA_SOURCE_IS_PARTIAL_REPLICA")); + errorNames.insert(std::make_pair(8466, "ERROR_DS_DRA_EXTN_CONNECTION_FAILED")); + errorNames.insert(std::make_pair(8467, "ERROR_DS_INSTALL_SCHEMA_MISMATCH")); + errorNames.insert(std::make_pair(8468, "ERROR_DS_DUP_LINK_ID")); + errorNames.insert(std::make_pair(8469, "ERROR_DS_NAME_ERROR_RESOLVING")); + errorNames.insert(std::make_pair(8470, "ERROR_DS_NAME_ERROR_NOT_FOUND")); + errorNames.insert(std::make_pair(8471, "ERROR_DS_NAME_ERROR_NOT_UNIQUE")); + errorNames.insert(std::make_pair(8472, "ERROR_DS_NAME_ERROR_NO_MAPPING")); + errorNames.insert(std::make_pair(8473, "ERROR_DS_NAME_ERROR_DOMAIN_ONLY")); + errorNames.insert(std::make_pair(8474, "ERROR_DS_NAME_ERROR_NO_SYNTACTICAL_MAPPING")); + errorNames.insert(std::make_pair(8475, "ERROR_DS_CONSTRUCTED_ATT_MOD")); + errorNames.insert(std::make_pair(8476, "ERROR_DS_WRONG_OM_OBJ_CLASS")); + errorNames.insert(std::make_pair(8477, "ERROR_DS_DRA_REPL_PENDING")); + errorNames.insert(std::make_pair(8478, "ERROR_DS_DS_REQUIRED")); + errorNames.insert(std::make_pair(8479, "ERROR_DS_INVALID_LDAP_DISPLAY_NAME")); + errorNames.insert(std::make_pair(8480, "ERROR_DS_NON_BASE_SEARCH")); + errorNames.insert(std::make_pair(8481, "ERROR_DS_CANT_RETRIEVE_ATTS")); + errorNames.insert(std::make_pair(8482, "ERROR_DS_BACKLINK_WITHOUT_LINK")); + errorNames.insert(std::make_pair(8483, "ERROR_DS_EPOCH_MISMATCH")); + errorNames.insert(std::make_pair(8484, "ERROR_DS_SRC_NAME_MISMATCH")); + errorNames.insert(std::make_pair(8485, "ERROR_DS_SRC_AND_DST_NC_IDENTICAL")); + errorNames.insert(std::make_pair(8486, "ERROR_DS_DST_NC_MISMATCH")); + errorNames.insert(std::make_pair(8487, "ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC")); + errorNames.insert(std::make_pair(8488, "ERROR_DS_SRC_GUID_MISMATCH")); + errorNames.insert(std::make_pair(8489, "ERROR_DS_CANT_MOVE_DELETED_OBJECT")); + errorNames.insert(std::make_pair(8490, "ERROR_DS_PDC_OPERATION_IN_PROGRESS")); + errorNames.insert(std::make_pair(8491, "ERROR_DS_CROSS_DOMAIN_CLEANUP_REQD")); + errorNames.insert(std::make_pair(8492, "ERROR_DS_ILLEGAL_XDOM_MOVE_OPERATION")); + errorNames.insert(std::make_pair(8493, "ERROR_DS_CANT_WITH_ACCT_GROUP_MEMBERSHPS")); + errorNames.insert(std::make_pair(8494, "ERROR_DS_NC_MUST_HAVE_NC_PARENT")); + errorNames.insert(std::make_pair(8495, "ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE")); + errorNames.insert(std::make_pair(8496, "ERROR_DS_DST_DOMAIN_NOT_NATIVE")); + errorNames.insert(std::make_pair(8497, "ERROR_DS_MISSING_INFRASTRUCTURE_CONTAINER")); + errorNames.insert(std::make_pair(8498, "ERROR_DS_CANT_MOVE_ACCOUNT_GROUP")); + errorNames.insert(std::make_pair(8499, "ERROR_DS_CANT_MOVE_RESOURCE_GROUP")); + errorNames.insert(std::make_pair(8500, "ERROR_DS_INVALID_SEARCH_FLAG")); + errorNames.insert(std::make_pair(8501, "ERROR_DS_NO_TREE_DELETE_ABOVE_NC")); + errorNames.insert(std::make_pair(8502, "ERROR_DS_COULDNT_LOCK_TREE_FOR_DELETE")); + errorNames.insert(std::make_pair(8503, "ERROR_DS_COULDNT_IDENTIFY_OBJECTS_FOR_TREE_DELETE")); + errorNames.insert(std::make_pair(8504, "ERROR_DS_SAM_INIT_FAILURE")); + errorNames.insert(std::make_pair(8505, "ERROR_DS_SENSITIVE_GROUP_VIOLATION")); + errorNames.insert(std::make_pair(8506, "ERROR_DS_CANT_MOD_PRIMARYGROUPID")); + errorNames.insert(std::make_pair(8507, "ERROR_DS_ILLEGAL_BASE_SCHEMA_MOD")); + errorNames.insert(std::make_pair(8508, "ERROR_DS_NONSAFE_SCHEMA_CHANGE")); + errorNames.insert(std::make_pair(8509, "ERROR_DS_SCHEMA_UPDATE_DISALLOWED")); + errorNames.insert(std::make_pair(8510, "ERROR_DS_CANT_CREATE_UNDER_SCHEMA")); + errorNames.insert(std::make_pair(8511, "ERROR_DS_INSTALL_NO_SRC_SCH_VERSION")); + errorNames.insert(std::make_pair(8512, "ERROR_DS_INSTALL_NO_SCH_VERSION_IN_INIFILE")); + errorNames.insert(std::make_pair(8513, "ERROR_DS_INVALID_GROUP_TYPE")); + errorNames.insert(std::make_pair(8514, "ERROR_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN")); + errorNames.insert(std::make_pair(8515, "ERROR_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN")); + errorNames.insert(std::make_pair(8516, "ERROR_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER")); + errorNames.insert(std::make_pair(8517, "ERROR_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER")); + errorNames.insert(std::make_pair(8518, "ERROR_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER")); + errorNames.insert(std::make_pair(8519, "ERROR_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER")); + errorNames.insert(std::make_pair(8520, "ERROR_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER")); + errorNames.insert(std::make_pair(8521, "ERROR_DS_HAVE_PRIMARY_MEMBERS")); + errorNames.insert(std::make_pair(8522, "ERROR_DS_STRING_SD_CONVERSION_FAILED")); + errorNames.insert(std::make_pair(8523, "ERROR_DS_NAMING_MASTER_GC")); + errorNames.insert(std::make_pair(8524, "ERROR_DS_DNS_LOOKUP_FAILURE")); + errorNames.insert(std::make_pair(8525, "ERROR_DS_COULDNT_UPDATE_SPNS")); + errorNames.insert(std::make_pair(8526, "ERROR_DS_CANT_RETRIEVE_SD")); + errorNames.insert(std::make_pair(8527, "ERROR_DS_KEY_NOT_UNIQUE")); + errorNames.insert(std::make_pair(8528, "ERROR_DS_WRONG_LINKED_ATT_SYNTAX")); + errorNames.insert(std::make_pair(8529, "ERROR_DS_SAM_NEED_BOOTKEY_PASSWORD")); + errorNames.insert(std::make_pair(8530, "ERROR_DS_SAM_NEED_BOOTKEY_FLOPPY")); + errorNames.insert(std::make_pair(8531, "ERROR_DS_CANT_START")); + errorNames.insert(std::make_pair(8532, "ERROR_DS_INIT_FAILURE")); + errorNames.insert(std::make_pair(8533, "ERROR_DS_NO_PKT_PRIVACY_ON_CONNECTION")); + errorNames.insert(std::make_pair(8534, "ERROR_DS_SOURCE_DOMAIN_IN_FOREST")); + errorNames.insert(std::make_pair(8535, "ERROR_DS_DESTINATION_DOMAIN_NOT_IN_FOREST")); + errorNames.insert(std::make_pair(8536, "ERROR_DS_DESTINATION_AUDITING_NOT_ENABLED")); + errorNames.insert(std::make_pair(8537, "ERROR_DS_CANT_FIND_DC_FOR_SRC_DOMAIN")); + errorNames.insert(std::make_pair(8538, "ERROR_DS_SRC_OBJ_NOT_GROUP_OR_USER")); + errorNames.insert(std::make_pair(8539, "ERROR_DS_SRC_SID_EXISTS_IN_FOREST")); + errorNames.insert(std::make_pair(8540, "ERROR_DS_SRC_AND_DST_OBJECT_CLASS_MISMATCH")); + errorNames.insert(std::make_pair(8541, "ERROR_SAM_INIT_FAILURE")); + errorNames.insert(std::make_pair(8542, "ERROR_DS_DRA_SCHEMA_INFO_SHIP")); + errorNames.insert(std::make_pair(8543, "ERROR_DS_DRA_SCHEMA_CONFLICT")); + errorNames.insert(std::make_pair(8544, "ERROR_DS_DRA_EARLIER_SCHEMA_CONFLICT")); + errorNames.insert(std::make_pair(8545, "ERROR_DS_DRA_OBJ_NC_MISMATCH")); + errorNames.insert(std::make_pair(8546, "ERROR_DS_NC_STILL_HAS_DSAS")); + errorNames.insert(std::make_pair(8547, "ERROR_DS_GC_REQUIRED")); + errorNames.insert(std::make_pair(8548, "ERROR_DS_LOCAL_MEMBER_OF_LOCAL_ONLY")); + errorNames.insert(std::make_pair(8549, "ERROR_DS_NO_FPO_IN_UNIVERSAL_GROUPS")); + errorNames.insert(std::make_pair(8550, "ERROR_DS_CANT_ADD_TO_GC")); + errorNames.insert(std::make_pair(8551, "ERROR_DS_NO_CHECKPOINT_WITH_PDC")); + errorNames.insert(std::make_pair(8552, "ERROR_DS_SOURCE_AUDITING_NOT_ENABLED")); + errorNames.insert(std::make_pair(8553, "ERROR_DS_CANT_CREATE_IN_NONDOMAIN_NC")); + errorNames.insert(std::make_pair(8554, "ERROR_DS_INVALID_NAME_FOR_SPN")); + errorNames.insert(std::make_pair(8555, "ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS")); + errorNames.insert(std::make_pair(8556, "ERROR_DS_UNICODEPWD_NOT_IN_QUOTES")); + errorNames.insert(std::make_pair(8557, "ERROR_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED")); + errorNames.insert(std::make_pair(8558, "ERROR_DS_MUST_BE_RUN_ON_DST_DC")); + errorNames.insert(std::make_pair(8559, "ERROR_DS_SRC_DC_MUST_BE_SP4_OR_GREATER")); + errorNames.insert(std::make_pair(8560, "ERROR_DS_CANT_TREE_DELETE_CRITICAL_OBJ")); + errorNames.insert(std::make_pair(8561, "ERROR_DS_INIT_FAILURE_CONSOLE")); + errorNames.insert(std::make_pair(8562, "ERROR_DS_SAM_INIT_FAILURE_CONSOLE")); + errorNames.insert(std::make_pair(8563, "ERROR_DS_FOREST_VERSION_TOO_HIGH")); + errorNames.insert(std::make_pair(8564, "ERROR_DS_DOMAIN_VERSION_TOO_HIGH")); + errorNames.insert(std::make_pair(8565, "ERROR_DS_FOREST_VERSION_TOO_LOW")); + errorNames.insert(std::make_pair(8566, "ERROR_DS_DOMAIN_VERSION_TOO_LOW")); + errorNames.insert(std::make_pair(8567, "ERROR_DS_INCOMPATIBLE_VERSION")); + errorNames.insert(std::make_pair(8568, "ERROR_DS_LOW_DSA_VERSION")); + errorNames.insert(std::make_pair(8569, "ERROR_DS_NO_BEHAVIOR_VERSION_IN_MIXEDDOMAIN")); + errorNames.insert(std::make_pair(8570, "ERROR_DS_NOT_SUPPORTED_SORT_ORDER")); + errorNames.insert(std::make_pair(8571, "ERROR_DS_NAME_NOT_UNIQUE")); + errorNames.insert(std::make_pair(8572, "ERROR_DS_MACHINE_ACCOUNT_CREATED_PRENT4")); + errorNames.insert(std::make_pair(8573, "ERROR_DS_OUT_OF_VERSION_STORE")); + errorNames.insert(std::make_pair(8574, "ERROR_DS_INCOMPATIBLE_CONTROLS_USED")); + errorNames.insert(std::make_pair(8575, "ERROR_DS_NO_REF_DOMAIN")); + errorNames.insert(std::make_pair(8576, "ERROR_DS_RESERVED_LINK_ID")); + errorNames.insert(std::make_pair(8577, "ERROR_DS_LINK_ID_NOT_AVAILABLE")); + errorNames.insert(std::make_pair(8578, "ERROR_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER")); + errorNames.insert(std::make_pair(8579, "ERROR_DS_MODIFYDN_DISALLOWED_BY_INSTANCE_TYPE")); + errorNames.insert(std::make_pair(8580, "ERROR_DS_NO_OBJECT_MOVE_IN_SCHEMA_NC")); + errorNames.insert(std::make_pair(8581, "ERROR_DS_MODIFYDN_DISALLOWED_BY_FLAG")); + errorNames.insert(std::make_pair(8582, "ERROR_DS_MODIFYDN_WRONG_GRANDPARENT")); + errorNames.insert(std::make_pair(8583, "ERROR_DS_NAME_ERROR_TRUST_REFERRAL")); + errorNames.insert(std::make_pair(8584, "ERROR_NOT_SUPPORTED_ON_STANDARD_SERVER")); + errorNames.insert(std::make_pair(8585, "ERROR_DS_CANT_ACCESS_REMOTE_PART_OF_AD")); + errorNames.insert(std::make_pair(8586, "ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE_V2")); + errorNames.insert(std::make_pair(8587, "ERROR_DS_THREAD_LIMIT_EXCEEDED")); + errorNames.insert(std::make_pair(8588, "ERROR_DS_NOT_CLOSEST")); + errorNames.insert(std::make_pair(8589, "ERROR_DS_CANT_DERIVE_SPN_WITHOUT_SERVER_REF")); + errorNames.insert(std::make_pair(8590, "ERROR_DS_SINGLE_USER_MODE_FAILED")); + errorNames.insert(std::make_pair(8591, "ERROR_DS_NTDSCRIPT_SYNTAX_ERROR")); + errorNames.insert(std::make_pair(8592, "ERROR_DS_NTDSCRIPT_PROCESS_ERROR")); + errorNames.insert(std::make_pair(8593, "ERROR_DS_DIFFERENT_REPL_EPOCHS")); + errorNames.insert(std::make_pair(8594, "ERROR_DS_DRS_EXTENSIONS_CHANGED")); + errorNames.insert(std::make_pair(8595, "ERROR_DS_REPLICA_SET_CHANGE_NOT_ALLOWED_ON_DISABLED_CR")); + errorNames.insert(std::make_pair(8596, "ERROR_DS_NO_MSDS_INTID")); + errorNames.insert(std::make_pair(8597, "ERROR_DS_DUP_MSDS_INTID")); + errorNames.insert(std::make_pair(8598, "ERROR_DS_EXISTS_IN_RDNATTID")); + errorNames.insert(std::make_pair(8599, "ERROR_DS_AUTHORIZATION_FAILED")); + errorNames.insert(std::make_pair(8600, "ERROR_DS_INVALID_SCRIPT")); + errorNames.insert(std::make_pair(8601, "ERROR_DS_REMOTE_CROSSREF_OP_FAILED")); + errorNames.insert(std::make_pair(8602, "ERROR_DS_CROSS_REF_BUSY")); + errorNames.insert(std::make_pair(8603, "ERROR_DS_CANT_DERIVE_SPN_FOR_DELETED_DOMAIN")); + errorNames.insert(std::make_pair(8604, "ERROR_DS_CANT_DEMOTE_WITH_WRITEABLE_NC")); + errorNames.insert(std::make_pair(8605, "ERROR_DS_DUPLICATE_ID_FOUND")); + errorNames.insert(std::make_pair(8606, "ERROR_DS_INSUFFICIENT_ATTR_TO_CREATE_OBJECT")); + errorNames.insert(std::make_pair(8607, "ERROR_DS_GROUP_CONVERSION_ERROR")); + errorNames.insert(std::make_pair(8608, "ERROR_DS_CANT_MOVE_APP_BASIC_GROUP")); + errorNames.insert(std::make_pair(8609, "ERROR_DS_CANT_MOVE_APP_QUERY_GROUP")); + errorNames.insert(std::make_pair(8610, "ERROR_DS_ROLE_NOT_VERIFIED")); + errorNames.insert(std::make_pair(8611, "ERROR_DS_WKO_CONTAINER_CANNOT_BE_SPECIAL")); + errorNames.insert(std::make_pair(8612, "ERROR_DS_DOMAIN_RENAME_IN_PROGRESS")); + errorNames.insert(std::make_pair(8613, "ERROR_DS_EXISTING_AD_CHILD_NC")); + errorNames.insert(std::make_pair(8614, "ERROR_DS_REPL_LIFETIME_EXCEEDED")); + errorNames.insert(std::make_pair(8615, "ERROR_DS_DISALLOWED_IN_SYSTEM_CONTAINER")); + errorNames.insert(std::make_pair(8616, "ERROR_DS_LDAP_SEND_QUEUE_FULL")); + errorNames.insert(std::make_pair(8617, "ERROR_DS_DRA_OUT_SCHEDULE_WINDOW")); + errorNames.insert(std::make_pair(8618, "ERROR_DS_POLICY_NOT_KNOWN")); + errorNames.insert(std::make_pair(8619, "ERROR_NO_SITE_SETTINGS_OBJECT")); + errorNames.insert(std::make_pair(8620, "ERROR_NO_SECRETS")); + errorNames.insert(std::make_pair(8621, "ERROR_NO_WRITABLE_DC_FOUND")); + errorNames.insert(std::make_pair(8622, "ERROR_DS_NO_SERVER_OBJECT")); + errorNames.insert(std::make_pair(8623, "ERROR_DS_NO_NTDSA_OBJECT")); + errorNames.insert(std::make_pair(8624, "ERROR_DS_NON_ASQ_SEARCH")); + errorNames.insert(std::make_pair(8625, "ERROR_DS_AUDIT_FAILURE")); + errorNames.insert(std::make_pair(8626, "ERROR_DS_INVALID_SEARCH_FLAG_SUBTREE")); + errorNames.insert(std::make_pair(8627, "ERROR_DS_INVALID_SEARCH_FLAG_TUPLE")); + errorNames.insert(std::make_pair(8628, "ERROR_DS_HIERARCHY_TABLE_TOO_DEEP")); + errorNames.insert(std::make_pair(8629, "ERROR_DS_DRA_CORRUPT_UTD_VECTOR")); + errorNames.insert(std::make_pair(8630, "ERROR_DS_DRA_SECRETS_DENIED")); + errorNames.insert(std::make_pair(8631, "ERROR_DS_RESERVED_MAPI_ID")); + errorNames.insert(std::make_pair(8632, "ERROR_DS_MAPI_ID_NOT_AVAILABLE")); + errorNames.insert(std::make_pair(8633, "ERROR_DS_DRA_MISSING_KRBTGT_SECRET")); + errorNames.insert(std::make_pair(8634, "ERROR_DS_DOMAIN_NAME_EXISTS_IN_FOREST")); + errorNames.insert(std::make_pair(8635, "ERROR_DS_FLAT_NAME_EXISTS_IN_FOREST")); + errorNames.insert(std::make_pair(8636, "ERROR_INVALID_USER_PRINCIPAL_NAME")); + errorNames.insert(std::make_pair(8637, "ERROR_DS_OID_MAPPED_GROUP_CANT_HAVE_MEMBERS")); + errorNames.insert(std::make_pair(8638, "ERROR_DS_OID_NOT_FOUND")); + errorNames.insert(std::make_pair(8639, "ERROR_DS_DRA_RECYCLED_TARGET")); + errorNames.insert(std::make_pair(13000, "ERROR_IPSEC_QM_POLICY_EXISTS")); + errorNames.insert(std::make_pair(13001, "ERROR_IPSEC_QM_POLICY_NOT_FOUND")); + errorNames.insert(std::make_pair(13002, "ERROR_IPSEC_QM_POLICY_IN_USE")); + errorNames.insert(std::make_pair(13003, "ERROR_IPSEC_MM_POLICY_EXISTS")); + errorNames.insert(std::make_pair(13004, "ERROR_IPSEC_MM_POLICY_NOT_FOUND")); + errorNames.insert(std::make_pair(13005, "ERROR_IPSEC_MM_POLICY_IN_USE")); + errorNames.insert(std::make_pair(13006, "ERROR_IPSEC_MM_FILTER_EXISTS")); + errorNames.insert(std::make_pair(13007, "ERROR_IPSEC_MM_FILTER_NOT_FOUND")); + errorNames.insert(std::make_pair(13008, "ERROR_IPSEC_TRANSPORT_FILTER_EXISTS")); + errorNames.insert(std::make_pair(13009, "ERROR_IPSEC_TRANSPORT_FILTER_NOT_FOUND")); + errorNames.insert(std::make_pair(13010, "ERROR_IPSEC_MM_AUTH_EXISTS")); + errorNames.insert(std::make_pair(13011, "ERROR_IPSEC_MM_AUTH_NOT_FOUND")); + errorNames.insert(std::make_pair(13012, "ERROR_IPSEC_MM_AUTH_IN_USE")); + errorNames.insert(std::make_pair(13013, "ERROR_IPSEC_DEFAULT_MM_POLICY_NOT_FOUND")); + errorNames.insert(std::make_pair(13014, "ERROR_IPSEC_DEFAULT_MM_AUTH_NOT_FOUND")); + errorNames.insert(std::make_pair(13015, "ERROR_IPSEC_DEFAULT_QM_POLICY_NOT_FOUND")); + errorNames.insert(std::make_pair(13016, "ERROR_IPSEC_TUNNEL_FILTER_EXISTS")); + errorNames.insert(std::make_pair(13017, "ERROR_IPSEC_TUNNEL_FILTER_NOT_FOUND")); + errorNames.insert(std::make_pair(13018, "ERROR_IPSEC_MM_FILTER_PENDING_DELETION")); + errorNames.insert(std::make_pair(13019, "ERROR_IPSEC_TRANSPORT_FILTER_PENDING_DELETION")); + errorNames.insert(std::make_pair(13020, "ERROR_IPSEC_TUNNEL_FILTER_PENDING_DELETION")); + errorNames.insert(std::make_pair(13021, "ERROR_IPSEC_MM_POLICY_PENDING_DELETION")); + errorNames.insert(std::make_pair(13022, "ERROR_IPSEC_MM_AUTH_PENDING_DELETION")); + errorNames.insert(std::make_pair(13023, "ERROR_IPSEC_QM_POLICY_PENDING_DELETION")); + errorNames.insert(std::make_pair(13800, "ERROR_IPSEC_IKE_NEG_STATUS_BEGIN")); + errorNames.insert(std::make_pair(13801, "ERROR_IPSEC_IKE_AUTH_FAIL")); + errorNames.insert(std::make_pair(13802, "ERROR_IPSEC_IKE_ATTRIB_FAIL")); + errorNames.insert(std::make_pair(13803, "ERROR_IPSEC_IKE_NEGOTIATION_PENDING")); + errorNames.insert(std::make_pair(13804, "ERROR_IPSEC_IKE_GENERAL_PROCESSING_ERROR")); + errorNames.insert(std::make_pair(13805, "ERROR_IPSEC_IKE_TIMED_OUT")); + errorNames.insert(std::make_pair(13806, "ERROR_IPSEC_IKE_NO_CERT")); + errorNames.insert(std::make_pair(13807, "ERROR_IPSEC_IKE_SA_DELETED")); + errorNames.insert(std::make_pair(13808, "ERROR_IPSEC_IKE_SA_REAPED")); + errorNames.insert(std::make_pair(13809, "ERROR_IPSEC_IKE_MM_ACQUIRE_DROP")); + errorNames.insert(std::make_pair(13810, "ERROR_IPSEC_IKE_QM_ACQUIRE_DROP")); + errorNames.insert(std::make_pair(13811, "ERROR_IPSEC_IKE_QUEUE_DROP_MM")); + errorNames.insert(std::make_pair(13812, "ERROR_IPSEC_IKE_QUEUE_DROP_NO_MM")); + errorNames.insert(std::make_pair(13813, "ERROR_IPSEC_IKE_DROP_NO_RESPONSE")); + errorNames.insert(std::make_pair(13814, "ERROR_IPSEC_IKE_MM_DELAY_DROP")); + errorNames.insert(std::make_pair(13815, "ERROR_IPSEC_IKE_QM_DELAY_DROP")); + errorNames.insert(std::make_pair(13816, "ERROR_IPSEC_IKE_ERROR")); + errorNames.insert(std::make_pair(13817, "ERROR_IPSEC_IKE_CRL_FAILED")); + errorNames.insert(std::make_pair(13818, "ERROR_IPSEC_IKE_INVALID_KEY_USAGE")); + errorNames.insert(std::make_pair(13819, "ERROR_IPSEC_IKE_INVALID_CERT_TYPE")); + errorNames.insert(std::make_pair(13820, "ERROR_IPSEC_IKE_NO_PRIVATE_KEY")); + errorNames.insert(std::make_pair(13821, "ERROR_IPSEC_IKE_SIMULTANEOUS_REKEY")); + errorNames.insert(std::make_pair(13822, "ERROR_IPSEC_IKE_DH_FAIL")); + errorNames.insert(std::make_pair(13823, "ERROR_IPSEC_IKE_CRITICAL_PAYLOAD_NOT_RECOGNIZED")); + errorNames.insert(std::make_pair(13824, "ERROR_IPSEC_IKE_INVALID_HEADER")); + errorNames.insert(std::make_pair(13825, "ERROR_IPSEC_IKE_NO_POLICY")); + errorNames.insert(std::make_pair(13826, "ERROR_IPSEC_IKE_INVALID_SIGNATURE")); + errorNames.insert(std::make_pair(13827, "ERROR_IPSEC_IKE_KERBEROS_ERROR")); + errorNames.insert(std::make_pair(13828, "ERROR_IPSEC_IKE_NO_PUBLIC_KEY")); + errorNames.insert(std::make_pair(13829, "ERROR_IPSEC_IKE_PROCESS_ERR")); + errorNames.insert(std::make_pair(13830, "ERROR_IPSEC_IKE_PROCESS_ERR_SA")); + errorNames.insert(std::make_pair(13831, "ERROR_IPSEC_IKE_PROCESS_ERR_PROP")); + errorNames.insert(std::make_pair(13832, "ERROR_IPSEC_IKE_PROCESS_ERR_TRANS")); + errorNames.insert(std::make_pair(13833, "ERROR_IPSEC_IKE_PROCESS_ERR_KE")); + errorNames.insert(std::make_pair(13834, "ERROR_IPSEC_IKE_PROCESS_ERR_ID")); + errorNames.insert(std::make_pair(13835, "ERROR_IPSEC_IKE_PROCESS_ERR_CERT")); + errorNames.insert(std::make_pair(13836, "ERROR_IPSEC_IKE_PROCESS_ERR_CERT_REQ")); + errorNames.insert(std::make_pair(13837, "ERROR_IPSEC_IKE_PROCESS_ERR_HASH")); + errorNames.insert(std::make_pair(13838, "ERROR_IPSEC_IKE_PROCESS_ERR_SIG")); + errorNames.insert(std::make_pair(13839, "ERROR_IPSEC_IKE_PROCESS_ERR_NONCE")); + errorNames.insert(std::make_pair(13840, "ERROR_IPSEC_IKE_PROCESS_ERR_NOTIFY")); + errorNames.insert(std::make_pair(13841, "ERROR_IPSEC_IKE_PROCESS_ERR_DELETE")); + errorNames.insert(std::make_pair(13842, "ERROR_IPSEC_IKE_PROCESS_ERR_VENDOR")); + errorNames.insert(std::make_pair(13843, "ERROR_IPSEC_IKE_INVALID_PAYLOAD")); + errorNames.insert(std::make_pair(13844, "ERROR_IPSEC_IKE_LOAD_SOFT_SA")); + errorNames.insert(std::make_pair(13845, "ERROR_IPSEC_IKE_SOFT_SA_TORN_DOWN")); + errorNames.insert(std::make_pair(13846, "ERROR_IPSEC_IKE_INVALID_COOKIE")); + errorNames.insert(std::make_pair(13847, "ERROR_IPSEC_IKE_NO_PEER_CERT")); + errorNames.insert(std::make_pair(13848, "ERROR_IPSEC_IKE_PEER_CRL_FAILED")); + errorNames.insert(std::make_pair(13849, "ERROR_IPSEC_IKE_POLICY_CHANGE")); + errorNames.insert(std::make_pair(13850, "ERROR_IPSEC_IKE_NO_MM_POLICY")); + errorNames.insert(std::make_pair(13851, "ERROR_IPSEC_IKE_NOTCBPRIV")); + errorNames.insert(std::make_pair(13852, "ERROR_IPSEC_IKE_SECLOADFAIL")); + errorNames.insert(std::make_pair(13853, "ERROR_IPSEC_IKE_FAILSSPINIT")); + errorNames.insert(std::make_pair(13854, "ERROR_IPSEC_IKE_FAILQUERYSSP")); + errorNames.insert(std::make_pair(13855, "ERROR_IPSEC_IKE_SRVACQFAIL")); + errorNames.insert(std::make_pair(13856, "ERROR_IPSEC_IKE_SRVQUERYCRED")); + errorNames.insert(std::make_pair(13857, "ERROR_IPSEC_IKE_GETSPIFAIL")); + errorNames.insert(std::make_pair(13858, "ERROR_IPSEC_IKE_INVALID_FILTER")); + errorNames.insert(std::make_pair(13859, "ERROR_IPSEC_IKE_OUT_OF_MEMORY")); + errorNames.insert(std::make_pair(13860, "ERROR_IPSEC_IKE_ADD_UPDATE_KEY_FAILED")); + errorNames.insert(std::make_pair(13861, "ERROR_IPSEC_IKE_INVALID_POLICY")); + errorNames.insert(std::make_pair(13862, "ERROR_IPSEC_IKE_UNKNOWN_DOI")); + errorNames.insert(std::make_pair(13863, "ERROR_IPSEC_IKE_INVALID_SITUATION")); + errorNames.insert(std::make_pair(13864, "ERROR_IPSEC_IKE_DH_FAILURE")); + errorNames.insert(std::make_pair(13865, "ERROR_IPSEC_IKE_INVALID_GROUP")); + errorNames.insert(std::make_pair(13866, "ERROR_IPSEC_IKE_ENCRYPT")); + errorNames.insert(std::make_pair(13867, "ERROR_IPSEC_IKE_DECRYPT")); + errorNames.insert(std::make_pair(13868, "ERROR_IPSEC_IKE_POLICY_MATCH")); + errorNames.insert(std::make_pair(13869, "ERROR_IPSEC_IKE_UNSUPPORTED_ID")); + errorNames.insert(std::make_pair(13870, "ERROR_IPSEC_IKE_INVALID_HASH")); + errorNames.insert(std::make_pair(13871, "ERROR_IPSEC_IKE_INVALID_HASH_ALG")); + errorNames.insert(std::make_pair(13872, "ERROR_IPSEC_IKE_INVALID_HASH_SIZE")); + errorNames.insert(std::make_pair(13873, "ERROR_IPSEC_IKE_INVALID_ENCRYPT_ALG")); + errorNames.insert(std::make_pair(13874, "ERROR_IPSEC_IKE_INVALID_AUTH_ALG")); + errorNames.insert(std::make_pair(13875, "ERROR_IPSEC_IKE_INVALID_SIG")); + errorNames.insert(std::make_pair(13876, "ERROR_IPSEC_IKE_LOAD_FAILED")); + errorNames.insert(std::make_pair(13877, "ERROR_IPSEC_IKE_RPC_DELETE")); + errorNames.insert(std::make_pair(13878, "ERROR_IPSEC_IKE_BENIGN_REINIT")); + errorNames.insert(std::make_pair(13879, "ERROR_IPSEC_IKE_INVALID_RESPONDER_LIFETIME_NOTIFY")); + errorNames.insert(std::make_pair(13880, "ERROR_IPSEC_IKE_INVALID_MAJOR_VERSION")); + errorNames.insert(std::make_pair(13881, "ERROR_IPSEC_IKE_INVALID_CERT_KEYLEN")); + errorNames.insert(std::make_pair(13882, "ERROR_IPSEC_IKE_MM_LIMIT")); + errorNames.insert(std::make_pair(13883, "ERROR_IPSEC_IKE_NEGOTIATION_DISABLED")); + errorNames.insert(std::make_pair(13884, "ERROR_IPSEC_IKE_QM_LIMIT")); + errorNames.insert(std::make_pair(13885, "ERROR_IPSEC_IKE_MM_EXPIRED")); + errorNames.insert(std::make_pair(13886, "ERROR_IPSEC_IKE_PEER_MM_ASSUMED_INVALID")); + errorNames.insert(std::make_pair(13887, "ERROR_IPSEC_IKE_CERT_CHAIN_POLICY_MISMATCH")); + errorNames.insert(std::make_pair(13888, "ERROR_IPSEC_IKE_UNEXPECTED_MESSAGE_ID")); + errorNames.insert(std::make_pair(13889, "ERROR_IPSEC_IKE_INVALID_AUTH_PAYLOAD")); + errorNames.insert(std::make_pair(13890, "ERROR_IPSEC_IKE_DOS_COOKIE_SENT")); + errorNames.insert(std::make_pair(13891, "ERROR_IPSEC_IKE_SHUTTING_DOWN")); + errorNames.insert(std::make_pair(13892, "ERROR_IPSEC_IKE_CGA_AUTH_FAILED")); + errorNames.insert(std::make_pair(13893, "ERROR_IPSEC_IKE_PROCESS_ERR_NATOA")); + errorNames.insert(std::make_pair(13894, "ERROR_IPSEC_IKE_INVALID_MM_FOR_QM")); + errorNames.insert(std::make_pair(13895, "ERROR_IPSEC_IKE_QM_EXPIRED")); + errorNames.insert(std::make_pair(13896, "ERROR_IPSEC_IKE_TOO_MANY_FILTERS")); + errorNames.insert(std::make_pair(13897, "ERROR_IPSEC_IKE_NEG_STATUS_END")); + errorNames.insert(std::make_pair(13898, "ERROR_IPSEC_IKE_KILL_DUMMY_NAP_TUNNEL")); + errorNames.insert(std::make_pair(13899, "ERROR_IPSEC_IKE_INNER_IP_ASSIGNMENT_FAILURE")); + errorNames.insert(std::make_pair(13900, "ERROR_IPSEC_IKE_REQUIRE_CP_PAYLOAD_MISSING")); + errorNames.insert(std::make_pair(13901, "ERROR_IPSEC_KEY_MODULE_IMPERSONATION_NEGOTIATION_PENDING")); + errorNames.insert(std::make_pair(13902, "ERROR_IPSEC_IKE_COEXISTENCE_SUPPRESS")); + errorNames.insert(std::make_pair(13903, "ERROR_IPSEC_IKE_RATELIMIT_DROP")); + errorNames.insert(std::make_pair(13904, "ERROR_IPSEC_IKE_PEER_DOESNT_SUPPORT_MOBIKE")); + errorNames.insert(std::make_pair(13905, "ERROR_IPSEC_IKE_AUTHORIZATION_FAILURE")); + errorNames.insert(std::make_pair(13906, "ERROR_IPSEC_IKE_STRONG_CRED_AUTHORIZATION_FAILURE")); + errorNames.insert(std::make_pair(13907, "ERROR_IPSEC_IKE_AUTHORIZATION_FAILURE_WITH_OPTIONAL_RETRY")); + errorNames.insert(std::make_pair(13908, "ERROR_IPSEC_IKE_STRONG_CRED_AUTHORIZATION_AND_CERTMAP_FAILURE")); + errorNames.insert(std::make_pair(13909, "ERROR_IPSEC_IKE_NEG_STATUS_EXTENDED_END")); + errorNames.insert(std::make_pair(13910, "ERROR_IPSEC_BAD_SPI")); + errorNames.insert(std::make_pair(13911, "ERROR_IPSEC_SA_LIFETIME_EXPIRED")); + errorNames.insert(std::make_pair(13912, "ERROR_IPSEC_WRONG_SA")); + errorNames.insert(std::make_pair(13913, "ERROR_IPSEC_REPLAY_CHECK_FAILED")); + errorNames.insert(std::make_pair(13914, "ERROR_IPSEC_INVALID_PACKET")); + errorNames.insert(std::make_pair(13915, "ERROR_IPSEC_INTEGRITY_CHECK_FAILED")); + errorNames.insert(std::make_pair(13916, "ERROR_IPSEC_CLEAR_TEXT_DROP")); + errorNames.insert(std::make_pair(13917, "ERROR_IPSEC_AUTH_FIREWALL_DROP")); + errorNames.insert(std::make_pair(13918, "ERROR_IPSEC_THROTTLE_DROP")); + errorNames.insert(std::make_pair(13925, "ERROR_IPSEC_DOSP_BLOCK")); + errorNames.insert(std::make_pair(13926, "ERROR_IPSEC_DOSP_RECEIVED_MULTICAST")); + errorNames.insert(std::make_pair(13927, "ERROR_IPSEC_DOSP_INVALID_PACKET")); + errorNames.insert(std::make_pair(13928, "ERROR_IPSEC_DOSP_STATE_LOOKUP_FAILED")); + errorNames.insert(std::make_pair(13929, "ERROR_IPSEC_DOSP_MAX_ENTRIES")); + errorNames.insert(std::make_pair(13930, "ERROR_IPSEC_DOSP_KEYMOD_NOT_ALLOWED")); + errorNames.insert(std::make_pair(13931, "ERROR_IPSEC_DOSP_NOT_INSTALLED")); + errorNames.insert(std::make_pair(13932, "ERROR_IPSEC_DOSP_MAX_PER_IP_RATELIMIT_QUEUES")); + errorNames.insert(std::make_pair(14000, "ERROR_SXS_SECTION_NOT_FOUND")); + errorNames.insert(std::make_pair(14001, "ERROR_SXS_CANT_GEN_ACTCTX")); + errorNames.insert(std::make_pair(14002, "ERROR_SXS_INVALID_ACTCTXDATA_FORMAT")); + errorNames.insert(std::make_pair(14003, "ERROR_SXS_ASSEMBLY_NOT_FOUND")); + errorNames.insert(std::make_pair(14004, "ERROR_SXS_MANIFEST_FORMAT_ERROR")); + errorNames.insert(std::make_pair(14005, "ERROR_SXS_MANIFEST_PARSE_ERROR")); + errorNames.insert(std::make_pair(14006, "ERROR_SXS_ACTIVATION_CONTEXT_DISABLED")); + errorNames.insert(std::make_pair(14007, "ERROR_SXS_KEY_NOT_FOUND")); + errorNames.insert(std::make_pair(14008, "ERROR_SXS_VERSION_CONFLICT")); + errorNames.insert(std::make_pair(14009, "ERROR_SXS_WRONG_SECTION_TYPE")); + errorNames.insert(std::make_pair(14010, "ERROR_SXS_THREAD_QUERIES_DISABLED")); + errorNames.insert(std::make_pair(14011, "ERROR_SXS_PROCESS_DEFAULT_ALREADY_SET")); + errorNames.insert(std::make_pair(14012, "ERROR_SXS_UNKNOWN_ENCODING_GROUP")); + errorNames.insert(std::make_pair(14013, "ERROR_SXS_UNKNOWN_ENCODING")); + errorNames.insert(std::make_pair(14014, "ERROR_SXS_INVALID_XML_NAMESPACE_URI")); + errorNames.insert(std::make_pair(14015, "ERROR_SXS_ROOT_MANIFEST_DEPENDENCY_NOT_INSTALLED")); + errorNames.insert(std::make_pair(14016, "ERROR_SXS_LEAF_MANIFEST_DEPENDENCY_NOT_INSTALLED")); + errorNames.insert(std::make_pair(14017, "ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE")); + errorNames.insert(std::make_pair(14018, "ERROR_SXS_MANIFEST_MISSING_REQUIRED_DEFAULT_NAMESPACE")); + errorNames.insert(std::make_pair(14019, "ERROR_SXS_MANIFEST_INVALID_REQUIRED_DEFAULT_NAMESPACE")); + errorNames.insert(std::make_pair(14020, "ERROR_SXS_PRIVATE_MANIFEST_CROSS_PATH_WITH_REPARSE_POINT")); + errorNames.insert(std::make_pair(14021, "ERROR_SXS_DUPLICATE_DLL_NAME")); + errorNames.insert(std::make_pair(14022, "ERROR_SXS_DUPLICATE_WINDOWCLASS_NAME")); + errorNames.insert(std::make_pair(14023, "ERROR_SXS_DUPLICATE_CLSID")); + errorNames.insert(std::make_pair(14024, "ERROR_SXS_DUPLICATE_IID")); + errorNames.insert(std::make_pair(14025, "ERROR_SXS_DUPLICATE_TLBID")); + errorNames.insert(std::make_pair(14026, "ERROR_SXS_DUPLICATE_PROGID")); + errorNames.insert(std::make_pair(14027, "ERROR_SXS_DUPLICATE_ASSEMBLY_NAME")); + errorNames.insert(std::make_pair(14028, "ERROR_SXS_FILE_HASH_MISMATCH")); + errorNames.insert(std::make_pair(14029, "ERROR_SXS_POLICY_PARSE_ERROR")); + errorNames.insert(std::make_pair(14030, "ERROR_SXS_XML_E_MISSINGQUOTE")); + errorNames.insert(std::make_pair(14031, "ERROR_SXS_XML_E_COMMENTSYNTAX")); + errorNames.insert(std::make_pair(14032, "ERROR_SXS_XML_E_BADSTARTNAMECHAR")); + errorNames.insert(std::make_pair(14033, "ERROR_SXS_XML_E_BADNAMECHAR")); + errorNames.insert(std::make_pair(14034, "ERROR_SXS_XML_E_BADCHARINSTRING")); + errorNames.insert(std::make_pair(14035, "ERROR_SXS_XML_E_XMLDECLSYNTAX")); + errorNames.insert(std::make_pair(14036, "ERROR_SXS_XML_E_BADCHARDATA")); + errorNames.insert(std::make_pair(14037, "ERROR_SXS_XML_E_MISSINGWHITESPACE")); + errorNames.insert(std::make_pair(14038, "ERROR_SXS_XML_E_EXPECTINGTAGEND")); + errorNames.insert(std::make_pair(14039, "ERROR_SXS_XML_E_MISSINGSEMICOLON")); + errorNames.insert(std::make_pair(14040, "ERROR_SXS_XML_E_UNBALANCEDPAREN")); + errorNames.insert(std::make_pair(14041, "ERROR_SXS_XML_E_INTERNALERROR")); + errorNames.insert(std::make_pair(14042, "ERROR_SXS_XML_E_UNEXPECTED_WHITESPACE")); + errorNames.insert(std::make_pair(14043, "ERROR_SXS_XML_E_INCOMPLETE_ENCODING")); + errorNames.insert(std::make_pair(14044, "ERROR_SXS_XML_E_MISSING_PAREN")); + errorNames.insert(std::make_pair(14045, "ERROR_SXS_XML_E_EXPECTINGCLOSEQUOTE")); + errorNames.insert(std::make_pair(14046, "ERROR_SXS_XML_E_MULTIPLE_COLONS")); + errorNames.insert(std::make_pair(14047, "ERROR_SXS_XML_E_INVALID_DECIMAL")); + errorNames.insert(std::make_pair(14048, "ERROR_SXS_XML_E_INVALID_HEXIDECIMAL")); + errorNames.insert(std::make_pair(14049, "ERROR_SXS_XML_E_INVALID_UNICODE")); + errorNames.insert(std::make_pair(14050, "ERROR_SXS_XML_E_WHITESPACEORQUESTIONMARK")); + errorNames.insert(std::make_pair(14051, "ERROR_SXS_XML_E_UNEXPECTEDENDTAG")); + errorNames.insert(std::make_pair(14052, "ERROR_SXS_XML_E_UNCLOSEDTAG")); + errorNames.insert(std::make_pair(14053, "ERROR_SXS_XML_E_DUPLICATEATTRIBUTE")); + errorNames.insert(std::make_pair(14054, "ERROR_SXS_XML_E_MULTIPLEROOTS")); + errorNames.insert(std::make_pair(14055, "ERROR_SXS_XML_E_INVALIDATROOTLEVEL")); + errorNames.insert(std::make_pair(14056, "ERROR_SXS_XML_E_BADXMLDECL")); + errorNames.insert(std::make_pair(14057, "ERROR_SXS_XML_E_MISSINGROOT")); + errorNames.insert(std::make_pair(14058, "ERROR_SXS_XML_E_UNEXPECTEDEOF")); + errorNames.insert(std::make_pair(14059, "ERROR_SXS_XML_E_BADPEREFINSUBSET")); + errorNames.insert(std::make_pair(14060, "ERROR_SXS_XML_E_UNCLOSEDSTARTTAG")); + errorNames.insert(std::make_pair(14061, "ERROR_SXS_XML_E_UNCLOSEDENDTAG")); + errorNames.insert(std::make_pair(14062, "ERROR_SXS_XML_E_UNCLOSEDSTRING")); + errorNames.insert(std::make_pair(14063, "ERROR_SXS_XML_E_UNCLOSEDCOMMENT")); + errorNames.insert(std::make_pair(14064, "ERROR_SXS_XML_E_UNCLOSEDDECL")); + errorNames.insert(std::make_pair(14065, "ERROR_SXS_XML_E_UNCLOSEDCDATA")); + errorNames.insert(std::make_pair(14066, "ERROR_SXS_XML_E_RESERVEDNAMESPACE")); + errorNames.insert(std::make_pair(14067, "ERROR_SXS_XML_E_INVALIDENCODING")); + errorNames.insert(std::make_pair(14068, "ERROR_SXS_XML_E_INVALIDSWITCH")); + errorNames.insert(std::make_pair(14069, "ERROR_SXS_XML_E_BADXMLCASE")); + errorNames.insert(std::make_pair(14070, "ERROR_SXS_XML_E_INVALID_STANDALONE")); + errorNames.insert(std::make_pair(14071, "ERROR_SXS_XML_E_UNEXPECTED_STANDALONE")); + errorNames.insert(std::make_pair(14072, "ERROR_SXS_XML_E_INVALID_VERSION")); + errorNames.insert(std::make_pair(14073, "ERROR_SXS_XML_E_MISSINGEQUALS")); + errorNames.insert(std::make_pair(14074, "ERROR_SXS_PROTECTION_RECOVERY_FAILED")); + errorNames.insert(std::make_pair(14075, "ERROR_SXS_PROTECTION_PUBLIC_KEY_TOO_SHORT")); + errorNames.insert(std::make_pair(14076, "ERROR_SXS_PROTECTION_CATALOG_NOT_VALID")); + errorNames.insert(std::make_pair(14077, "ERROR_SXS_UNTRANSLATABLE_HRESULT")); + errorNames.insert(std::make_pair(14078, "ERROR_SXS_PROTECTION_CATALOG_FILE_MISSING")); + errorNames.insert(std::make_pair(14079, "ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE")); + errorNames.insert(std::make_pair(14080, "ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME")); + errorNames.insert(std::make_pair(14081, "ERROR_SXS_ASSEMBLY_MISSING")); + errorNames.insert(std::make_pair(14082, "ERROR_SXS_CORRUPT_ACTIVATION_STACK")); + errorNames.insert(std::make_pair(14083, "ERROR_SXS_CORRUPTION")); + errorNames.insert(std::make_pair(14084, "ERROR_SXS_EARLY_DEACTIVATION")); + errorNames.insert(std::make_pair(14085, "ERROR_SXS_INVALID_DEACTIVATION")); + errorNames.insert(std::make_pair(14086, "ERROR_SXS_MULTIPLE_DEACTIVATION")); + errorNames.insert(std::make_pair(14087, "ERROR_SXS_PROCESS_TERMINATION_REQUESTED")); + errorNames.insert(std::make_pair(14088, "ERROR_SXS_RELEASE_ACTIVATION_CONTEXT")); + errorNames.insert(std::make_pair(14089, "ERROR_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY")); + errorNames.insert(std::make_pair(14090, "ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE")); + errorNames.insert(std::make_pair(14091, "ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_NAME")); + errorNames.insert(std::make_pair(14092, "ERROR_SXS_IDENTITY_DUPLICATE_ATTRIBUTE")); + errorNames.insert(std::make_pair(14093, "ERROR_SXS_IDENTITY_PARSE_ERROR")); + errorNames.insert(std::make_pair(14094, "ERROR_MALFORMED_SUBSTITUTION_STRING")); + errorNames.insert(std::make_pair(14095, "ERROR_SXS_INCORRECT_PUBLIC_KEY_TOKEN")); + errorNames.insert(std::make_pair(14096, "ERROR_UNMAPPED_SUBSTITUTION_STRING")); + errorNames.insert(std::make_pair(14097, "ERROR_SXS_ASSEMBLY_NOT_LOCKED")); + errorNames.insert(std::make_pair(14098, "ERROR_SXS_COMPONENT_STORE_CORRUPT")); + errorNames.insert(std::make_pair(14099, "ERROR_ADVANCED_INSTALLER_FAILED")); + errorNames.insert(std::make_pair(14100, "ERROR_XML_ENCODING_MISMATCH")); + errorNames.insert(std::make_pair(14101, "ERROR_SXS_MANIFEST_IDENTITY_SAME_BUT_CONTENTS_DIFFERENT")); + errorNames.insert(std::make_pair(14102, "ERROR_SXS_IDENTITIES_DIFFERENT")); + errorNames.insert(std::make_pair(14103, "ERROR_SXS_ASSEMBLY_IS_NOT_A_DEPLOYMENT")); + errorNames.insert(std::make_pair(14104, "ERROR_SXS_FILE_NOT_PART_OF_ASSEMBLY")); + errorNames.insert(std::make_pair(14105, "ERROR_SXS_MANIFEST_TOO_BIG")); + errorNames.insert(std::make_pair(14106, "ERROR_SXS_SETTING_NOT_REGISTERED")); + errorNames.insert(std::make_pair(14107, "ERROR_SXS_TRANSACTION_CLOSURE_INCOMPLETE")); + errorNames.insert(std::make_pair(14108, "ERROR_SMI_PRIMITIVE_INSTALLER_FAILED")); + errorNames.insert(std::make_pair(14109, "ERROR_GENERIC_COMMAND_FAILED")); + errorNames.insert(std::make_pair(14110, "ERROR_SXS_FILE_HASH_MISSING")); + errorNames.insert(std::make_pair(15000, "ERROR_EVT_INVALID_CHANNEL_PATH")); + errorNames.insert(std::make_pair(15001, "ERROR_EVT_INVALID_QUERY")); + errorNames.insert(std::make_pair(15002, "ERROR_EVT_PUBLISHER_METADATA_NOT_FOUND")); + errorNames.insert(std::make_pair(15003, "ERROR_EVT_EVENT_TEMPLATE_NOT_FOUND")); + errorNames.insert(std::make_pair(15004, "ERROR_EVT_INVALID_PUBLISHER_NAME")); + errorNames.insert(std::make_pair(15005, "ERROR_EVT_INVALID_EVENT_DATA")); + errorNames.insert(std::make_pair(15007, "ERROR_EVT_CHANNEL_NOT_FOUND")); + errorNames.insert(std::make_pair(15008, "ERROR_EVT_MALFORMED_XML_TEXT")); + errorNames.insert(std::make_pair(15009, "ERROR_EVT_SUBSCRIPTION_TO_DIRECT_CHANNEL")); + errorNames.insert(std::make_pair(15010, "ERROR_EVT_CONFIGURATION_ERROR")); + errorNames.insert(std::make_pair(15011, "ERROR_EVT_QUERY_RESULT_STALE")); + errorNames.insert(std::make_pair(15012, "ERROR_EVT_QUERY_RESULT_INVALID_POSITION")); + errorNames.insert(std::make_pair(15013, "ERROR_EVT_NON_VALIDATING_MSXML")); + errorNames.insert(std::make_pair(15014, "ERROR_EVT_FILTER_ALREADYSCOPED")); + errorNames.insert(std::make_pair(15015, "ERROR_EVT_FILTER_NOTELTSET")); + errorNames.insert(std::make_pair(15016, "ERROR_EVT_FILTER_INVARG")); + errorNames.insert(std::make_pair(15017, "ERROR_EVT_FILTER_INVTEST")); + errorNames.insert(std::make_pair(15018, "ERROR_EVT_FILTER_INVTYPE")); + errorNames.insert(std::make_pair(15019, "ERROR_EVT_FILTER_PARSEERR")); + errorNames.insert(std::make_pair(15020, "ERROR_EVT_FILTER_UNSUPPORTEDOP")); + errorNames.insert(std::make_pair(15021, "ERROR_EVT_FILTER_UNEXPECTEDTOKEN")); + errorNames.insert(std::make_pair(15022, "ERROR_EVT_INVALID_OPERATION_OVER_ENABLED_DIRECT_CHANNEL")); + errorNames.insert(std::make_pair(15023, "ERROR_EVT_INVALID_CHANNEL_PROPERTY_VALUE")); + errorNames.insert(std::make_pair(15024, "ERROR_EVT_INVALID_PUBLISHER_PROPERTY_VALUE")); + errorNames.insert(std::make_pair(15025, "ERROR_EVT_CHANNEL_CANNOT_ACTIVATE")); + errorNames.insert(std::make_pair(15026, "ERROR_EVT_FILTER_TOO_COMPLEX")); + errorNames.insert(std::make_pair(15027, "ERROR_EVT_MESSAGE_NOT_FOUND")); + errorNames.insert(std::make_pair(15028, "ERROR_EVT_MESSAGE_ID_NOT_FOUND")); + errorNames.insert(std::make_pair(15029, "ERROR_EVT_UNRESOLVED_VALUE_INSERT")); + errorNames.insert(std::make_pair(15030, "ERROR_EVT_UNRESOLVED_PARAMETER_INSERT")); + errorNames.insert(std::make_pair(15031, "ERROR_EVT_MAX_INSERTS_REACHED")); + errorNames.insert(std::make_pair(15032, "ERROR_EVT_EVENT_DEFINITION_NOT_FOUND")); + errorNames.insert(std::make_pair(15033, "ERROR_EVT_MESSAGE_LOCALE_NOT_FOUND")); + errorNames.insert(std::make_pair(15034, "ERROR_EVT_VERSION_TOO_OLD")); + errorNames.insert(std::make_pair(15035, "ERROR_EVT_VERSION_TOO_NEW")); + errorNames.insert(std::make_pair(15036, "ERROR_EVT_CANNOT_OPEN_CHANNEL_OF_QUERY")); + errorNames.insert(std::make_pair(15037, "ERROR_EVT_PUBLISHER_DISABLED")); + errorNames.insert(std::make_pair(15038, "ERROR_EVT_FILTER_OUT_OF_RANGE")); + errorNames.insert(std::make_pair(15080, "ERROR_EC_SUBSCRIPTION_CANNOT_ACTIVATE")); + errorNames.insert(std::make_pair(15081, "ERROR_EC_LOG_DISABLED")); + errorNames.insert(std::make_pair(15082, "ERROR_EC_CIRCULAR_FORWARDING")); + errorNames.insert(std::make_pair(15083, "ERROR_EC_CREDSTORE_FULL")); + errorNames.insert(std::make_pair(15084, "ERROR_EC_CRED_NOT_FOUND")); + errorNames.insert(std::make_pair(15085, "ERROR_EC_NO_ACTIVE_CHANNEL")); + errorNames.insert(std::make_pair(15100, "ERROR_MUI_FILE_NOT_FOUND")); + errorNames.insert(std::make_pair(15101, "ERROR_MUI_INVALID_FILE")); + errorNames.insert(std::make_pair(15102, "ERROR_MUI_INVALID_RC_CONFIG")); + errorNames.insert(std::make_pair(15103, "ERROR_MUI_INVALID_LOCALE_NAME")); + errorNames.insert(std::make_pair(15104, "ERROR_MUI_INVALID_ULTIMATEFALLBACK_NAME")); + errorNames.insert(std::make_pair(15105, "ERROR_MUI_FILE_NOT_LOADED")); + errorNames.insert(std::make_pair(15106, "ERROR_RESOURCE_ENUM_USER_STOP")); + errorNames.insert(std::make_pair(15107, "ERROR_MUI_INTLSETTINGS_UILANG_NOT_INSTALLED")); + errorNames.insert(std::make_pair(15108, "ERROR_MUI_INTLSETTINGS_INVALID_LOCALE_NAME")); + errorNames.insert(std::make_pair(15200, "ERROR_MCA_INVALID_CAPABILITIES_STRING")); + errorNames.insert(std::make_pair(15201, "ERROR_MCA_INVALID_VCP_VERSION")); + errorNames.insert(std::make_pair(15202, "ERROR_MCA_MONITOR_VIOLATES_MCCS_SPECIFICATION")); + errorNames.insert(std::make_pair(15203, "ERROR_MCA_MCCS_VERSION_MISMATCH")); + errorNames.insert(std::make_pair(15204, "ERROR_MCA_UNSUPPORTED_MCCS_VERSION")); + errorNames.insert(std::make_pair(15205, "ERROR_MCA_INTERNAL_ERROR")); + errorNames.insert(std::make_pair(15206, "ERROR_MCA_INVALID_TECHNOLOGY_TYPE_RETURNED")); + errorNames.insert(std::make_pair(15207, "ERROR_MCA_UNSUPPORTED_COLOR_TEMPERATURE")); + errorNames.insert(std::make_pair(15250, "ERROR_AMBIGUOUS_SYSTEM_DEVICE")); + errorNames.insert(std::make_pair(15299, "ERROR_SYSTEM_DEVICE_NOT_FOUND")); + errorNames.insert(std::make_pair(15300, "ERROR_HASH_NOT_SUPPORTED")); + errorNames.insert(std::make_pair(15301, "ERROR_HASH_NOT_PRESENT")); } -const char* ErrorCodeToName(unsigned int ErrorCode) +const char* errornamefromcode(unsigned int ErrorCode) { - if(!ErrorNames.count(ErrorCode)) - return nullptr; - - return ErrorNames[ErrorCode]; + if(!errorNames.count(ErrorCode)) + return 0; + return errorNames[ErrorCode]; } \ No newline at end of file diff --git a/x64_dbg_dbg/error.h b/x64_dbg_dbg/error.h index 65985171..7b4eeac1 100644 --- a/x64_dbg_dbg/error.h +++ b/x64_dbg_dbg/error.h @@ -1,4 +1,7 @@ -#pragma once +#ifndef _ERROR_H +#define _ERROR_H -void ErrorCodeInit(); -const char* ErrorCodeToName(unsigned int ErrorCode); \ No newline at end of file +void errorinit(); +const char* errornamefromcode(unsigned int ErrorCode); + +#endif //_ERROR_H \ No newline at end of file diff --git a/x64_dbg_dbg/exception.cpp b/x64_dbg_dbg/exception.cpp index dda1b38e..8e000e6b 100644 --- a/x64_dbg_dbg/exception.cpp +++ b/x64_dbg_dbg/exception.cpp @@ -1,79 +1,77 @@ #include "exception.h" -#include +#include -std::unordered_map ExceptionNames; +static std::map exceptionNames; -void ExceptionCodeInit() +void exceptioninit() { - ExceptionNames.clear(); - ExceptionNames.insert(std::make_pair(0x04242420, "CLRDBG_NOTIFICATION_EXCEPTION_CODE")); - ExceptionNames.insert(std::make_pair(0x40000005, "STATUS_SEGMENT_NOTIFICATION")); - ExceptionNames.insert(std::make_pair(0x4000001C, "STATUS_WX86_UNSIMULATE")); - ExceptionNames.insert(std::make_pair(0x4000001D, "STATUS_WX86_CONTINUE")); - ExceptionNames.insert(std::make_pair(0x4000001E, "STATUS_WX86_SINGLE_STEP")); - ExceptionNames.insert(std::make_pair(0x4000001F, "STATUS_WX86_BREAKPOINT")); - ExceptionNames.insert(std::make_pair(0x40000020, "STATUS_WX86_EXCEPTION_CONTINUE")); - ExceptionNames.insert(std::make_pair(0x40000021, "STATUS_WX86_EXCEPTION_LASTCHANCE")); - ExceptionNames.insert(std::make_pair(0x40000022, "STATUS_WX86_EXCEPTION_CHAIN")); - ExceptionNames.insert(std::make_pair(0x40000028, "STATUS_WX86_CREATEWX86TIB")); - ExceptionNames.insert(std::make_pair(0x40010003, "DBG_TERMINATE_THREAD")); - ExceptionNames.insert(std::make_pair(0x40010004, "DBG_TERMINATE_PROCESS")); - ExceptionNames.insert(std::make_pair(0x40010005, "DBG_CONTROL_C")); - ExceptionNames.insert(std::make_pair(0x40010006, "DBG_PRINTEXCEPTION_C")); - ExceptionNames.insert(std::make_pair(0x40010007, "DBG_RIPEXCEPTION")); - ExceptionNames.insert(std::make_pair(0x40010008, "DBG_CONTROL_BREAK")); - ExceptionNames.insert(std::make_pair(0x40010009, "DBG_COMMAND_EXCEPTION")); - ExceptionNames.insert(std::make_pair(0x406D1388, "MS_VC_EXCEPTION")); - ExceptionNames.insert(std::make_pair(0x80000001, "EXCEPTION_GUARD_PAGE")); - ExceptionNames.insert(std::make_pair(0x80000002, "EXCEPTION_DATATYPE_MISALIGNMENT")); - ExceptionNames.insert(std::make_pair(0x80000003, "EXCEPTION_BREAKPOINT")); - ExceptionNames.insert(std::make_pair(0x80000004, "EXCEPTION_SINGLE_STEP")); - ExceptionNames.insert(std::make_pair(0x80000026, "STATUS_LONGJUMP")); - ExceptionNames.insert(std::make_pair(0x80000029, "STATUS_UNWIND_CONSOLIDATE")); - ExceptionNames.insert(std::make_pair(0x80010001, "DBG_EXCEPTION_NOT_HANDLED")); - ExceptionNames.insert(std::make_pair(0xC0000005, "EXCEPTION_ACCESS_VIOLATION")); - ExceptionNames.insert(std::make_pair(0xC0000006, "EXCEPTION_IN_PAGE_ERROR")); - ExceptionNames.insert(std::make_pair(0xC0000008, "EXCEPTION_INVALID_HANDLE")); - ExceptionNames.insert(std::make_pair(0xC000000D, "STATUS_INVALID_PARAMETER")); - ExceptionNames.insert(std::make_pair(0xC0000017, "STATUS_NO_MEMORY")); - ExceptionNames.insert(std::make_pair(0xC000001D, "EXCEPTION_ILLEGAL_INSTRUCTION")); - ExceptionNames.insert(std::make_pair(0xC0000025, "EXCEPTION_NONCONTINUABLE_EXCEPTION")); - ExceptionNames.insert(std::make_pair(0xC0000026, "EXCEPTION_INVALID_DISPOSITION")); - ExceptionNames.insert(std::make_pair(0xC000008C, "EXCEPTION_ARRAY_BOUNDS_EXCEEDED")); - ExceptionNames.insert(std::make_pair(0xC000008D, "EXCEPTION_FLT_DENORMAL_OPERAND")); - ExceptionNames.insert(std::make_pair(0xC000008E, "EXCEPTION_FLT_DIVIDE_BY_ZERO")); - ExceptionNames.insert(std::make_pair(0xC000008F, "EXCEPTION_FLT_INEXACT_RESULT")); - ExceptionNames.insert(std::make_pair(0xC0000090, "EXCEPTION_FLT_INVALID_OPERATION")); - ExceptionNames.insert(std::make_pair(0xC0000091, "EXCEPTION_FLT_OVERFLOW")); - ExceptionNames.insert(std::make_pair(0xC0000092, "EXCEPTION_FLT_STACK_CHECK")); - ExceptionNames.insert(std::make_pair(0xC0000093, "EXCEPTION_FLT_UNDERFLOW")); - ExceptionNames.insert(std::make_pair(0xC0000094, "EXCEPTION_INT_DIVIDE_BY_ZERO")); - ExceptionNames.insert(std::make_pair(0xC0000095, "EXCEPTION_INT_OVERFLOW")); - ExceptionNames.insert(std::make_pair(0xC0000096, "EXCEPTION_PRIV_INSTRUCTION")); - ExceptionNames.insert(std::make_pair(0xC00000FD, "EXCEPTION_STACK_OVERFLOW")); - ExceptionNames.insert(std::make_pair(0xC0000135, "STATUS_DLL_NOT_FOUND")); - ExceptionNames.insert(std::make_pair(0xC0000138, "STATUS_ORDINAL_NOT_FOUND")); - ExceptionNames.insert(std::make_pair(0xC0000139, "STATUS_ENTRYPOINT_NOT_FOUND")); - ExceptionNames.insert(std::make_pair(0xC000013A, "STATUS_CONTROL_C_EXIT")); - ExceptionNames.insert(std::make_pair(0xC0000142, "STATUS_DLL_INIT_FAILED")); - ExceptionNames.insert(std::make_pair(0xC000014A, "STATUS_ILLEGAL_FLOAT_CONTEXT")); - ExceptionNames.insert(std::make_pair(0xC0000194, "EXCEPTION_POSSIBLE_DEADLOCK")); - ExceptionNames.insert(std::make_pair(0xC00001A5, "STATUS_INVALID_EXCEPTION_HANDLER")); - ExceptionNames.insert(std::make_pair(0xC00002B4, "STATUS_FLOAT_MULTIPLE_FAULTS")); - ExceptionNames.insert(std::make_pair(0xC00002B5, "STATUS_FLOAT_MULTIPLE_TRAPS")); - ExceptionNames.insert(std::make_pair(0xC00002C5, "STATUS_DATATYPE_MISALIGNMENT_ERROR")); - ExceptionNames.insert(std::make_pair(0xC00002C9, "STATUS_REG_NAT_CONSUMPTION")); - ExceptionNames.insert(std::make_pair(0xC0000409, "STATUS_STACK_BUFFER_OVERRUN")); - ExceptionNames.insert(std::make_pair(0xC0000417, "STATUS_INVALID_CRUNTIME_PARAMETER")); - ExceptionNames.insert(std::make_pair(0xC0000420, "STATUS_ASSERTION_FAILURE")); - ExceptionNames.insert(std::make_pair(0xE0434352, "CLR_EXCEPTION")); - ExceptionNames.insert(std::make_pair(0xE06D7363, "CPP_EH_EXCEPTION")); + exceptionNames.insert(std::make_pair(0x40000005, "STATUS_SEGMENT_NOTIFICATION")); + exceptionNames.insert(std::make_pair(0x4000001C, "STATUS_WX86_UNSIMULATE")); + exceptionNames.insert(std::make_pair(0x4000001D, "STATUS_WX86_CONTINUE")); + exceptionNames.insert(std::make_pair(0x4000001E, "STATUS_WX86_SINGLE_STEP")); + exceptionNames.insert(std::make_pair(0x4000001F, "STATUS_WX86_BREAKPOINT")); + exceptionNames.insert(std::make_pair(0x40000020, "STATUS_WX86_EXCEPTION_CONTINUE")); + exceptionNames.insert(std::make_pair(0x40000021, "STATUS_WX86_EXCEPTION_LASTCHANCE")); + exceptionNames.insert(std::make_pair(0x40000022, "STATUS_WX86_EXCEPTION_CHAIN")); + exceptionNames.insert(std::make_pair(0x40000028, "STATUS_WX86_CREATEWX86TIB")); + exceptionNames.insert(std::make_pair(0x40010003, "DBG_TERMINATE_THREAD")); + exceptionNames.insert(std::make_pair(0x40010004, "DBG_TERMINATE_PROCESS")); + exceptionNames.insert(std::make_pair(0x40010005, "DBG_CONTROL_C")); + exceptionNames.insert(std::make_pair(0x40010006, "DBG_PRINTEXCEPTION_C")); + exceptionNames.insert(std::make_pair(0x40010007, "DBG_RIPEXCEPTION")); + exceptionNames.insert(std::make_pair(0x40010008, "DBG_CONTROL_BREAK")); + exceptionNames.insert(std::make_pair(0x40010009, "DBG_COMMAND_EXCEPTION")); + exceptionNames.insert(std::make_pair(0x80000001, "EXCEPTION_GUARD_PAGE")); + exceptionNames.insert(std::make_pair(0x80000002, "EXCEPTION_DATATYPE_MISALIGNMENT")); + exceptionNames.insert(std::make_pair(0x80000003, "EXCEPTION_BREAKPOINT")); + exceptionNames.insert(std::make_pair(0x80000004, "EXCEPTION_SINGLE_STEP")); + exceptionNames.insert(std::make_pair(0x80000026, "STATUS_LONGJUMP")); + exceptionNames.insert(std::make_pair(0x80000029, "STATUS_UNWIND_CONSOLIDATE")); + exceptionNames.insert(std::make_pair(0x80010001, "DBG_EXCEPTION_NOT_HANDLED")); + exceptionNames.insert(std::make_pair(0xC0000005, "EXCEPTION_ACCESS_VIOLATION")); + exceptionNames.insert(std::make_pair(0xC0000006, "EXCEPTION_IN_PAGE_ERROR")); + exceptionNames.insert(std::make_pair(0xC0000008, "EXCEPTION_INVALID_HANDLE")); + exceptionNames.insert(std::make_pair(0xC000000D, "STATUS_INVALID_PARAMETER")); + exceptionNames.insert(std::make_pair(0xC0000017, "STATUS_NO_MEMORY")); + exceptionNames.insert(std::make_pair(0xC000001D, "EXCEPTION_ILLEGAL_INSTRUCTION")); + exceptionNames.insert(std::make_pair(0xC0000025, "EXCEPTION_NONCONTINUABLE_EXCEPTION")); + exceptionNames.insert(std::make_pair(0xC0000026, "EXCEPTION_INVALID_DISPOSITION")); + exceptionNames.insert(std::make_pair(0xC000008C, "EXCEPTION_ARRAY_BOUNDS_EXCEEDED")); + exceptionNames.insert(std::make_pair(0xC000008D, "EXCEPTION_FLT_DENORMAL_OPERAND")); + exceptionNames.insert(std::make_pair(0xC000008E, "EXCEPTION_FLT_DIVIDE_BY_ZERO")); + exceptionNames.insert(std::make_pair(0xC000008F, "EXCEPTION_FLT_INEXACT_RESULT")); + exceptionNames.insert(std::make_pair(0xC0000090, "EXCEPTION_FLT_INVALID_OPERATION")); + exceptionNames.insert(std::make_pair(0xC0000091, "EXCEPTION_FLT_OVERFLOW")); + exceptionNames.insert(std::make_pair(0xC0000092, "EXCEPTION_FLT_STACK_CHECK")); + exceptionNames.insert(std::make_pair(0xC0000093, "EXCEPTION_FLT_UNDERFLOW")); + exceptionNames.insert(std::make_pair(0xC0000094, "EXCEPTION_INT_DIVIDE_BY_ZERO")); + exceptionNames.insert(std::make_pair(0xC0000095, "EXCEPTION_INT_OVERFLOW")); + exceptionNames.insert(std::make_pair(0xC0000096, "EXCEPTION_PRIV_INSTRUCTION")); + exceptionNames.insert(std::make_pair(0xC00000FD, "EXCEPTION_STACK_OVERFLOW")); + exceptionNames.insert(std::make_pair(0xC0000135, "STATUS_DLL_NOT_FOUND")); + exceptionNames.insert(std::make_pair(0xC0000138, "STATUS_ORDINAL_NOT_FOUND")); + exceptionNames.insert(std::make_pair(0xC0000139, "STATUS_ENTRYPOINT_NOT_FOUND")); + exceptionNames.insert(std::make_pair(0xC000013A, "STATUS_CONTROL_C_EXIT")); + exceptionNames.insert(std::make_pair(0xC0000142, "STATUS_DLL_INIT_FAILED")); + exceptionNames.insert(std::make_pair(0xC000014A, "STATUS_ILLEGAL_FLOAT_CONTEXT")); + exceptionNames.insert(std::make_pair(0xC0000194, "EXCEPTION_POSSIBLE_DEADLOCK")); + exceptionNames.insert(std::make_pair(0xC00002B4, "STATUS_FLOAT_MULTIPLE_FAULTS")); + exceptionNames.insert(std::make_pair(0xC00002B5, "STATUS_FLOAT_MULTIPLE_TRAPS")); + exceptionNames.insert(std::make_pair(0xC00002C5, "STATUS_DATATYPE_MISALIGNMENT_ERROR")); + exceptionNames.insert(std::make_pair(0xC00002C9, "STATUS_REG_NAT_CONSUMPTION")); + exceptionNames.insert(std::make_pair(0xC0000409, "STATUS_STACK_BUFFER_OVERRUN")); + exceptionNames.insert(std::make_pair(0xC0000417, "STATUS_INVALID_CRUNTIME_PARAMETER")); + exceptionNames.insert(std::make_pair(0xC0000420, "STATUS_ASSERTION_FAILURE")); + exceptionNames.insert(std::make_pair(0x04242420, "CLRDBG_NOTIFICATION_EXCEPTION_CODE")); + exceptionNames.insert(std::make_pair(0xE0434352, "CLR_EXCEPTION")); + exceptionNames.insert(std::make_pair(0xE06D7363, "CPP_EH_EXCEPTION")); + exceptionNames.insert(std::make_pair(0x406D1388, "MS_VC_EXCEPTION")); + exceptionNames.insert(std::make_pair(0xC00001A5, "STATUS_INVALID_EXCEPTION_HANDLER")); } -const char* ExceptionCodeToName(unsigned int ExceptionCode) +const char* exceptionnamefromcode(unsigned int ExceptionCode) { - if(!ExceptionNames.count(ExceptionCode)) - return nullptr; - - return ExceptionNames[ExceptionCode]; + if(!exceptionNames.count(ExceptionCode)) + return 0; + return exceptionNames[ExceptionCode]; } \ No newline at end of file diff --git a/x64_dbg_dbg/exception.h b/x64_dbg_dbg/exception.h index 39043631..df0ea2a3 100644 --- a/x64_dbg_dbg/exception.h +++ b/x64_dbg_dbg/exception.h @@ -1,4 +1,7 @@ -#pragma once +#ifndef _EXCEPTION_H +#define _EXCEPTION_H -void ExceptionCodeInit(); -const char* ExceptionCodeToName(unsigned int ExceptionCode); \ No newline at end of file +void exceptioninit(); +const char* exceptionnamefromcode(unsigned int ExceptionCode); + +#endif //_EXCEPTIONS_H \ No newline at end of file diff --git a/x64_dbg_dbg/function.cpp b/x64_dbg_dbg/function.cpp index 48059ad1..cc5406d6 100644 --- a/x64_dbg_dbg/function.cpp +++ b/x64_dbg_dbg/function.cpp @@ -8,257 +8,185 @@ typedef std::map FunctionsInfo; static FunctionsInfo functions; -bool FunctionAdd(uint Start, uint End, bool Manual) +bool functionadd(uint start, uint end, bool manual) { - // CHECK: Export/Command function - if(!DbgIsDebugging()) + if(!DbgIsDebugging() or end < start or !memisvalidreadptr(fdProcessInfo->hProcess, start)) return false; - - // Make sure memory is readable - if(!MemIsValidReadPtr(Start)) + const uint modbase = modbasefromaddr(start); + if(modbase != modbasefromaddr(end)) //the function boundaries are not in the same module return false; - - // Fail if boundary exceeds module size - const uint moduleBase = ModBaseFromAddr(Start); - - if(moduleBase != ModBaseFromAddr(End)) + if(functionoverlaps(start, end)) return false; - - // Fail if 'Start' and 'End' are incompatible - if(Start > End || FunctionOverlaps(Start, End)) - return false; - FUNCTIONSINFO function; - ModNameFromAddr(Start, function.mod, true); - function.start = Start - moduleBase; - function.end = End - moduleBase; - function.manual = Manual; - - // Insert to global table - EXCLUSIVE_ACQUIRE(LockFunctions); - - functions.insert(std::make_pair(ModuleRange(ModHashFromAddr(moduleBase), Range(function.start, function.end)), function)); + modnamefromaddr(start, function.mod, true); + function.start = start - modbase; + function.end = end - modbase; + function.manual = manual; + CriticalSectionLocker locker(LockFunctions); + functions.insert(std::make_pair(ModuleRange(modhashfromva(modbase), Range(function.start, function.end)), function)); return true; } -bool FunctionGet(uint Address, uint* Start, uint* End) +bool functionget(uint addr, uint* start, uint* end) { - // CHECK: Exported function if(!DbgIsDebugging()) return false; - - const uint modbase = ModBaseFromAddr(Address); - - // Lookup by module hash, then function range - SHARED_ACQUIRE(LockFunctions); - - auto found = functions.find(ModuleRange(ModHashFromAddr(modbase), Range(Address - modbase, Address - modbase))); - - // Was this range found? - if(found == functions.end()) + uint modbase = modbasefromaddr(addr); + CriticalSectionLocker locker(LockFunctions); + const FunctionsInfo::iterator found = functions.find(ModuleRange(modhashfromva(modbase), Range(addr - modbase, addr - modbase))); + if(found == functions.end()) //not found return false; - - if(Start) - *Start = found->second.start + modbase; - - if(End) - *End = found->second.end + modbase; - + if(start) + *start = found->second.start + modbase; + if(end) + *end = found->second.end + modbase; return true; } -bool FunctionOverlaps(uint Start, uint End) +bool functionoverlaps(uint start, uint end) { - // CHECK: Exported function - if(!DbgIsDebugging()) + if(!DbgIsDebugging() or end < start) return false; - - // A function can't end before it begins - if(Start > End) - return false; - - const uint moduleBase = ModBaseFromAddr(Start); - - SHARED_ACQUIRE(LockFunctions); - return (functions.count(ModuleRange(ModHashFromAddr(moduleBase), Range(Start - moduleBase, End - moduleBase))) > 0); + const uint modbase = modbasefromaddr(start); + CriticalSectionLocker locker(LockFunctions); + return (functions.count(ModuleRange(modhashfromva(modbase), Range(start - modbase, end - modbase))) > 0); } -bool FunctionDelete(uint Address) +bool functiondel(uint addr) { - // CHECK: Exported function if(!DbgIsDebugging()) return false; - - const uint moduleBase = ModBaseFromAddr(Address); - - EXCLUSIVE_ACQUIRE(LockFunctions); - return (functions.erase(ModuleRange(ModHashFromAddr(moduleBase), Range(Address - moduleBase, Address - moduleBase))) > 0); + const uint modbase = modbasefromaddr(addr); + CriticalSectionLocker locker(LockFunctions); + return (functions.erase(ModuleRange(modhashfromva(modbase), Range(addr - modbase, addr - modbase))) > 0); } -void FunctionDelRange(uint Start, uint End) +void functiondelrange(uint start, uint end) { - // CHECK: Exported function if(!DbgIsDebugging()) return; - - // Should all functions be deleted? - // 0x00000000 - 0xFFFFFFFF - if(Start == 0 && End == ~0) + bool bDelAll = (start == 0 && end == ~0); //0x00000000-0xFFFFFFFF + uint modbase = modbasefromaddr(start); + if(modbase != modbasefromaddr(end)) + return; + start -= modbase; + end -= modbase; + CriticalSectionLocker locker(LockFunctions); + FunctionsInfo::iterator i = functions.begin(); + while(i != functions.end()) { - EXCLUSIVE_ACQUIRE(LockFunctions); - functions.clear(); - } - else - { - // The start and end address must be in the same module - uint moduleBase = ModBaseFromAddr(Start); - - if(moduleBase != ModBaseFromAddr(End)) - return; - - // Convert these to a relative offset - Start -= moduleBase; - End -= moduleBase; - - EXCLUSIVE_ACQUIRE(LockFunctions); - for(auto itr = functions.begin(); itr != functions.end();) + if(i->second.manual) //ignore manual { - // Ignore manually set entries - if(itr->second.manual) - { - itr++; - continue; - } - - // [Start, End] - if(itr->second.end >= Start && itr->second.start <= End) - itr = functions.erase(itr); - else - itr++; + i++; + continue; } - } -} - -void FunctionCacheSave(JSON Root) -{ - EXCLUSIVE_ACQUIRE(LockFunctions); - - // Allocate JSON object array - const JSON jsonFunctions = json_array(); - const JSON jsonAutoFunctions = json_array(); - - for(auto & i : functions) - { - JSON currentFunction = json_object(); - - json_object_set_new(currentFunction, "module", json_string(i.second.mod)); - json_object_set_new(currentFunction, "start", json_hex(i.second.start)); - json_object_set_new(currentFunction, "end", json_hex(i.second.end)); - - if(i.second.manual) - json_array_append_new(jsonFunctions, currentFunction); + if(bDelAll or !(i->second.start <= end and i->second.end >= start)) + functions.erase(i++); else - json_array_append_new(jsonAutoFunctions, currentFunction); + i++; } - - if(json_array_size(jsonFunctions)) - json_object_set(Root, "functions", jsonFunctions); - - if(json_array_size(jsonAutoFunctions)) - json_object_set(Root, "autofunctions", jsonAutoFunctions); - - // Decrease reference count to avoid leaking memory - json_decref(jsonFunctions); - json_decref(jsonAutoFunctions); } -void FunctionCacheLoad(JSON Root) +void functioncachesave(JSON root) { - EXCLUSIVE_ACQUIRE(LockFunctions); + CriticalSectionLocker locker(LockFunctions); + const JSON jsonfunctions = json_array(); + const JSON jsonautofunctions = json_array(); + for(FunctionsInfo::iterator i = functions.begin(); i != functions.end(); ++i) + { + const FUNCTIONSINFO curFunction = i->second; + JSON curjsonfunction = json_object(); + json_object_set_new(curjsonfunction, "module", json_string(curFunction.mod)); + json_object_set_new(curjsonfunction, "start", json_hex(curFunction.start)); + json_object_set_new(curjsonfunction, "end", json_hex(curFunction.end)); + if(curFunction.manual) + json_array_append_new(jsonfunctions, curjsonfunction); + else + json_array_append_new(jsonautofunctions, curjsonfunction); + } + if(json_array_size(jsonfunctions)) + json_object_set(root, "functions", jsonfunctions); + json_decref(jsonfunctions); + if(json_array_size(jsonautofunctions)) + json_object_set(root, "autofunctions", jsonautofunctions); + json_decref(jsonautofunctions); +} - // Delete existing entries +void functioncacheload(JSON root) +{ + CriticalSectionLocker locker(LockFunctions); functions.clear(); - - // Inline lambda to enumerate all JSON array indices - auto InsertFunctions = [](const JSON Object, bool Manual) + const JSON jsonfunctions = json_object_get(root, "functions"); + if(jsonfunctions) { size_t i; JSON value; - json_array_foreach(Object, i, value) + json_array_foreach(jsonfunctions, i, value) { - FUNCTIONSINFO function; - - // Copy module name + FUNCTIONSINFO curFunction; const char* mod = json_string_value(json_object_get(value, "module")); - if(mod && *mod && strlen(mod) < MAX_MODULE_SIZE) - strcpy_s(function.mod, mod); + strcpy_s(curFunction.mod, mod); else - function.mod[0] = '\0'; - - // Function address - function.start = (uint)json_hex_value(json_object_get(value, "start")); - function.end = (uint)json_hex_value(json_object_get(value, "end")); - function.manual = Manual; - - // Sanity check - if(function.end < function.start) - continue; - - const uint key = ModHashFromName(function.mod); - functions.insert(std::make_pair(ModuleRange(ModHashFromName(function.mod), Range(function.start, function.end)), function)); + *curFunction.mod = '\0'; + curFunction.start = (uint)json_hex_value(json_object_get(value, "start")); + curFunction.end = (uint)json_hex_value(json_object_get(value, "end")); + if(curFunction.end < curFunction.start) + continue; //invalid function + curFunction.manual = true; + const uint key = modhashfromname(curFunction.mod); + functions.insert(std::make_pair(ModuleRange(modhashfromname(curFunction.mod), Range(curFunction.start, curFunction.end)), curFunction)); } - }; - - const JSON jsonFunctions = json_object_get(Root, "functions"); - const JSON jsonAutoFunctions = json_object_get(Root, "autofunctions"); - - if(jsonFunctions) - InsertFunctions(jsonFunctions, true); - - if(jsonAutoFunctions) - InsertFunctions(jsonAutoFunctions, false); + } + JSON jsonautofunctions = json_object_get(root, "autofunctions"); + if(jsonautofunctions) + { + size_t i; + JSON value; + json_array_foreach(jsonautofunctions, i, value) + { + FUNCTIONSINFO curFunction; + const char* mod = json_string_value(json_object_get(value, "module")); + if(mod && *mod && strlen(mod) < MAX_MODULE_SIZE) + strcpy_s(curFunction.mod, mod); + else + *curFunction.mod = '\0'; + curFunction.start = (uint)json_hex_value(json_object_get(value, "start")); + curFunction.end = (uint)json_hex_value(json_object_get(value, "end")); + if(curFunction.end < curFunction.start) + continue; //invalid function + curFunction.manual = true; + const uint key = modhashfromname(curFunction.mod); + functions.insert(std::make_pair(ModuleRange(modhashfromname(curFunction.mod), Range(curFunction.start, curFunction.end)), curFunction)); + } + } } -bool FunctionEnum(FUNCTIONSINFO* List, size_t* Size) +bool functionenum(FUNCTIONSINFO* functionlist, size_t* cbsize) { - // CHECK: Exported function if(!DbgIsDebugging()) return false; - - // If a list isn't passed and the size not requested, fail - if(!List && !Size) + if(!functionlist && !cbsize) return false; - - SHARED_ACQUIRE(LockFunctions); - - // Did the caller request the buffer size needed? - if(Size) + CriticalSectionLocker locker(LockFunctions); + if(!functionlist && cbsize) { - *Size = functions.size() * sizeof(FUNCTIONSINFO); - - if(!List) - return true; + *cbsize = functions.size() * sizeof(FUNCTIONSINFO); + return true; } - - // Fill out the buffer - for(auto & itr : functions) + int j = 0; + for(FunctionsInfo::iterator i = functions.begin(); i != functions.end(); ++i, j++) { - // Adjust for relative to virtual addresses - uint moduleBase = ModBaseFromName(itr.second.mod); - - *List = itr.second; - List->start += moduleBase; - List->end += moduleBase; - - List++; + functionlist[j] = i->second; + uint modbase = modbasefromname(functionlist[j].mod); + functionlist[j].start += modbase; + functionlist[j].end += modbase; } - return true; } -void FunctionClear() +void functionclear() { - EXCLUSIVE_ACQUIRE(LockFunctions); - functions.clear(); + CriticalSectionLocker locker(LockFunctions); + FunctionsInfo().swap(functions); } \ No newline at end of file diff --git a/x64_dbg_dbg/function.h b/x64_dbg_dbg/function.h index 41afb223..53f4adda 100644 --- a/x64_dbg_dbg/function.h +++ b/x64_dbg_dbg/function.h @@ -1,4 +1,5 @@ -#pragma once +#ifndef _FUNCTION_H +#define _FUNCTION_H #include "addrinfo.h" @@ -10,12 +11,14 @@ struct FUNCTIONSINFO bool manual; }; -bool FunctionAdd(uint Start, uint End, bool Manual); -bool FunctionGet(uint Address, uint* Start, uint* End); -bool FunctionOverlaps(uint Start, uint End); -bool FunctionDelete(uint Address); -void FunctionDelRange(uint Start, uint End); -void FunctionCacheSave(JSON Root); -void FunctionCacheLoad(JSON Root); -bool FunctionEnum(FUNCTIONSINFO* List, size_t* Size); -void FunctionClear(); \ No newline at end of file +bool functionadd(uint start, uint end, bool manual); +bool functionget(uint addr, uint* start, uint* end); +bool functionoverlaps(uint start, uint end); +bool functiondel(uint addr); +void functiondelrange(uint start, uint end); +void functioncachesave(JSON root); +void functioncacheload(JSON root); +bool functionenum(FUNCTIONSINFO* functionlist, size_t* cbsize); +void functionclear(); + +#endif //_FUNCTION_H \ No newline at end of file diff --git a/x64_dbg_dbg/instruction.cpp b/x64_dbg_dbg/instruction.cpp index 6e0ee4ec..f9cba729 100644 --- a/x64_dbg_dbg/instruction.cpp +++ b/x64_dbg_dbg/instruction.cpp @@ -158,7 +158,7 @@ CMDRESULT cbInstrMov(int argc, char* argv[]) } //Check the destination uint dest; - if(!valfromstring(argv[1], &dest) || !MemIsValidReadPtr(dest)) + if(!valfromstring(argv[1], &dest) || !memisvalidreadptr(fdProcessInfo->hProcess, dest)) { dprintf("invalid destination \"%s\"\n", argv[1]); return STATUS_ERROR; @@ -175,7 +175,7 @@ CMDRESULT cbInstrMov(int argc, char* argv[]) data[j] = res; } //Move data to destination - if(!MemWrite((void*)dest, data, data.size(), 0)) + if(!memwrite(fdProcessInfo->hProcess, (void*)dest, data, data.size(), 0)) { dprintf("failed to write to "fhex"\n", dest); return STATUS_ERROR; @@ -294,7 +294,7 @@ CMDRESULT cbInstrCmt(int argc, char* argv[]) uint addr = 0; if(!valfromstring(argv[1], &addr, false)) return STATUS_ERROR; - if(!CommentSet(addr, argv[2], true)) + if(!commentset(addr, argv[2], true)) { dputs("error setting comment"); return STATUS_ERROR; @@ -312,7 +312,7 @@ CMDRESULT cbInstrCmtdel(int argc, char* argv[]) uint addr = 0; if(!valfromstring(argv[1], &addr, false)) return STATUS_ERROR; - if(!CommentDelete(addr)) + if(!commentdel(addr)) { dputs("error deleting comment"); return STATUS_ERROR; @@ -368,7 +368,7 @@ CMDRESULT cbInstrBookmarkSet(int argc, char* argv[]) uint addr = 0; if(!valfromstring(argv[1], &addr, false)) return STATUS_ERROR; - if(!BookmarkSet(addr, true)) + if(!bookmarkset(addr, true)) { dputs("failed to set bookmark!"); return STATUS_ERROR; @@ -387,7 +387,7 @@ CMDRESULT cbInstrBookmarkDel(int argc, char* argv[]) uint addr = 0; if(!valfromstring(argv[1], &addr, false)) return STATUS_ERROR; - if(!BookmarkDelete(addr)) + if(!bookmarkdel(addr)) { dputs("failed to delete bookmark!"); return STATUS_ERROR; @@ -454,7 +454,7 @@ CMDRESULT cbFunctionAdd(int argc, char* argv[]) uint end = 0; if(!valfromstring(argv[1], &start, false) or !valfromstring(argv[2], &end, false)) return STATUS_ERROR; - if(!FunctionAdd(start, end, true)) + if(!functionadd(start, end, true)) { dputs("failed to add function"); return STATUS_ERROR; @@ -474,7 +474,7 @@ CMDRESULT cbFunctionDel(int argc, char* argv[]) uint addr = 0; if(!valfromstring(argv[1], &addr, false)) return STATUS_ERROR; - if(!FunctionDelete(addr)) + if(!functiondel(addr)) { dputs("failed to delete function"); return STATUS_ERROR; @@ -1053,7 +1053,7 @@ CMDRESULT cbInstrCopystr(int argc, char* argv[]) dprintf("invalid address \"%s\"!\n", argv[1]); return STATUS_ERROR; } - if(!MemPatch((void*)addr, string, strlen(string), 0)) + if(!mempatch(fdProcessInfo->hProcess, (void*)addr, string, strlen(string), 0)) { dputs("memwrite failed!"); return STATUS_ERROR; @@ -1084,14 +1084,14 @@ CMDRESULT cbInstrFind(int argc, char* argv[]) if(pattern[len - 1] == '#') pattern[len - 1] = '\0'; uint size = 0; - uint base = MemFindBaseAddr(addr, &size, true); + uint base = memfindbaseaddr(addr, &size, true); if(!base) { dprintf("invalid memory address "fhex"!\n", addr); return STATUS_ERROR; } Memory data(size, "cbInstrFind:data"); - if(!MemRead((void*)base, data, size, 0)) + if(!memread(fdProcessInfo->hProcess, (const void*)base, data, size, 0)) { dputs("failed to read memory!"); return STATUS_ERROR; @@ -1136,14 +1136,14 @@ CMDRESULT cbInstrFindAll(int argc, char* argv[]) if(pattern[len - 1] == '#') pattern[len - 1] = '\0'; uint size = 0; - uint base = MemFindBaseAddr(addr, &size, true); + uint base = memfindbaseaddr(addr, &size, true); if(!base) { dprintf("invalid memory address "fhex"!\n", addr); return STATUS_ERROR; } Memory data(size, "cbInstrFindAll:data"); - if(!MemRead((void*)base, data, size, 0)) + if(!memread(fdProcessInfo->hProcess, (const void*)base, data, size, 0)) { dputs("failed to read memory!"); return STATUS_ERROR; @@ -1192,7 +1192,7 @@ CMDRESULT cbInstrFindAll(int argc, char* argv[]) if(findData) { Memory printData(patternsize, "cbInstrFindAll:printData"); - MemRead((void*)result, printData, patternsize, 0); + memread(fdProcessInfo->hProcess, (const void*)result, printData, patternsize, 0); for(int j = 0, k = 0; j < patternsize; j++) { if(j) @@ -1270,14 +1270,14 @@ CMDRESULT cbInstrCommentList(int argc, char* argv[]) GuiReferenceAddColumn(0, "Comment"); GuiReferenceReloadData(); size_t cbsize; - CommentEnum(0, &cbsize); + commentenum(0, &cbsize); if(!cbsize) { dputs("no comments"); return STATUS_CONTINUE; } Memory comments(cbsize, "cbInstrCommentList:comments"); - CommentEnum(comments, 0); + commentenum(comments, 0); int count = (int)(cbsize / sizeof(COMMENTSINFO)); for(int i = 0; i < count; i++) { @@ -1339,14 +1339,14 @@ CMDRESULT cbInstrBookmarkList(int argc, char* argv[]) GuiReferenceAddColumn(0, "Disassembly"); GuiReferenceReloadData(); size_t cbsize; - BookmarkEnum(0, &cbsize); + bookmarkenum(0, &cbsize); if(!cbsize) { dputs("no bookmarks"); return STATUS_CONTINUE; } Memory bookmarks(cbsize, "cbInstrBookmarkList:bookmarks"); - BookmarkEnum(bookmarks, 0); + bookmarkenum(bookmarks, 0); int count = (int)(cbsize / sizeof(BOOKMARKSINFO)); for(int i = 0; i < count; i++) { @@ -1374,14 +1374,14 @@ CMDRESULT cbInstrFunctionList(int argc, char* argv[]) GuiReferenceAddColumn(0, "Label/Comment"); GuiReferenceReloadData(); size_t cbsize; - FunctionEnum(0, &cbsize); + functionenum(0, &cbsize); if(!cbsize) { dputs("no functions"); return STATUS_CONTINUE; } Memory functions(cbsize, "cbInstrFunctionList:functions"); - FunctionEnum(functions, 0); + functionenum(functions, 0); int count = (int)(cbsize / sizeof(FUNCTIONSINFO)); for(int i = 0; i < count; i++) { @@ -1400,7 +1400,7 @@ CMDRESULT cbInstrFunctionList(int argc, char* argv[]) else { char comment[MAX_COMMENT_SIZE] = ""; - if(CommentGet(functions[i].start, comment)) + if(commentget(functions[i].start, comment)) GuiReferenceSetCellContent(i, 3, comment); } } @@ -1446,7 +1446,7 @@ CMDRESULT cbInstrLoopList(int argc, char* argv[]) else { char comment[MAX_COMMENT_SIZE] = ""; - if(CommentGet(loops[i].start, comment)) + if(commentget(loops[i].start, comment)) GuiReferenceSetCellContent(i, 3, comment); } } diff --git a/x64_dbg_dbg/label.cpp b/x64_dbg_dbg/label.cpp index 56d7d745..9421ef7f 100644 --- a/x64_dbg_dbg/label.cpp +++ b/x64_dbg_dbg/label.cpp @@ -4,13 +4,13 @@ #include "memory.h" #include "debugger.h" -typedef std::unordered_map LabelsInfo; +typedef std::map LabelsInfo; static LabelsInfo labels; bool labelset(uint addr, const char* text, bool manual) { - if(!DbgIsDebugging() or !MemIsValidReadPtr(addr) or !text or strlen(text) >= MAX_LABEL_SIZE - 1 or strstr(text, "&")) + if(!DbgIsDebugging() or !memisvalidreadptr(fdProcessInfo->hProcess, addr) or !text or strlen(text) >= MAX_LABEL_SIZE - 1 or strstr(text, "&")) return false; if(!*text) //NOTE: delete when there is no text { @@ -20,11 +20,11 @@ bool labelset(uint addr, const char* text, bool manual) LABELSINFO label; label.manual = manual; strcpy_s(label.text, text); - ModNameFromAddr(addr, label.mod, true); - label.addr = addr - ModBaseFromAddr(addr); - uint key = ModHashFromAddr(addr); + modnamefromaddr(addr, label.mod, true); + label.addr = addr - modbasefromaddr(addr); + uint key = modhashfromva(addr); CriticalSectionLocker locker(LockLabels); - if(!labels.insert(std::make_pair(ModHashFromAddr(key), label)).second) //already present + if(!labels.insert(std::make_pair(modhashfromva(key), label)).second) //already present labels[key] = label; return true; } @@ -39,7 +39,7 @@ bool labelfromstring(const char* text, uint* addr) if(!strcmp(i->second.text, text)) { if(addr) - *addr = i->second.addr + ModBaseFromName(i->second.mod); + *addr = i->second.addr + modbasefromname(i->second.mod); return true; } } @@ -51,7 +51,7 @@ bool labelget(uint addr, char* text) if(!DbgIsDebugging()) return false; CriticalSectionLocker locker(LockLabels); - const LabelsInfo::iterator found = labels.find(ModHashFromAddr(addr)); + const LabelsInfo::iterator found = labels.find(modhashfromva(addr)); if(found == labels.end()) //not found return false; if(text) @@ -64,7 +64,7 @@ bool labeldel(uint addr) if(!DbgIsDebugging()) return false; CriticalSectionLocker locker(LockLabels); - return (labels.erase(ModHashFromAddr(addr)) > 0); + return (labels.erase(modhashfromva(addr)) > 0); } void labeldelrange(uint start, uint end) @@ -72,8 +72,8 @@ void labeldelrange(uint start, uint end) if(!DbgIsDebugging()) return; bool bDelAll = (start == 0 && end == ~0); //0x00000000-0xFFFFFFFF - uint modbase = ModBaseFromAddr(start); - if(modbase != ModBaseFromAddr(end)) + uint modbase = modbasefromaddr(start); + if(modbase != modbasefromaddr(end)) return; start -= modbase; end -= modbase; @@ -146,7 +146,7 @@ void labelcacheload(JSON root) for(int i = 0; i < len; i++) if(curLabel.text[i] == '&') curLabel.text[i] = ' '; - const uint key = ModHashFromName(curLabel.mod) + curLabel.addr; + const uint key = modhashfromname(curLabel.mod) + curLabel.addr; labels.insert(std::make_pair(key, curLabel)); } } @@ -170,7 +170,7 @@ void labelcacheload(JSON root) strcpy_s(curLabel.text, text); else continue; //skip - const uint key = ModHashFromName(curLabel.mod) + curLabel.addr; + const uint key = modhashfromname(curLabel.mod) + curLabel.addr; labels.insert(std::make_pair(key, curLabel)); } } @@ -192,7 +192,7 @@ bool labelenum(LABELSINFO* labellist, size_t* cbsize) for(LabelsInfo::iterator i = labels.begin(); i != labels.end(); ++i, j++) { labellist[j] = i->second; - labellist[j].addr += ModBaseFromName(labellist[j].mod); + labellist[j].addr += modbasefromname(labellist[j].mod); } return true; } diff --git a/x64_dbg_dbg/loop.cpp b/x64_dbg_dbg/loop.cpp index 50c42327..a390513d 100644 --- a/x64_dbg_dbg/loop.cpp +++ b/x64_dbg_dbg/loop.cpp @@ -10,16 +10,16 @@ static LoopsInfo loops; bool loopadd(uint start, uint end, bool manual) { - if(!DbgIsDebugging() or end < start or !MemIsValidReadPtr(start)) + if(!DbgIsDebugging() or end < start or !memisvalidreadptr(fdProcessInfo->hProcess, start)) return false; - const uint modbase = ModBaseFromAddr(start); - if(modbase != ModBaseFromAddr(end)) //the function boundaries are not in the same mem page + const uint modbase = modbasefromaddr(start); + if(modbase != modbasefromaddr(end)) //the function boundaries are not in the same mem page return false; int finaldepth; if(loopoverlaps(0, start, end, &finaldepth)) //loop cannot overlap another loop return false; LOOPSINFO loop; - ModNameFromAddr(start, loop.mod, true); + modnamefromaddr(start, loop.mod, true); loop.start = start - modbase; loop.end = end - modbase; loop.depth = finaldepth; @@ -29,7 +29,7 @@ bool loopadd(uint start, uint end, bool manual) loop.parent = 0; loop.manual = manual; CriticalSectionLocker locker(LockLoops); - loops.insert(std::make_pair(DepthModuleRange(finaldepth, ModuleRange(ModHashFromAddr(modbase), Range(loop.start, loop.end))), loop)); + loops.insert(std::make_pair(DepthModuleRange(finaldepth, ModuleRange(modhashfromva(modbase), Range(loop.start, loop.end))), loop)); return true; } @@ -38,9 +38,9 @@ bool loopget(int depth, uint addr, uint* start, uint* end) { if(!DbgIsDebugging()) return false; - const uint modbase = ModBaseFromAddr(addr); + const uint modbase = modbasefromaddr(addr); CriticalSectionLocker locker(LockLoops); - LoopsInfo::iterator found = loops.find(DepthModuleRange(depth, ModuleRange(ModHashFromAddr(modbase), Range(addr - modbase, addr - modbase)))); + LoopsInfo::iterator found = loops.find(DepthModuleRange(depth, ModuleRange(modhashfromva(modbase), Range(addr - modbase, addr - modbase)))); if(found == loops.end()) //not found return false; if(start) @@ -56,10 +56,10 @@ bool loopoverlaps(int depth, uint start, uint end, int* finaldepth) if(!DbgIsDebugging()) return false; - const uint modbase = ModBaseFromAddr(start); + const uint modbase = modbasefromaddr(start); uint curStart = start - modbase; uint curEnd = end - modbase; - const uint key = ModHashFromAddr(modbase); + const uint key = modhashfromva(modbase); CriticalSectionLocker locker(LockLoops); @@ -145,7 +145,7 @@ void loopcacheload(JSON root) if(curLoop.end < curLoop.start) continue; //invalid loop curLoop.manual = true; - loops.insert(std::make_pair(DepthModuleRange(curLoop.depth, ModuleRange(ModHashFromName(curLoop.mod), Range(curLoop.start, curLoop.end))), curLoop)); + loops.insert(std::make_pair(DepthModuleRange(curLoop.depth, ModuleRange(modhashfromname(curLoop.mod), Range(curLoop.start, curLoop.end))), curLoop)); } } JSON jsonautoloops = json_object_get(root, "autoloops"); @@ -168,45 +168,36 @@ void loopcacheload(JSON root) if(curLoop.end < curLoop.start) continue; //invalid loop curLoop.manual = false; - loops.insert(std::make_pair(DepthModuleRange(curLoop.depth, ModuleRange(ModHashFromName(curLoop.mod), Range(curLoop.start, curLoop.end))), curLoop)); + loops.insert(std::make_pair(DepthModuleRange(curLoop.depth, ModuleRange(modhashfromname(curLoop.mod), Range(curLoop.start, curLoop.end))), curLoop)); } } } -bool loopenum(LOOPSINFO* List, size_t* Size) +bool loopenum(LOOPSINFO* looplist, size_t* cbsize) { - // If looplist or size is not requested, fail - if(!List && !Size) + if(!DbgIsDebugging()) return false; - - SHARED_ACQUIRE(LockLoops); - - // See if the caller requested an output size - if(Size) + if(!looplist && !cbsize) + return false; + CriticalSectionLocker locker(LockLoops); + if(!looplist && cbsize) { - *Size = loops.size() * sizeof(LOOPSINFO); - - if(!List) - return true; + *cbsize = loops.size() * sizeof(LOOPSINFO); + return true; } - - for(auto itr = loops.begin(); itr != loops.end(); itr++) + int j = 0; + for(LoopsInfo::iterator i = loops.begin(); i != loops.end(); ++i, j++) { - *List = itr->second; - - // Adjust the offset to a real virtual address - uint modbase = ModBaseFromName(List->mod); - List->start += modbase; - List->end += modbase; - - List++; + looplist[j] = i->second; + uint modbase = modbasefromname(looplist[j].mod); + looplist[j].start += modbase; + looplist[j].end += modbase; } - return true; } void loopclear() { - EXCLUSIVE_ACQUIRE(LockLoops); - loops.clear(); + CriticalSectionLocker locker(LockLoops); + LoopsInfo().swap(loops); } \ No newline at end of file diff --git a/x64_dbg_dbg/math.cpp b/x64_dbg_dbg/math.cpp index 85914657..5d1759b9 100644 --- a/x64_dbg_dbg/math.cpp +++ b/x64_dbg_dbg/math.cpp @@ -1,19 +1,12 @@ #include "math.h" #include "value.h" -enum BRACKET_TYPE -{ - BRACKET_FREE, - BRACKET_OPEN, - BRACKET_CLOSE, -}; - struct BRACKET_PAIR { int openpos; int closepos; int layer; - BRACKET_TYPE isset; + int isset; //0=free, 1=open, 2=close }; struct EXPRESSION @@ -25,8 +18,7 @@ struct EXPRESSION /* operator precedence -0 (INVALID/NONE) -1 ( ) (PARENTHESIS) +1 ( ) 2 ~ (NOT) 3 * / % (MUL DIV) 4 + - (ADD SUB) @@ -35,21 +27,18 @@ operator precedence 7 ^ (XOR) 8 | (OR) */ + int mathisoperator(char ch) { - // - // The lower the number, the higher the priority. - // Zero indicates no operator was found. - // - if(ch == '(' || ch == ')') + if(ch == '(' or ch == ')') return 1; else if(ch == '~') return 2; - else if(ch == '*' || ch == '`' || ch == '/' || ch == '%') + else if(ch == '*' or ch == '`' or ch == '/' or ch == '%') return 3; - else if(ch == '+' || ch == '-') + else if(ch == '+' or ch == '-') return 4; - else if(ch == '<' || ch == '>') + else if(ch == '<' or ch == '>') return 5; else if(ch == '&') return 6; @@ -57,7 +46,6 @@ int mathisoperator(char ch) return 7; else if(ch == '|') return 8; - return 0; } @@ -69,13 +57,10 @@ void mathformat(char* text) { int len = (int)strlen(text); Memory temp(len + 1, "mathformat:temp"); - - for (int i = 0, j = 0; i < len; i++) - { - if (mathisoperator(text[i]) < 3 || text[i] != text[i + 1]) - j += sprintf(temp + j, "%c", text[i]); - } - + memset(temp, 0, len + 1); + for(int i = 0, j = 0; i < len; i++) + if(mathisoperator(text[i]) < 3 or text[i] != text[i + 1]) + j += sprintf(temp + j, "%c", text[i]); strcpy(text, temp); } @@ -84,138 +69,172 @@ void mathformat(char* text) */ bool mathcontains(const char* text) { - // Skip negative values - if(*text == '-') + if(*text == '-') //ignore negative values text++; - - // Search the entire string looking for a math operator - for (; text[0] != '\0'; text++) - { - if (mathisoperator(text[0])) - return true; - } - + int len = (int)strlen(text); + for(int i = 0; i < len; i++) + if(mathisoperator(text[i])) + return true; return false; } #ifdef __MINGW64__ -inline unsigned long long umulhi(unsigned long long x, unsigned long long y) +static inline unsigned long long umulhi(unsigned long long x, unsigned long long y) { return (unsigned long long)(((__uint128_t)x * y) >> 64); } -inline long long mulhi(long long x, long long y) +static inline long long mulhi(long long x, long long y) { return (long long)(((__int128_t)x * y) >> 64); } #elif _WIN64 #include -inline unsigned long long umulhi(unsigned long long x, unsigned long long y) +static inline unsigned long long umulhi(unsigned long long x, unsigned long long y) { unsigned __int64 res; _umul128(x, y, &res); return res; } -inline long long mulhi(long long x, long long y) +static inline long long mulhi(long long x, long long y) { __int64 res; _mul128(x, y, &res); return res; } #else -inline unsigned int umulhi(unsigned int x, unsigned int y) +static inline unsigned int umulhi(unsigned int x, unsigned int y) { return (unsigned int)(((unsigned long long)x * y) >> 32); } -inline int mulhi(int x, int y) +static inline int mulhi(int x, int y) { return (int)(((long long)x * y) >> 32); } #endif //__MINGW64__ -template -bool MathDoOperation(char op, T left, T right, T* result) -{ - switch (op) - { - case '*': - *result = left * right; - return true; - case '`': - *result = umulhi(left, right); - return true; - case '/': - if (right) - { - *result = left / right; - return true; - } - return false; - case '%': - if (right) - { - *result = left % right; - return true; - } - return false; - case '+': - *result = left + right; - return true; - case '-': - *result = left - right; - return true; - case '<': - *result = left << right; - return true; - case '>': - *result = left >> right; - return true; - case '&': - *result = left & right; - return true; - case '^': - *result = left ^ right; - return true; - case '|': - *result = left | right; - return true; - } - return false; -} - bool mathdounsignedoperation(char op, uint left, uint right, uint* result) { - return MathDoOperation(op, left, right, result); + switch(op) + { + case '*': + *result = left * right; + return true; + case '`': + *result = umulhi(left, right); + return true; + case '/': + if(right) + { + *result = left / right; + return true; + } + return false; + case '%': + if(right) + { + *result = left % right; + return true; + } + return false; + case '+': + *result = left + right; + return true; + case '-': + *result = left - right; + return true; + case '<': + *result = left << right; + return true; + case '>': + *result = left >> right; + return true; + case '&': + *result = left & right; + return true; + case '^': + *result = left ^ right; + return true; + case '|': + *result = left | right; + return true; + } + return false; } bool mathdosignedoperation(char op, sint left, sint right, sint* result) { - return MathDoOperation(op, left, right, result); + switch(op) + { + case '*': + *result = left * right; + return true; + case '`': + *result = mulhi(left, right); + return true; + case '/': + if(right) + { + *result = left / right; + return true; + } + return false; + case '%': + if(right) + { + *result = left % right; + return true; + } + return false; + case '+': + *result = left + right; + return true; + case '-': + *result = left - right; + return true; + case '<': + *result = left << right; + return true; + case '>': + *result = left >> right; + return true; + case '&': + *result = left & right; + return true; + case '^': + *result = left ^ right; + return true; + case '|': + *result = left | right; + return true; + } + return false; } -void fillpair(EXPRESSION* expstruct, int pos, int layer) +static void fillpair(EXPRESSION* expstruct, int pos, int layer) { for(int i = 0; i < expstruct->total_pairs; i++) { - if(expstruct->pairs[i].isset == BRACKET_FREE) + if(!expstruct->pairs[i].isset) { - expstruct->pairs[i].layer = layer; - expstruct->pairs[i].openpos = pos; - expstruct->pairs[i].isset = BRACKET_OPEN; + expstruct->pairs[i].layer = layer; + expstruct->pairs[i].openpos = pos; + expstruct->pairs[i].isset = 1; break; } - else if(expstruct->pairs[i].layer == layer && expstruct->pairs[i].isset == BRACKET_OPEN) + else if(expstruct->pairs[i].layer == layer and expstruct->pairs[i].isset == 1) { - expstruct->pairs[i].closepos = pos; - expstruct->pairs[i].isset = BRACKET_CLOSE; + expstruct->pairs[i].closepos = pos; + expstruct->pairs[i].isset = 2; break; } } } -int matchpairs(EXPRESSION* expstruct, char* expression, int endlayer) + +static int matchpairs(EXPRESSION* expstruct, char* expression, int endlayer) { int layer = endlayer; int len = (int)strlen(expression); @@ -243,7 +262,7 @@ int matchpairs(EXPRESSION* expstruct, char* expression, int endlayer) return 0; } -int expressionformat(char* exp) +static int expressionformat(char* exp) { int len = (int)strlen(exp); int open = 0; @@ -266,36 +285,35 @@ int expressionformat(char* exp) return open; } -void adjustpairs(EXPRESSION* exps, int cur_open, int cur_close, int cur_len, int new_len) +static void adjustpairs(EXPRESSION* exps, int cur_open, int cur_close, int cur_len, int new_len) { for(int i = 0; i < exps->total_pairs; i++) { if(exps->pairs[i].openpos > cur_open) exps->pairs[i].openpos += new_len - cur_len; - if(exps->pairs[i].closepos > cur_close) exps->pairs[i].closepos += new_len - cur_len; } } -bool printlayer(char* exp, EXPRESSION* exps, int layer, bool silent, bool baseonly) +static bool printlayer(char* exp, EXPRESSION* exps, int layer, bool silent, bool baseonly) { for(int i = 0; i < exps->total_pairs; i++) { if(exps->pairs[i].layer == layer) { - int open = exps->pairs[i].openpos; - int close = exps->pairs[i].closepos; - int len = close - open; + char temp[256] = ""; + char backup[256] = ""; - char temp[256]; + int open = exps->pairs[i].openpos; + int close = exps->pairs[i].closepos; + int len = close - open; strncpy(temp, exp + open + 1, len - 1); - char backup[256]; strcpy_s(backup, exp + open + len + 1); uint value; - if(!mathfromstring(temp, &value, silent, baseonly, nullptr, nullptr)) + if(!mathfromstring(temp, &value, silent, baseonly, 0, 0)) return false; adjustpairs(exps, open, close, len + 1, sprintf(exp + open, "%"fext"X", value)); @@ -305,41 +323,32 @@ bool printlayer(char* exp, EXPRESSION* exps, int layer, bool silent, bool baseon } } - return true; } bool mathhandlebrackets(char* expression, bool silent, bool baseonly) { - int totalPairs = expressionformat(expression); - - if(totalPairs == -1) + EXPRESSION expstruct; + expstruct.expression = expression; + int total_pairs = expressionformat(expression); + if(total_pairs == -1) return false; - else if(!totalPairs) + else if(!total_pairs) return true; + expstruct.total_pairs = total_pairs; - Memory pairs(totalPairs * sizeof(BRACKET_PAIR), "mathhandlebrackets:pairs"); - - EXPRESSION expStruct; - expStruct.expression = expression; - expStruct.total_pairs = totalPairs; - expStruct.pairs = pairs; - - matchpairs(&expStruct, expression, 0); - + Memory pairs(expstruct.total_pairs * sizeof(BRACKET_PAIR), "mathhandlebrackets:expstruct.pairs"); + expstruct.pairs = pairs; + memset(expstruct.pairs, 0, expstruct.total_pairs * sizeof(BRACKET_PAIR)); + matchpairs(&expstruct, expression, 0); int deepest = 0; - for (int i = 0; i < expStruct.total_pairs; i++) - { - if (expStruct.pairs[i].layer > deepest) - deepest = expStruct.pairs[i].layer; - } - - for (int i = deepest; i > 0; i--) - { - if (!printlayer(expression, &expStruct, i, silent, baseonly)) - return false; - } + for(int i = 0; i < expstruct.total_pairs; i++) + if(expstruct.pairs[i].layer > deepest) + deepest = expstruct.pairs[i].layer; + for(int i = deepest; i > 0; i--) + if(!printlayer(expression, &expstruct, i, silent, baseonly)) + return false; return true; } @@ -370,6 +379,8 @@ bool mathfromstring(const char* string, uint* value, bool silent, bool baseonly, return valfromstring(string, value, silent, baseonly, value_size, isvar, 0); Memory strleft(len + 1 + negative, "mathfromstring:strleft"); Memory strright(len + 1, "mathfromstring:strright"); + memset(strleft, 0, len + 1); + memset(strright, 0, len + 1); strncpy(strleft, string - negative, highestop_pos + negative); strcpy(strright, string + highestop_pos + 1); strcpy(strleft, StringUtils::Trim(strleft).c_str()); diff --git a/x64_dbg_dbg/math.h b/x64_dbg_dbg/math.h index d6ea8867..97fa745c 100644 --- a/x64_dbg_dbg/math.h +++ b/x64_dbg_dbg/math.h @@ -1,4 +1,5 @@ -#pragma once +#ifndef _MATH_H +#define _MATH_H #include "_global.h" @@ -8,4 +9,6 @@ bool mathcontains(const char* text); bool mathhandlebrackets(char* expression, bool silent, bool baseonly); bool mathfromstring(const char* string, uint* value, bool silent, bool baseonly, int* value_size, bool* isvar); bool mathdounsignedoperation(char op, uint left, uint right, uint* result); -bool mathdosignedoperation(char op, sint left, sint right, sint* result); \ No newline at end of file +bool mathdosignedoperation(char op, sint left, sint right, sint* result); + +#endif // _MATH_H diff --git a/x64_dbg_dbg/memory.cpp b/x64_dbg_dbg/memory.cpp index 22f331e7..03074db3 100644 --- a/x64_dbg_dbg/memory.cpp +++ b/x64_dbg_dbg/memory.cpp @@ -5,16 +5,10 @@ #include "threading.h" #include "module.h" -#define PAGE_SHIFT (12) -#define PAGE_SIZE (4096) -#define PAGE_ALIGN(Va) ((ULONG_PTR)((ULONG_PTR)(Va) & ~(PAGE_SIZE - 1))) -#define BYTES_TO_PAGES(Size) (((Size) >> PAGE_SHIFT) + (((Size) & (PAGE_SIZE - 1)) != 0)) -#define ROUND_TO_PAGES(Size) (((ULONG_PTR)(Size) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)) - MemoryMap memoryPages; bool bListAllPages = false; -void MemUpdateMap(HANDLE hProcess) +void memupdatemap(HANDLE hProcess) { CriticalSectionLocker locker(LockMemoryPages); MEMORY_BASIC_INFORMATION mbi; @@ -33,7 +27,7 @@ void MemUpdateMap(HANDLE hProcess) curAllocationBase = (uint)mbi.AllocationBase; MEMPAGE curPage; *curPage.info = 0; - ModNameFromAddr(MyAddress, curPage.info, true); + modnamefromaddr(MyAddress, curPage.info, true); memcpy(&curPage.mbi, &mbi, sizeof(mbi)); pageVector.push_back(curPage); } @@ -56,11 +50,11 @@ void MemUpdateMap(HANDLE hProcess) if(!pageVector.at(i).info[0] || (scmp(curMod, pageVector.at(i).info) && !bListAllPages)) //there is a module continue; //skip non-modules strcpy(curMod, pageVector.at(i).info); - uint base = ModBaseFromName(pageVector.at(i).info); + uint base = modbasefromname(pageVector.at(i).info); if(!base) continue; std::vector sections; - if(!ModSectionsFromAddr(base, §ions)) + if(!modsectionsfromaddr(base, §ions)) continue; int SectionNumber = (int)sections.size(); if(!SectionNumber) //no sections = skip @@ -129,187 +123,102 @@ void MemUpdateMap(HANDLE hProcess) } } -uint MemFindBaseAddr(uint addr, uint* Size, bool refresh) +uint memfindbaseaddr(uint addr, uint* size, bool refresh) { - // Update the memory map if needed if(refresh) - MemUpdateMap(fdProcessInfo->hProcess); - - SHARED_ACQUIRE(LockMemoryPages); - - // Search for the memory page address - auto found = memoryPages.find(std::make_pair(addr, addr)); - + memupdatemap(fdProcessInfo->hProcess); //update memory map + CriticalSectionLocker locker(LockMemoryPages); + MemoryMap::iterator found = memoryPages.find(std::make_pair(addr, addr)); if(found == memoryPages.end()) return 0; - - // Return the allocation region size when requested - if(Size) - *Size = found->second.mbi.RegionSize; - + if(size) + *size = found->second.mbi.RegionSize; return found->first.first; } -bool MemRead(void* BaseAddress, void* Buffer, SIZE_T Size, SIZE_T* NumberOfBytesRead) +bool memread(HANDLE hProcess, const void* lpBaseAddress, void* lpBuffer, SIZE_T nSize, SIZE_T* lpNumberOfBytesRead) { - // Fast fail if address is invalid - if (!MemIsCanonicalAddress((uint)BaseAddress)) - return false; - - // Buffer must be supplied and size must be greater than 0 - if (!Buffer || Size <= 0) - return false; - - // If the 'bytes read' parameter is null, use a temp - SIZE_T bytesReadTemp = 0; - - if (!NumberOfBytesRead) - NumberOfBytesRead = &bytesReadTemp; - - // Normal single-call read - bool ret = MemoryReadSafe(fdProcessInfo->hProcess, BaseAddress, Buffer, Size, NumberOfBytesRead); - - if (ret && *NumberOfBytesRead == Size) - return true; - - // Read page-by-page (Skip if only 1 page exists) - // If (SIZE > PAGE_SIZE) or (ADDRESS exceeds boundary), multiple reads will be needed - SIZE_T pageCount = BYTES_TO_PAGES(Size); - - if (pageCount > 1) - { - // Determine the number of bytes between ADDRESS and the next page - uint offset = 0; - uint readBase = (uint)BaseAddress; - uint readSize = ROUND_TO_PAGES(readBase) - readBase; - - // Reset the bytes read count - *NumberOfBytesRead = 0; - - for (SIZE_T i = 0; i < pageCount; i++) - { - SIZE_T bytesRead = 0; - - if (MemoryReadSafe(fdProcessInfo->hProcess, (PVOID)readBase, ((PBYTE)Buffer + offset), readSize, &bytesRead)) - *NumberOfBytesRead += bytesRead; - - offset += readSize; - readBase += readSize; - - Size -= readSize; - readSize = (Size > PAGE_SIZE) ? PAGE_SIZE : Size; - } - } - - SetLastError(ERROR_PARTIAL_COPY); - return (*NumberOfBytesRead > 0); -} - -bool MemWrite(void* BaseAddress, void* Buffer, SIZE_T Size, SIZE_T* NumberOfBytesWritten) -{ - // Fast fail if address is invalid - if (!MemIsCanonicalAddress((uint)BaseAddress)) - return false; - - // Buffer must be supplied and size must be greater than 0 - if(!Buffer || Size <= 0) + if(!hProcess or !lpBaseAddress or !lpBuffer or !nSize) //generic failures return false; - - // If the 'bytes written' parameter is null, use a temp - SIZE_T bytesWrittenTemp = 0; - - if(!NumberOfBytesWritten) - NumberOfBytesWritten = &bytesWrittenTemp; - - // Try a regular WriteProcessMemory call - bool ret = MemoryWriteSafe(fdProcessInfo->hProcess, BaseAddress, Buffer, Size, NumberOfBytesWritten); - - if(ret && * NumberOfBytesWritten == Size) - return true; - - // Write page-by-page (Skip if only 1 page exists) - // See: MemRead - SIZE_T pageCount = BYTES_TO_PAGES(Size); - - if (pageCount > 1) - { - // Determine the number of bytes between ADDRESS and the next page - uint offset = 0; - uint writeBase = (uint)BaseAddress; - uint writeSize = ROUND_TO_PAGES(writeBase) - writeBase; - - // Reset the bytes read count - *NumberOfBytesWritten = 0; - - for (SIZE_T i = 0; i < pageCount; i++) - { - SIZE_T bytesWritten = 0; - - if (MemoryWriteSafe(fdProcessInfo->hProcess, (PVOID)writeBase, ((PBYTE)Buffer + offset), writeSize, &bytesWritten)) - *NumberOfBytesWritten += bytesWritten; - - offset += writeSize; - writeBase += writeSize; - - Size -= writeSize; - writeSize = (Size > PAGE_SIZE) ? PAGE_SIZE : Size; - } - } - - SetLastError(ERROR_PARTIAL_COPY); - return (*NumberOfBytesWritten > 0); -} - -bool MemPatch(void* BaseAddress, void* Buffer, SIZE_T Size, SIZE_T* NumberOfBytesWritten) -{ - // Buffer and size must be valid - if(!Buffer || Size <= 0) - return false; - - // Allocate the memory - Memory oldData(Size, "mempatch:oldData"); - - if(!MemRead(BaseAddress, oldData, Size, nullptr)) + SIZE_T read = 0; + DWORD oldprotect = 0; + bool ret = MemoryReadSafe(hProcess, (void*)lpBaseAddress, lpBuffer, nSize, &read); //try 'normal' RPM + if(ret and read == nSize) //'normal' RPM worked! { - // If no memory can be read, no memory can be written. Fail out - // of this function. - return false; + if(lpNumberOfBytesRead) + *lpNumberOfBytesRead = read; + return true; } - - for(SIZE_T i = 0; i < Size; i++) - patchset((uint)BaseAddress + i, oldData[i], ((unsigned char*)Buffer)[i]); - - return MemWrite(BaseAddress, Buffer, Size, NumberOfBytesWritten); + for(uint i = 0; i < nSize; i++) //read byte-per-byte + { + unsigned char* curaddr = (unsigned char*)lpBaseAddress + i; + unsigned char* curbuf = (unsigned char*)lpBuffer + i; + ret = MemoryReadSafe(hProcess, curaddr, curbuf, 1, 0); //try 'normal' RPM + if(!ret) //we failed + { + if(lpNumberOfBytesRead) + *lpNumberOfBytesRead = i; + SetLastError(ERROR_PARTIAL_COPY); + return false; + } + } + return true; } -bool MemIsValidReadPtr(uint Address) +bool memwrite(HANDLE hProcess, void* lpBaseAddress, const void* lpBuffer, SIZE_T nSize, SIZE_T* lpNumberOfBytesWritten) +{ + if(!hProcess or !lpBaseAddress or !lpBuffer or !nSize) //generic failures + return false; + SIZE_T written = 0; + DWORD oldprotect = 0; + bool ret = MemoryWriteSafe(hProcess, lpBaseAddress, lpBuffer, nSize, &written); + if(ret and written == nSize) //'normal' WPM worked! + { + if(lpNumberOfBytesWritten) + *lpNumberOfBytesWritten = written; + return true; + } + for(uint i = 0; i < nSize; i++) //write byte-per-byte + { + unsigned char* curaddr = (unsigned char*)lpBaseAddress + i; + unsigned char* curbuf = (unsigned char*)lpBuffer + i; + ret = MemoryWriteSafe(hProcess, curaddr, curbuf, 1, 0); //try 'normal' WPM + if(!ret) //we failed + { + if(lpNumberOfBytesWritten) + *lpNumberOfBytesWritten = i; + SetLastError(ERROR_PARTIAL_COPY); + return false; + } + } + return true; +} + +bool mempatch(HANDLE hProcess, void* lpBaseAddress, const void* lpBuffer, SIZE_T nSize, SIZE_T* lpNumberOfBytesWritten) +{ + if(!hProcess or !lpBaseAddress or !lpBuffer or !nSize) //generic failures + return false; + Memory olddata(nSize, "mempatch:olddata"); + if(!memread(hProcess, lpBaseAddress, olddata, nSize, 0)) + return memwrite(hProcess, lpBaseAddress, lpBuffer, nSize, lpNumberOfBytesWritten); + unsigned char* newdata = (unsigned char*)lpBuffer; + for(uint i = 0; i < nSize; i++) + patchset((uint)lpBaseAddress + i, olddata[i], newdata[i]); + return memwrite(hProcess, lpBaseAddress, lpBuffer, nSize, lpNumberOfBytesWritten); +} + +bool memisvalidreadptr(HANDLE hProcess, uint addr) { unsigned char a = 0; - return MemRead((void*)Address, &a, 1, nullptr); + return memread(hProcess, (void*)addr, &a, 1, 0); } -bool MemIsCanonicalAddress(uint Address) +void* memalloc(HANDLE hProcess, uint addr, SIZE_T size, DWORD fdProtect) { -#ifndef _WIN64 - // 32-bit mode only supports 4GB max, so limits are - // not an issue - return true; -#else - // The most-significant 16 bits must be all 1 or all 0. - // (64 - 16) = 48bit linear address range. - // - // 0xFFFF800000000000 = Significant 16 bits set - // 0x0000800000000000 = 48th bit set - return (((Address & 0xFFFF800000000000) + 0x800000000000) & ~0x800000000000) == 0; -#endif // _WIN64 + return VirtualAllocEx(hProcess, (void*)addr, size, MEM_RESERVE | MEM_COMMIT, fdProtect); } -void* MemAllocRemote(uint Address, SIZE_T Size, DWORD Protect) +void memfree(HANDLE hProcess, uint addr) { - return VirtualAllocEx(fdProcessInfo->hProcess, (void*)Address, Size, MEM_RESERVE | MEM_COMMIT, Protect); -} - -void MemFreeRemote(uint Address) -{ - VirtualFreeEx(fdProcessInfo->hProcess, (void*)Address, 0, MEM_RELEASE); + VirtualFreeEx(hProcess, (void*)addr, 0, MEM_RELEASE); } \ No newline at end of file diff --git a/x64_dbg_dbg/memory.h b/x64_dbg_dbg/memory.h index 4fd833f1..c17c6f18 100644 --- a/x64_dbg_dbg/memory.h +++ b/x64_dbg_dbg/memory.h @@ -1,3 +1,6 @@ +#ifndef _MEMORY_H +#define _MEMORY_H + #include "_global.h" #include "addrinfo.h" @@ -6,12 +9,13 @@ typedef std::map MemoryMap; extern MemoryMap memoryPages; extern bool bListAllPages; -void MemUpdateMap(HANDLE hProcess); -uint MemFindBaseAddr(uint addr, uint* Size, bool refresh = false); -bool MemRead(void* BaseAddress, void* Buffer, SIZE_T Size, SIZE_T* NumberOfBytesRead); -bool MemWrite(void* BaseAddress, void* Buffer, SIZE_T Size, SIZE_T* NumberOfBytesWritten); -bool MemPatch(void* BaseAddress, void* Buffer, SIZE_T Size, SIZE_T* NumberOfBytesWritten); -bool MemIsValidReadPtr(uint Address); -bool MemIsCanonicalAddress(uint Address); -void* MemAllocRemote(uint Address, SIZE_T Size, DWORD Protect); -void MemFreeRemote(uint Address); \ No newline at end of file +void memupdatemap(HANDLE hProcess); +uint memfindbaseaddr(uint addr, uint* size, bool refresh = false); +bool memread(HANDLE hProcess, const void* lpBaseAddress, void* lpBuffer, SIZE_T nSize, SIZE_T* lpNumberOfBytesRead); +bool memwrite(HANDLE hProcess, void* lpBaseAddress, const void* lpBuffer, SIZE_T nSize, SIZE_T* lpNumberOfBytesWritten); +bool mempatch(HANDLE hProcess, void* lpBaseAddress, const void* lpBuffer, SIZE_T nSize, SIZE_T* lpNumberOfBytesWritten); +bool memisvalidreadptr(HANDLE hProcess, uint addr); +void* memalloc(HANDLE hProcess, uint addr, SIZE_T size, DWORD fdProtect); +void memfree(HANDLE hProcess, uint addr); + +#endif // _MEMORY_H diff --git a/x64_dbg_dbg/module.cpp b/x64_dbg_dbg/module.cpp index 3ec8edb0..3d4c91cf 100644 --- a/x64_dbg_dbg/module.cpp +++ b/x64_dbg_dbg/module.cpp @@ -6,262 +6,194 @@ static ModulesInfo modinfo; -bool ModLoad(uint Base, uint Size, const char* FullPath) +///module functions +bool modload(uint base, uint size, const char* fullpath) { - // - // Handle a new module being loaded - // - // TODO: Do loaded modules always require a path? - if(!Base || !Size || !FullPath) + if(!base or !size or !fullpath) return false; + char name[deflen] = ""; + int len = (int)strlen(fullpath); + while(fullpath[len] != '\\' and len) + len--; + if(len) + len++; + strcpy_s(name, fullpath + len); + _strlwr(name); + len = (int)strlen(name); + name[MAX_MODULE_SIZE - 1] = 0; //ignore later characters + while(name[len] != '.' and len) + len--; MODINFO info; - - // Break the module path into a directory and file name - char dir[deflen]; - char* file; - - if(GetFullPathNameA(FullPath, ARRAYSIZE(dir), dir, &file) == 0) - return false; - - // Make everything lowercase - _strlwr(dir); - - // Copy the extension into the module struct - { - char* extensionPos = strrchr(file, '.'); - - if(extensionPos) - { - strcpy_s(info.extension, extensionPos); - extensionPos[0] = '\0'; - } - } - - // Copy the name to the module struct - strcpy_s(info.name, file); - - // Module base address/size/hash index - info.hash = ModHashFromName(info.name); - info.base = Base; - info.size = Size; - - // Process module sections + memset(&info, 0, sizeof(MODINFO)); info.sections.clear(); - - WString wszFullPath = StringUtils::Utf8ToUtf16(FullPath); - if(StaticFileLoadW(wszFullPath.c_str(), UE_ACCESS_READ, false, &info.Handle, &info.FileMapSize, &info.MapHandle, &info.FileMapVA)) + info.hash = modhashfromname(name); + if(len) { - // Get the entry point - info.entry = GetPE32DataFromMappedFile(info.FileMapVA, 0, UE_OEP) + info.base; + strcpy_s(info.extension, name + len); + name[len] = 0; //remove extension + } + info.base = base; + info.size = size; + strcpy_s(info.name, name); - // Enumerate all PE sections - int sectionCount = (int)GetPE32DataFromMappedFile(info.FileMapVA, 0, UE_SECTIONNUMBER); - - for(int i = 0; i < sectionCount; i++) + //process module sections + HANDLE FileHandle; + DWORD LoadedSize; + HANDLE FileMap; + ULONG_PTR FileMapVA; + WString wszFullPath = StringUtils::Utf8ToUtf16(fullpath); + if(StaticFileLoadW(wszFullPath.c_str(), UE_ACCESS_READ, false, &FileHandle, &LoadedSize, &FileMap, &FileMapVA)) + { + info.entry = GetPE32DataFromMappedFile(FileMapVA, 0, UE_OEP) + info.base; //get entry point + int SectionCount = (int)GetPE32DataFromMappedFile(FileMapVA, 0, UE_SECTIONNUMBER); + if(SectionCount > 0) { - MODSECTIONINFO curSection; - - curSection.addr = GetPE32DataFromMappedFile(info.FileMapVA, i, UE_SECTIONVIRTUALOFFSET) + info.base; - curSection.size = GetPE32DataFromMappedFile(info.FileMapVA, i, UE_SECTIONVIRTUALSIZE); - const char* sectionName = (const char*)GetPE32DataFromMappedFile(info.FileMapVA, i, UE_SECTIONNAME); - - // Escape section name when needed - strcpy_s(curSection.name, StringUtils::Escape(sectionName).c_str()); - - // Add entry to the vector - info.sections.push_back(curSection); + for(int i = 0; i < SectionCount; i++) + { + MODSECTIONINFO curSection; + curSection.addr = GetPE32DataFromMappedFile(FileMapVA, i, UE_SECTIONVIRTUALOFFSET) + base; + curSection.size = GetPE32DataFromMappedFile(FileMapVA, i, UE_SECTIONVIRTUALSIZE); + const char* SectionName = (const char*)GetPE32DataFromMappedFile(FileMapVA, i, UE_SECTIONNAME); + //escape section name when needed + int len = (int)strlen(SectionName); + int escape_count = 0; + for(int k = 0; k < len; k++) + if(SectionName[k] == '\\' or SectionName[k] == '\"' or !isprint(SectionName[k])) + escape_count++; + strcpy_s(curSection.name, StringUtils::Escape(SectionName).c_str()); + info.sections.push_back(curSection); + } } + StaticFileUnloadW(wszFullPath.c_str(), false, FileHandle, LoadedSize, FileMap, FileMapVA); } - // Add module to list - EXCLUSIVE_ACQUIRE(LockModules); - modinfo.insert(std::make_pair(Range(Base, Base + Size - 1), info)); - EXCLUSIVE_RELEASE(); - - SymUpdateModuleList(); + //add module to list + CriticalSectionLocker locker(LockModules); + modinfo.insert(std::make_pair(Range(base, base + size - 1), info)); + symupdatemodulelist(); return true; } -bool ModUnload(uint Base) +bool modunload(uint base) { - EXCLUSIVE_ACQUIRE(LockModules); - - // Find the iterator index - const auto found = modinfo.find(Range(Base, Base)); - - if(found == modinfo.end()) + CriticalSectionLocker locker(LockModules); + const ModulesInfo::iterator found = modinfo.find(Range(base, base)); + if(found == modinfo.end()) //not found return false; - - // Remove it from the list modinfo.erase(found); - - // Unload everything from TitanEngine - StaticFileUnloadW(nullptr, false, found->second.Handle, found->second.FileMapSize, found->second.MapHandle, found->second.FileMapVA); - EXCLUSIVE_RELEASE(); - - // Update symbols - SymUpdateModuleList(); + symupdatemodulelist(); return true; } -void ModClear() +void modclear() { - EXCLUSIVE_ACQUIRE(LockModules); - modinfo.clear(); - EXCLUSIVE_RELEASE(); - - // Tell the symbol updater - SymUpdateModuleList(); + CriticalSectionLocker locker(LockModules); + ModulesInfo().swap(modinfo); + symupdatemodulelist(); } -MODINFO* ModInfoFromAddr(uint Address) +bool modnamefromaddr(uint addr, char* modname, bool extension) { - // - // NOTE: THIS DOES _NOT_ USE LOCKS - // - auto found = modinfo.find(Range(Address, Address)); - - // Was the module found with this address? - if(found == modinfo.end()) - return nullptr; - - return &found->second; -} - -bool ModNameFromAddr(uint Address, char* Name, bool Extension) -{ - if(!Name) + if(!modname) return false; - - SHARED_ACQUIRE(LockModules); - - // Get a pointer to module information - auto module = ModInfoFromAddr(Address); - - if(!module) + *modname = '\0'; + CriticalSectionLocker locker(LockModules); + const ModulesInfo::iterator found = modinfo.find(Range(addr, addr)); + if(found == modinfo.end()) //not found return false; - - // Copy initial module name - strcpy_s(Name, MAX_MODULE_SIZE, module->name); - - if(Extension) - strcat_s(Name, MAX_MODULE_SIZE, module->extension); - + String mod = found->second.name; + if(extension) + mod += found->second.extension; + strcpy_s(modname, MAX_MODULE_SIZE, mod.c_str()); return true; } -uint ModBaseFromAddr(uint Address) +uint modbasefromaddr(uint addr) { - SHARED_ACQUIRE(LockModules); - - auto module = ModInfoFromAddr(Address); - - if(!module) + CriticalSectionLocker locker(LockModules); + const ModulesInfo::iterator found = modinfo.find(Range(addr, addr)); + if(found == modinfo.end()) //not found return 0; - - return module->base; + return found->second.base; } -uint ModHashFromAddr(uint Address) +uint modhashfromva(uint va) //return a unique hash from a VA { - // - // Returns a unique hash from a virtual address - // - SHARED_ACQUIRE(LockModules); - - auto module = ModInfoFromAddr(Address); - - if(!module) - return Address; - - return module->hash + (Address - module->base); + CriticalSectionLocker locker(LockModules); + const ModulesInfo::iterator found = modinfo.find(Range(va, va)); + if(found == modinfo.end()) //not found + return va; + return found->second.hash + (va - found->second.base); } -uint ModHashFromName(const char* Module) +uint modhashfromname(const char* mod) //return MODINFO.hash { - // - // return MODINFO.hash (based on the name) - // - if(!Module || Module[0] == '\0') + if(!mod or !*mod) return 0; - - return murmurhash(Module, (int)strlen(Module)); + int len = (int)strlen(mod); + return murmurhash(mod, len); } -uint ModBaseFromName(const char* Module) +uint modbasefromname(const char* modname) { - if(!Module || strlen(Module) >= MAX_MODULE_SIZE) + if(!modname or strlen(modname) >= MAX_MODULE_SIZE) return 0; - - SHARED_ACQUIRE(LockModules); - - for(auto itr = modinfo.begin(); itr != modinfo.end(); itr++) + CriticalSectionLocker locker(LockModules); + for(ModulesInfo::iterator i = modinfo.begin(); i != modinfo.end(); ++i) { - char currentModule[MAX_MODULE_SIZE]; - strcpy_s(currentModule, itr->second.name); - strcat_s(currentModule, itr->second.extension); - - // Test with and without extension - if(!_stricmp(currentModule, Module) || !_stricmp(itr->second.name, Module)) - return itr->second.base; + MODINFO* curMod = &i->second; + char curmodname[MAX_MODULE_SIZE] = ""; + sprintf(curmodname, "%s%s", curMod->name, curMod->extension); + if(!_stricmp(curmodname, modname)) //with extension + return curMod->base; + if(!_stricmp(curMod->name, modname)) //without extension + return curMod->base; } - return 0; } -uint ModSizeFromAddr(uint Address) +uint modsizefromaddr(uint addr) { - SHARED_ACQUIRE(LockModules); - - auto module = ModInfoFromAddr(Address); - - if(!module) + CriticalSectionLocker locker(LockModules); + const ModulesInfo::iterator found = modinfo.find(Range(addr, addr)); + if(found == modinfo.end()) //not found return 0; - - return module->size; + return found->second.size; } -bool ModSectionsFromAddr(uint Address, std::vector* Sections) +bool modsectionsfromaddr(uint addr, std::vector* sections) { - SHARED_ACQUIRE(LockModules); - - auto module = ModInfoFromAddr(Address); - - if(!module) + CriticalSectionLocker locker(LockModules); + const ModulesInfo::iterator found = modinfo.find(Range(addr, addr)); + if(found == modinfo.end()) //not found return false; - - // Copy vector <-> vector - *Sections = module->sections; + *sections = found->second.sections; return true; } -uint ModEntryFromAddr(uint Address) +uint modentryfromaddr(uint addr) { - SHARED_ACQUIRE(LockModules); - - auto module = ModInfoFromAddr(Address); - - if(!module) + CriticalSectionLocker locker(LockModules); + const ModulesInfo::iterator found = modinfo.find(Range(addr, addr)); + if(found == modinfo.end()) //not found return 0; - - return module->entry; + return found->second.entry; } -int ModPathFromAddr(duint Address, char* Path, int Size) +int modpathfromaddr(duint addr, char* path, int size) { - SHARED_ACQUIRE(LockModules); - - auto module = ModInfoFromAddr(Address); - - if(!module) + Memory wszModPath(size * sizeof(wchar_t), "modpathfromaddr:wszModPath"); + if(!GetModuleFileNameExW(fdProcessInfo->hProcess, (HMODULE)modbasefromaddr(addr), wszModPath, size)) + { + *path = '\0'; return 0; - - strcpy_s(Path, Size, module->path); - return (int)strlen(Path); + } + strcpy_s(path, size, StringUtils::Utf16ToUtf8(wszModPath()).c_str()); + return (int)strlen(path); } -int ModPathFromName(const char* Module, char* Path, int Size) +int modpathfromname(const char* modname, char* path, int size) { - return ModPathFromAddr(ModBaseFromName(Module), Path, Size); -} \ No newline at end of file + return modpathfromaddr(modbasefromname(modname), path, size); +} diff --git a/x64_dbg_dbg/module.h b/x64_dbg_dbg/module.h index 656cc310..95edba18 100644 --- a/x64_dbg_dbg/module.h +++ b/x64_dbg_dbg/module.h @@ -1,47 +1,40 @@ -#pragma once +#ifndef _MODULE_H +#define _MODULE_H #include "_global.h" #include "addrinfo.h" struct MODSECTIONINFO { - uint addr; // Virtual address - uint size; // Virtual size - char name[50]; // Escaped section name + uint addr; //va + uint size; //virtual size + char name[50]; }; struct MODINFO { - uint base; // Module base - uint size; // Module size - uint hash; // Full module name hash - uint entry; // Entry point - - char name[MAX_MODULE_SIZE]; // Module name (without extension) - char extension[MAX_MODULE_SIZE]; // File extension - char path[MAX_PATH]; // File path (in UTF8) - - HANDLE Handle; // Handle to the file opened by TitanEngine - HANDLE MapHandle; // Handle to the memory map - ULONG_PTR FileMapVA; // File map virtual address (Debugger local) - DWORD FileMapSize; // File map virtual size - + uint base; //module base + uint size; //module size + uint hash; //full module name hash + uint entry; //entry point + char name[MAX_MODULE_SIZE]; //module name (without extension) + char extension[MAX_MODULE_SIZE]; //file extension std::vector sections; }; - typedef std::map ModulesInfo; -bool ModLoad(uint Base, uint Size, const char* FullPath); -bool ModUnload(uint Base); -void ModClear(); -MODINFO* ModInfoFromAddr(uint Address); -bool ModNameFromAddr(uint Address, char* Name, bool Extension); -uint ModBaseFromAddr(uint Address); -uint ModHashFromAddr(uint Address); -uint ModHashFromName(const char* Module); -uint ModBaseFromName(const char* Module); -uint ModSizeFromAddr(uint Address); -bool ModSectionsFromAddr(uint Address, std::vector* Sections); -uint ModEntryFromAddr(uint Address); -int ModPathFromAddr(duint Address, char* Path, int Size); -int ModPathFromName(const char* Module, char* Path, int Size); \ No newline at end of file +bool modload(uint base, uint size, const char* fullpath); +bool modunload(uint base); +void modclear(); +bool modnamefromaddr(uint addr, char* modname, bool extension); +uint modbasefromaddr(uint addr); +uint modhashfromva(uint va); +uint modhashfromname(const char* mod); +uint modbasefromname(const char* modname); +uint modsizefromaddr(uint addr); +bool modsectionsfromaddr(uint addr, std::vector* sections); +uint modentryfromaddr(uint addr); +int modpathfromaddr(duint addr, char* path, int size); +int modpathfromname(const char* modname, char* path, int size); + +#endif //_MODULE_H \ No newline at end of file diff --git a/x64_dbg_dbg/patches.cpp b/x64_dbg_dbg/patches.cpp index a15a29b6..c567aec7 100644 --- a/x64_dbg_dbg/patches.cpp +++ b/x64_dbg_dbg/patches.cpp @@ -10,16 +10,16 @@ static PatchesInfo patches; bool patchset(uint addr, unsigned char oldbyte, unsigned char newbyte) { - if(!DbgIsDebugging() || !MemIsValidReadPtr(addr)) + if(!DbgIsDebugging() || !memisvalidreadptr(fdProcessInfo->hProcess, addr)) return false; if(oldbyte == newbyte) return true; //no need to make a patch for a byte that is equal to itself PATCHINFO newPatch; - newPatch.addr = addr - ModBaseFromAddr(addr); - ModNameFromAddr(addr, newPatch.mod, true); + newPatch.addr = addr - modbasefromaddr(addr); + modnamefromaddr(addr, newPatch.mod, true); newPatch.oldbyte = oldbyte; newPatch.newbyte = newbyte; - uint key = ModHashFromAddr(addr); + uint key = modhashfromva(addr); CriticalSectionLocker locker(LockPatches); PatchesInfo::iterator found = patches.find(key); if(found != patches.end()) //we found a patch on the specified address @@ -45,13 +45,13 @@ bool patchget(uint addr, PATCHINFO* patch) if(!DbgIsDebugging()) return false; CriticalSectionLocker locker(LockPatches); - PatchesInfo::iterator found = patches.find(ModHashFromAddr(addr)); + PatchesInfo::iterator found = patches.find(modhashfromva(addr)); if(found == patches.end()) //not found return false; if(patch) { *patch = found->second; - patch->addr += ModBaseFromAddr(addr); + patch->addr += modbasefromaddr(addr); return true; } return (found->second.oldbyte != found->second.newbyte); @@ -62,11 +62,11 @@ bool patchdel(uint addr, bool restore) if(!DbgIsDebugging()) return false; CriticalSectionLocker locker(LockPatches); - PatchesInfo::iterator found = patches.find(ModHashFromAddr(addr)); + PatchesInfo::iterator found = patches.find(modhashfromva(addr)); if(found == patches.end()) //not found return false; if(restore) - MemWrite((void*)(found->second.addr + ModBaseFromAddr(addr)), &found->second.oldbyte, sizeof(char), 0); + memwrite(fdProcessInfo->hProcess, (void*)(found->second.addr + modbasefromaddr(addr)), &found->second.oldbyte, sizeof(char), 0); patches.erase(found); return true; } @@ -76,8 +76,8 @@ void patchdelrange(uint start, uint end, bool restore) if(!DbgIsDebugging()) return; bool bDelAll = (start == 0 && end == ~0); //0x00000000-0xFFFFFFFF - uint modbase = ModBaseFromAddr(start); - if(modbase != ModBaseFromAddr(end)) + uint modbase = modbasefromaddr(start); + if(modbase != modbasefromaddr(end)) return; start -= modbase; end -= modbase; @@ -88,7 +88,7 @@ void patchdelrange(uint start, uint end, bool restore) if(bDelAll || (i->second.addr >= start && i->second.addr < end)) { if(restore) - MemWrite((void*)(i->second.addr + modbase), &i->second.oldbyte, sizeof(char), 0); + memwrite(fdProcessInfo->hProcess, (void*)(i->second.addr + modbase), &i->second.oldbyte, sizeof(char), 0); patches.erase(i++); } else @@ -130,7 +130,7 @@ bool patchenum(PATCHINFO* patcheslist, size_t* cbsize) for(PatchesInfo::iterator i = patches.begin(); i != patches.end(); ++i, j++) { patcheslist[j] = i->second; - uint modbase = ModBaseFromName(patcheslist[j].mod); + uint modbase = modbasefromname(patcheslist[j].mod); patcheslist[j].addr += modbase; } return true; @@ -154,7 +154,7 @@ int patchfile(const PATCHINFO* patchlist, int count, const char* szFileName, cha sprintf(error, "not all patches are in module %s", modname); return -1; } - uint modbase = ModBaseFromName(modname); + uint modbase = modbasefromname(modname); if(!modbase) //module not loaded { if(error) diff --git a/x64_dbg_dbg/plugin_loader.cpp b/x64_dbg_dbg/plugin_loader.cpp index 43bf1653..1e8fc555 100644 --- a/x64_dbg_dbg/plugin_loader.cpp +++ b/x64_dbg_dbg/plugin_loader.cpp @@ -303,7 +303,7 @@ void plugincbcall(CBTYPE cbType, void* callbackInfo) if(pluginCallbackList.at(i).cbType == cbType) { CBPLUGIN cbPlugin = pluginCallbackList.at(i).cbPlugin; - if(!IsBadReadPtr((const void*)cbPlugin, sizeof(uint))) + if(memisvalidreadptr(GetCurrentProcess(), (uint)cbPlugin)) cbPlugin(cbType, callbackInfo); } } diff --git a/x64_dbg_dbg/reference.cpp b/x64_dbg_dbg/reference.cpp index 5bd33a2f..0f7e3ccd 100644 --- a/x64_dbg_dbg/reference.cpp +++ b/x64_dbg_dbg/reference.cpp @@ -10,7 +10,7 @@ int reffind(uint addr, uint size, CBREF cbRef, void* userinfo, bool silent, cons uint start_size; uint base; uint base_size; - base = MemFindBaseAddr(addr, &base_size, true); + base = memfindbaseaddr(addr, &base_size, true); if(!base or !base_size) { if(!silent) @@ -33,7 +33,7 @@ int reffind(uint addr, uint size, CBREF cbRef, void* userinfo, bool silent, cons start_size = maxsize; } Memory data(start_size, "reffind:data"); - if(!MemRead((void*)start_addr, data, start_size, 0)) + if(!memread(fdProcessInfo->hProcess, (const void*)start_addr, data, start_size, 0)) { if(!silent) dputs("error reading memory"); @@ -53,7 +53,7 @@ int reffind(uint addr, uint size, CBREF cbRef, void* userinfo, bool silent, cons refinfo.userinfo = userinfo; char fullName[deflen] = ""; char modname[MAX_MODULE_SIZE] = ""; - if(ModNameFromAddr(start_addr, modname, true)) + if(modnamefromaddr(start_addr, modname, true)) sprintf_s(fullName, "%s (%s)", name, modname); else sprintf_s(fullName, "%s (%p)", name, start_addr); diff --git a/x64_dbg_dbg/stackinfo.cpp b/x64_dbg_dbg/stackinfo.cpp index 1b484e1b..89ebb514 100644 --- a/x64_dbg_dbg/stackinfo.cpp +++ b/x64_dbg_dbg/stackinfo.cpp @@ -12,17 +12,17 @@ bool stackcommentget(uint addr, STACK_COMMENT* comment) { uint data = 0; memset(comment, 0, sizeof(STACK_COMMENT)); - MemRead((void*)addr, &data, sizeof(uint), 0); - if(!MemIsValidReadPtr(data)) //the stack value is no pointer + memread(fdProcessInfo->hProcess, (const void*)addr, &data, sizeof(uint), 0); + if(!memisvalidreadptr(fdProcessInfo->hProcess, data)) //the stack value is no pointer return false; uint size = 0; - uint base = MemFindBaseAddr(data, &size); + uint base = memfindbaseaddr(data, &size); uint readStart = data - 16 * 4; if(readStart < base) readStart = base; unsigned char disasmData[256]; - MemRead((void*)readStart, disasmData, sizeof(disasmData), 0); + memread(fdProcessInfo->hProcess, (const void*)readStart, disasmData, sizeof(disasmData), 0); uint prev = disasmback(disasmData, 0, sizeof(disasmData), data - readStart, 1); uint previousInstr = readStart + prev; @@ -44,7 +44,7 @@ bool stackcommentget(uint addr, STACK_COMMENT* comment) if(_dbg_addrinfoget(data, SEG_DEFAULT, &addrinfo)) strcpy_s(label, addrinfo.label); char module[MAX_MODULE_SIZE] = ""; - ModNameFromAddr(data, module, false); + modnamefromaddr(data, module, false); char returnToAddr[MAX_COMMENT_SIZE] = ""; if(*module) sprintf(returnToAddr, "%s.", module); @@ -60,7 +60,7 @@ bool stackcommentget(uint addr, STACK_COMMENT* comment) if(_dbg_addrinfoget(data, SEG_DEFAULT, &addrinfo)) strcpy_s(label, addrinfo.label); *module = 0; - ModNameFromAddr(data, module, false); + modnamefromaddr(data, module, false); char returnFromAddr[MAX_COMMENT_SIZE] = ""; if(*module) sprintf(returnFromAddr, "%s.", module); @@ -94,7 +94,7 @@ bool stackcommentget(uint addr, STACK_COMMENT* comment) if(_dbg_addrinfoget(data, SEG_DEFAULT, &addrinfo)) strcpy_s(label, addrinfo.label); char module[MAX_MODULE_SIZE] = ""; - ModNameFromAddr(data, module, false); + modnamefromaddr(data, module, false); char addrInfo[MAX_COMMENT_SIZE] = ""; if(*module) //module { @@ -118,12 +118,12 @@ void stackgetcallstack(uint csp, CALLSTACK* callstack) callstack->total = 0; if(!DbgIsDebugging() or csp % sizeof(uint)) //alignment problem return; - if(!MemIsValidReadPtr(csp)) + if(!memisvalidreadptr(fdProcessInfo->hProcess, csp)) return; std::vector callstackVector; DWORD ticks = GetTickCount(); uint stacksize = 0; - uint stackbase = MemFindBaseAddr(csp, &stacksize, false); + uint stackbase = memfindbaseaddr(csp, &stacksize, false); if(!stackbase) //super-fail (invalid stack address) return; //walk up the stack @@ -131,16 +131,16 @@ void stackgetcallstack(uint csp, CALLSTACK* callstack) while(i != stackbase + stacksize) { uint data = 0; - MemRead((void*)i, &data, sizeof(uint), 0); - if(MemIsValidReadPtr(data)) //the stack value is a pointer + memread(fdProcessInfo->hProcess, (const void*)i, &data, sizeof(uint), 0); + if(memisvalidreadptr(fdProcessInfo->hProcess, data)) //the stack value is a pointer { uint size = 0; - uint base = MemFindBaseAddr(data, &size); + uint base = memfindbaseaddr(data, &size); uint readStart = data - 16 * 4; if(readStart < base) readStart = base; unsigned char disasmData[256]; - MemRead((void*)readStart, disasmData, sizeof(disasmData), 0); + memread(fdProcessInfo->hProcess, (const void*)readStart, disasmData, sizeof(disasmData), 0); uint prev = disasmback(disasmData, 0, sizeof(disasmData), data - readStart, 1); uint previousInstr = readStart + prev; BASIC_INSTRUCTION_INFO basicinfo; @@ -153,7 +153,7 @@ void stackgetcallstack(uint csp, CALLSTACK* callstack) if(_dbg_addrinfoget(data, SEG_DEFAULT, &addrinfo)) strcpy_s(label, addrinfo.label); char module[MAX_MODULE_SIZE] = ""; - ModNameFromAddr(data, module, false); + modnamefromaddr(data, module, false); char returnToAddr[MAX_COMMENT_SIZE] = ""; if(*module) sprintf(returnToAddr, "%s.", module); @@ -176,7 +176,7 @@ void stackgetcallstack(uint csp, CALLSTACK* callstack) if(_dbg_addrinfoget(data, SEG_DEFAULT, &addrinfo)) strcpy_s(label, addrinfo.label); *module = 0; - ModNameFromAddr(data, module, false); + modnamefromaddr(data, module, false); char returnFromAddr[MAX_COMMENT_SIZE] = ""; if(*module) sprintf(returnFromAddr, "%s.", module); diff --git a/x64_dbg_dbg/symbolinfo.cpp b/x64_dbg_dbg/symbolinfo.cpp index 0e58fb9d..e1e05ab7 100644 --- a/x64_dbg_dbg/symbolinfo.cpp +++ b/x64_dbg_dbg/symbolinfo.cpp @@ -11,234 +11,166 @@ struct SYMBOLCBDATA void* user; }; -static BOOL CALLBACK EnumSymbols(PSYMBOL_INFO SymInfo, ULONG SymbolSize, PVOID UserContext) +static BOOL CALLBACK EnumSymbols(PSYMBOL_INFO pSymInfo, ULONG SymbolSize, PVOID UserContext) { + int len = (int)strlen(pSymInfo->Name); SYMBOLINFO curSymbol; memset(&curSymbol, 0, sizeof(SYMBOLINFO)); - - curSymbol.addr = (duint)SymInfo->Address; - curSymbol.decoratedSymbol = (char*)BridgeAlloc(strlen(SymInfo->Name) + 1); + curSymbol.addr = (duint)pSymInfo->Address; + curSymbol.decoratedSymbol = (char*)BridgeAlloc(len + 1); + strcpy_s(curSymbol.decoratedSymbol, len + 1, pSymInfo->Name); curSymbol.undecoratedSymbol = (char*)BridgeAlloc(MAX_SYM_NAME); - strcpy_s(curSymbol.decoratedSymbol, strlen(SymInfo->Name) + 1, SymInfo->Name); - - // Skip bad ordinals - if(strstr(SymInfo->Name, "Ordinal")) + if(strstr(pSymInfo->Name, "Ordinal")) { - // Does the symbol point to the module base? - if(SymInfo->Address == SymInfo->ModBase) + //skip bad ordinals + if(pSymInfo->Address == pSymInfo->ModBase) return TRUE; } - - // Convert a mangled/decorated C++ name to a readable format - if(!SafeUnDecorateSymbolName(SymInfo->Name, curSymbol.undecoratedSymbol, MAX_SYM_NAME, UNDNAME_COMPLETE)) + if(!SafeUnDecorateSymbolName(pSymInfo->Name, curSymbol.undecoratedSymbol, MAX_SYM_NAME, UNDNAME_COMPLETE)) { BridgeFree(curSymbol.undecoratedSymbol); - curSymbol.undecoratedSymbol = nullptr; + curSymbol.undecoratedSymbol = 0; } else if(!strcmp(curSymbol.decoratedSymbol, curSymbol.undecoratedSymbol)) { BridgeFree(curSymbol.undecoratedSymbol); - curSymbol.undecoratedSymbol = nullptr; + curSymbol.undecoratedSymbol = 0; } - SYMBOLCBDATA* cbData = (SYMBOLCBDATA*)UserContext; cbData->cbSymbolEnum(&curSymbol, cbData->user); return TRUE; } -void SymEnum(uint Base, CBSYMBOLENUM EnumCallback, void* UserData) +void symenum(uint base, CBSYMBOLENUM cbSymbolEnum, void* user) { SYMBOLCBDATA symbolCbData; - symbolCbData.cbSymbolEnum = EnumCallback; - symbolCbData.user = UserData; - - // Enumerate every single symbol for the module in 'base' - if(!SafeSymEnumSymbols(fdProcessInfo->hProcess, Base, "*", EnumSymbols, &symbolCbData)) - dputs("SymEnumSymbols failed!"); + symbolCbData.cbSymbolEnum = cbSymbolEnum; + symbolCbData.user = user; + char mask[] = "*"; + SafeSymEnumSymbols(fdProcessInfo->hProcess, base, mask, EnumSymbols, &symbolCbData); } -bool SymGetModuleList(std::vector* List) +#ifdef _WIN64 +static BOOL CALLBACK EnumModules(LPCTSTR ModuleName, DWORD64 BaseOfDll, PVOID UserContext) +#else +static BOOL CALLBACK EnumModules(LPCTSTR ModuleName, ULONG BaseOfDll, PVOID UserContext) +#endif //_WIN64 { - // - // Inline lambda enum - // - auto EnumModules = [](LPCTSTR ModuleName, DWORD64 BaseOfDll, PVOID UserContext) -> BOOL - { - SYMBOLMODULEINFO curModule; - curModule.base = (duint)BaseOfDll; - - // Terminate module name if one isn't found - if(!ModNameFromAddr(curModule.base, curModule.name, true)) - curModule.name[0] = '\0'; - - ((std::vector*)UserContext)->push_back(curModule); - return TRUE; - }; - - // Execute the symbol enumerator (Force cast to STDCALL) - if(!SafeSymEnumerateModules64(fdProcessInfo->hProcess, EnumModules, List)) - { - dputs("SymEnumerateModules64 failed!"); - return false; - } - - return true; + SYMBOLMODULEINFO curModule; + memset(&curModule, 0, sizeof(SYMBOLMODULEINFO)); + curModule.base = BaseOfDll; + modnamefromaddr(BaseOfDll, curModule.name, true); + ((std::vector*)UserContext)->push_back(curModule); + return TRUE; } -void SymUpdateModuleList() +void symupdatemodulelist() { - // Build the vector of modules std::vector modList; - - if(!SymGetModuleList(&modList)) - return; - - // Create a new array to be sent to the GUI thread - size_t moduleCount = modList.size(); - SYMBOLMODULEINFO *data = (SYMBOLMODULEINFO *)BridgeAlloc(moduleCount * sizeof(SYMBOLMODULEINFO)); - - // Direct copy from std::vector data - memcpy(data, modList.data(), moduleCount * sizeof(SYMBOLMODULEINFO)); - - // Send the module data to the GUI for updating - GuiSymbolUpdateModuleList((int)moduleCount, data); + modList.clear(); + SafeSymEnumerateModules(fdProcessInfo->hProcess, EnumModules, &modList); + int modcount = (int)modList.size(); + SYMBOLMODULEINFO* modListBridge = (SYMBOLMODULEINFO*)BridgeAlloc(sizeof(SYMBOLMODULEINFO) * modcount); + for(int i = 0; i < modcount; i++) + memcpy(&modListBridge[i], &modList.at(i), sizeof(SYMBOLMODULEINFO)); + GuiSymbolUpdateModuleList(modcount, modListBridge); } -void SymDownloadAllSymbols(const char* SymbolStore) +void symdownloadallsymbols(const char* szSymbolStore) { - // Default to Microsoft's symbol server - if(!SymbolStore) - SymbolStore = "http://msdl.microsoft.com/download/symbols"; - - // Build the vector of modules + if(!szSymbolStore) + szSymbolStore = "http://msdl.microsoft.com/download/symbols"; std::vector modList; - - if(!SymGetModuleList(&modList)) + modList.clear(); + SafeSymEnumerateModules(fdProcessInfo->hProcess, EnumModules, &modList); + int modcount = (int)modList.size(); + if(!modcount) return; - - // Skip loading if there aren't any found modules - if(modList.size() <= 0) - return; - - // Backup the current symbol search path - char oldSearchPath[MAX_PATH]; - - if(!SafeSymGetSearchPath(fdProcessInfo->hProcess, oldSearchPath, MAX_PATH)) + char szOldSearchPath[MAX_PATH] = ""; + if(!SafeSymGetSearchPath(fdProcessInfo->hProcess, szOldSearchPath, MAX_PATH)) //backup current path { dputs("SymGetSearchPath failed!"); return; } - - // Use the custom server path and directory - char customSearchPath[MAX_PATH * 2]; - sprintf_s(customSearchPath, "SRV*%s*%s", szSymbolCachePath, SymbolStore); - - if(!SafeSymSetSearchPath(fdProcessInfo->hProcess, customSearchPath)) + char szServerSearchPath[MAX_PATH * 2] = ""; + sprintf_s(szServerSearchPath, "SRV*%s*%s", szSymbolCachePath, szSymbolStore); + if(!SafeSymSetSearchPath(fdProcessInfo->hProcess, szServerSearchPath)) //update search path { dputs("SymSetSearchPath (1) failed!"); return; } - - // Reload - for(auto & module : modList) + for(int i = 0; i < modcount; i++) //reload all modules { - dprintf("Downloading symbols for %s...\n", module.name); - - wchar_t modulePath[MAX_PATH]; - if(!GetModuleFileNameExW(fdProcessInfo->hProcess, (HMODULE)module.base, modulePath, MAX_PATH)) + dprintf("downloading symbols for %s...\n", modList.at(i).name); + uint modbase = modList.at(i).base; + wchar_t szModulePath[MAX_PATH] = L""; + if(!GetModuleFileNameExW(fdProcessInfo->hProcess, (HMODULE)modbase, szModulePath, MAX_PATH)) { - dprintf("GetModuleFileNameExW("fhex") failed!\n", module.base); + dprintf("GetModuleFileNameExW("fhex") failed!\n", modbase); continue; } - - if(!SafeSymUnloadModule64(fdProcessInfo->hProcess, (DWORD64)module.base)) + if(!SafeSymUnloadModule64(fdProcessInfo->hProcess, (DWORD64)modbase)) { - dprintf("SymUnloadModule64("fhex") failed!\n", module.base); + dprintf("SymUnloadModule64("fhex") failed!\n", modbase); continue; } - - if(!SafeSymLoadModuleEx(fdProcessInfo->hProcess, 0, StringUtils::Utf16ToUtf8(modulePath).c_str(), 0, (DWORD64)module.base, 0, 0, 0)) + if(!SafeSymLoadModuleEx(fdProcessInfo->hProcess, 0, StringUtils::Utf16ToUtf8(szModulePath).c_str(), 0, (DWORD64)modbase, 0, 0, 0)) { - dprintf("SymLoadModuleEx("fhex") failed!\n", module.base); + dprintf("SymLoadModuleEx("fhex") failed!\n", modbase); continue; } } - - // Restore the old search path - if(!SafeSymSetSearchPath(fdProcessInfo->hProcess, oldSearchPath)) + if(!SafeSymSetSearchPath(fdProcessInfo->hProcess, szOldSearchPath)) //restore search path + { dputs("SymSetSearchPath (2) failed!"); + } } -bool SymAddrFromName(const char* Name, uint* Address) +bool symfromname(const char* name, uint* addr) { - if(!Name || Name[0] == '\0') + if(!name or !strlen(name) or !addr or !_strnicmp(name, "ordinal", 7)) //skip 'OrdinalXXX' return false; - - if(!Address) - return false; - - // Skip 'OrdinalXXX' - if(!_strnicmp(Name, "Ordinal", 7)) - return false; - - // According to MSDN: - // Note that the total size of the data is the SizeOfStruct + (MaxNameLen - 1) * sizeof(TCHAR) char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(char)]; - - PSYMBOL_INFO symbol = (PSYMBOL_INFO)&buffer; - symbol->SizeOfStruct = sizeof(SYMBOL_INFO); - symbol->MaxNameLen = MAX_LABEL_SIZE; - - if(!SafeSymFromName(fdProcessInfo->hProcess, Name, symbol)) + PSYMBOL_INFO pSymbol = (PSYMBOL_INFO)buffer; + pSymbol->SizeOfStruct = sizeof(SYMBOL_INFO); + pSymbol->MaxNameLen = MAX_LABEL_SIZE; + if(!SafeSymFromName(fdProcessInfo->hProcess, name, pSymbol)) return false; - - *Address = (uint)symbol->Address; + *addr = (uint)pSymbol->Address; return true; } -const char* SymGetSymbolicName(uint Address) +const char* symgetsymbolicname(uint addr) { - // - // This resolves an address to a module and symbol: - // [modname.]symbolname - // - char label[MAX_SYM_NAME]; - - // User labels have priority, but if one wasn't found, - // default to a symbol lookup - if(!labelget(Address, label)) + //[modname.]symbolname + static char symbolicname[MAX_MODULE_SIZE + MAX_SYM_NAME] = ""; + char label[MAX_SYM_NAME] = ""; + bool retval = false; + if(labelget(addr, label)) //user labels have priority + retval = true; + else //no user labels { - char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(char)]; - - PSYMBOL_INFO symbol = (PSYMBOL_INFO)buffer; - symbol->SizeOfStruct = sizeof(SYMBOL_INFO); - symbol->MaxNameLen = MAX_LABEL_SIZE; - - // Perform a symbol lookup DWORD64 displacement = 0; - - if(!SafeSymFromAddr(fdProcessInfo->hProcess, (DWORD64)Address, &displacement, symbol)) - return nullptr; - - // If the symbol wasn't at offset 0 (start from the beginning) ignore it - if(displacement != 0) - return nullptr; - - // Terminate the string for sanity - symbol->Name[symbol->MaxNameLen - 1] = '\0'; - - if(!bUndecorateSymbolNames || !SafeUnDecorateSymbolName(symbol->Name, label, MAX_SYM_NAME, UNDNAME_COMPLETE)) - strcpy_s(label, symbol->Name); + char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(char)]; + PSYMBOL_INFO pSymbol = (PSYMBOL_INFO)buffer; + pSymbol->SizeOfStruct = sizeof(SYMBOL_INFO); + pSymbol->MaxNameLen = MAX_LABEL_SIZE; + if(SafeSymFromAddr(fdProcessInfo->hProcess, (DWORD64)addr, &displacement, pSymbol) and !displacement) + { + pSymbol->Name[pSymbol->MaxNameLen - 1] = '\0'; + if(!bUndecorateSymbolNames or !SafeUnDecorateSymbolName(pSymbol->Name, label, MAX_SYM_NAME, UNDNAME_COMPLETE)) + strcpy_s(label, pSymbol->Name); + retval = true; + } } - - // TODO: FIXME: STATIC VARIABLE - static char symbolicname[MAX_MODULE_SIZE + MAX_SYM_NAME]; - char modname[MAX_MODULE_SIZE]; - - if(ModNameFromAddr(Address, modname, false)) - sprintf_s(symbolicname, "%s.%s", modname, label); - else - sprintf_s(symbolicname, "<%s>", label); - - return symbolicname; + if(retval) + { + char modname[MAX_MODULE_SIZE] = ""; + if(modnamefromaddr(addr, modname, false)) + sprintf(symbolicname, "%s.%s", modname, label); + else + sprintf(symbolicname, "<%s>", label); + return symbolicname; + } + return 0; } diff --git a/x64_dbg_dbg/symbolinfo.h b/x64_dbg_dbg/symbolinfo.h index 2bb57f6b..b5f9eab1 100644 --- a/x64_dbg_dbg/symbolinfo.h +++ b/x64_dbg_dbg/symbolinfo.h @@ -1,10 +1,12 @@ -#pragma once +#ifndef _SYMBOLINFO_H +#define _SYMBOLINFO_H #include "_global.h" -void SymEnum(uint Base, CBSYMBOLENUM EnumCallback, void* UserData); -bool SymGetModuleList(std::vector* List); -void SymUpdateModuleList(); -void SymDownloadAllSymbols(const char* SymbolStore); -bool SymAddrFromName(const char* Name, uint* Address); -const char* SymGetSymbolicName(uint Address); \ No newline at end of file +void symenum(uint base, CBSYMBOLENUM cbSymbolEnum, void* user); +void symupdatemodulelist(); +void symdownloadallsymbols(const char* szSymbolStore); +bool symfromname(const char* name, uint* addr); +const char* symgetsymbolicname(uint addr); + +#endif //_SYMBOLINFO_H diff --git a/x64_dbg_dbg/thread.cpp b/x64_dbg_dbg/thread.cpp index d5cf7188..e7063cc0 100644 --- a/x64_dbg_dbg/thread.cpp +++ b/x64_dbg_dbg/thread.cpp @@ -5,251 +5,151 @@ #include "threading.h" static std::vector threadList; +static int threadNum; +static int currentThread; -void ThreadCreate(CREATE_THREAD_DEBUG_INFO* CreateThread) +void threadcreate(CREATE_THREAD_DEBUG_INFO* CreateThread) { THREADINFO curInfo; - memset(&curInfo, 0, sizeof(THREADINFO)); - - curInfo.ThreadNumber = ThreadGetCount(); - curInfo.Handle = CreateThread->hThread; - curInfo.ThreadId = ((DEBUG_EVENT*)GetDebugData())->dwThreadId; - curInfo.ThreadStartAddress = (uint)CreateThread->lpStartAddress; - curInfo.ThreadLocalBase = (uint)CreateThread->lpThreadLocalBase; - - // The first thread (#0) is always the main program thread - if(curInfo.ThreadNumber <= 0) + curInfo.ThreadNumber = threadNum; + curInfo.hThread = CreateThread->hThread; + curInfo.dwThreadId = ((DEBUG_EVENT*)GetDebugData())->dwThreadId; + curInfo.ThreadStartAddress = (uint)CreateThread->lpStartAddress; + curInfo.ThreadLocalBase = (uint)CreateThread->lpThreadLocalBase; + *curInfo.threadName = '\0'; + if(!threadNum) strcpy_s(curInfo.threadName, "Main Thread"); - - // Modify global thread list - EXCLUSIVE_ACQUIRE(LockThreads); + CriticalSectionLocker locker(LockThreads); threadList.push_back(curInfo); - EXCLUSIVE_RELEASE(); - - // Notify GUI + threadNum++; + locker.unlock(); //prevent possible deadlocks GuiUpdateThreadView(); } -void ThreadExit(DWORD dwThreadId) +void threadexit(DWORD dwThreadId) { - EXCLUSIVE_ACQUIRE(LockThreads); - - // Don't use a foreach loop here because of the erase() call - for(auto itr = threadList.begin(); itr != threadList.end(); itr++) - { - if(itr->ThreadId == dwThreadId) + CriticalSectionLocker locker(LockThreads); + for(unsigned int i = 0; i < threadList.size(); i++) + if(threadList.at(i).dwThreadId == dwThreadId) { - threadList.erase(itr); + threadList.erase(threadList.begin() + i); break; } - } - - EXCLUSIVE_RELEASE(); + locker.unlock(); //prevent possible deadlocks GuiUpdateThreadView(); } -void ThreadClear() +void threadclear() { - // Clear the current array of threads - EXCLUSIVE_ACQUIRE(LockThreads); - threadList.clear(); - EXCLUSIVE_RELEASE(); - - // Update the GUI's list + threadNum = 0; + CriticalSectionLocker locker(LockThreads); + std::vector().swap(threadList); + locker.unlock(); //prevent possible deadlocks GuiUpdateThreadView(); } -int ThreadGetCount() +static THREADWAITREASON GetThreadWaitReason(DWORD dwThreadId) { - SHARED_ACQUIRE(LockThreads); - return (int)threadList.size(); -} - -void ThreadGetList(THREADLIST* list) -{ - SHARED_ACQUIRE(LockThreads); - - // - // This function converts a C++ std::vector to a C-style THREADLIST[] - // Also assume BridgeAlloc zeros the returned buffer - // - size_t count = threadList.size(); - - if(count <= 0) - return; - - list->count = (int)count; - list->list = (THREADALLINFO*)BridgeAlloc(count * sizeof(THREADALLINFO)); - - // Fill out the list data - for(size_t i = 0; i < count; i++) - { - HANDLE threadHandle = threadList[i].Handle; - - // Get the debugger's current thread index - if(threadHandle == hActiveThread) - list->CurrentThread = (int)i; - - memcpy(&list->list[i].BasicInfo, &threadList[i], sizeof(THREADINFO)); - - list->list[i].ThreadCip = GetContextDataEx(threadHandle, UE_CIP); - list->list[i].SuspendCount = ThreadGetSuspendCount(threadHandle); - list->list[i].Priority = ThreadGetPriority(threadHandle); - list->list[i].WaitReason = ThreadGetWaitReason(threadHandle); - list->list[i].LastError = ThreadGetLastError(list->list[i].BasicInfo.ThreadLocalBase); - } -} - -bool ThreadIsValid(DWORD dwThreadId) -{ - SHARED_ACQUIRE(LockThreads); - - for(auto & entry : threadList) - { - if(entry.ThreadId == dwThreadId) - return true; - } - - return false; -} - -bool ThreadGetTeb(uint TEBAddress, TEB* Teb) -{ - // - // TODO: Keep a cached copy inside the vector - // - memset(Teb, 0, sizeof(TEB)); - - return MemRead((void*)TEBAddress, Teb, sizeof(TEB), nullptr); -} - -int ThreadGetSuspendCount(HANDLE Thread) -{ - // - // Suspend a thread in order to get the previous suspension count - // WARNING: This function is very bad (threads should not be randomly interrupted) - // - int suspendCount = (int)SuspendThread(Thread); - - if(suspendCount == -1) - return 0; - - // Resume the thread's normal execution - ResumeThread(Thread); - - return suspendCount; -} - -THREADPRIORITY ThreadGetPriority(HANDLE Thread) -{ - return (THREADPRIORITY)GetThreadPriority(Thread); -} - -THREADWAITREASON ThreadGetWaitReason(HANDLE Thread) -{ - UNREFERENCED_PARAMETER(Thread); - - // TODO: Implement this + //TODO: implement this return _Executive; } -DWORD ThreadGetLastError(uint tebAddress) +static DWORD GetThreadLastError(uint tebAddress) { TEB teb; - if(!ThreadGetTeb(tebAddress, &teb)) - { - // TODO: Assert (Why would the TEB fail?) + memset(&teb, 0, sizeof(TEB)); + if(!memread(fdProcessInfo->hProcess, (void*)tebAddress, &teb, sizeof(TEB), 0)) return 0; - } - return teb.LastErrorValue; } -bool ThreadSetName(DWORD dwThreadId, const char* name) +void threadgetlist(THREADLIST* list) { - EXCLUSIVE_ACQUIRE(LockThreads); - - // Modifies a variable (name), so an exclusive lock is required - for(auto & entry : threadList) + CriticalSectionLocker locker(LockThreads); + int count = (int)threadList.size(); + list->count = count; + if(!count) + return; + list->list = (THREADALLINFO*)BridgeAlloc(count * sizeof(THREADALLINFO)); + for(int i = 0; i < count; i++) { - if(entry.ThreadId == dwThreadId) - { - if(!name) - name = ""; - - strcpy_s(entry.threadName, name); - return true; - } + if(hActiveThread == threadList.at(i).hThread) + currentThread = i; + memset(&list->list[i], 0, sizeof(THREADALLINFO)); + memcpy(&list->list[i].BasicInfo, &threadList.at(i), sizeof(THREADINFO)); + HANDLE hThread = list->list[i].BasicInfo.hThread; + list->list[i].ThreadCip = GetContextDataEx(hThread, UE_CIP); + list->list[i].SuspendCount = SuspendThread(hThread); + ResumeThread(hThread); + list->list[i].Priority = (THREADPRIORITY)GetThreadPriority(list->list[i].BasicInfo.hThread); + list->list[i].WaitReason = GetThreadWaitReason(list->list[i].BasicInfo.dwThreadId); + list->list[i].LastError = GetThreadLastError(list->list[i].BasicInfo.ThreadLocalBase); } + list->CurrentThread = currentThread; +} +bool threadisvalid(DWORD dwThreadId) +{ + CriticalSectionLocker locker(LockThreads); + for(unsigned int i = 0; i < threadList.size(); i++) + if(threadList.at(i).dwThreadId == dwThreadId) + return true; return false; } -HANDLE ThreadGetHandle(DWORD dwThreadId) +bool threadsetname(DWORD dwThreadId, const char* name) { - SHARED_ACQUIRE(LockThreads); + CriticalSectionLocker locker(LockThreads); + for(unsigned int i = 0; i < threadList.size(); i++) + if(threadList.at(i).dwThreadId == dwThreadId) + { + if(name) + strcpy_s(threadList.at(i).threadName, name); + else + *threadList.at(i).threadName = '\0'; + } + return false; +} - for(auto & entry : threadList) - { - if(entry.ThreadId == dwThreadId) - return entry.Handle; - } - - // TODO: Set an assert if the handle is never found, - // using a bad handle causes random/silent issues everywhere +HANDLE threadgethandle(DWORD dwThreadId) +{ + CriticalSectionLocker locker(LockThreads); + for(unsigned int i = 0; i < threadList.size(); i++) + if(threadList.at(i).dwThreadId == dwThreadId) + return threadList.at(i).hThread; return 0; } -DWORD ThreadGetId(HANDLE hThread) +DWORD threadgetid(HANDLE hThread) { - SHARED_ACQUIRE(LockThreads); - - // Search for the ID in the local list - for(auto & entry : threadList) - { - if(entry.Handle == hThread) - return entry.ThreadId; - } - - // Wasn't found, check with Windows - // NOTE: Requires VISTA+ - DWORD id = GetThreadId(hThread); - - // Returns 0 on error; - // TODO: Same problem with ThreadGetHandle() - return id; + CriticalSectionLocker locker(LockThreads); + for(unsigned int i = 0; i < threadList.size(); i++) + if(threadList.at(i).hThread == hThread) + return threadList.at(i).dwThreadId; + return 0; } -int ThreadSuspendAll() +int threadgetcount() { - // - // SuspendThread does not modify any internal variables - // - SHARED_ACQUIRE(LockThreads); + return (int)threadList.size(); +} +int threadsuspendall() +{ + CriticalSectionLocker locker(LockThreads); int count = 0; - for(auto & entry : threadList) - { - if(SuspendThread(entry.Handle) != -1) + for(unsigned int i = 0; i < threadList.size(); i++) + if(SuspendThread(threadList.at(i).hThread) != -1) count++; - } - return count; } -int ThreadResumeAll() +int threadresumeall() { - // - // ResumeThread does not modify any internal variables - // - SHARED_ACQUIRE(LockThreads); - + CriticalSectionLocker locker(LockThreads); int count = 0; - for(auto & entry : threadList) - { - if(ResumeThread(entry.Handle) != -1) + for(unsigned int i = 0; i < threadList.size(); i++) + if(ResumeThread(threadList.at(i).hThread) != -1) count++; - } - return count; } \ No newline at end of file diff --git a/x64_dbg_dbg/thread.h b/x64_dbg_dbg/thread.h index 5eb62bd2..eaacbaef 100644 --- a/x64_dbg_dbg/thread.h +++ b/x64_dbg_dbg/thread.h @@ -1,22 +1,20 @@ -#pragma once +#ifndef _THREAD_H +#define _THREAD_H #include "_global.h" #include "debugger.h" -void ThreadCreate(CREATE_THREAD_DEBUG_INFO* CreateThread); -void ThreadExit(DWORD dwThreadId); -void ThreadClear(); -int ThreadGetCount(); -void ThreadGetList(THREADLIST* list); -bool ThreadIsValid(DWORD dwThreadId); -bool ThreadSetName(DWORD dwTHreadId, const char* name); -bool ThreadGetTeb(uint TEBAddress, TEB* Teb); -int ThreadGetSuspendCount(HANDLE Thread); -THREADPRIORITY ThreadGetPriority(HANDLE Thread); -THREADWAITREASON ThreadGetWaitReason(HANDLE Thread); -DWORD ThreadGetLastError(uint tebAddress); -bool ThreadSetName(DWORD dwThreadId, const char* name); -HANDLE ThreadGetHandle(DWORD dwThreadId); -DWORD ThreadGetId(HANDLE hThread); -int ThreadSuspendAll(); -int ThreadResumeAll(); \ No newline at end of file +//functions +void threadcreate(CREATE_THREAD_DEBUG_INFO* CreateThread); +void threadexit(DWORD dwThreadId); +void threadclear(); +void threadgetlist(THREADLIST* list); +bool threadisvalid(DWORD dwThreadId); +bool threadsetname(DWORD dwTHreadId, const char* name); +HANDLE threadgethandle(DWORD dwThreadId); +DWORD threadgetid(HANDLE hThread); +int threadgetcount(); +int threadsuspendall(); +int threadresumeall(); + +#endif //_THREAD_H diff --git a/x64_dbg_dbg/threading.cpp b/x64_dbg_dbg/threading.cpp index dfeb9089..0ef8a16d 100644 --- a/x64_dbg_dbg/threading.cpp +++ b/x64_dbg_dbg/threading.cpp @@ -28,37 +28,53 @@ bool waitislocked(WAIT_ID id) return waitarray[id]; } -bool SectionLockerGlobal::m_Initialized = false; -SRWLOCK SectionLockerGlobal::m_Locks[SectionLock::LockLast]; +CRITICAL_SECTION CriticalSectionLocker::locks[LockLast] = {}; +bool CriticalSectionLocker::bInitDone = false; -void SectionLockerGlobal::Initialize() +void CriticalSectionLocker::Initialize() { - if(m_Initialized) + if(bInitDone) return; - - // Destroy previous data if any existed - memset(m_Locks, 0, sizeof(m_Locks)); - - for(int i = 0; i < ARRAYSIZE(m_Locks); i++) - InitializeSRWLock(&m_Locks[i]); - - m_Initialized = true; + for(int i = 0; i < LockLast; i++) + InitializeCriticalSection(&locks[i]); + bInitDone = true; } -void SectionLockerGlobal::Deinitialize() +void CriticalSectionLocker::Deinitialize() { - if(!m_Initialized) + if(!bInitDone) return; - - for(int i = 0; i < ARRAYSIZE(m_Locks); i++) + for(int i = 0; i < LockLast; i++) { - // Wait for the lock's ownership to be released - AcquireSRWLockExclusive(&m_Locks[i]); - ReleaseSRWLockExclusive(&m_Locks[i]); - - // Invalidate data - memset(&m_Locks[i], 0, sizeof(SRWLOCK)); + EnterCriticalSection(&locks[i]); //obtain ownership + DeleteCriticalSection(&locks[i]); } + bInitDone = false; +} - m_Initialized = false; +CriticalSectionLocker::CriticalSectionLocker(CriticalSectionLock lock) +{ + Initialize(); //initialize critical sections + gLock = lock; + + EnterCriticalSection(&locks[gLock]); + Locked = true; +} + +CriticalSectionLocker::~CriticalSectionLocker() +{ + if(Locked) + LeaveCriticalSection(&locks[gLock]); +} + +void CriticalSectionLocker::unlock() +{ + Locked = false; + LeaveCriticalSection(&locks[gLock]); +} + +void CriticalSectionLocker::relock() +{ + EnterCriticalSection(&locks[gLock]); + Locked = true; } \ No newline at end of file diff --git a/x64_dbg_dbg/threading.h b/x64_dbg_dbg/threading.h index 7d092b54..6d6800ad 100644 --- a/x64_dbg_dbg/threading.h +++ b/x64_dbg_dbg/threading.h @@ -1,7 +1,9 @@ -#pragma once +#ifndef _THREADING_H +#define _THREADING_H #include "_global.h" +//enums enum WAIT_ID { WAITID_RUN, @@ -16,22 +18,7 @@ void lock(WAIT_ID id); void unlock(WAIT_ID id); bool waitislocked(WAIT_ID id); -// -// THREAD SYNCHRONIZATION -// -// Better, but requires VISTA+ -// https://msdn.microsoft.com/en-us/library/windows/desktop/aa904937%28v=vs.85%29.aspx -// -#define CriticalSectionLocker -#define locker(x) EXCLUSIVE_ACQUIRE(x) - -#define EXCLUSIVE_ACQUIRE(Index) SectionLocker __ThreadLock; -#define EXCLUSIVE_RELEASE() __ThreadLock.Unlock(); - -#define SHARED_ACQUIRE(Index) SectionLocker __SThreadLock; -#define SHARED_RELEASE() __SThreadLock.Unlock(); - -enum SectionLock +enum CriticalSectionLock { LockMemoryPages, LockVariables, @@ -45,75 +32,26 @@ enum SectionLock LockPatches, LockThreads, LockDprintf, - LockSym, - - // This is defined because of a bug in the Windows 8.1 kernel; - // Calling VirtualQuery/VirtualProtect/ReadProcessMemory can and will cause - // a deadlock. - // https://bitbucket.org/mrexodia/x64_dbg/issue/247/x64-dbg-bug-string-references-function - LockWin8Workaround, - - LockLast, + LockSym, + LockLast }; -class SectionLockerGlobal +class CriticalSectionLocker { - template friend class SectionLocker; - public: - static void Initialize(); static void Deinitialize(); + CriticalSectionLocker(CriticalSectionLock lock); + ~CriticalSectionLocker(); + void unlock(); + void relock(); private: - static bool m_Initialized; - static SRWLOCK m_Locks[SectionLock::LockLast]; + static void Initialize(); + static bool bInitDone; + static CRITICAL_SECTION locks[LockLast]; + + CriticalSectionLock gLock; + bool Locked; }; -template -class SectionLocker -{ -public: - SectionLocker() - { - m_LockCount = 0; - Lock(); - } - - ~SectionLocker() - { - if(m_LockCount > 0) - Unlock(); - -#ifdef _DEBUG - // TODO: Assert that the lock count is zero on destructor - if (m_LockCount > 0) - __debugbreak(); -#endif - } - - inline void Lock() - { - if(Shared) - AcquireSRWLockShared(&Internal::m_Locks[LockIndex]); - else - AcquireSRWLockExclusive(&Internal::m_Locks[LockIndex]); - - m_LockCount++; - } - - inline void Unlock() - { - m_LockCount--; - - if(Shared) - ReleaseSRWLockShared(&Internal::m_Locks[LockIndex]); - else - ReleaseSRWLockExclusive(&Internal::m_Locks[LockIndex]); - } - -private: - using Internal = SectionLockerGlobal; - -protected: - BYTE m_LockCount; -}; \ No newline at end of file +#endif // _THREADING_H diff --git a/x64_dbg_dbg/value.cpp b/x64_dbg_dbg/value.cpp index f440f6e9..055a8e41 100644 --- a/x64_dbg_dbg/value.cpp +++ b/x64_dbg_dbg/value.cpp @@ -1189,7 +1189,7 @@ bool valapifromstring(const char* name, uint* value, int* value_size, bool print SELECTIONDATA seldata; memset(&seldata, 0, sizeof(seldata)); GuiSelectionGet(GUI_DISASSEMBLY, &seldata); - if(!ModNameFromAddr(seldata.start, modname, true)) + if(!modnamefromaddr(seldata.start, modname, true)) return false; } else @@ -1200,7 +1200,7 @@ bool valapifromstring(const char* name, uint* value, int* value_size, bool print apiname++; if(!strlen(apiname)) return false; - uint modbase = ModBaseFromName(modname); + uint modbase = modbasefromname(modname); wchar_t szModName[MAX_PATH] = L""; if(!GetModuleFileNameExW(fdProcessInfo->hProcess, (HMODULE)modbase, szModName, MAX_PATH)) { @@ -1477,7 +1477,7 @@ bool valfromstring(const char* string, uint* value, bool silent, bool baseonly, return false; uint addr = *value; *value = 0; - if(!MemRead((void*)addr, value, read_size, 0)) + if(!memread(fdProcessInfo->hProcess, (void*)addr, value, read_size, 0)) { if(!silent) dputs("failed to read memory"); @@ -1559,7 +1559,7 @@ bool valfromstring(const char* string, uint* value, bool silent, bool baseonly, return true; else if(labelfromstring(string, value)) //then come labels return true; - else if(SymAddrFromName(string, value)) //then come symbols + else if(symfromname(string, value)) //then come symbols return true; else if(varget(string, value, value_size, 0)) //finally variables { @@ -2025,7 +2025,7 @@ bool valtostring(const char* string, uint* value, bool silent) { return false; } - if(!MemPatch((void*)temp, value, read_size, 0)) + if(!mempatch(fdProcessInfo->hProcess, (void*)temp, value, read_size, 0)) { if(!silent) dputs("failed to write memory"); @@ -2094,7 +2094,7 @@ bool valtostring(const char* string, uint* value, bool silent) uint valfileoffsettova(const char* modname, uint offset) { char modpath[MAX_PATH] = ""; - if(ModPathFromName(modname, modpath, MAX_PATH)) + if(modpathfromname(modname, modpath, MAX_PATH)) { HANDLE FileHandle; DWORD LoadedSize; @@ -2106,7 +2106,7 @@ uint valfileoffsettova(const char* modname, uint offset) FileMapVA + (ULONG_PTR)offset, //Offset inside FileMapVA false); //Return without ImageBase StaticFileUnloadW(StringUtils::Utf8ToUtf16(modpath).c_str(), true, FileHandle, LoadedSize, FileMap, FileMapVA); - return offset < LoadedSize ? (duint)rva + ModBaseFromName(modname) : 0; + return offset < LoadedSize ? (duint)rva + modbasefromname(modname) : 0; } } return 0; @@ -2115,7 +2115,7 @@ uint valfileoffsettova(const char* modname, uint offset) uint valvatofileoffset(uint va) { char modpath[MAX_PATH] = ""; - if(ModPathFromAddr(va, modpath, MAX_PATH)) + if(modpathfromaddr(va, modpath, MAX_PATH)) { HANDLE FileHandle; DWORD LoadedSize; @@ -2123,7 +2123,7 @@ uint valvatofileoffset(uint va) ULONG_PTR FileMapVA; if(StaticFileLoadW(StringUtils::Utf8ToUtf16(modpath).c_str(), UE_ACCESS_READ, false, &FileHandle, &LoadedSize, &FileMap, &FileMapVA)) { - ULONGLONG offset = ConvertVAtoFileOffsetEx(FileMapVA, LoadedSize, 0, va - ModBaseFromAddr(va), true, false); + ULONGLONG offset = ConvertVAtoFileOffsetEx(FileMapVA, LoadedSize, 0, va - modbasefromaddr(va), true, false); StaticFileUnloadW(StringUtils::Utf8ToUtf16(modpath).c_str(), true, FileHandle, LoadedSize, FileMap, FileMapVA); return (duint)offset; } diff --git a/x64_dbg_dbg/variable.cpp b/x64_dbg_dbg/variable.cpp index 2b84c077..f71905a0 100644 --- a/x64_dbg_dbg/variable.cpp +++ b/x64_dbg_dbg/variable.cpp @@ -6,36 +6,30 @@ static VAR* vars; static void varsetvalue(VAR* var, VAR_VALUE* value) { - // VAR_STRING needs to be freed before destroying it - if(var->value.type == VAR_STRING) + switch(var->value.type) { + case VAR_STRING: var->value.u.data->clear(); delete var->value.u.data; + break; + default: + break; } - - // Replace all information in the struct memcpy(&var->value, value, sizeof(VAR_VALUE)); } static bool varset(const char* name, VAR_VALUE* value, bool setreadonly) { - EXCLUSIVE_ACQUIRE(LockVariables); - + CriticalSectionLocker locker(LockVariables); String name_; if(*name != '$') name_ = "$"; name_ += name; VariableMap::iterator found = variables.find(name_); - if(found == variables.end()) //not found + if(found == variables.end()) //not found return false; if(found->second.alias.length()) - { - // Release the lock (potential deadlock here) - EXCLUSIVE_RELEASE(); - return varset(found->second.alias.c_str(), value, setreadonly); - } - if(!setreadonly && (found->second.type == VAR_READONLY || found->second.type == VAR_HIDDEN)) return false; varsetvalue(&found->second, value); @@ -45,55 +39,39 @@ static bool varset(const char* name, VAR_VALUE* value, bool setreadonly) void varinit() { varfree(); - - // General variables + //General variables varnew("$result\1$res", 0, VAR_SYSTEM); varnew("$result1\1$res1", 0, VAR_SYSTEM); varnew("$result2\1$res2", 0, VAR_SYSTEM); varnew("$result3\1$res3", 0, VAR_SYSTEM); varnew("$result4\1$res4", 0, VAR_SYSTEM); - - // InitDebug variables - varnew("$hProcess\1$hp", 0, VAR_READONLY); // Process handle - varnew("$pid", 0, VAR_READONLY); // Process ID - - // Hidden variables + //InitDebug variables + varnew("$hProcess\1$hp", 0, VAR_READONLY); + varnew("$pid", 0, VAR_READONLY); + //hidden variables varnew("$ans\1$an", 0, VAR_HIDDEN); - - // Read-only variables - varnew("$lastalloc", 0, VAR_READONLY); // Last memory allocation - varnew("$_EZ_FLAG", 0, VAR_READONLY); // Equal/zero flag for internal use (1=equal, 0=unequal) - varnew("$_BS_FLAG", 0, VAR_READONLY); // Bigger/smaller flag for internal use (1=bigger, 0=smaller) + //read-only variables + varnew("$lastalloc", 0, VAR_READONLY); + varnew("$_EZ_FLAG", 0, VAR_READONLY); //equal/zero flag for internal use (1=equal, 0=unequal) + varnew("$_BS_FLAG", 0, VAR_READONLY); //bigger/smaller flag for internal use (1=bigger, 0=smaller) } void varfree() { - EXCLUSIVE_ACQUIRE(LockVariables); - - // Each variable must be deleted manually; strings especially - // because there are sub-allocations - VAR_VALUE emptyValue; - - for (auto& itr : variables) - varsetvalue(&itr.second, &emptyValue); - - // Now clear all vector elements + CriticalSectionLocker locker(LockVariables); variables.clear(); } VAR* vargetptr() { - // TODO: Implement this? Or remove it - return nullptr; + return 0; } bool varnew(const char* name, uint value, VAR_TYPE type) { + CriticalSectionLocker locker(LockVariables); if(!name) return false; - - CriticalSectionLocker locker(LockVariables); - std::vector names = StringUtils::Split(name, '\1'); String firstName; for(int i = 0; i < (int)names.size(); i++) @@ -122,8 +100,7 @@ bool varnew(const char* name, uint value, VAR_TYPE type) static bool varget(const char* name, VAR_VALUE* value, int* size, VAR_TYPE* type) { - SHARED_ACQUIRE(LockVariables); - + CriticalSectionLocker locker(LockVariables); String name_; if(*name != '$') name_ = "$"; @@ -132,12 +109,7 @@ static bool varget(const char* name, VAR_VALUE* value, int* size, VAR_TYPE* type if(found == variables.end()) //not found return false; if(found->second.alias.length()) - { - // Release the lock (potential deadlock here) - SHARED_RELEASE(); - return varget(found->second.alias.c_str(), value, size, type); - } if(type) *type = found->second.type; if(size) @@ -212,8 +184,7 @@ bool varset(const char* name, const char* string, bool setreadonly) bool vardel(const char* name, bool delsystem) { - EXCLUSIVE_ACQUIRE(LockVariables); - + CriticalSectionLocker locker(LockVariables); String name_; if(*name != '$') name_ = "$"; @@ -222,13 +193,7 @@ bool vardel(const char* name, bool delsystem) if(found == variables.end()) //not found return false; if(found->second.alias.length()) - { - // Release the lock (potential deadlock here) - EXCLUSIVE_RELEASE(); - return vardel(found->second.alias.c_str(), delsystem); - } - if(!delsystem && found->second.type != VAR_USER) return false; found = variables.begin(); @@ -244,8 +209,7 @@ bool vardel(const char* name, bool delsystem) bool vargettype(const char* name, VAR_TYPE* type, VAR_VALUE_TYPE* valtype) { - SHARED_ACQUIRE(LockVariables); - + CriticalSectionLocker locker(LockVariables); String name_; if(*name != '$') name_ = "$"; @@ -262,29 +226,18 @@ bool vargettype(const char* name, VAR_TYPE* type, VAR_VALUE_TYPE* valtype) return true; } -bool varenum(VAR* List, size_t* Size) +bool varenum(VAR* entries, size_t* cbsize) { - // A list or size must be requested - if(!List && !Size) + CriticalSectionLocker locker(LockVariables); + if(!entries && !cbsize || !variables.size()) return false; - - SHARED_ACQUIRE(LockVariables); - - if(Size) + if(!entries && cbsize) { - // Size requested, so return it - *Size = variables.size() * sizeof(VAR); - - if(!List) - return true; + *cbsize = variables.size() * sizeof(VAR); + return true; } - - // Fill out all list entries - for(auto & itr : variables) - { - *List = itr.second; - List++; - } - + int j = 0; + for(VariableMap::iterator i = variables.begin(); i != variables.end(); ++i, j++) + entries[j] = i->second; return true; } \ No newline at end of file diff --git a/x64_dbg_dbg/x64_dbg.cpp b/x64_dbg_dbg/x64_dbg.cpp index eea09dde..ff2b7dba 100644 --- a/x64_dbg_dbg/x64_dbg.cpp +++ b/x64_dbg_dbg/x64_dbg.cpp @@ -236,7 +236,6 @@ extern "C" DLL_EXPORT const char* _dbg_dbginit() return "Invalid TITAN_ENGINE_CONTEXT_t alignment!"; if(sizeof(TITAN_ENGINE_CONTEXT_t) != sizeof(REGISTERCONTEXT)) return "Invalid REGISTERCONTEXT alignment!"; - SectionLockerGlobal::Initialize(); dbginit(); dbgfunctionsinit(); json_set_alloc_funcs(emalloc_json, efree_json); @@ -315,8 +314,7 @@ extern "C" DLL_EXPORT void _dbg_dbgexitsignal() } else DeleteFileA(alloctrace); - - SectionLockerGlobal::Deinitialize(); + CriticalSectionLocker::Deinitialize(); } extern "C" DLL_EXPORT bool _dbg_dbgcmddirectexec(const char* cmd) diff --git a/x64_dbg_dbg/x64_dbg_dbg.vcxproj b/x64_dbg_dbg/x64_dbg_dbg.vcxproj index 8fb7b44e..c544ed20 100644 --- a/x64_dbg_dbg/x64_dbg_dbg.vcxproj +++ b/x64_dbg_dbg/x64_dbg_dbg.vcxproj @@ -1,14 +1,6 @@  - - Debug - Win32 - - - Debug - x64 - Release Win32 @@ -132,22 +124,10 @@ DynamicLibrary false - v120 - - - DynamicLibrary - false - v120 DynamicLibrary false - v120 - - - DynamicLibrary - false - v120 @@ -155,15 +135,9 @@ - - - - - - false @@ -171,37 +145,17 @@ $(Platform)\$(Configuration)\ x32_dbg - - false - $(SolutionDir)bin\x32\ - $(Platform)\$(Configuration)\ - x32_dbg - false $(SolutionDir)bin\x64\ x64_dbg - - false - $(SolutionDir)bin\x64\ - x64_dbg - WIN32;NDEBUG;_WINDOWS;_USRDLL;X64_DBG_EXPORTS;BUILD_DBG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreadedDLL Level3 ProgramDatabase - true - MultiFile - true - true - AVXI - None - None - true - Speed MachineX86 @@ -212,45 +166,12 @@ lz4\lz4_x86.lib;jansson\jansson_x86.lib;DeviceNameResolver\DeviceNameResolver_x86.lib;XEDParse\XEDParse_x86.lib;$(SolutionDir)bin\x32\x32_bridge.lib;dbghelp\dbghelp_x86.lib;TitanEngine\TitanEngine_x86.lib;BeaEngine\BeaEngine.lib;psapi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;shlwapi.lib;%(AdditionalDependencies) - - - WIN32;_DEBUG;_WINDOWS;_USRDLL;X64_DBG_EXPORTS;BUILD_DBG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - Level3 - ProgramDatabase - true - NoIPO - false - true - Disabled - - - MachineX86 - true - Windows - false - false - lz4\lz4_x86.lib;jansson\jansson_x86.lib;DeviceNameResolver\DeviceNameResolver_x86.lib;XEDParse\XEDParse_x86.lib;$(SolutionDir)bin\x32\x32_bridge.lib;dbghelp\dbghelp_x86.lib;TitanEngine\TitanEngine_x86.lib;BeaEngine\BeaEngine.lib;psapi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;shlwapi.lib;%(AdditionalDependencies) - - WIN32;NDEBUG;_WINDOWS;_USRDLL;X64_DBG_EXPORTS;BUILD_DBG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MultiThreadedDLL Level3 ProgramDatabase - true - MultiFile - true - true - AVXI - None - None - true - Speed - AVXI - false - None true @@ -260,29 +181,6 @@ lz4\lz4_x64.lib;jansson\jansson_x64.lib;DeviceNameResolver\DeviceNameResolver_x64.lib;XEDParse\XEDParse_x64.lib;$(SolutionDir)bin\x64\x64_bridge.lib;dbghelp\dbghelp_x64.lib;TitanEngine\TitanEngine_x64.lib;BeaEngine\BeaEngine_64.lib;psapi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;shlwapi.lib;%(AdditionalDependencies) - - - WIN32;_DEBUG;_WINDOWS;_USRDLL;X64_DBG_EXPORTS;BUILD_DBG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - Level3 - ProgramDatabase - true - NoIPO - false - false - Disabled - Rw - None - true - - - true - Windows - false - false - lz4\lz4_x64.lib;jansson\jansson_x64.lib;DeviceNameResolver\DeviceNameResolver_x64.lib;XEDParse\XEDParse_x64.lib;$(SolutionDir)bin\x64\x64_bridge.lib;dbghelp\dbghelp_x64.lib;TitanEngine\TitanEngine_x64.lib;BeaEngine\BeaEngine_64.lib;psapi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;shlwapi.lib;%(AdditionalDependencies) - - diff --git a/x64_dbg_dbg/x64_dbg_dbg.vcxproj.filters b/x64_dbg_dbg/x64_dbg_dbg.vcxproj.filters index 1b220994..4974409f 100644 --- a/x64_dbg_dbg/x64_dbg_dbg.vcxproj.filters +++ b/x64_dbg_dbg/x64_dbg_dbg.vcxproj.filters @@ -9,6 +9,10 @@ {93995380-89BD-4b04-88EB-625FBE52EBFB} h;hpp;hxx;hm;inl;inc;xsd + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + {44fd9eb7-2017-49b8-8d9a-dec680632343} diff --git a/x64_dbg_dbg/x64_dbg_dbg.vcxproj.user b/x64_dbg_dbg/x64_dbg_dbg.vcxproj.user index bdb12b67..b72054fc 100644 --- a/x64_dbg_dbg/x64_dbg_dbg.vcxproj.user +++ b/x64_dbg_dbg/x64_dbg_dbg.vcxproj.user @@ -5,19 +5,9 @@ WindowsLocalDebugger $(OutDir) - - $(OutDir)\x32_dbg.exe - WindowsLocalDebugger - $(OutDir) - $(OutDir)\x64_dbg.exe WindowsLocalDebugger $(OutDir) - - $(OutDir)\x64_dbg.exe - WindowsLocalDebugger - $(OutDir) - \ No newline at end of file diff --git a/x64_dbg_exe/x64_dbg_exe.vcxproj b/x64_dbg_exe/x64_dbg_exe.vcxproj index 0750ddb4..4e831d7c 100644 --- a/x64_dbg_exe/x64_dbg_exe.vcxproj +++ b/x64_dbg_exe/x64_dbg_exe.vcxproj @@ -1,14 +1,6 @@  - - Debug - Win32 - - - Debug - x64 - Release Win32 @@ -31,9 +23,6 @@ - - - {3A22175E-6B72-FDCC-1603-C4A2163C7900} Win32Proj @@ -42,22 +31,10 @@ Application false - v120 - - - Application - false - v120 Application false - v120 - - - Application - false - v120 @@ -65,15 +42,9 @@ - - - - - - false @@ -82,25 +53,12 @@ x32_dbg false - - false - $(SolutionDir)bin\x32\ - $(Platform)\$(Configuration)\ - x32_dbg - false - false $(SolutionDir)bin\x64\ x64_dbg false - - false - $(SolutionDir)bin\x64\ - x64_dbg - false - WIN32;NDEBUG;_WINDOWS;_USRDLL;X64_DBG_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) @@ -120,25 +78,6 @@ - - - WIN32;NDEBUG;_WINDOWS;_USRDLL;X64_DBG_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - MultiThreadedDLL - Level3 - ProgramDatabase - - - MachineX86 - true - Windows - true - true - $(SolutionDir)bin\x32\x32_bridge.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - $(TargetDir)$(TargetName)_exe.pdb - - - - WIN32;NDEBUG;_WINDOWS;_USRDLL;X64_DBG_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) @@ -157,24 +96,6 @@ - - - WIN32;NDEBUG;_WINDOWS;_USRDLL;X64_DBG_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - MultiThreadedDLL - Level3 - ProgramDatabase - - - true - Windows - true - true - $(SolutionDir)bin\x64\x64_bridge.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - $(TargetDir)$(TargetName)_exe.pdb - - - - diff --git a/x64_dbg_exe/x64_dbg_exe.vcxproj.filters b/x64_dbg_exe/x64_dbg_exe.vcxproj.filters index 26d9b663..c37e6d1a 100644 --- a/x64_dbg_exe/x64_dbg_exe.vcxproj.filters +++ b/x64_dbg_exe/x64_dbg_exe.vcxproj.filters @@ -35,7 +35,4 @@ - - - \ No newline at end of file diff --git a/x64_dbg_gui/Project/Src/BasicView/AbstractTableView.cpp b/x64_dbg_gui/Project/Src/BasicView/AbstractTableView.cpp index 4fa6df51..96715382 100644 --- a/x64_dbg_gui/Project/Src/BasicView/AbstractTableView.cpp +++ b/x64_dbg_gui/Project/Src/BasicView/AbstractTableView.cpp @@ -32,7 +32,6 @@ AbstractTableView::AbstractTableView(QWidget* parent) : QAbstractScrollArea(pare setVerticalScrollBar(new AbstractTableScrollBar(verticalScrollBar())); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); memset(&mScrollBarAttributes, 0, sizeof(mScrollBarAttributes)); - setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); horizontalScrollBar()->setRange(0, 0); horizontalScrollBar()->setPageStep(650); mMouseWheelScrollDelta = 4; diff --git a/x64_dbg_gui/Project/Src/BasicView/AbstractTableView.h b/x64_dbg_gui/Project/Src/BasicView/AbstractTableView.h index cfdbcb3d..e72958eb 100644 --- a/x64_dbg_gui/Project/Src/BasicView/AbstractTableView.h +++ b/x64_dbg_gui/Project/Src/BasicView/AbstractTableView.h @@ -8,7 +8,6 @@ #include #include #include "NewTypes.h" -#include "StringUtil.h" //Hacky class that fixes a really annoying cursor problem class AbstractTableScrollBar : public QScrollBar diff --git a/x64_dbg_gui/Project/Src/BasicView/Disassembly.cpp b/x64_dbg_gui/Project/Src/BasicView/Disassembly.cpp index 60d05ff7..c24b8dca 100644 --- a/x64_dbg_gui/Project/Src/BasicView/Disassembly.cpp +++ b/x64_dbg_gui/Project/Src/BasicView/Disassembly.cpp @@ -1480,7 +1480,7 @@ QString Disassembly::getAddrText(int_t cur_addr, char label[MAX_LABEL_SIZE]) #endif //_WIN64 } } - addrText += AddressToString(cur_addr); + addrText += QString("%1").arg(cur_addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper(); char label_[MAX_LABEL_SIZE] = ""; if(DbgGetLabelAt(cur_addr, SEG_DEFAULT, label_)) //has label { diff --git a/x64_dbg_gui/Project/Src/Gui/CPUDump.cpp b/x64_dbg_gui/Project/Src/Gui/CPUDump.cpp index c4a2d714..7f05567f 100644 --- a/x64_dbg_gui/Project/Src/Gui/CPUDump.cpp +++ b/x64_dbg_gui/Project/Src/Gui/CPUDump.cpp @@ -404,7 +404,7 @@ QString CPUDump::paintContent(QPainter* painter, int_t rowBase, int rowOffset, i #endif //_WIN64 } } - addrText += AddressToString(cur_addr); + addrText += QString("%1").arg(cur_addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper(); if(DbgGetLabelAt(cur_addr, SEG_DEFAULT, label)) //has label { char module[MAX_MODULE_SIZE] = ""; diff --git a/x64_dbg_gui/Project/Src/Gui/CPUInfoBox.cpp b/x64_dbg_gui/Project/Src/Gui/CPUInfoBox.cpp index 6cde593b..7d033177 100644 --- a/x64_dbg_gui/Project/Src/Gui/CPUInfoBox.cpp +++ b/x64_dbg_gui/Project/Src/Gui/CPUInfoBox.cpp @@ -184,7 +184,7 @@ void CPUInfoBox::disasmSelectionChanged(int_t parVA) char section[MAX_SECTION_SIZE] = ""; if(DbgFunctions()->SectionFromAddr(parVA, section)) info += "\"" + QString(section) + "\":"; - info += AddressToString(parVA); + info += QString("%1").arg(parVA, sizeof(int_t) * 2, 16, QChar('0')).toUpper(); char label[MAX_LABEL_SIZE] = ""; if(DbgGetLabelAt(parVA, SEG_DEFAULT, label)) info += " <" + QString(label) + ">"; diff --git a/x64_dbg_gui/Project/Src/Gui/CPUStack.cpp b/x64_dbg_gui/Project/Src/Gui/CPUStack.cpp index d7d795ac..3041bd4d 100644 --- a/x64_dbg_gui/Project/Src/Gui/CPUStack.cpp +++ b/x64_dbg_gui/Project/Src/Gui/CPUStack.cpp @@ -224,7 +224,7 @@ QString CPUStack::paintContent(QPainter* painter, int_t rowBase, int rowOffset, #endif //_WIN64 } } - addrText += AddressToString(cur_addr); + addrText += QString("%1").arg(cur_addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper(); if(DbgGetLabelAt(cur_addr, SEG_DEFAULT, label)) //has label { char module[MAX_MODULE_SIZE] = ""; diff --git a/x64_dbg_gui/Project/Src/Gui/HexEditDialog.cpp b/x64_dbg_gui/Project/Src/Gui/HexEditDialog.cpp index 44e27f6d..9abd93d1 100644 --- a/x64_dbg_gui/Project/Src/Gui/HexEditDialog.cpp +++ b/x64_dbg_gui/Project/Src/Gui/HexEditDialog.cpp @@ -123,12 +123,12 @@ void HexEditDialog::dataChangedSlot() ui->lineEditUnicode->setText(unicode); } -void HexEditDialog::on_lineEditAscii_textEdited(const QString & arg1) +void HexEditDialog::on_lineEditAscii_textEdited(const QString &arg1) { on_btnAscii2Hex_clicked(); } -void HexEditDialog::on_lineEditUnicode_textEdited(const QString & arg1) +void HexEditDialog::on_lineEditUnicode_textEdited(const QString &arg1) { on_btnUnicode2Hex_clicked(); } diff --git a/x64_dbg_gui/Project/Src/Gui/HexEditDialog.h b/x64_dbg_gui/Project/Src/Gui/HexEditDialog.h index 8616abf3..13dd455f 100644 --- a/x64_dbg_gui/Project/Src/Gui/HexEditDialog.h +++ b/x64_dbg_gui/Project/Src/Gui/HexEditDialog.h @@ -28,8 +28,8 @@ private slots: void on_btnUnicode2Hex_clicked(); void on_chkKeepSize_toggled(bool checked); void dataChangedSlot(); - void on_lineEditAscii_textEdited(const QString & arg1); - void on_lineEditUnicode_textEdited(const QString & arg1); + void on_lineEditAscii_textEdited(const QString &arg1); + void on_lineEditUnicode_textEdited(const QString &arg1); private: Ui::HexEditDialog* ui; diff --git a/x64_dbg_gui/Project/Src/Gui/MemoryMapView.cpp b/x64_dbg_gui/Project/Src/Gui/MemoryMapView.cpp index 66328826..92ca43f2 100644 --- a/x64_dbg_gui/Project/Src/Gui/MemoryMapView.cpp +++ b/x64_dbg_gui/Project/Src/Gui/MemoryMapView.cpp @@ -20,7 +20,6 @@ MemoryMapView::MemoryMapView(StdTable* parent) : StdTable(parent) connect(Bridge::getBridge(), SIGNAL(updateMemory()), this, SLOT(refreshMap())); connect(Bridge::getBridge(), SIGNAL(dbgStateChanged(DBGSTATE)), this, SLOT(stateChangedSlot(DBGSTATE))); connect(this, SIGNAL(contextMenuSignal(QPoint)), this, SLOT(contextMenuSlot(QPoint))); - connect(this, SIGNAL(doubleClickedSignal()), this, SLOT(doubleClickedSlot())); setupContextMenu(); } @@ -147,11 +146,6 @@ void MemoryMapView::contextMenuSlot(const QPoint & pos) wMenu->exec(mapToGlobal(pos)); //execute context menu } -void MemoryMapView::doubleClickedSlot() -{ - followDisassemblerSlot(); -} - QString MemoryMapView::getProtectionString(DWORD Protect) { #define RIGHTS_STRING (sizeof("ERWCG") + 1) diff --git a/x64_dbg_gui/Project/Src/Gui/MemoryMapView.h b/x64_dbg_gui/Project/Src/Gui/MemoryMapView.h index 7c0847d6..1d7e4e37 100644 --- a/x64_dbg_gui/Project/Src/Gui/MemoryMapView.h +++ b/x64_dbg_gui/Project/Src/Gui/MemoryMapView.h @@ -28,7 +28,6 @@ public slots: void memoryRemoveSlot(); void memoryExecuteSingleshootToggleSlot(); void contextMenuSlot(const QPoint & pos); - void doubleClickedSlot(); void switchView(); void pageMemoryRights(); void refreshMap(); diff --git a/x64_dbg_gui/Project/Src/Gui/SymbolView.cpp b/x64_dbg_gui/Project/Src/Gui/SymbolView.cpp index 85edc9b3..8e96cb3e 100644 --- a/x64_dbg_gui/Project/Src/Gui/SymbolView.cpp +++ b/x64_dbg_gui/Project/Src/Gui/SymbolView.cpp @@ -199,10 +199,6 @@ void SymbolView::updateSymbolList(int module_count, SYMBOLMODULEINFO* modules) mModuleList->setCellContent(i, 1, modules[i].name); } mModuleList->reloadData(); - - // This BridgeFree call must remain here because of how arguments - // are passed; they are thread-thread delayed so passing a stack - // variable can not work. if(modules) BridgeFree(modules); } diff --git a/x64_dbg_gui/Project/Src/Gui/ThreadView.cpp b/x64_dbg_gui/Project/Src/Gui/ThreadView.cpp index 236b1c10..4266b420 100644 --- a/x64_dbg_gui/Project/Src/Gui/ThreadView.cpp +++ b/x64_dbg_gui/Project/Src/Gui/ThreadView.cpp @@ -223,7 +223,7 @@ void ThreadView::updateThreadList() setCellContent(i, 0, "Main"); else setCellContent(i, 0, QString("%1").arg(threadList.list[i].BasicInfo.ThreadNumber, 0, 10)); - setCellContent(i, 1, QString("%1").arg(threadList.list[i].BasicInfo.ThreadId, 0, 16).toUpper()); + setCellContent(i, 1, QString("%1").arg(threadList.list[i].BasicInfo.dwThreadId, 0, 16).toUpper()); setCellContent(i, 2, QString("%1").arg(threadList.list[i].BasicInfo.ThreadStartAddress, sizeof(int_t) * 2, 16, QChar('0')).toUpper()); setCellContent(i, 3, QString("%1").arg(threadList.list[i].BasicInfo.ThreadLocalBase, sizeof(int_t) * 2, 16, QChar('0')).toUpper()); setCellContent(i, 4, QString("%1").arg(threadList.list[i].ThreadCip, sizeof(int_t) * 2, 16, QChar('0')).toUpper()); diff --git a/x64_dbg_gui/Project/Src/Utils/StringUtil.h b/x64_dbg_gui/Project/Src/Utils/StringUtil.h deleted file mode 100644 index 6f27817d..00000000 --- a/x64_dbg_gui/Project/Src/Utils/StringUtil.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef STRINGUTIL_H -#define STRINGUTIL_H - -#include -#include "NewTypes.h" - -static QString AddressToString(int_t Address) -{ - // - // This function exists because of how QT handles - // variables in strings. - // - // QString::arg(): - // ((int32)0xFFFF0000) == 0xFFFFFFFFFFFF0000 with sign extension - // - char temp[32]; - -#ifdef _WIN64 - sprintf_s(temp, "%016llX", Address); -#else - sprintf_s(temp, "%08X", Address); -#endif // _WIN64 - - return QString(temp); -} - -#endif // STRINGUTIL_H diff --git a/x64_dbg_gui/Project/x64_dbg.pro b/x64_dbg_gui/Project/x64_dbg.pro index 314862a3..1af66de0 100644 --- a/x64_dbg_gui/Project/x64_dbg.pro +++ b/x64_dbg_gui/Project/x64_dbg.pro @@ -151,8 +151,7 @@ HEADERS += \ Src/Gui/PageMemoryRights.h \ Src/Gui/SelectFields.h \ Src/Gui/ReferenceManager.h \ - Src/Bridge/BridgeResult.h \ - Src/Utils/StringUtil.h + Src/Bridge/BridgeResult.h INCLUDEPATH += \ diff --git a/x64_dbg_launcher/x64_dbg_launcher.vcxproj b/x64_dbg_launcher/x64_dbg_launcher.vcxproj index b239d668..d64cf9bd 100644 --- a/x64_dbg_launcher/x64_dbg_launcher.vcxproj +++ b/x64_dbg_launcher/x64_dbg_launcher.vcxproj @@ -1,10 +1,6 @@  - - Debug - Win32 - Release Win32 @@ -27,12 +23,6 @@ Application false - v120 - - - Application - false - v120 @@ -40,9 +30,6 @@ - - - false @@ -51,13 +38,6 @@ x96_dbg false - - false - $(SolutionDir)bin\ - $(Platform)\$(Configuration)\ - x96_dbg - false - WIN32;NDEBUG;_WINDOWS;_USRDLL;X64_DBG_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) @@ -77,25 +57,6 @@ - - - WIN32;NDEBUG;_WINDOWS;_USRDLL;X64_DBG_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - MultiThreadedDLL - Level3 - ProgramDatabase - - - MachineX86 - true - Windows - true - true - shlwapi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - $(TargetDir)$(TargetName).pdb - - - -