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
5#ifndef SANDBOX_SRC_PROCESS_MITIGATIONS_WIN32K_INTERCEPTION_H_
6#define SANDBOX_SRC_PROCESS_MITIGATIONS_WIN32K_INTERCEPTION_H_
7
8#include <windows.h>
9#include "base/basictypes.h"
10#include "sandbox/win/src/sandbox_types.h"
11
12namespace sandbox {
13
14extern "C" {
15
16typedef BOOL (WINAPI* GdiDllInitializeFunction) (
17    HANDLE dll,
18    DWORD reason,
19    LPVOID reserved);
20
21typedef HGDIOBJ (WINAPI *GetStockObjectFunction) (int object);
22
23typedef ATOM (WINAPI *RegisterClassWFunction) (const WNDCLASS* wnd_class);
24
25// Interceptor for the  GdiDllInitialize function.
26SANDBOX_INTERCEPT BOOL WINAPI TargetGdiDllInitialize(
27    GdiDllInitializeFunction orig_gdi_dll_initialize,
28    HANDLE dll,
29    DWORD reason);
30
31// Interceptor for the GetStockObject function.
32SANDBOX_INTERCEPT HGDIOBJ WINAPI TargetGetStockObject(
33    GetStockObjectFunction orig_get_stock_object,
34    int object);
35
36// Interceptor for the RegisterClassW function.
37SANDBOX_INTERCEPT ATOM WINAPI TargetRegisterClassW(
38    RegisterClassWFunction orig_register_class_function,
39    const WNDCLASS* wnd_class);
40
41}  // extern "C"
42
43}  // namespace sandbox
44
45#endif  // SANDBOX_SRC_PROCESS_MITIGATIONS_WIN32K_INTERCEPTION_H_
46
47