summaryrefslogtreecommitdiffstats
path: root/sandbox/src/eat_resolver.cc
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-10 22:37:16 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-10 22:37:16 +0000
commit9420c240cd8428c63530675e25e97702a007a848 (patch)
tree2915461707676a6074a8f384acfa8f1082ab7458 /sandbox/src/eat_resolver.cc
parente603d9502bf6f6a5f0887bc0e0feeb8925d0296e (diff)
downloadchromium_src-9420c240cd8428c63530675e25e97702a007a848.zip
chromium_src-9420c240cd8428c63530675e25e97702a007a848.tar.gz
chromium_src-9420c240cd8428c63530675e25e97702a007a848.tar.bz2
Sandbox: Add support for EAT interceptions in 64 bit.
BUG=27218 TEST=manual integration tests. Review URL: http://codereview.chromium.org/600035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38681 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox/src/eat_resolver.cc')
-rw-r--r--sandbox/src/eat_resolver.cc19
1 files changed, 17 insertions, 2 deletions
diff --git a/sandbox/src/eat_resolver.cc b/sandbox/src/eat_resolver.cc
index 89d8c94..d4f6e83 100644
--- a/sandbox/src/eat_resolver.cc
+++ b/sandbox/src/eat_resolver.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2010 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.
@@ -26,6 +26,17 @@ NTSTATUS EatResolverThunk::Setup(const void* target_module,
if (!eat_entry_)
return STATUS_INVALID_PARAMETER;
+ size_t thunk_bytes = GetInternalThunkSize();
+
+#if defined(_WIN64)
+ // We have two thunks, in order: the return path and the forward path.
+ if (!SetInternalThunk(thunk_storage, storage_bytes, NULL, target_))
+ return STATUS_BUFFER_TOO_SMALL;
+
+ storage_bytes -= thunk_bytes;
+ thunk_storage = reinterpret_cast<char*>(thunk_storage) + thunk_bytes;
+#endif
+
if (!SetInternalThunk(thunk_storage, storage_bytes, target_, interceptor_))
return STATUS_BUFFER_TOO_SMALL;
@@ -41,7 +52,7 @@ NTSTATUS EatResolverThunk::Setup(const void* target_module,
#pragma warning(pop)
if (NULL != storage_used)
- *storage_used = GetInternalThunkSize();
+ *storage_used = GetThunkSize();
return ret;
}
@@ -68,7 +79,11 @@ NTSTATUS EatResolverThunk::ResolveTarget(const void* module,
}
size_t EatResolverThunk::GetThunkSize() const {
+#if defined(_WIN64)
+ return GetInternalThunkSize() * 2;
+#else
return GetInternalThunkSize();
+#endif
}
} // namespace sandbox