michael@0: // Copyright (c) 2010 The Chromium Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: michael@0: #ifndef SANDBOX_SRC_FILESYSTEM_DISPATCHER_H__ michael@0: #define SANDBOX_SRC_FILESYSTEM_DISPATCHER_H__ michael@0: michael@0: #include "base/basictypes.h" michael@0: #include "sandbox/win/src/crosscall_server.h" michael@0: #include "sandbox/win/src/sandbox_policy_base.h" michael@0: michael@0: namespace sandbox { michael@0: michael@0: // This class handles file system-related IPC calls. michael@0: class FilesystemDispatcher : public Dispatcher { michael@0: public: michael@0: explicit FilesystemDispatcher(PolicyBase* policy_base); michael@0: ~FilesystemDispatcher() {} michael@0: michael@0: // Dispatcher interface. michael@0: virtual bool SetupService(InterceptionManager* manager, int service); michael@0: michael@0: private: michael@0: // Processes IPC requests coming from calls to NtCreateFile in the target. michael@0: bool NtCreateFile(IPCInfo* ipc, std::wstring* name, DWORD attributes, michael@0: DWORD desired_access, DWORD file_attributes, michael@0: DWORD share_access, DWORD create_disposition, michael@0: DWORD create_options); michael@0: michael@0: // Processes IPC requests coming from calls to NtOpenFile in the target. michael@0: bool NtOpenFile(IPCInfo* ipc, std::wstring* name, DWORD attributes, michael@0: DWORD desired_access, DWORD share_access, michael@0: DWORD create_options); michael@0: michael@0: // Processes IPC requests coming from calls to NtQueryAttributesFile in the michael@0: // target. michael@0: bool NtQueryAttributesFile(IPCInfo* ipc, std::wstring* name, DWORD attributes, michael@0: CountedBuffer* info); michael@0: michael@0: // Processes IPC requests coming from calls to NtQueryFullAttributesFile in michael@0: // the target. michael@0: bool NtQueryFullAttributesFile(IPCInfo* ipc, std::wstring* name, michael@0: DWORD attributes, CountedBuffer* info); michael@0: michael@0: // Processes IPC requests coming from calls to NtSetInformationFile with the michael@0: // rename information class. michael@0: bool NtSetInformationFile(IPCInfo* ipc, HANDLE handle, CountedBuffer* status, michael@0: CountedBuffer* info, DWORD length, michael@0: DWORD info_class); michael@0: michael@0: PolicyBase* policy_base_; michael@0: DISALLOW_COPY_AND_ASSIGN(FilesystemDispatcher); michael@0: }; michael@0: michael@0: } // namespace sandbox michael@0: michael@0: #endif // SANDBOX_SRC_FILESYSTEM_DISPATCHER_H__