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