-
Notifications
You must be signed in to change notification settings - Fork 257
/
etw_settings.h
59 lines (50 loc) · 1.29 KB
/
etw_settings.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
51
52
53
54
55
56
57
58
59
#pragma once
#include <iostream>
struct ETWProfile {
public:
bool process_start;
bool img_load;
bool allocation;
bool tcpip;
bool obj_mgr;
ETWProfile(bool _process_start = false, bool _img_load = false, bool _allocation = false, bool _tcpip = false, bool _obj_mgr = false)
: process_start(_process_start), img_load(_img_load), allocation(_allocation), tcpip(_tcpip), obj_mgr(_obj_mgr)
{
}
bool initProfile(const std::string& fileName)
{
bool isOk = loadIni(fileName);
if (!isOk) {
setAll();
isOk = saveIni(fileName);
}
return isOk;
}
bool loadIni(const std::string& fileName);
bool saveIni(const std::string& fileName);
void setAll()
{
this->process_start = true;
this->img_load = true;
this->allocation = true;
this->tcpip = true;
this->obj_mgr = true;
}
bool isEnabled()
{
if (this->process_start
|| this->img_load
|| this->allocation
|| this->tcpip
|| this->obj_mgr
)
{
return true;
}
return false;
}
protected:
static const char DELIM;
bool fillSettings(std::string line);
void stripComments(std::string& str);
};