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

Unified Diff: rlz/win/lib/process_info.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 | « cloud_print/virtual_driver/win/port_monitor/port_monitor_dll.cc ('k') | rlz/win/lib/registry_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: rlz/win/lib/process_info.cc
diff --git a/rlz/win/lib/process_info.cc b/rlz/win/lib/process_info.cc
index 4b83f384b3198fed3b1c06e36bbe12d824161d85..8fc5565a810c4f34218786a5ab98082e8f6c5738 100644
--- a/rlz/win/lib/process_info.cc
+++ b/rlz/win/lib/process_info.cc
@@ -9,7 +9,7 @@
#include <windows.h>
#include "base/memory/scoped_ptr.h"
-#include "base/process/process_handle.h"
+#include "base/process/process_info.h"
#include "base/strings/string16.h"
#include "base/win/scoped_handle.h"
#include "base/win/win_util.h"
@@ -100,12 +100,13 @@ bool ProcessInfo::HasAdminRights() {
has_rights = true;
} else if (base::win::GetVersion() >= base::win::VERSION_VISTA) {
TOKEN_ELEVATION_TYPE elevation;
- base::IntegrityLevel level;
-
- if (SUCCEEDED(GetElevationType(&elevation)) &&
- base::GetProcessIntegrityLevel(base::GetCurrentProcessHandle(), &level))
- has_rights = (elevation == TokenElevationTypeFull) ||
- (level == base::HIGH_INTEGRITY);
+ if (SUCCEEDED(GetElevationType(&elevation))) {
+ base::IntegrityLevel level = base::GetCurrentProcessIntegrityLevel();
+ if (level != base::INTEGRITY_UNKNOWN) {
+ has_rights = (elevation == TokenElevationTypeFull) ||
+ (level == base::HIGH_INTEGRITY);
+ }
+ }
} else {
long group = 0;
if (GetUserGroup(&group))
« no previous file with comments | « cloud_print/virtual_driver/win/port_monitor/port_monitor_dll.cc ('k') | rlz/win/lib/registry_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698