OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_SRC_FILESYSTEM_DISPATCHER_H__ | 5 #ifndef SANDBOX_SRC_FILESYSTEM_DISPATCHER_H__ |
6 #define SANDBOX_SRC_FILESYSTEM_DISPATCHER_H__ | 6 #define SANDBOX_SRC_FILESYSTEM_DISPATCHER_H__ |
7 | 7 |
8 #include <stdint.h> | 8 #include "base/basictypes.h" |
9 | |
10 #include "base/macros.h" | |
11 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
12 #include "sandbox/win/src/crosscall_server.h" | 10 #include "sandbox/win/src/crosscall_server.h" |
13 #include "sandbox/win/src/sandbox_policy_base.h" | 11 #include "sandbox/win/src/sandbox_policy_base.h" |
14 | 12 |
15 namespace sandbox { | 13 namespace sandbox { |
16 | 14 |
17 // This class handles file system-related IPC calls. | 15 // This class handles file system-related IPC calls. |
18 class FilesystemDispatcher : public Dispatcher { | 16 class FilesystemDispatcher : public Dispatcher { |
19 public: | 17 public: |
20 explicit FilesystemDispatcher(PolicyBase* policy_base); | 18 explicit FilesystemDispatcher(PolicyBase* policy_base); |
21 ~FilesystemDispatcher() override {} | 19 ~FilesystemDispatcher() override {} |
22 | 20 |
23 // Dispatcher interface. | 21 // Dispatcher interface. |
24 bool SetupService(InterceptionManager* manager, int service) override; | 22 bool SetupService(InterceptionManager* manager, int service) override; |
25 | 23 |
26 private: | 24 private: |
27 // Processes IPC requests coming from calls to NtCreateFile in the target. | 25 // Processes IPC requests coming from calls to NtCreateFile in the target. |
28 bool NtCreateFile(IPCInfo* ipc, | 26 bool NtCreateFile(IPCInfo* ipc, |
29 base::string16* name, | 27 base::string16* name, |
30 uint32_t attributes, | 28 uint32 attributes, |
31 uint32_t desired_access, | 29 uint32 desired_access, |
32 uint32_t file_attributes, | 30 uint32 file_attributes, |
33 uint32_t share_access, | 31 uint32 share_access, |
34 uint32_t create_disposition, | 32 uint32 create_disposition, |
35 uint32_t create_options); | 33 uint32 create_options); |
36 | 34 |
37 // Processes IPC requests coming from calls to NtOpenFile in the target. | 35 // Processes IPC requests coming from calls to NtOpenFile in the target. |
38 bool NtOpenFile(IPCInfo* ipc, | 36 bool NtOpenFile(IPCInfo* ipc, |
39 base::string16* name, | 37 base::string16* name, |
40 uint32_t attributes, | 38 uint32 attributes, |
41 uint32_t desired_access, | 39 uint32 desired_access, |
42 uint32_t share_access, | 40 uint32 share_access, |
43 uint32_t create_options); | 41 uint32 create_options); |
44 | 42 |
45 // Processes IPC requests coming from calls to NtQueryAttributesFile in the | 43 // Processes IPC requests coming from calls to NtQueryAttributesFile in the |
46 // target. | 44 // target. |
47 bool NtQueryAttributesFile(IPCInfo* ipc, | 45 bool NtQueryAttributesFile(IPCInfo* ipc, |
48 base::string16* name, | 46 base::string16* name, |
49 uint32_t attributes, | 47 uint32 attributes, |
50 CountedBuffer* info); | 48 CountedBuffer* info); |
51 | 49 |
52 // Processes IPC requests coming from calls to NtQueryFullAttributesFile in | 50 // Processes IPC requests coming from calls to NtQueryFullAttributesFile in |
53 // the target. | 51 // the target. |
54 bool NtQueryFullAttributesFile(IPCInfo* ipc, | 52 bool NtQueryFullAttributesFile(IPCInfo* ipc, |
55 base::string16* name, | 53 base::string16* name, |
56 uint32_t attributes, | 54 uint32 attributes, |
57 CountedBuffer* info); | 55 CountedBuffer* info); |
58 | 56 |
59 // Processes IPC requests coming from calls to NtSetInformationFile with the | 57 // Processes IPC requests coming from calls to NtSetInformationFile with the |
60 // rename information class. | 58 // rename information class. |
61 bool NtSetInformationFile(IPCInfo* ipc, | 59 bool NtSetInformationFile(IPCInfo* ipc, |
62 HANDLE handle, | 60 HANDLE handle, |
63 CountedBuffer* status, | 61 CountedBuffer* status, |
64 CountedBuffer* info, | 62 CountedBuffer* info, |
65 uint32_t length, | 63 uint32 length, |
66 uint32_t info_class); | 64 uint32 info_class); |
67 | 65 |
68 PolicyBase* policy_base_; | 66 PolicyBase* policy_base_; |
69 DISALLOW_COPY_AND_ASSIGN(FilesystemDispatcher); | 67 DISALLOW_COPY_AND_ASSIGN(FilesystemDispatcher); |
70 }; | 68 }; |
71 | 69 |
72 } // namespace sandbox | 70 } // namespace sandbox |
73 | 71 |
74 #endif // SANDBOX_SRC_FILESYSTEM_DISPATCHER_H__ | 72 #endif // SANDBOX_SRC_FILESYSTEM_DISPATCHER_H__ |
OLD | NEW |