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