diff --git a/toolkit/crashreporter/nsExceptionHandler.cpp b/toolkit/crashreporter/nsExceptionHandler.cpp index 7f42278ef244..319f78f27cc0 100644 --- a/toolkit/crashreporter/nsExceptionHandler.cpp +++ b/toolkit/crashreporter/nsExceptionHandler.cpp @@ -338,7 +338,8 @@ nsTArray >* gDelayedAnnotations; // reporter is loaded instead (in case it became unloaded somehow) typedef LPTOP_LEVEL_EXCEPTION_FILTER (WINAPI *SetUnhandledExceptionFilter_func) (LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter); -static SetUnhandledExceptionFilter_func stub_SetUnhandledExceptionFilter = 0; +static WindowsDllInterceptor::FuncHookType + stub_SetUnhandledExceptionFilter; static LPTOP_LEVEL_EXCEPTION_FILTER previousUnhandledExceptionFilter = nullptr; static WindowsDllInterceptor gKernel32Intercept; static bool gBlockUnhandledExceptionFilter = true; @@ -1639,9 +1640,9 @@ nsresult SetExceptionHandler(nsIFile* aXREDirectory, // protect the crash reporter from being unloaded gBlockUnhandledExceptionFilter = true; gKernel32Intercept.Init("kernel32.dll"); - bool ok = gKernel32Intercept.AddHook("SetUnhandledExceptionFilter", - reinterpret_cast(patched_SetUnhandledExceptionFilter), - (void**) &stub_SetUnhandledExceptionFilter); + bool ok = stub_SetUnhandledExceptionFilter.Set(gKernel32Intercept, + "SetUnhandledExceptionFilter", + &patched_SetUnhandledExceptionFilter); #ifdef DEBUG if (!ok)