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

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

Issue 544333002: Remove NT_PLACE, it's not really used. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 6 years, 3 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
« no previous file with comments | « sandbox/win/src/resolver_32.cc ('k') | sandbox/win/src/sandbox_nt_types.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) 2006-2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2010 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 "sandbox/win/src/resolver.h" 5 #include "sandbox/win/src/resolver.h"
6 6
7 // For placement new. This file must not depend on the CRT at runtime, but
8 // placement operator new is inline.
9 #include <new>
10
7 #include "sandbox/win/src/sandbox_nt_util.h" 11 #include "sandbox/win/src/sandbox_nt_util.h"
8 12
9 namespace { 13 namespace {
10 14
11 const BYTE kPushRax = 0x50; 15 const BYTE kPushRax = 0x50;
12 const USHORT kMovRax = 0xB848; 16 const USHORT kMovRax = 0xB848;
13 const ULONG kMovRspRax = 0x24048948; 17 const ULONG kMovRspRax = 0x24048948;
14 const BYTE kRetNp = 0xC3; 18 const BYTE kRetNp = 0xC3;
15 19
16 #pragma pack(push, 1) 20 #pragma pack(push, 1)
(...skipping 29 matching lines...) Expand all
46 size_t ResolverThunk::GetInternalThunkSize() const { 50 size_t ResolverThunk::GetInternalThunkSize() const {
47 return sizeof(InternalThunk); 51 return sizeof(InternalThunk);
48 } 52 }
49 53
50 bool ResolverThunk::SetInternalThunk(void* storage, size_t storage_bytes, 54 bool ResolverThunk::SetInternalThunk(void* storage, size_t storage_bytes,
51 const void* original_function, 55 const void* original_function,
52 const void* interceptor) { 56 const void* interceptor) {
53 if (storage_bytes < sizeof(InternalThunk)) 57 if (storage_bytes < sizeof(InternalThunk))
54 return false; 58 return false;
55 59
56 InternalThunk* thunk = new(storage, NT_PLACE) InternalThunk; 60 InternalThunk* thunk = new(storage) InternalThunk;
57 thunk->interceptor_function = reinterpret_cast<ULONG_PTR>(interceptor); 61 thunk->interceptor_function = reinterpret_cast<ULONG_PTR>(interceptor);
58 62
59 return true; 63 return true;
60 } 64 }
61 65
62 NTSTATUS ResolverThunk::ResolveTarget(const void* module, 66 NTSTATUS ResolverThunk::ResolveTarget(const void* module,
63 const char* function_name, 67 const char* function_name,
64 void** address) { 68 void** address) {
65 // We don't support sidestep & co. 69 // We don't support sidestep & co.
66 return STATUS_NOT_IMPLEMENTED; 70 return STATUS_NOT_IMPLEMENTED;
67 } 71 }
68 72
69 } // namespace sandbox 73 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/win/src/resolver_32.cc ('k') | sandbox/win/src/sandbox_nt_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698