-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSTATUS.cpp
More file actions
40 lines (36 loc) · 1.07 KB
/
STATUS.cpp
File metadata and controls
40 lines (36 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "STATUS.h"
#include "SrvUtils.h"
using namespace DrvLoader;
inline void DrvLoader::AppendErrInfo(PWSTR msg, DWORD errCode, PCWSTR end)
{
SrvUtils::errIter = SrvUtils::expected_err.find(errCode);
if (SrvUtils::errIter != SrvUtils::expected_err.end())
{
if (SrvUtils::errIter->first != ERROR_NO_MSG)
{
wcsapp(msg, MSG_BUF_SIZE, SrvUtils::errIter->second, end);
}
}
else
{
wcsapp(msg, MSG_BUF_SIZE, TEXT("未知错误。"), end);
}
}
STATUS::STATUS(DWORD exitCode, OPTIONAL PCWSTR msg)
{
this->exitCode = exitCode;
wcscpy_s(this->Msg, msg);
if (!this->Success())
{
AppendErrInfo(this->Msg, exitCode);
}
DebugLog("--------------------------------------------------------------\n");
DebugLog("STATUS constructed. Location: 0x%p\n", this);
DebugLog("--------------------------------------------------------------\n");
}
STATUS::~STATUS()
{
DebugLog("--------------------------------------------------------------\n");
DebugLog("STATUS destructed. Location: 0x%p\n", this);
DebugLog("--------------------------------------------------------------\n");
}