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.
4 
5 #ifndef SANDBOX_WIN_SRC_FILESYSTEM_INTERCEPTION_H_
6 #define SANDBOX_WIN_SRC_FILESYSTEM_INTERCEPTION_H_
7 
8 #include "sandbox/win/src/nt_internals.h"
9 #include "sandbox/win/src/sandbox_types.h"
10 
11 namespace sandbox {
12 
13 extern "C" {
14 
15 // Interception of NtCreateFile on the child process.
16 SANDBOX_INTERCEPT NTSTATUS WINAPI
17 TargetNtCreateFile(NtCreateFileFunction orig_CreateFile,
18                    PHANDLE file,
19                    ACCESS_MASK desired_access,
20                    POBJECT_ATTRIBUTES object_attributes,
21                    PIO_STATUS_BLOCK io_status,
22                    PLARGE_INTEGER allocation_size,
23                    ULONG file_attributes,
24                    ULONG sharing,
25                    ULONG disposition,
26                    ULONG options,
27                    PVOID ea_buffer,
28                    ULONG ea_length);
29 
30 // Interception of NtOpenFile on the child process.
31 SANDBOX_INTERCEPT NTSTATUS WINAPI
32 TargetNtOpenFile(NtOpenFileFunction orig_OpenFile,
33                  PHANDLE file,
34                  ACCESS_MASK desired_access,
35                  POBJECT_ATTRIBUTES object_attributes,
36                  PIO_STATUS_BLOCK io_status,
37                  ULONG sharing,
38                  ULONG options);
39 
40 // Interception of NtQueryAtttributesFile on the child process.
41 // It should never be called directly.
42 SANDBOX_INTERCEPT NTSTATUS WINAPI
43 TargetNtQueryAttributesFile(NtQueryAttributesFileFunction orig_QueryAttributes,
44                             POBJECT_ATTRIBUTES object_attributes,
45                             PFILE_BASIC_INFORMATION file_attributes);
46 
47 // Interception of NtQueryFullAtttributesFile on the child process.
48 // It should never be called directly.
49 SANDBOX_INTERCEPT NTSTATUS WINAPI TargetNtQueryFullAttributesFile(
50     NtQueryFullAttributesFileFunction orig_QueryAttributes,
51     POBJECT_ATTRIBUTES object_attributes,
52     PFILE_NETWORK_OPEN_INFORMATION file_attributes);
53 
54 // Interception of NtSetInformationFile on the child process.
55 SANDBOX_INTERCEPT NTSTATUS WINAPI
56 TargetNtSetInformationFile(NtSetInformationFileFunction orig_SetInformationFile,
57                            HANDLE file,
58                            PIO_STATUS_BLOCK io_status,
59                            PVOID file_information,
60                            ULONG length,
61                            FILE_INFORMATION_CLASS file_information_class);
62 
63 }  // extern "C"
64 
65 }  // namespace sandbox
66 
67 #endif  // SANDBOX_WIN_SRC_FILESYSTEM_INTERCEPTION_H_
68