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 #include "cloud_print/service/win/local_security_policy.h" | 5 #include "cloud_print/service/win/local_security_policy.h" |
6 | 6 |
7 #include <atlsecurity.h> | 7 #include <atlsecurity.h> |
8 #include <ntsecapi.h> | 8 #include <ntsecapi.h> |
9 #include <windows.h> | 9 #include <windows.h> |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/string_util.h" | 12 #include "base/strings/string_util.h" |
13 | 13 |
14 const wchar_t kSeServiceLogonRight[] = L"SeServiceLogonRight"; | 14 const wchar_t kSeServiceLogonRight[] = L"SeServiceLogonRight"; |
15 | 15 |
16 #ifndef STATUS_SUCCESS | 16 #ifndef STATUS_SUCCESS |
17 #define STATUS_SUCCESS ((NTSTATUS)0x00000000L) | 17 #define STATUS_SUCCESS ((NTSTATUS)0x00000000L) |
18 #endif | 18 #endif |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 template<class T> | 22 template<class T> |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 privilege_string.Buffer = &privilage_copy[0]; | 110 privilege_string.Buffer = &privilage_copy[0]; |
111 privilege_string.Length = wcslen(privilege_string.Buffer) * | 111 privilege_string.Length = wcslen(privilege_string.Buffer) * |
112 sizeof(privilege_string.Buffer[0]); | 112 sizeof(privilege_string.Buffer[0]); |
113 privilege_string.MaximumLength = privilege_string.Length + | 113 privilege_string.MaximumLength = privilege_string.Length + |
114 sizeof(privilege_string.Buffer[0]); | 114 sizeof(privilege_string.Buffer[0]); |
115 return STATUS_SUCCESS == | 115 return STATUS_SUCCESS == |
116 ::LsaAddAccountRights(policy_, const_cast<SID*>(user_sid.GetPSID()), | 116 ::LsaAddAccountRights(policy_, const_cast<SID*>(user_sid.GetPSID()), |
117 &privilege_string, 1); | 117 &privilege_string, 1); |
118 } | 118 } |
119 | 119 |
OLD | NEW |