-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprocess.cpp
50 lines (41 loc) · 905 Bytes
/
process.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
#include "process.h"
#include "biosdate_wmi.h"
#include "disksn_wmi.h"
#include "disksn_ioctl.h"
#include "clipboard.h"
#include "log.h"
#ifdef _DEBUG
#include "walnut.h"
#endif
int process(const std::string& argument, std::string& result) {
std::string arg = argument;
int ret = 0;
result = "";
if (arg == "biosdt") {
get_bios_date_wmi(result);
}
else if (arg == "biosdt-wmi") {
get_bios_date_wmi(result);
}
else if (arg == "disksn") {
get_disk_sn_wmi(result);
}
else if (arg == "disksn-wmi") {
get_disk_sn_wmi(result);
}
else if (arg == "disksn-fast") {
get_disk_sn_ioctl(result);
}
else {
Log::print(L"Argomento non corretto");
return -1;
}
Clipboard::CopyToClipboard(result);
return 0;
}
#ifdef _DEBUG
__declspec(dllexport) int __stdcall walnut_process(const std::string& arg, std::string& result) {
walnut_initialize();
return process(arg, result);
}
#endif