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

Unified Diff: rlz/win/lib/registry_util.cc

Issue 921913002: Move GetProcessIntegrityLevel to file_info.h and remove the handle argument. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix cast Created 5 years, 10 months 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
« no previous file with comments | « rlz/win/lib/process_info.cc ('k') | win8/delegate_execute/command_execute_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: rlz/win/lib/registry_util.cc
diff --git a/rlz/win/lib/registry_util.cc b/rlz/win/lib/registry_util.cc
index 61197d2239f17c6e13f175adfdd253e8e25e7338..8fba7dd47aa2f3b14368d62705786091154b5f76 100644
--- a/rlz/win/lib/registry_util.cc
+++ b/rlz/win/lib/registry_util.cc
@@ -7,7 +7,7 @@
#include "rlz/win/lib/registry_util.h"
-#include "base/process/process_handle.h"
+#include "base/process/process_info.h"
#include "base/strings/utf_string_conversions.h"
#include "base/win/registry.h"
#include "base/win/windows_version.h"
@@ -58,15 +58,10 @@ bool HasUserKeyAccess(bool write_access) {
}
if (write_access) {
- if (base::win::GetVersion() < base::win::VERSION_VISTA) return true;
- base::ProcessHandle process_handle = base::GetCurrentProcessHandle();
- base::IntegrityLevel level = base::INTEGRITY_UNKNOWN;
+ if (base::win::GetVersion() < base::win::VERSION_VISTA)
+ return true;
- if (!base::GetProcessIntegrityLevel(process_handle, &level)) {
- ASSERT_STRING("UserKey::HasAccess: Cannot determine Integrity Level.");
- return false;
- }
- if (level <= base::LOW_INTEGRITY) {
+ if (base::GetCurrentProcessIntegrityLevel() <= base::LOW_INTEGRITY) {
ASSERT_STRING("UserKey::HasAccess: Cannot write from Low Integrity.");
return false;
}
« no previous file with comments | « rlz/win/lib/process_info.cc ('k') | win8/delegate_execute/command_execute_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698