target_interceptions.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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_TARGET_INTERCEPTIONS_H_
  5. #define SANDBOX_WIN_SRC_TARGET_INTERCEPTIONS_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 NtMapViewOfSection on the child process.
  11. // It should never be called directly. This function provides the means to
  12. // detect dlls being loaded, so we can patch them if needed.
  13. SANDBOX_INTERCEPT NTSTATUS WINAPI
  14. TargetNtMapViewOfSection(NtMapViewOfSectionFunction orig_MapViewOfSection,
  15. HANDLE section,
  16. HANDLE process,
  17. PVOID* base,
  18. ULONG_PTR zero_bits,
  19. SIZE_T commit_size,
  20. PLARGE_INTEGER offset,
  21. PSIZE_T view_size,
  22. SECTION_INHERIT inherit,
  23. ULONG allocation_type,
  24. ULONG protect);
  25. // Interception of NtUnmapViewOfSection on the child process.
  26. // It should never be called directly. This function provides the means to
  27. // detect dlls being unloaded, so we can clean up our interceptions.
  28. SANDBOX_INTERCEPT NTSTATUS WINAPI
  29. TargetNtUnmapViewOfSection(NtUnmapViewOfSectionFunction orig_UnmapViewOfSection,
  30. HANDLE process,
  31. PVOID base);
  32. } // extern "C"
  33. } // namespace sandbox
  34. #endif // SANDBOX_WIN_SRC_TARGET_INTERCEPTIONS_H_