#include <grpcpp/grpcpp.h>
#include "panoptes.grpc.pb.h"
#include "PanoptesPE.h"
Go to the source code of this file.
|
| std::unique_ptr< PanoptesService::Stub > | stub_ |
| |
◆ GetRegistryPortValue()
| bool GetRegistryPortValue |
( |
DWORD & |
portValue | ) |
|
Definition at line 10 of file service_client_pe.cpp.
10 {
11 HKEY hKey;
12 DWORD dwType = REG_DWORD;
14
15
16 LONG lResult = RegOpenKeyExA(
17 HKEY_LOCAL_MACHINE,
18 "SOFTWARE\\Panoptes",
19 0,
20 KEY_READ,
21 &hKey
22 );
23
24 if (lResult != ERROR_SUCCESS) {
25 std::cerr << "Error opening registry key. Error code: " << lResult << std::endl;
26 return false;
27 }
28
29
30 lResult = RegQueryValueExA(
31 hKey,
32 "SRV_PORT",
33 NULL,
34 &dwType,
35 reinterpret_cast<LPBYTE>(&portValue),
36 &dwSize
37 );
38
39 RegCloseKey(hKey);
40
41 if (lResult != ERROR_SUCCESS) {
42 std::cerr << "Error reading registry value. Error code: " << lResult << std::endl;
43 return false;
44 }
45
46 if (dwType != REG_DWORD) {
47 std::cerr << "Unexpected value type in registry." << std::endl;
48 return false;
49 }
50
51 return true;
52}
◆ stub_
| std::unique_ptr<PanoptesService::Stub> stub_ |