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

Side by Side 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: GN fix (thanks Bruce) Created 4 years, 8 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
Will Harris 2016/04/04 00:15:09 no (c)
penny 2016/04/11 22:11:59 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <windows.h>
6 #include <stdio.h>
7
8 #pragma data_seg(".shared")
9 BOOL hook_called = false;
Will Harris 2016/04/04 00:15:09 why is this linker-fu needed?
penny 2016/04/11 22:11:59 Fair question. I've added some detailed comments.
10 #pragma data_seg()
11 #pragma comment(linker, "/SECTION:.shared,RWS")
12
13 extern "C" __declspec(dllexport) BOOL WasHookCalled() {
14 return hook_called;
15 }
16
17 extern "C" __declspec(dllexport) LRESULT
18 HookProc(int code, WPARAM wParam, LPARAM lParam) {
19 // Supported versions of Windows do not require the HHOOK to be passed along.
20 hook_called = true;
21 return CallNextHookEx(NULL, code, wParam, lParam);
22 }
23
24 BOOL WINAPI DllMain(__in HINSTANCE hinstDLL,
25 __in DWORD reason,
26 __in LPVOID lpvReserved) {
27 return TRUE;
28 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698