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_PROCESS_THREAD_DISPATCHER_H_ michael@0: #define SANDBOX_SRC_PROCESS_THREAD_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 process and thread-related IPC calls. michael@0: class ThreadProcessDispatcher : public Dispatcher { michael@0: public: michael@0: explicit ThreadProcessDispatcher(PolicyBase* policy_base); michael@0: ~ThreadProcessDispatcher() {} 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 NtOpenThread() in the target. michael@0: bool NtOpenThread(IPCInfo* ipc, DWORD desired_access, DWORD thread_id); michael@0: michael@0: // Processes IPC requests coming from calls to NtOpenProcess() in the target. michael@0: bool NtOpenProcess(IPCInfo* ipc, DWORD desired_access, DWORD process_id); michael@0: michael@0: // Processes IPC requests from calls to NtOpenProcessToken() in the target. michael@0: bool NtOpenProcessToken(IPCInfo* ipc, HANDLE process, DWORD desired_access); michael@0: michael@0: // Processes IPC requests from calls to NtOpenProcessTokenEx() in the target. michael@0: bool NtOpenProcessTokenEx(IPCInfo* ipc, HANDLE process, DWORD desired_access, michael@0: DWORD attributes); michael@0: michael@0: // Processes IPC requests coming from calls to CreateProcessW() in the target. michael@0: bool CreateProcessW(IPCInfo* ipc, std::wstring* name, std::wstring* cmd_line, michael@0: std::wstring* cur_dir, CountedBuffer* info); michael@0: michael@0: PolicyBase* policy_base_; michael@0: DISALLOW_COPY_AND_ASSIGN(ThreadProcessDispatcher); michael@0: }; michael@0: michael@0: } // namespace sandbox michael@0: michael@0: #endif // SANDBOX_SRC_PROCESS_THREAD_DISPATCHER_H_