Don't preload rarely seen large images
[chromium-blink-merge.git] / sandbox / win / wow_helper / target_code.h
blobc198a852e2d9c424702915cc3cc2f98983b91393
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
3 // found in the LICENSE file.
5 #ifndef SANDBOX_WOW_HELPER_TARGET_CODE_H__
6 #define SANDBOX_WOW_HELPER_TARGET_CODE_H__
8 #include "sandbox/win/src/nt_internals.h"
10 namespace sandbox {
12 extern "C" {
14 // Holds the information needed for the interception of NtMapViewOfSection.
15 // Changes of this structure must be synchronized with changes of PatchInfo32
16 // on sandbox/win/src/wow64.cc.
17 struct PatchInfo {
18 HANDLE dll_load; // Event to signal the broker.
19 HANDLE continue_load; // Event to wait for the broker.
20 HANDLE section; // First argument of the call.
21 NtMapViewOfSectionFunction orig_MapViewOfSection;
22 NtSignalAndWaitForSingleObjectFunction signal_and_wait;
23 void* patch_location;
26 // Interception of NtMapViewOfSection on the child process.
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.
29 NTSTATUS WINAPI TargetNtMapViewOfSection(
30 PatchInfo* patch_info, HANDLE process, PVOID* base, ULONG_PTR zero_bits,
31 SIZE_T commit_size, PLARGE_INTEGER offset, PSIZE_T view_size,
32 SECTION_INHERIT inherit, ULONG allocation_type, ULONG protect);
34 // Marker of the end of TargetNtMapViewOfSection.
35 NTSTATUS WINAPI TargetEnd();
37 } // extern "C"
39 } // namespace sandbox
41 #endif // SANDBOX_WOW_HELPER_TARGET_CODE_H__