forked from mirrors/gecko-dev
Backed out changeset 4dab43248f15 (bug 1372823) for crashing GTest on Windows 10 x64 debug. r=backout
MozReview-Commit-ID: 1u7TFtv6Mdv
This commit is contained in:
parent
ddbf9d22ec
commit
15ce5cb2db
2 changed files with 10 additions and 0 deletions
|
|
@ -303,8 +303,10 @@ printf_stderr(const char *fmt, ...)
|
|||
}
|
||||
|
||||
|
||||
#ifdef _M_IX86
|
||||
typedef MOZ_NORETURN_PTR void (__fastcall* BaseThreadInitThunk_func)(BOOL aIsInitialThread, void* aStartAddress, void* aThreadParam);
|
||||
static BaseThreadInitThunk_func stub_BaseThreadInitThunk = nullptr;
|
||||
#endif
|
||||
|
||||
typedef NTSTATUS (NTAPI *LdrLoadDll_func) (PWCHAR filePath, PULONG flags, PUNICODE_STRING moduleFileName, PHANDLE handle);
|
||||
static LdrLoadDll_func stub_LdrLoadDll;
|
||||
|
|
@ -786,6 +788,7 @@ continue_loading:
|
|||
return stub_LdrLoadDll(filePath, flags, moduleFileName, handle);
|
||||
}
|
||||
|
||||
#ifdef _M_IX86
|
||||
static bool
|
||||
ShouldBlockThread(void* aStartAddress)
|
||||
{
|
||||
|
|
@ -821,6 +824,8 @@ patched_BaseThreadInitThunk(BOOL aIsInitialThread, void* aStartAddress,
|
|||
stub_BaseThreadInitThunk(aIsInitialThread, aStartAddress, aThreadParam);
|
||||
}
|
||||
|
||||
#endif // _M_IX86
|
||||
|
||||
|
||||
static WindowsDllInterceptor NtDllIntercept;
|
||||
static WindowsDllInterceptor Kernel32Intercept;
|
||||
|
|
@ -870,6 +875,8 @@ DllBlocklist_Initialize(uint32_t aInitFlags)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef _M_IX86 // Minimize impact. Crashes in BaseThreadInitThunk are more frequent on x86
|
||||
|
||||
// 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")) {
|
||||
|
|
@ -881,6 +888,7 @@ DllBlocklist_Initialize(uint32_t aInitFlags)
|
|||
#endif
|
||||
}
|
||||
}
|
||||
#endif // _M_IX86
|
||||
}
|
||||
|
||||
MFBT_API void
|
||||
|
|
|
|||
|
|
@ -548,7 +548,9 @@ int main()
|
|||
TestHook(TestSetCursorPos, "user32.dll", "SetCursorPos") &&
|
||||
TestHook(TestTlsAlloc, "kernel32.dll", "TlsAlloc") &&
|
||||
TestHook(TestTlsFree, "kernel32.dll", "TlsFree") &&
|
||||
#ifdef _M_IX86
|
||||
TestDetour("kernel32.dll", "BaseThreadInitThunk") &&
|
||||
#endif
|
||||
TestDetour("ntdll.dll", "LdrLoadDll")) {
|
||||
printf("TEST-PASS | WindowsDllInterceptor | all checks passed\n");
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue