OLD | NEW |
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. |
11 #include <LMCons.h> // For UNLEN | 11 #include <LMCons.h> // For UNLEN |
12 | 12 |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/process_util.h" | 15 #include "base/process_util.h" |
16 #include "base/win/scoped_handle.h" | 16 #include "base/win/scoped_handle.h" |
17 #include "base/win/windows_version.h" | 17 #include "base/win/windows_version.h" |
18 #include "rlz/lib/assert.h" | 18 #include "rlz/lib/assert.h" |
19 #include "rlz/win/lib/vista_winnt.h" | |
20 | 19 |
21 namespace { | 20 namespace { |
22 | 21 |
23 HRESULT GetCurrentUser(std::wstring* name, | 22 HRESULT GetCurrentUser(std::wstring* name, |
24 std::wstring* domain, | 23 std::wstring* domain, |
25 std::wstring* sid) { | 24 std::wstring* sid) { |
26 DWORD err; | 25 DWORD err; |
27 | 26 |
28 // Get the current username & domain the hard way. (GetUserNameEx would be | 27 // Get the current username & domain the hard way. (GetUserNameEx would be |
29 // nice, but unfortunately requires connectivity to a domain controller. | 28 // nice, but unfortunately requires connectivity to a domain controller. |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 } | 186 } |
188 | 187 |
189 evaluated = true; | 188 evaluated = true; |
190 if (!has_rights) | 189 if (!has_rights) |
191 ASSERT_STRING("ProcessInfo::HasAdminRights: Does not have admin rights."); | 190 ASSERT_STRING("ProcessInfo::HasAdminRights: Does not have admin rights."); |
192 | 191 |
193 return has_rights; | 192 return has_rights; |
194 } | 193 } |
195 | 194 |
196 }; // namespace | 195 }; // namespace |
OLD | NEW |