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) // reporter is loaded instead (in case it became unloaded somehow)
typedef LPTOP_LEVEL_EXCEPTION_FILTER (WINAPI *SetUnhandledExceptionFilter_func) typedef LPTOP_LEVEL_EXCEPTION_FILTER (WINAPI *SetUnhandledExceptionFilter_func)
(LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter); (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 LPTOP_LEVEL_EXCEPTION_FILTER previousUnhandledExceptionFilter = nullptr;
static WindowsDllInterceptor gKernel32Intercept; static WindowsDllInterceptor gKernel32Intercept;
static bool gBlockUnhandledExceptionFilter = true; static bool gBlockUnhandledExceptionFilter = true;
@ -1639,9 +1640,9 @@ nsresult SetExceptionHandler(nsIFile* aXREDirectory,
// protect the crash reporter from being unloaded // protect the crash reporter from being unloaded
gBlockUnhandledExceptionFilter = true; gBlockUnhandledExceptionFilter = true;
gKernel32Intercept.Init("kernel32.dll"); gKernel32Intercept.Init("kernel32.dll");
bool ok = gKernel32Intercept.AddHook("SetUnhandledExceptionFilter", bool ok = stub_SetUnhandledExceptionFilter.Set(gKernel32Intercept,
reinterpret_cast<intptr_t>(patched_SetUnhandledExceptionFilter), "SetUnhandledExceptionFilter",
(void**) &stub_SetUnhandledExceptionFilter); &patched_SetUnhandledExceptionFilter);
#ifdef DEBUG #ifdef DEBUG
if (!ok) if (!ok)