Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1064)

Unified Diff: sandbox/win/tests/integration_tests/hooking_dll.cc

Issue 1835003003: [Windows Sandbox] MITIGATION_EXTENSION_POINT_DISABLE support for children. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tiny cleanup - strange link error only on win8_chromium_ng try bot. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sandbox/win/tests/integration_tests/hooking_dll.cc
diff --git a/sandbox/win/tests/integration_tests/hooking_dll.cc b/sandbox/win/tests/integration_tests/hooking_dll.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d100d254b8131fea5d97384d134d7636e8b5d1fb
--- /dev/null
+++ b/sandbox/win/tests/integration_tests/hooking_dll.cc
@@ -0,0 +1,28 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <windows.h>
+#include <stdio.h>
+
+#pragma data_seg(".shared")
+BOOL hook_called = false;
+#pragma data_seg()
+#pragma comment(linker, "/SECTION:.shared,RWS")
+
+extern "C" __declspec(dllexport) BOOL WasHookCalled() {
+ return hook_called;
+}
+
+extern "C" __declspec(dllexport) LRESULT
+ HookProc(int code, WPARAM wParam, LPARAM lParam) {
+ // Supported versions of Windows do not require the HHOOK to be passed along.
+ hook_called = true;
+ return CallNextHookEx(NULL, code, wParam, lParam);
+}
+
+BOOL WINAPI DllMain(__in HINSTANCE hinstDLL,
+ __in DWORD reason,
+ __in LPVOID lpvReserved) {
+ return TRUE;
+}

Powered by Google App Engine
This is Rietveld 408576698