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 "sandbox/win/src/restricted_token.h" | 5 #include "sandbox/win/src/restricted_token.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 } | 29 } |
30 | 30 |
31 scoped_ptr<BYTE[]> buffer(new BYTE[size]); | 31 scoped_ptr<BYTE[]> buffer(new BYTE[size]); |
32 if (!::GetTokenInformation(token.Get(), info_class, buffer.get(), size, | 32 if (!::GetTokenInformation(token.Get(), info_class, buffer.get(), size, |
33 &size)) { | 33 &size)) { |
34 *error = ::GetLastError(); | 34 *error = ::GetLastError(); |
35 return nullptr; | 35 return nullptr; |
36 } | 36 } |
37 | 37 |
38 *error = ERROR_SUCCESS; | 38 *error = ERROR_SUCCESS; |
39 return buffer.Pass(); | 39 return buffer; |
40 } | 40 } |
41 | 41 |
42 } // namespace | 42 } // namespace |
43 | 43 |
44 namespace sandbox { | 44 namespace sandbox { |
45 | 45 |
46 RestrictedToken::RestrictedToken() | 46 RestrictedToken::RestrictedToken() |
47 : integrity_level_(INTEGRITY_LEVEL_LAST), | 47 : integrity_level_(INTEGRITY_LEVEL_LAST), |
48 init_(false) { | 48 init_(false) { |
49 } | 49 } |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 | 416 |
417 return ERROR_SUCCESS; | 417 return ERROR_SUCCESS; |
418 } | 418 } |
419 | 419 |
420 DWORD RestrictedToken::SetIntegrityLevel(IntegrityLevel integrity_level) { | 420 DWORD RestrictedToken::SetIntegrityLevel(IntegrityLevel integrity_level) { |
421 integrity_level_ = integrity_level; | 421 integrity_level_ = integrity_level; |
422 return ERROR_SUCCESS; | 422 return ERROR_SUCCESS; |
423 } | 423 } |
424 | 424 |
425 } // namespace sandbox | 425 } // namespace sandbox |
OLD | NEW |