filesystem_interception.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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_FILESYSTEM_INTERCEPTION_H_
  5. #define SANDBOX_WIN_SRC_FILESYSTEM_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. // Interception of NtCreateFile on the child process.
  11. SANDBOX_INTERCEPT NTSTATUS WINAPI
  12. TargetNtCreateFile(NtCreateFileFunction orig_CreateFile,
  13. PHANDLE file,
  14. ACCESS_MASK desired_access,
  15. POBJECT_ATTRIBUTES object_attributes,
  16. PIO_STATUS_BLOCK io_status,
  17. PLARGE_INTEGER allocation_size,
  18. ULONG file_attributes,
  19. ULONG sharing,
  20. ULONG disposition,
  21. ULONG options,
  22. PVOID ea_buffer,
  23. ULONG ea_length);
  24. // Interception of NtOpenFile on the child process.
  25. SANDBOX_INTERCEPT NTSTATUS WINAPI
  26. TargetNtOpenFile(NtOpenFileFunction orig_OpenFile,
  27. PHANDLE file,
  28. ACCESS_MASK desired_access,
  29. POBJECT_ATTRIBUTES object_attributes,
  30. PIO_STATUS_BLOCK io_status,
  31. ULONG sharing,
  32. ULONG options);
  33. // Interception of NtQueryAtttributesFile on the child process.
  34. // It should never be called directly.
  35. SANDBOX_INTERCEPT NTSTATUS WINAPI
  36. TargetNtQueryAttributesFile(NtQueryAttributesFileFunction orig_QueryAttributes,
  37. POBJECT_ATTRIBUTES object_attributes,
  38. PFILE_BASIC_INFORMATION file_attributes);
  39. // Interception of NtQueryFullAtttributesFile on the child process.
  40. // It should never be called directly.
  41. SANDBOX_INTERCEPT NTSTATUS WINAPI TargetNtQueryFullAttributesFile(
  42. NtQueryFullAttributesFileFunction orig_QueryAttributes,
  43. POBJECT_ATTRIBUTES object_attributes,
  44. PFILE_NETWORK_OPEN_INFORMATION file_attributes);
  45. // Interception of NtSetInformationFile on the child process.
  46. SANDBOX_INTERCEPT NTSTATUS WINAPI
  47. TargetNtSetInformationFile(NtSetInformationFileFunction orig_SetInformationFile,
  48. HANDLE file,
  49. PIO_STATUS_BLOCK io_status,
  50. PVOID file_information,
  51. ULONG length,
  52. FILE_INFORMATION_CLASS file_information_class);
  53. } // extern "C"
  54. } // namespace sandbox
  55. #endif // SANDBOX_WIN_SRC_FILESYSTEM_INTERCEPTION_H_