OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "components/user_prefs/tracked/device_id.h" | 5 #include "services/preferences/tracked/device_id.h" |
6 | 6 |
7 #include <sddl.h> // For ConvertSidToStringSidA. | |
7 #include <windows.h> | 8 #include <windows.h> |
gab
2017/03/29 16:27:57
windows.h always goes first
Sam McNally
2017/03/30 02:23:23
Done.
| |
8 #include <sddl.h> // For ConvertSidToStringSidA. | |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 | 14 |
15 MachineIdStatus GetDeterministicMachineSpecificId(std::string* machine_id) { | 15 MachineIdStatus GetDeterministicMachineSpecificId(std::string* machine_id) { |
16 DCHECK(machine_id); | 16 DCHECK(machine_id); |
17 | 17 |
18 wchar_t computer_name[MAX_COMPUTERNAME_LENGTH + 1] = {}; | 18 wchar_t computer_name[MAX_COMPUTERNAME_LENGTH + 1] = {}; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
63 | 63 |
64 char* sid_string = nullptr; | 64 char* sid_string = nullptr; |
65 if (!::ConvertSidToStringSidA(sid, &sid_string)) | 65 if (!::ConvertSidToStringSidA(sid, &sid_string)) |
66 return MachineIdStatus::FAILURE; | 66 return MachineIdStatus::FAILURE; |
67 | 67 |
68 *machine_id = sid_string; | 68 *machine_id = sid_string; |
69 ::LocalFree(sid_string); | 69 ::LocalFree(sid_string); |
70 | 70 |
71 return MachineIdStatus::SUCCESS; | 71 return MachineIdStatus::SUCCESS; |
72 } | 72 } |
OLD | NEW |