process_mitigations_win32k_interception.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright 2014 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_PROCESS_MITIGATIONS_WIN32K_INTERCEPTION_H_
  5. #define SANDBOX_WIN_SRC_PROCESS_MITIGATIONS_WIN32K_INTERCEPTION_H_
  6. #include <windows.h>
  7. #include "sandbox/win/src/nt_internals.h"
  8. #include "sandbox/win/src/sandbox_types.h"
  9. namespace sandbox {
  10. typedef BOOL(WINAPI* GdiDllInitializeFunction)(HANDLE dll,
  11. DWORD reason,
  12. LPVOID reserved);
  13. using GetStockObjectFunction = decltype(&::GetStockObject);
  14. using RegisterClassWFunction = decltype(&::RegisterClassW);
  15. extern "C" {
  16. // Interceptor for the GdiDllInitialize function.
  17. SANDBOX_INTERCEPT BOOL WINAPI
  18. TargetGdiDllInitialize(GdiDllInitializeFunction orig_gdi_dll_initialize,
  19. HANDLE dll,
  20. DWORD reason);
  21. // Interceptor for the GetStockObject function.
  22. SANDBOX_INTERCEPT HGDIOBJ WINAPI
  23. TargetGetStockObject(GetStockObjectFunction orig_get_stock_object, int object);
  24. // Interceptor for the RegisterClassW function.
  25. SANDBOX_INTERCEPT ATOM WINAPI
  26. TargetRegisterClassW(RegisterClassWFunction orig_register_class_function,
  27. const WNDCLASS* wnd_class);
  28. } // extern "C"
  29. } // namespace sandbox
  30. #endif // SANDBOX_WIN_SRC_PROCESS_MITIGATIONS_WIN32K_INTERCEPTION_H_