1 // Copyright 2016 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_TESTS_INTEGRATION_TESTS_HOOKING_DLL_H_
6 #define SANDBOX_TESTS_INTEGRATION_TESTS_HOOKING_DLL_H_
7 
8 #include <windows.h>
9 
10 #ifdef BUILDING_DLL
11 #define DLL_EXPORT __declspec(dllexport)
12 #else
13 #define DLL_EXPORT __declspec(dllimport)
14 #endif
15 
16 namespace hooking_dll {
17 
18 constexpr wchar_t g_hook_dll_file[] = L"sbox_integration_test_hooking_dll.dll";
19 constexpr wchar_t g_hook_event[] = L"ChromeExtensionTestHookEvent";
20 
21 // System mutex to prevent conflicting tests from running at the same time.
22 // This particular mutex is related to the use of the hooking_dll.
23 constexpr wchar_t g_hooking_dll_mutex[] = L"ChromeTestHookingDllMutex";
24 
25 DLL_EXPORT void SetHook(HHOOK hook_handle);
26 DLL_EXPORT bool WasHookCalled();
27 DLL_EXPORT LRESULT HookProc(int code, WPARAM w_param, LPARAM l_param);
28 
29 }  // namespace hooking_dll
30 
31 #endif  // SANDBOX_TESTS_INTEGRATION_TESTS_HOOKING_DLL_H_
32