summaryrefslogtreecommitdiffstats
path: root/remoting/base
diff options
context:
space:
mode:
authoralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-03 02:24:41 +0000
committeralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-03 02:24:41 +0000
commitc09a61db857990675454493a56141d1cdcac427c (patch)
treee7e97ca8cefe9f95e519304fe4ba68d0513441f2 /remoting/base
parent14689246fd04d424204bc1ced1cf20a3bd569427 (diff)
downloadchromium_src-c09a61db857990675454493a56141d1cdcac427c.zip
chromium_src-c09a61db857990675454493a56141d1cdcac427c.tar.gz
chromium_src-c09a61db857990675454493a56141d1cdcac427c.tar.bz2
Implemented a pairing registry delegate that stores the pairings in the Windows registry.
The delegate supports two different keys for storing privileged (the shared secret) and unprivileged data (the rest of the fields). BUG=156182 Review URL: https://chromiumcodereview.appspot.com/21641002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215461 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/base')
-rw-r--r--remoting/base/scoped_reg_key_win.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/remoting/base/scoped_reg_key_win.h b/remoting/base/scoped_reg_key_win.h
new file mode 100644
index 0000000..c68b99f
--- /dev/null
+++ b/remoting/base/scoped_reg_key_win.h
@@ -0,0 +1,42 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_BASE_SCOPED_REG_KEY_WIN_H_
+#define REMOTING_BASE_SCOPED_REG_KEY_WIN_H_
+
+#include <windows.h>
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/win/scoped_handle.h"
+
+namespace remoting {
+
+// The traits class for Win32 registry handles.
+class RegKeyTraits {
+ public:
+ typedef HKEY Handle;
+
+ static bool CloseHandle(HKEY handle) {
+ return RegCloseKey(handle) == ERROR_SUCCESS;
+ }
+
+ static bool IsHandleValid(HKEY handle) {
+ return handle != NULL;
+ }
+
+ static HKEY NullHandle() {
+ return NULL;
+ }
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(RegKeyTraits);
+};
+
+typedef base::win::GenericScopedHandle<
+ RegKeyTraits, base::win::DummyVerifierTraits> ScopedRegKey;
+
+} // namespace remoting
+
+#endif // REMOTING_BASE_SCOPED_REG_KEY_WIN_H_