| 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/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 |
| 11 namespace sandbox { | 11 namespace sandbox { |
| 12 | 12 |
| 13 // This is the list of all imported symbols from ntdll.dll. | 13 // This is the list of all imported symbols from ntdll.dll. |
| 14 SANDBOX_INTERCEPT NtExports g_nt = { NULL }; | 14 SANDBOX_INTERCEPT NtExports g_nt = { NULL }; |
| 15 | 15 |
| 16 } | 16 } |
| 17 | 17 |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 } | 350 } |
| 351 | 351 |
| 352 return out_string; | 352 return out_string; |
| 353 } | 353 } |
| 354 | 354 |
| 355 UNICODE_STRING* GetImageInfoFromModule(HMODULE module, uint32* flags) { | 355 UNICODE_STRING* GetImageInfoFromModule(HMODULE module, uint32* flags) { |
| 356 UNICODE_STRING* out_name = NULL; | 356 UNICODE_STRING* out_name = NULL; |
| 357 __try { | 357 __try { |
| 358 do { | 358 do { |
| 359 *flags = 0; | 359 *flags = 0; |
| 360 PEImage pe(module); | 360 base::win::PEImage pe(module); |
| 361 | 361 |
| 362 if (!pe.VerifyMagic()) | 362 if (!pe.VerifyMagic()) |
| 363 break; | 363 break; |
| 364 *flags |= MODULE_IS_PE_IMAGE; | 364 *flags |= MODULE_IS_PE_IMAGE; |
| 365 | 365 |
| 366 PIMAGE_EXPORT_DIRECTORY exports = pe.GetExportDirectory(); | 366 PIMAGE_EXPORT_DIRECTORY exports = pe.GetExportDirectory(); |
| 367 if (exports) { | 367 if (exports) { |
| 368 char* name = reinterpret_cast<char*>(pe.RVAToAddr(exports->Name)); | 368 char* name = reinterpret_cast<char*>(pe.RVAToAddr(exports->Name)); |
| 369 out_name = AnsiToUnicode(name); | 369 out_name = AnsiToUnicode(name); |
| 370 } | 370 } |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |