summaryrefslogtreecommitdiffstats
path: root/sandbox/src/sandbox_policy_base.cc
diff options
context:
space:
mode:
authorcpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-03 03:26:54 +0000
committercpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-03 03:26:54 +0000
commitbbf2f954ea4b583dd223a1729d0dec9e6d0284c1 (patch)
treeb7f69746e8f30889d4823bdb7df409eecf957d19 /sandbox/src/sandbox_policy_base.cc
parent42ff2c813339961af8e09a372979a7bf7be77a5d (diff)
downloadchromium_src-bbf2f954ea4b583dd223a1729d0dec9e6d0284c1.zip
chromium_src-bbf2f954ea4b583dd223a1729d0dec9e6d0284c1.tar.gz
chromium_src-bbf2f954ea4b583dd223a1729d0dec9e6d0284c1.tar.bz2
Porting sbox IPC to 64 bit
-IPC unit tests enabled -Integration IPCTest test enabled -All unit test pass (62 tests) Other tests require interceptor fu. BUG=27218 TEST= unit tests included Review URL: http://codereview.chromium.org/661299 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40485 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox/src/sandbox_policy_base.cc')
-rw-r--r--sandbox/src/sandbox_policy_base.cc18
1 files changed, 6 insertions, 12 deletions
diff --git a/sandbox/src/sandbox_policy_base.cc b/sandbox/src/sandbox_policy_base.cc
index 868c841..d47d5921 100644
--- a/sandbox/src/sandbox_policy_base.cc
+++ b/sandbox/src/sandbox_policy_base.cc
@@ -72,7 +72,7 @@ PolicyBase::PolicyBase()
memset(&ipc_targets_, NULL, sizeof(ipc_targets_));
Dispatcher* dispatcher = NULL;
#if !defined(_WIN64)
- // Bug 27218: We don't have IPC yet.
+ // Bug 27218: We don't have dispatch for some x64 syscalls.
dispatcher = new FilesystemDispatcher(this);
ipc_targets_[IPC_NTCREATEFILE_TAG] = dispatcher;
ipc_targets_[IPC_NTOPENFILE_TAG] = dispatcher;
@@ -103,7 +103,7 @@ PolicyBase::~PolicyBase() {
delete target;
}
#if !defined(_WIN64)
- // Bug 27218: We don't have IPC yet.
+ // Bug 27218: We don't have dispatch for some x64 syscalls.
delete ipc_targets_[IPC_NTCREATEFILE_TAG];
delete ipc_targets_[IPC_NTOPENTHREAD_TAG];
delete ipc_targets_[IPC_CREATENAMEDPIPEW_TAG];
@@ -111,8 +111,8 @@ PolicyBase::~PolicyBase() {
delete ipc_targets_[IPC_NTCREATEKEY_TAG];
delete policy_maker_;
delete policy_;
- ::DeleteCriticalSection(&lock_);
#endif
+ ::DeleteCriticalSection(&lock_);
}
DWORD PolicyBase::MakeJobObject(HANDLE* job) {
@@ -393,21 +393,15 @@ bool PolicyBase::SetupService(InterceptionManager* manager, int service) {
// IPC subsystem. We receive a integer cookie and we are expected to return the
// cookie times two (or three) and the current tick count.
bool PolicyBase::Ping(IPCInfo* ipc, void* arg1) {
- uint32 tag = ipc->ipc_tag;
-
- switch (tag) {
-#ifndef _WIN64 // TODO(gregoryd): To build this code for 64-bits Windows we
- // need to make sure IPC is fully ported to Win64.
+ switch (ipc->ipc_tag) {
case IPC_PING1_TAG: {
- uint32 cookie = bit_cast<uint32>(arg1);
- COMPILE_ASSERT(sizeof(cookie) == sizeof(arg1), breaks_with_64_bit);
-
+ IPCInt ipc_int(arg1);
+ uint32 cookie = ipc_int.As32Bit();
ipc->return_info.extended_count = 2;
ipc->return_info.extended[0].unsigned_int = ::GetTickCount();
ipc->return_info.extended[1].unsigned_int = 2 * cookie;
return true;
}
-#endif
case IPC_PING2_TAG: {
CountedBuffer* io_buffer = reinterpret_cast<CountedBuffer*>(arg1);
if (sizeof(uint32) != io_buffer->Size())