Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7538)

Unified Diff: chrome/installer/setup/setup_util_unittest.cc

Issue 71013004: Base: Remove Receive() from ScopedHandle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ScopedProcessInfo Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/installer/setup/setup_util_unittest.cc
diff --git a/chrome/installer/setup/setup_util_unittest.cc b/chrome/installer/setup/setup_util_unittest.cc
index 0391e3a3b03b410cbe116d4282b0dc085049b0e8..b7f2655d821dd6c1369311f50b46896073376c13 100644
--- a/chrome/installer/setup/setup_util_unittest.cc
+++ b/chrome/installer/setup/setup_util_unittest.cc
@@ -55,13 +55,16 @@ static const wchar_t kTestedPrivilege[] = SE_RESTORE_NAME;
// Returns true if the current process' token has privilege |privilege_name|
// enabled.
bool CurrentProcessHasPrivilege(const wchar_t* privilege_name) {
- base::win::ScopedHandle token;
+ HANDLE temp_handle;
if (!::OpenProcessToken(::GetCurrentProcess(), TOKEN_QUERY,
- token.Receive())) {
+ &temp_handle)) {
ADD_FAILURE();
return false;
}
+ base::win::ScopedHandle token;
+ token.Set(temp_handle);
+
// First get the size of the buffer needed for |privileges| below.
DWORD size;
EXPECT_FALSE(::GetTokenInformation(token, TokenPrivileges, NULL, 0, &size));

Powered by Google App Engine
This is Rietveld 408576698