mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1361410: Don't hook BaseThreadInitThunk when WRusr.dll is loaded, mitigating a crash; r=dmajor
MozReview-Commit-ID: KqWq2bHT0CE --HG-- extra : rebase_source : 54292be2efe4d50ec5806c1d066eb34ac97ecf14
This commit is contained in:
parent
a4e932605b
commit
5c4000df9d
@ -866,17 +866,20 @@ DllBlocklist_Initialize(uint32_t aInitFlags)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _M_IX86 // Minimize impact; crashes in BaseThreadInitThunk are vastly more frequent on x86
|
#ifdef _M_IX86 // Minimize impact. Crashes in BaseThreadInitThunk are more frequent on x86
|
||||||
if(!Kernel32Intercept.AddDetour("BaseThreadInitThunk",
|
|
||||||
|
// Bug 1361410: WRusr.dll will overwrite our hook and cause a crash.
|
||||||
|
// Workaround: If we detect WRusr.dll, don't hook.
|
||||||
|
if (!GetModuleHandleW(L"WRusr.dll")) {
|
||||||
|
if(!Kernel32Intercept.AddDetour("BaseThreadInitThunk",
|
||||||
reinterpret_cast<intptr_t>(patched_BaseThreadInitThunk),
|
reinterpret_cast<intptr_t>(patched_BaseThreadInitThunk),
|
||||||
(void**) &stub_BaseThreadInitThunk)) {
|
(void**) &stub_BaseThreadInitThunk)) {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf_stderr("BaseThreadInitThunk hook failed\n");
|
printf_stderr("BaseThreadInitThunk hook failed\n");
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif // _M_IX86
|
#endif // _M_IX86
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MFBT_API void
|
MFBT_API void
|
||||||
|
Loading…
Reference in New Issue
Block a user