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

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

Issue 1513043002: clang/win: Let remaining chromium_code targets build with -Wextra. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years 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
« no previous file with comments | « rlz/win/lib/machine_deal.cc ('k') | rlz/win/lib/rlz_value_store_registry.cc » ('j') | 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 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 *group = 0; 52 *group = 0;
53 53
54 // groups are listed in DECREASING order of importance 54 // groups are listed in DECREASING order of importance
55 // (eg. If a user is a member of both the admin group and 55 // (eg. If a user is a member of both the admin group and
56 // the power user group, it is more useful to list the user 56 // the power user group, it is more useful to list the user
57 // as an admin) 57 // as an admin)
58 DWORD user_groups[] = {DOMAIN_ALIAS_RID_ADMINS, 58 DWORD user_groups[] = {DOMAIN_ALIAS_RID_ADMINS,
59 DOMAIN_ALIAS_RID_POWER_USERS}; 59 DOMAIN_ALIAS_RID_POWER_USERS};
60 SID_IDENTIFIER_AUTHORITY nt_authority = {SECURITY_NT_AUTHORITY}; 60 SID_IDENTIFIER_AUTHORITY nt_authority = {SECURITY_NT_AUTHORITY};
61 61
62 for (int i = 0; i < arraysize(user_groups) && *group == 0; ++i) { 62 for (size_t i = 0; i < arraysize(user_groups) && *group == 0; ++i) {
63 PSID current_group; 63 PSID current_group;
64 if (AllocateAndInitializeSid(&nt_authority, 2, 64 if (AllocateAndInitializeSid(&nt_authority, 2,
65 SECURITY_BUILTIN_DOMAIN_RID, 65 SECURITY_BUILTIN_DOMAIN_RID,
66 user_groups[i], 0, 0, 0, 0, 66 user_groups[i], 0, 0, 0, 0,
67 0, 0, &current_group)) { 67 0, 0, &current_group)) {
68 BOOL current_level; 68 BOOL current_level;
69 if (CheckTokenMembership(NULL, current_group, &current_level) && 69 if (CheckTokenMembership(NULL, current_group, &current_level) &&
70 current_level) { 70 current_level) {
71 *group = user_groups[i]; 71 *group = user_groups[i];
72 } 72 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 } 115 }
116 116
117 evaluated = true; 117 evaluated = true;
118 if (!has_rights) 118 if (!has_rights)
119 ASSERT_STRING("ProcessInfo::HasAdminRights: Does not have admin rights."); 119 ASSERT_STRING("ProcessInfo::HasAdminRights: Does not have admin rights.");
120 120
121 return has_rights; 121 return has_rights;
122 } 122 }
123 123
124 }; // namespace 124 }; // namespace
OLDNEW
« no previous file with comments | « rlz/win/lib/machine_deal.cc ('k') | rlz/win/lib/rlz_value_store_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698