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);
|
typedef MOZ_NORETURN_PTR void (__fastcall* BaseThreadInitThunk_func)(BOOL aIsInitialThread, void* aStartAddress, void* aThreadParam);
|
||||||
static BaseThreadInitThunk_func stub_BaseThreadInitThunk = nullptr;
|
static BaseThreadInitThunk_func stub_BaseThreadInitThunk = nullptr;
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef NTSTATUS (NTAPI *LdrLoadDll_func) (PWCHAR filePath, PULONG flags, PUNICODE_STRING moduleFileName, PHANDLE handle);
|
typedef NTSTATUS (NTAPI *LdrLoadDll_func) (PWCHAR filePath, PULONG flags, PUNICODE_STRING moduleFileName, PHANDLE handle);
|
||||||
static LdrLoadDll_func stub_LdrLoadDll;
|
static LdrLoadDll_func stub_LdrLoadDll;
|
||||||
|
|
@ -786,6 +788,7 @@ continue_loading:
|
||||||
return stub_LdrLoadDll(filePath, flags, moduleFileName, handle);
|
return stub_LdrLoadDll(filePath, flags, moduleFileName, handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _M_IX86
|
||||||
static bool
|
static bool
|
||||||
ShouldBlockThread(void* aStartAddress)
|
ShouldBlockThread(void* aStartAddress)
|
||||||
{
|
{
|
||||||
|
|
@ -821,6 +824,8 @@ patched_BaseThreadInitThunk(BOOL aIsInitialThread, void* aStartAddress,
|
||||||
stub_BaseThreadInitThunk(aIsInitialThread, aStartAddress, aThreadParam);
|
stub_BaseThreadInitThunk(aIsInitialThread, aStartAddress, aThreadParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // _M_IX86
|
||||||
|
|
||||||
|
|
||||||
static WindowsDllInterceptor NtDllIntercept;
|
static WindowsDllInterceptor NtDllIntercept;
|
||||||
static WindowsDllInterceptor Kernel32Intercept;
|
static WindowsDllInterceptor Kernel32Intercept;
|
||||||
|
|
@ -870,6 +875,8 @@ DllBlocklist_Initialize(uint32_t aInitFlags)
|
||||||
}
|
}
|
||||||
#endif
|
#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.
|
// Bug 1361410: WRusr.dll will overwrite our hook and cause a crash.
|
||||||
// Workaround: If we detect WRusr.dll, don't hook.
|
// Workaround: If we detect WRusr.dll, don't hook.
|
||||||
if (!GetModuleHandleW(L"WRusr.dll")) {
|
if (!GetModuleHandleW(L"WRusr.dll")) {
|
||||||
|
|
@ -881,6 +888,7 @@ DllBlocklist_Initialize(uint32_t aInitFlags)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // _M_IX86
|
||||||
}
|
}
|
||||||
|
|
||||||
MFBT_API void
|
MFBT_API void
|
||||||
|
|
|
||||||
|
|
@ -548,7 +548,9 @@ int main()
|
||||||
TestHook(TestSetCursorPos, "user32.dll", "SetCursorPos") &&
|
TestHook(TestSetCursorPos, "user32.dll", "SetCursorPos") &&
|
||||||
TestHook(TestTlsAlloc, "kernel32.dll", "TlsAlloc") &&
|
TestHook(TestTlsAlloc, "kernel32.dll", "TlsAlloc") &&
|
||||||
TestHook(TestTlsFree, "kernel32.dll", "TlsFree") &&
|
TestHook(TestTlsFree, "kernel32.dll", "TlsFree") &&
|
||||||
|
#ifdef _M_IX86
|
||||||
TestDetour("kernel32.dll", "BaseThreadInitThunk") &&
|
TestDetour("kernel32.dll", "BaseThreadInitThunk") &&
|
||||||
|
#endif
|
||||||
TestDetour("ntdll.dll", "LdrLoadDll")) {
|
TestDetour("ntdll.dll", "LdrLoadDll")) {
|
||||||
printf("TEST-PASS | WindowsDllInterceptor | all checks passed\n");
|
printf("TEST-PASS | WindowsDllInterceptor | all checks passed\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue