Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(347)

Side by Side Diff: sandbox/win/wow_helper/target_code.cc

Issue 10783004: Move Windows Sandbox, trybots version (don't commit me!) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to top of tree Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sandbox/win/wow_helper/target_code.h ('k') | sandbox/win/wow_helper/wow_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "sandbox/wow_helper/target_code.h" 5 #include "sandbox/win/wow_helper/target_code.h"
6 6
7 namespace sandbox { 7 namespace sandbox {
8 8
9 // Hooks NtMapViewOfSection to detect the load of dlls. 9 // Hooks NtMapViewOfSection to detect the load of dlls.
10 NTSTATUS WINAPI TargetNtMapViewOfSection( 10 NTSTATUS WINAPI TargetNtMapViewOfSection(
11 PatchInfo *patch_info, HANDLE process, PVOID *base, ULONG_PTR zero_bits, 11 PatchInfo *patch_info, HANDLE process, PVOID *base, ULONG_PTR zero_bits,
12 SIZE_T commit_size, PLARGE_INTEGER offset, PSIZE_T view_size, 12 SIZE_T commit_size, PLARGE_INTEGER offset, PSIZE_T view_size,
13 SECTION_INHERIT inherit, ULONG allocation_type, ULONG protect) { 13 SECTION_INHERIT inherit, ULONG allocation_type, ULONG protect) {
14 NTSTATUS ret = patch_info->orig_MapViewOfSection(patch_info->section, process, 14 NTSTATUS ret = patch_info->orig_MapViewOfSection(patch_info->section, process,
15 base, zero_bits, commit_size, 15 base, zero_bits, commit_size,
16 offset, view_size, inherit, 16 offset, view_size, inherit,
17 allocation_type, protect); 17 allocation_type, protect);
18 18
19 LARGE_INTEGER timeout; 19 LARGE_INTEGER timeout;
20 timeout.QuadPart = -(5 * 10000000); // 5 seconds. 20 timeout.QuadPart = -(5 * 10000000); // 5 seconds.
21 21
22 // The wait is alertable. 22 // The wait is alertable.
23 patch_info->signal_and_wait(patch_info->dll_load, patch_info->continue_load, 23 patch_info->signal_and_wait(patch_info->dll_load, patch_info->continue_load,
24 TRUE, &timeout); 24 TRUE, &timeout);
25 25
26 return ret; 26 return ret;
27 } 27 }
28 28
29 // Marks the end of the code to copy to the target process. 29 // Marks the end of the code to copy to the target process.
30 NTSTATUS WINAPI TargetEnd() { 30 NTSTATUS WINAPI TargetEnd() {
31 return STATUS_SUCCESS; 31 return STATUS_SUCCESS;
32 } 32 }
33 33
34 } // namespace sandbox 34 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/win/wow_helper/target_code.h ('k') | sandbox/win/wow_helper/wow_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698