-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathHardwareID.h
50 lines (38 loc) · 1.22 KB
/
HardwareID.h
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
#pragma once
#include "StdAfx.h"
#define MAX_NAME 256
class HardwareID
{
bool m_bDataExported = false;
//Need to pull this out and put it in it's own hardware retrieval class
//LPHW_PROFILE_INFOA lpHwProfileInfo = { 0 }; // why did this work??
char userName[UNLEN + 1] = { 0 };
DWORD userNameSize;
char computerName[UNLEN + 1] = { 0 };
DWORD computerNameSize;
HW_PROFILE_INFO hwProfileInfo{ 0 };
char* m_pMac;
//all of the following are used for the SID
PSID m_pSID = NULL;
SID_NAME_USE m_SIDType;
char lpDomain[MAX_NAME];
DWORD i, dwSize = 0, dwResult = 0;
void GetUserAndComputerName();
char* GetMAC();
void GetMachineSID();
void CreateJSON();
public:
//HardwareID() : m_pMac("") {};
HardwareID() {
GetUserAndComputerName();
::GetCurrentHwProfile(&hwProfileInfo);
m_pMac = GetMAC();
GetMachineSID();
CreateJSON();
}
~HardwareID() {
free(m_pMac);
}
void ExportData(string path = ".\\SysLat_Logs");
Json::Value HardwareIDJSON;
};