| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef SANDBOX_WOW_HELPER_TARGET_CODE_H__ | 5 #ifndef SANDBOX_WOW_HELPER_TARGET_CODE_H__ |
| 6 #define SANDBOX_WOW_HELPER_TARGET_CODE_H__ | 6 #define SANDBOX_WOW_HELPER_TARGET_CODE_H__ |
| 7 | 7 |
| 8 #include "sandbox/src/nt_internals.h" | 8 #include "sandbox/win/src/nt_internals.h" |
| 9 | 9 |
| 10 namespace sandbox { | 10 namespace sandbox { |
| 11 | 11 |
| 12 extern "C" { | 12 extern "C" { |
| 13 | 13 |
| 14 // Holds the information needed for the interception of NtMapViewOfSection. | 14 // Holds the information needed for the interception of NtMapViewOfSection. |
| 15 // Changes of this structure must be synchronized with changes of PatchInfo32 | 15 // Changes of this structure must be synchronized with changes of PatchInfo32 |
| 16 // on sandbox/src/wow64.cc. | 16 // on sandbox/win/src/wow64.cc. |
| 17 struct PatchInfo { | 17 struct PatchInfo { |
| 18 HANDLE dll_load; // Event to signal the broker. | 18 HANDLE dll_load; // Event to signal the broker. |
| 19 HANDLE continue_load; // Event to wait for the broker. | 19 HANDLE continue_load; // Event to wait for the broker. |
| 20 HANDLE section; // First argument of the call. | 20 HANDLE section; // First argument of the call. |
| 21 NtMapViewOfSectionFunction orig_MapViewOfSection; | 21 NtMapViewOfSectionFunction orig_MapViewOfSection; |
| 22 NtSignalAndWaitForSingleObjectFunction signal_and_wait; | 22 NtSignalAndWaitForSingleObjectFunction signal_and_wait; |
| 23 void* patch_location; | 23 void* patch_location; |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 // Interception of NtMapViewOfSection on the child process. | 26 // Interception of NtMapViewOfSection on the child process. |
| 27 // It should never be called directly. This function provides the means to | 27 // It should never be called directly. This function provides the means to |
| 28 // detect dlls being loaded, so we can patch them if needed. | 28 // detect dlls being loaded, so we can patch them if needed. |
| 29 NTSTATUS WINAPI TargetNtMapViewOfSection( | 29 NTSTATUS WINAPI TargetNtMapViewOfSection( |
| 30 PatchInfo* patch_info, HANDLE process, PVOID* base, ULONG_PTR zero_bits, | 30 PatchInfo* patch_info, HANDLE process, PVOID* base, ULONG_PTR zero_bits, |
| 31 SIZE_T commit_size, PLARGE_INTEGER offset, PSIZE_T view_size, | 31 SIZE_T commit_size, PLARGE_INTEGER offset, PSIZE_T view_size, |
| 32 SECTION_INHERIT inherit, ULONG allocation_type, ULONG protect); | 32 SECTION_INHERIT inherit, ULONG allocation_type, ULONG protect); |
| 33 | 33 |
| 34 // Marker of the end of TargetNtMapViewOfSection. | 34 // Marker of the end of TargetNtMapViewOfSection. |
| 35 NTSTATUS WINAPI TargetEnd(); | 35 NTSTATUS WINAPI TargetEnd(); |
| 36 | 36 |
| 37 } // extern "C" | 37 } // extern "C" |
| 38 | 38 |
| 39 } // namespace sandbox | 39 } // namespace sandbox |
| 40 | 40 |
| 41 #endif // SANDBOX_WOW_HELPER_TARGET_CODE_H__ | 41 #endif // SANDBOX_WOW_HELPER_TARGET_CODE_H__ |
| OLD | NEW |