summaryrefslogtreecommitdiffstats
path: root/src/common/registry_win32.h
diff options
context:
space:
mode:
authorLucian Petrut <lpetrut@cloudbasesolutions.com>2020-04-30 09:06:38 +0200
committerLucian Petrut <lpetrut@cloudbasesolutions.com>2020-11-18 10:23:43 +0100
commit32b33f372b8df262fc9aed1525e05cf3f6c79ccd (patch)
treef6679ed8c53486a3eabbe5bf44adfe4f0fbe8767 /src/common/registry_win32.h
parentcommon: Add win32_strerror and errno_to_ntstatus (diff)
downloadceph-32b33f372b8df262fc9aed1525e05cf3f6c79ccd.tar.xz
ceph-32b33f372b8df262fc9aed1525e05cf3f6c79ccd.zip
common: Add Windows registry key utils
We'll add some helpers facilitating Windows registry key operations. Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com> Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Diffstat (limited to '')
-rw-r--r--src/common/registry_win32.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/common/registry_win32.h b/src/common/registry_win32.h
new file mode 100644
index 00000000000..974d662de2d
--- /dev/null
+++ b/src/common/registry_win32.h
@@ -0,0 +1,37 @@
+/*
+ * Ceph - scalable distributed file system
+ *
+ * Copyright (C) 2019 SUSE LINUX GmbH
+ *
+ * This is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software
+ * Foundation. See file COPYING.
+ *
+ */
+
+#include "include/compat.h"
+#include "common/ceph_context.h"
+
+
+class RegistryKey {
+public:
+ RegistryKey(CephContext *cct_, HKEY hRootKey, LPCTSTR strKey, bool create_value);
+ ~RegistryKey();
+
+ static remove(CephContext *cct_, HKEY hRootKey, LPCTSTR strKey);
+
+ int flush();
+
+ int set(LPCTSTR lpValue, DWORD data);
+ int set(LPCTSTR lpValue, std::string data);
+
+ int get(LPCTSTR lpValue, DWORD* value);
+ int get(LPCTSTR lpValue, std::string& value);
+
+ HKEY hKey = NULL;
+ bool missingKey = false;
+
+private:
+ CephContext *cct;
+};