From defc758e614bb8a50063abdebd2d349511e7ae41 Mon Sep 17 00:00:00 2001 From: David Major Date: Tue, 3 Mar 2015 19:33:31 +1300 Subject: [PATCH] Bug 1137609: Test for the missing export because we can't trust the version. r=glandium --HG-- extra : rebase_source : afa4439bcc3cfbc4a25999cf096962e02a2a95a4 --- toolkit/xre/WindowsCrtPatch.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/toolkit/xre/WindowsCrtPatch.h b/toolkit/xre/WindowsCrtPatch.h index 90f541cbbbad..8b848a0f2197 100644 --- a/toolkit/xre/WindowsCrtPatch.h +++ b/toolkit/xre/WindowsCrtPatch.h @@ -128,11 +128,15 @@ Init() MOZ_ASSERT(!GetModuleHandleA("msvcr120d.dll")); #if defined(_M_IX86) && defined(_MSC_VER) - if (!mozilla::IsXPSP3OrLater()) { - NtdllIntercept.Init("ntdll.dll"); - NtdllIntercept.AddHook("RtlImageNtHeader", - reinterpret_cast(patched_RtlImageNtHeader), - reinterpret_cast(&stub_RtlImageNtHeader)); + if (!mozilla::IsWin2003OrLater()) { + // Test for the export because we can't trust the SP version (bug 1137609) + HMODULE kernel = GetModuleHandleA("kernel32.dll"); + if (!kernel || !GetProcAddress(kernel, "GetLogicalProcessorInformation")) { + NtdllIntercept.Init("ntdll.dll"); + NtdllIntercept.AddHook("RtlImageNtHeader", + reinterpret_cast(patched_RtlImageNtHeader), + reinterpret_cast(&stub_RtlImageNtHeader)); + } } #endif }