| OLD | NEW |
| 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/src/sandbox_nt_util.h" | 5 #include "sandbox/src/sandbox_nt_util.h" |
| 6 | 6 |
| 7 #include "base/win/pe_image.h" | 7 #include "base/win/pe_image.h" |
| 8 #include "sandbox/src/sandbox_factory.h" | 8 #include "sandbox/src/sandbox_factory.h" |
| 9 #include "sandbox/src/target_services.h" | 9 #include "sandbox/src/target_services.h" |
| 10 | 10 |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 } | 531 } |
| 532 | 532 |
| 533 } // namespace sandbox | 533 } // namespace sandbox |
| 534 | 534 |
| 535 void* operator new(size_t size, sandbox::AllocationType type, | 535 void* operator new(size_t size, sandbox::AllocationType type, |
| 536 void* near_to) { | 536 void* near_to) { |
| 537 using namespace sandbox; | 537 using namespace sandbox; |
| 538 | 538 |
| 539 if (NT_ALLOC == type) { | 539 if (NT_ALLOC == type) { |
| 540 if (!InitHeap()) | 540 if (!InitHeap()) |
| 541 return false; | 541 return NULL; |
| 542 | 542 |
| 543 // Use default flags for the allocation. | 543 // Use default flags for the allocation. |
| 544 return g_nt.RtlAllocateHeap(sandbox::g_heap, 0, size); | 544 return g_nt.RtlAllocateHeap(sandbox::g_heap, 0, size); |
| 545 } else if (NT_PAGE == type) { | 545 } else if (NT_PAGE == type) { |
| 546 return AllocateNearTo(near_to, size); | 546 return AllocateNearTo(near_to, size); |
| 547 } | 547 } |
| 548 NOTREACHED_NT(); | 548 NOTREACHED_NT(); |
| 549 return NULL; | 549 return NULL; |
| 550 } | 550 } |
| 551 | 551 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 577 UNREFERENCED_PARAMETER(type); | 577 UNREFERENCED_PARAMETER(type); |
| 578 return buffer; | 578 return buffer; |
| 579 } | 579 } |
| 580 | 580 |
| 581 void __cdecl operator delete(void* memory, void* buffer, | 581 void __cdecl operator delete(void* memory, void* buffer, |
| 582 sandbox::AllocationType type) { | 582 sandbox::AllocationType type) { |
| 583 UNREFERENCED_PARAMETER(memory); | 583 UNREFERENCED_PARAMETER(memory); |
| 584 UNREFERENCED_PARAMETER(buffer); | 584 UNREFERENCED_PARAMETER(buffer); |
| 585 UNREFERENCED_PARAMETER(type); | 585 UNREFERENCED_PARAMETER(type); |
| 586 } | 586 } |
| OLD | NEW |