-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathPoolTagNote.cpp
68 lines (55 loc) · 1.69 KB
/
PoolTagNote.cpp
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include "stdafx.h"
#include "PoolTagNote.h"
namespace Sunstrider
{
PoolTagNote::PoolTagNote(__in ExtExtension* aExt)
{
aExt->m_Control->GetExtensionFunction(0,
"GetPoolTagDescription",
reinterpret_cast<FARPROC*>(&_GetPoolTagDescription));
}
auto PoolTagNote::get(__in ULONG aTag) const
-> std::string
{
auto vResult = std::string();
for (;;)
{
if (!_GetPoolTagDescription)
{
break;
}
DEBUG_POOLTAG_DESCRIPTION vTagInfo = { sizeof(vTagInfo) };
auto hr = _GetPoolTagDescription(aTag, &vTagInfo);
if (FAILED(hr))
{
break;
}
char vDesc[400] = {};
if (vTagInfo.Description[0])
{
hr = StringCbPrintfA(vDesc, sizeof(vDesc),
" Pooltag %4.4s : %s", (char*)&aTag, vTagInfo.Description);
}
else
{
hr = StringCbPrintfA(vDesc, sizeof(vDesc),
" Pooltag %4.4s : Unknown", (char*)&aTag);
}
char vBinary[100] = {};
if (vTagInfo.Binary[0])
{
hr = StringCbPrintfA(vBinary, sizeof(vBinary),
", Binary : %s", vTagInfo.Binary);
}
char vOwner[100] = {};
if (vTagInfo.Owner[0])
{
hr = StringCbPrintfA(vOwner, sizeof(vOwner),
", Owner : %s", vTagInfo.Owner);
}
vResult = vDesc + std::string(vBinary) + vOwner;
break;
}
return std::move(vResult);
}
}