1
0
Fork 0

DBG: added EnumExceptions

This commit is contained in:
mrexodia 2017-08-13 16:23:59 +02:00
parent 864437cc5f
commit 0cd8078256
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
4 changed files with 29 additions and 0 deletions

View File

@ -336,6 +336,12 @@ static void _enumerrorcodes(ListOf(CONSTANTINFO) errorcodes)
BridgeList<CONSTANTINFO>::CopyData(errorcodes, errorcodesV);
}
static void _enumexceptions(ListOf(CONSTANTINFO) exceptions)
{
auto exceptionsV = ExceptionList();
BridgeList<CONSTANTINFO>::CopyData(exceptions, exceptionsV);
}
void dbgfunctionsinit()
{
_dbgfunctions.AssembleAtEx = _assembleatex;
@ -401,4 +407,5 @@ void dbgfunctionsinit()
_dbgfunctions.GetUserComment = CommentGet;
_dbgfunctions.EnumConstants = _enumconstants;
_dbgfunctions.EnumErrorCodes = _enumerrorcodes;
_dbgfunctions.EnumExceptions = _enumexceptions;
}

View File

@ -252,6 +252,7 @@ typedef struct DBGFUNCTIONS_
GETUSERCOMMENT GetUserComment;
ENUMCONSTANTS EnumConstants;
ENUMCONSTANTS EnumErrorCodes;
ENUMCONSTANTS EnumExceptions;
} DBGFUNCTIONS;
#ifdef BUILD_DBG

View File

@ -133,6 +133,26 @@ const String & ExceptionCodeToName(unsigned int ExceptionCode)
return name;
}
std::vector<CONSTANTINFO> ExceptionList()
{
std::vector<CONSTANTINFO> result;
for(auto it = ExceptionNames.begin(); it != ExceptionNames.end(); ++it)
{
CONSTANTINFO info;
info.name = it->second.c_str();
info.value = it->first;
result.push_back(info);
}
for(auto it = NtStatusNames.begin(); it != NtStatusNames.end(); ++it)
{
CONSTANTINFO info;
info.name = it->second.c_str();
info.value = it->first;
result.push_back(info);
}
return result;
}
const String & NtStatusCodeToName(unsigned int NtStatusCode)
{
bool success;

View File

@ -9,6 +9,7 @@
bool ExceptionCodeInit(const String & exceptionFile);
const String & ExceptionCodeToName(unsigned int ExceptionCode);
std::vector<CONSTANTINFO> ExceptionList();
bool NtStatusCodeInit(const String & ntStatusFile);
const String & NtStatusCodeToName(unsigned int NtStatusCode);
bool ErrorCodeInit(const String & errorFile);