named_pipe_interception.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright (c) 2006-2008 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_INTERCEPTION_H_
  5. #define SANDBOX_WIN_SRC_NAMED_PIPE_INTERCEPTION_H_
  6. #include "sandbox/win/src/nt_internals.h"
  7. #include "sandbox/win/src/sandbox_types.h"
  8. namespace sandbox {
  9. extern "C" {
  10. typedef HANDLE(WINAPI* CreateNamedPipeWFunction)(
  11. LPCWSTR lpName,
  12. DWORD dwOpenMode,
  13. DWORD dwPipeMode,
  14. DWORD nMaxInstances,
  15. DWORD nOutBufferSize,
  16. DWORD nInBufferSize,
  17. DWORD nDefaultTimeOut,
  18. LPSECURITY_ATTRIBUTES lpSecurityAttributes);
  19. // Interception of CreateNamedPipeW in kernel32.dll
  20. SANDBOX_INTERCEPT HANDLE WINAPI
  21. TargetCreateNamedPipeW(CreateNamedPipeWFunction orig_CreateNamedPipeW,
  22. LPCWSTR pipe_name,
  23. DWORD open_mode,
  24. DWORD pipe_mode,
  25. DWORD max_instance,
  26. DWORD out_buffer_size,
  27. DWORD in_buffer_size,
  28. DWORD default_timeout,
  29. LPSECURITY_ATTRIBUTES security_attributes);
  30. } // extern "C"
  31. } // namespace sandbox
  32. #endif // SANDBOX_WIN_SRC_NAMED_PIPE_INTERCEPTION_H_