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

Unified Diff: sandbox/win/src/sandbox_nt_util.cc

Issue 84063004: Restructure sandbox code to reduce dependencies pulled in by intercept code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix presubmit warning. Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/win/src/sandbox_nt_util.h ('k') | sandbox/win/src/sandbox_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/win/src/sandbox_nt_util.cc
diff --git a/sandbox/win/src/sandbox_nt_util.cc b/sandbox/win/src/sandbox_nt_util.cc
index 71314611283e85057964617b191b3514f18b964e..613d4859dd7488fe77bdec3707fc79cdb6e53a43 100644
--- a/sandbox/win/src/sandbox_nt_util.cc
+++ b/sandbox/win/src/sandbox_nt_util.cc
@@ -11,7 +11,7 @@
namespace sandbox {
// This is the list of all imported symbols from ntdll.dll.
-SANDBOX_INTERCEPT NtExports g_nt = { NULL };
+SANDBOX_INTERCEPT NtExports g_nt;
} // namespace sandbox
@@ -208,15 +208,7 @@ bool ValidParameter(void* buffer, size_t size, RequiredAccess intent) {
NTSTATUS CopyData(void* destination, const void* source, size_t bytes) {
NTSTATUS ret = STATUS_SUCCESS;
__try {
- if (SandboxFactory::GetTargetServices()->GetState()->InitCalled()) {
- memcpy(destination, source, bytes);
- } else {
- const char* from = reinterpret_cast<const char*>(source);
- char* to = reinterpret_cast<char*>(destination);
- for (size_t i = 0; i < bytes; i++) {
- to[i] = from[i];
- }
- }
+ g_nt.memcpy(destination, source, bytes);
} __except(EXCEPTION_EXECUTE_HANDLER) {
ret = GetExceptionCode();
}
« no previous file with comments | « sandbox/win/src/sandbox_nt_util.h ('k') | sandbox/win/src/sandbox_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698