summaryrefslogtreecommitdiffstats
path: root/remoting/host/pairing_registry_delegate_win.cc
diff options
context:
space:
mode:
authorweitaosu@chromium.org <weitaosu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-15 08:20:58 +0000
committerweitaosu@chromium.org <weitaosu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-15 08:20:58 +0000
commit5a50d5dd3d5491619cb5035862fa364f576f0a24 (patch)
treeabe6e97a4460af9ce628a67b43503b968f5a1abb /remoting/host/pairing_registry_delegate_win.cc
parentbccf5ab99c7f5dcb14afa20eb4c095ca2512c9b6 (diff)
downloadchromium_src-5a50d5dd3d5491619cb5035862fa364f576f0a24.zip
chromium_src-5a50d5dd3d5491619cb5035862fa364f576f0a24.tar.gz
chromium_src-5a50d5dd3d5491619cb5035862fa364f576f0a24.tar.bz2
Clear the secrets reg key as well as the clients reg key in clearPairedClients.
BUG=325567 Review URL: https://codereview.chromium.org/164183009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251558 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/pairing_registry_delegate_win.cc')
-rw-r--r--remoting/host/pairing_registry_delegate_win.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/remoting/host/pairing_registry_delegate_win.cc b/remoting/host/pairing_registry_delegate_win.cc
index 1d7ad31..b4b89b2 100644
--- a/remoting/host/pairing_registry_delegate_win.cc
+++ b/remoting/host/pairing_registry_delegate_win.cc
@@ -149,6 +149,8 @@ bool PairingRegistryDelegateWin::DeleteAll() {
return false;
}
+ // Enumerate and delete the values in the privileged and unprivileged keys
+ // separately in case they get out of sync.
bool success = true;
DWORD count = unprivileged_.GetValueCount();
while (count > 0) {
@@ -162,6 +164,18 @@ bool PairingRegistryDelegateWin::DeleteAll() {
count = unprivileged_.GetValueCount();
}
+ count = privileged_.GetValueCount();
+ while (count > 0) {
+ // presubmit: allow wstring
+ std::wstring value_name;
+ LONG result = privileged_.GetValueNameAt(0, &value_name);
+ if (result == ERROR_SUCCESS)
+ result = privileged_.DeleteValue(value_name.c_str());
+
+ success = success && (result == ERROR_SUCCESS);
+ count = privileged_.GetValueCount();
+ }
+
return success;
}