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
3 // found in the LICENSE file.
5 // Defines InterceptionManager, the class in charge of setting up interceptions
6 // for the sandboxed process. For more details see:
7 // http://dev.chromium.org/developers/design-documents/sandbox .
9 #ifndef SANDBOX_SRC_INTERCEPTION_INTERNAL_H_
10 #define SANDBOX_SRC_INTERCEPTION_INTERNAL_H_
12 #include "sandbox/win/src/sandbox_types.h"
16 const int kMaxThunkDataBytes
= 64;
20 // The following structures contain variable size fields at the end, and will be
21 // used to transfer information between two processes. In order to guarantee
22 // our ability to follow the chain of structures, the alignment should be fixed,
26 // Structures for the shared memory that contains patching information
27 // for the InterceptionAgent.
28 // A single interception:
30 size_t record_bytes
; // rounded to sizeof(size_t) bytes
31 InterceptionType type
;
33 const void* interceptor_address
;
34 char function
[1]; // placeholder for null terminated name
35 // char interceptor[] // followed by the interceptor function
40 size_t record_bytes
; // rounded to sizeof(size_t) bytes
41 size_t offset_to_functions
;
44 wchar_t dll_name
[1]; // placeholder for null terminated name
45 // FunctionInfo function_info[] // followed by the functions to intercept
50 int num_intercepted_dlls
;
51 void* interceptor_base
;
52 DllPatchInfo dll_list
[1]; // placeholder for the list of dlls
55 // Dummy single thunk:
57 char data
[kMaxThunkDataBytes
];
60 // In-memory representation of the interceptions for a given dll:
61 struct DllInterceptionData
{
67 int dummy
; // Improve alignment.
74 } // namespace sandbox
76 #endif // SANDBOX_SRC_INTERCEPTION_INTERNAL_H_