| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/wow64.h" | 5 #include "sandbox/src/wow64.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 130 |
| 131 // The child is intercepted on 64 bit, go on and wait for our event. | 131 // The child is intercepted on 64 bit, go on and wait for our event. |
| 132 if (!DllMapped()) | 132 if (!DllMapped()) |
| 133 return false; | 133 return false; |
| 134 | 134 |
| 135 // The 32 bit version is available, cleanup the child. | 135 // The 32 bit version is available, cleanup the child. |
| 136 return Restore64Code(child_->Process(), patch_info); | 136 return Restore64Code(child_->Process(), patch_info); |
| 137 } | 137 } |
| 138 | 138 |
| 139 bool Wow64::RunWowHelper(void* buffer) { | 139 bool Wow64::RunWowHelper(void* buffer) { |
| 140 COMPILE_ASSERT(sizeof(buffer) <= sizeof DWORD, unsupported_64_bits); | 140 COMPILE_ASSERT(sizeof(buffer) <= sizeof(DWORD), unsupported_64_bits); |
| 141 | 141 |
| 142 // Get the path to the helper (beside the exe). | 142 // Get the path to the helper (beside the exe). |
| 143 wchar_t prog_name[MAX_PATH]; | 143 wchar_t prog_name[MAX_PATH]; |
| 144 GetModuleFileNameW(NULL, prog_name, MAX_PATH); | 144 GetModuleFileNameW(NULL, prog_name, MAX_PATH); |
| 145 std::wstring path(prog_name); | 145 std::wstring path(prog_name); |
| 146 size_t name_pos = path.find_last_of(L"\\"); | 146 size_t name_pos = path.find_last_of(L"\\"); |
| 147 if (std::wstring::npos == name_pos) | 147 if (std::wstring::npos == name_pos) |
| 148 return false; | 148 return false; |
| 149 path.resize(name_pos + 1); | 149 path.resize(name_pos + 1); |
| 150 | 150 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 SIZE_T read; | 210 SIZE_T read; |
| 211 if (!::ReadProcessMemory(child_->Process(), ntdll_, &buffer, kBufferSize, | 211 if (!::ReadProcessMemory(child_->Process(), ntdll_, &buffer, kBufferSize, |
| 212 &read)) | 212 &read)) |
| 213 return false; | 213 return false; |
| 214 if (kBufferSize != read) | 214 if (kBufferSize != read) |
| 215 return false; | 215 return false; |
| 216 return true; | 216 return true; |
| 217 } | 217 } |
| 218 | 218 |
| 219 } // namespace sandbox | 219 } // namespace sandbox |
| OLD | NEW |