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

Side by Side Diff: rlz/win/lib/process_info.cc

Issue 405123002: clang/win: Fix a Wenum-compare warning and a few Wwritable-strings warnings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « rlz/win/lib/process_info.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Information about the current process. 5 // Information about the current process.
6 6
7 #include "rlz/win/lib/process_info.h" 7 #include "rlz/win/lib/process_info.h"
8 8
9 #include <windows.h> 9 #include <windows.h>
10 #include <Sddl.h> // For ConvertSidToStringSid. 10 #include <Sddl.h> // For ConvertSidToStringSid.
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 if (!evaluated) { 165 if (!evaluated) {
166 if (IsRunningAsSystem()) { 166 if (IsRunningAsSystem()) {
167 has_rights = true; 167 has_rights = true;
168 } else if (base::win::GetVersion() >= base::win::VERSION_VISTA) { 168 } else if (base::win::GetVersion() >= base::win::VERSION_VISTA) {
169 TOKEN_ELEVATION_TYPE elevation; 169 TOKEN_ELEVATION_TYPE elevation;
170 base::IntegrityLevel level; 170 base::IntegrityLevel level;
171 171
172 if (SUCCEEDED(GetElevationType(&elevation)) && 172 if (SUCCEEDED(GetElevationType(&elevation)) &&
173 base::GetProcessIntegrityLevel(base::GetCurrentProcessHandle(), &level)) 173 base::GetProcessIntegrityLevel(base::GetCurrentProcessHandle(), &level))
174 has_rights = (elevation == TokenElevationTypeFull) || 174 has_rights = (elevation == TokenElevationTypeFull) ||
175 (level == HIGH_INTEGRITY); 175 (level == base::HIGH_INTEGRITY);
176 } else { 176 } else {
177 long group = 0; 177 long group = 0;
178 if (GetUserGroup(&group)) 178 if (GetUserGroup(&group))
179 has_rights = (group == DOMAIN_ALIAS_RID_ADMINS); 179 has_rights = (group == DOMAIN_ALIAS_RID_ADMINS);
180 } 180 }
181 } 181 }
182 182
183 evaluated = true; 183 evaluated = true;
184 if (!has_rights) 184 if (!has_rights)
185 ASSERT_STRING("ProcessInfo::HasAdminRights: Does not have admin rights."); 185 ASSERT_STRING("ProcessInfo::HasAdminRights: Does not have admin rights.");
186 186
187 return has_rights; 187 return has_rights;
188 } 188 }
189 189
190 }; // namespace 190 }; // namespace
OLDNEW
« no previous file with comments | « rlz/win/lib/process_info.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698