From 63e70eee769555ebabcc4c7b751062efe5aa62fa Mon Sep 17 00:00:00 2001 From: Aaron Klotz Date: Wed, 27 Jun 2018 11:49:17 -0600 Subject: [PATCH] Bug 1460022: Part 4 - Update a11y code to reflect new interface for DLL interceptor; r=Jamie --HG-- extra : rebase_source : ada28438a506edcd4a122ec2c99a742503baa945 --- accessible/windows/msaa/Compatibility.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/accessible/windows/msaa/Compatibility.cpp b/accessible/windows/msaa/Compatibility.cpp index 6446f19805c0..f4434f37c0b5 100644 --- a/accessible/windows/msaa/Compatibility.cpp +++ b/accessible/windows/msaa/Compatibility.cpp @@ -95,7 +95,8 @@ Compatibility::IsModuleVersionLessThan(HMODULE aModuleHandle, //////////////////////////////////////////////////////////////////////////////// static WindowsDllInterceptor sUser32Interceptor; -static decltype(&InSendMessageEx) sInSendMessageExStub = nullptr; +static WindowsDllInterceptor::FuncHookType + sInSendMessageExStub; static bool sInSendMessageExHackEnabled = false; static PVOID sVectoredExceptionHandler = nullptr; @@ -267,11 +268,9 @@ Compatibility::Init() if ((sConsumers & (~(UIAUTOMATION | NVDA))) && BrowserTabsRemoteAutostart()) { sUser32Interceptor.Init("user32.dll"); - if (!sInSendMessageExStub) { - sUser32Interceptor.AddHook("InSendMessageEx", - reinterpret_cast(&InSendMessageExHook), - (void**)&sInSendMessageExStub); - } + sInSendMessageExStub.Set(sUser32Interceptor, "InSendMessageEx", + &InSendMessageExHook); + // The vectored exception handler allows us to catch exceptions ahead of any // SEH handlers. if (!sVectoredExceptionHandler) {