named_pipe_dispatcher.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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
  3. // found in the LICENSE file.
  4. #ifndef SANDBOX_WIN_SRC_NAMED_PIPE_DISPATCHER_H_
  5. #define SANDBOX_WIN_SRC_NAMED_PIPE_DISPATCHER_H_
  6. #include <stdint.h>
  7. #include <string>
  8. #include "base/memory/raw_ptr.h"
  9. #include "sandbox/win/src/crosscall_server.h"
  10. #include "sandbox/win/src/ipc_tags.h"
  11. #include "sandbox/win/src/sandbox_policy_base.h"
  12. namespace sandbox {
  13. // This class handles named pipe related IPC calls.
  14. class NamedPipeDispatcher : public Dispatcher {
  15. public:
  16. explicit NamedPipeDispatcher(PolicyBase* policy_base);
  17. NamedPipeDispatcher(const NamedPipeDispatcher&) = delete;
  18. NamedPipeDispatcher& operator=(const NamedPipeDispatcher&) = delete;
  19. ~NamedPipeDispatcher() override {}
  20. // Dispatcher interface.
  21. bool SetupService(InterceptionManager* manager, IpcTag service) override;
  22. private:
  23. // Processes IPC requests coming from calls to CreateNamedPipeW() in the
  24. // target.
  25. bool CreateNamedPipe(IPCInfo* ipc,
  26. std::wstring* name,
  27. uint32_t open_mode,
  28. uint32_t pipe_mode,
  29. uint32_t max_instances,
  30. uint32_t out_buffer_size,
  31. uint32_t in_buffer_size,
  32. uint32_t default_timeout);
  33. raw_ptr<PolicyBase> policy_base_;
  34. };
  35. } // namespace sandbox
  36. #endif // SANDBOX_WIN_SRC_NAMED_PIPE_DISPATCHER_H_