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

Side by Side Diff: sandbox/win/src/restricted_token_utils.cc

Issue 10783004: Move Windows Sandbox, trybots version (don't commit me!) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to top of tree Created 8 years, 5 months 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 | Annotate | Revision Log
« no previous file with comments | « sandbox/win/src/restricted_token_utils.h ('k') | sandbox/win/src/sandbox.h » ('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 #include <aclapi.h> 5 #include <aclapi.h>
6 #include <sddl.h> 6 #include <sddl.h>
7 #include <vector> 7 #include <vector>
8 8
9 #include "sandbox/src/restricted_token_utils.h" 9 #include "sandbox/win/src/restricted_token_utils.h"
10 10
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/win/scoped_handle.h" 12 #include "base/win/scoped_handle.h"
13 #include "base/win/scoped_process_information.h" 13 #include "base/win/scoped_process_information.h"
14 #include "base/win/windows_version.h" 14 #include "base/win/windows_version.h"
15 #include "sandbox/src/job.h" 15 #include "sandbox/win/src/job.h"
16 #include "sandbox/src/restricted_token.h" 16 #include "sandbox/win/src/restricted_token.h"
17 #include "sandbox/src/security_level.h" 17 #include "sandbox/win/src/security_level.h"
18 #include "sandbox/src/sid.h" 18 #include "sandbox/win/src/sid.h"
19 19
20 namespace sandbox { 20 namespace sandbox {
21 21
22 DWORD CreateRestrictedToken(HANDLE *token_handle, 22 DWORD CreateRestrictedToken(HANDLE *token_handle,
23 TokenLevel security_level, 23 TokenLevel security_level,
24 IntegrityLevel integrity_level, 24 IntegrityLevel integrity_level,
25 TokenType token_type) { 25 TokenType token_type) {
26 if (!token_handle) 26 if (!token_handle)
27 return ERROR_BAD_ARGUMENTS; 27 return ERROR_BAD_ARGUMENTS;
28 28
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 if (!::OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_DEFAULT, 335 if (!::OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_DEFAULT,
336 &token_handle)) 336 &token_handle))
337 return ::GetLastError(); 337 return ::GetLastError();
338 338
339 base::win::ScopedHandle token(token_handle); 339 base::win::ScopedHandle token(token_handle);
340 340
341 return SetTokenIntegrityLevel(token.Get(), integrity_level); 341 return SetTokenIntegrityLevel(token.Get(), integrity_level);
342 } 342 }
343 343
344 } // namespace sandbox 344 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/win/src/restricted_token_utils.h ('k') | sandbox/win/src/sandbox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698