1 // Copyright 2019 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_SIGNED_DISPATCHER_H_
6 #define SANDBOX_WIN_SRC_SIGNED_DISPATCHER_H_
7 
8 #include <stdint.h>
9 
10 #include "base/macros.h"
11 #include "sandbox/win/src/crosscall_server.h"
12 #include "sandbox/win/src/interception.h"
13 #include "sandbox/win/src/ipc_tags.h"
14 #include "sandbox/win/src/sandbox_policy_base.h"
15 
16 namespace sandbox {
17 
18 // This class handles signed-binary related IPC calls.
19 class SignedDispatcher : public Dispatcher {
20  public:
21   explicit SignedDispatcher(PolicyBase* policy_base);
~SignedDispatcher()22   ~SignedDispatcher() override {}
23 
24   // Dispatcher interface.
25   bool SetupService(InterceptionManager* manager, IpcTag service) override;
26 
27  private:
28   // Processes IPC requests coming from calls to CreateSection in the target.
29   bool CreateSection(IPCInfo* ipc, HANDLE file_handle);
30 
31   PolicyBase* policy_base_;
32   DISALLOW_COPY_AND_ASSIGN(SignedDispatcher);
33 };
34 
35 }  // namespace sandbox
36 
37 #endif  // SANDBOX_WIN_SRC_SIGNED_DISPATCHER_H_
38