diff options
author | ericu@google.com <ericu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-12 21:34:06 +0000 |
---|---|---|
committer | ericu@google.com <ericu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-12 21:34:06 +0000 |
commit | 35ddf48890db45eb94b113e98fd235561a8a68e4 (patch) | |
tree | 225b322a62c5926202a4935a901e879f04b44597 /sandbox/src/process_thread_policy.cc | |
parent | 3eae83e8b5899b30929d0007d04efa4494ff04bc (diff) | |
download | chromium_src-35ddf48890db45eb94b113e98fd235561a8a68e4.zip chromium_src-35ddf48890db45eb94b113e98fd235561a8a68e4.tar.gz chromium_src-35ddf48890db45eb94b113e98fd235561a8a68e4.tar.bz2 |
Revert 41481 - Secound round of sbox changes for 64 bit port
Handling pointer sized items
Beefing up unit tests
Beefing up integration tests
Enabling Process, Thread and Token IPCs
Making validation tests compile again
BUG=27218
TEST= unit tests included
Review URL: http://codereview.chromium.org/757001
TBR=cpu@chromium.org
Review URL: http://codereview.chromium.org/871008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41491 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox/src/process_thread_policy.cc')
-rw-r--r-- | sandbox/src/process_thread_policy.cc | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/sandbox/src/process_thread_policy.cc b/sandbox/src/process_thread_policy.cc index 7e4effb..3abd043 100644 --- a/sandbox/src/process_thread_policy.cc +++ b/sandbox/src/process_thread_policy.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -103,7 +103,7 @@ bool ProcessPolicy::GenerateRules(const wchar_t* name, NTSTATUS ProcessPolicy::OpenThreadAction(const ClientInfo& client_info, uint32 desired_access, uint32 thread_id, - HANDLE* handle) { + HANDLE *handle) { *handle = NULL; NtOpenThreadFunction NtOpenThread = NULL; @@ -135,7 +135,7 @@ NTSTATUS ProcessPolicy::OpenThreadAction(const ClientInfo& client_info, NTSTATUS ProcessPolicy::OpenProcessAction(const ClientInfo& client_info, uint32 desired_access, uint32 process_id, - HANDLE* handle) { + HANDLE *handle) { *handle = NULL; NtOpenProcessFunction NtOpenProcess = NULL; @@ -165,13 +165,16 @@ NTSTATUS ProcessPolicy::OpenProcessAction(const ClientInfo& client_info, } NTSTATUS ProcessPolicy::OpenProcessTokenAction(const ClientInfo& client_info, - HANDLE process, + uint32 process_requested, uint32 desired_access, - HANDLE* handle) { + HANDLE *handle) { *handle = NULL; + NtOpenProcessTokenFunction NtOpenProcessToken = NULL; ResolveNTFunctionPtr("NtOpenProcessToken", &NtOpenProcessToken); + HANDLE process = reinterpret_cast<HANDLE>( + static_cast<ULONG_PTR>(process_requested)); if (CURRENT_PROCESS != process) return STATUS_ACCESS_DENIED; @@ -186,18 +189,21 @@ NTSTATUS ProcessPolicy::OpenProcessTokenAction(const ClientInfo& client_info, return STATUS_ACCESS_DENIED; } } + return status; } NTSTATUS ProcessPolicy::OpenProcessTokenExAction(const ClientInfo& client_info, - HANDLE process, + uint32 process_requested, uint32 desired_access, uint32 attributes, - HANDLE* handle) { + HANDLE *handle) { *handle = NULL; NtOpenProcessTokenExFunction NtOpenProcessTokenEx = NULL; ResolveNTFunctionPtr("NtOpenProcessTokenEx", &NtOpenProcessTokenEx); + HANDLE process = reinterpret_cast<HANDLE>( + static_cast<ULONG_PTR>(process_requested)); if (CURRENT_PROCESS != process) return STATUS_ACCESS_DENIED; @@ -212,6 +218,7 @@ NTSTATUS ProcessPolicy::OpenProcessTokenExAction(const ClientInfo& client_info, return STATUS_ACCESS_DENIED; } } + return status; } |