Bug 1460022: Part 10 - Update crash reporter to work with revised DLL interceptor interface; r=dmajor

This commit is contained in:
Aaron Klotz 2018-06-27 11:51:40 -06:00
Родитель a65c046384
Коммит 390fdc316e
1 изменённых файлов: 5 добавлений и 4 удалений

Просмотреть файл

@ -338,7 +338,8 @@ nsTArray<nsAutoPtr<DelayedNote> >* 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<SetUnhandledExceptionFilter_func>
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<intptr_t>(patched_SetUnhandledExceptionFilter),
(void**) &stub_SetUnhandledExceptionFilter);
bool ok = stub_SetUnhandledExceptionFilter.Set(gKernel32Intercept,
"SetUnhandledExceptionFilter",
&patched_SetUnhandledExceptionFilter);
#ifdef DEBUG
if (!ok)