From c09a61db857990675454493a56141d1cdcac427c Mon Sep 17 00:00:00 2001 From: "alexeypa@chromium.org" Date: Sat, 3 Aug 2013 02:24:41 +0000 Subject: 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 --- remoting/base/scoped_reg_key_win.h | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 remoting/base/scoped_reg_key_win.h (limited to 'remoting/base') 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 + +#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_ -- cgit v1.1