Bug 1137609 - Test for the missing export because we can't trust the version. r=glandium, a=sledru
authorDavid Major <dmajor@mozilla.com>
Tue, 03 Mar 2015 19:33:31 +1300
changeset 245444 d3002e389444
parent 245443 7e01afd0e736
child 245445 611f37fccce0
push id676
push userryanvm@gmail.com
push date2015-03-04 16:46 +0000
treeherdermozilla-release@611f37fccce0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium, sledru
bugs1137609
milestone36.0
Bug 1137609 - Test for the missing export because we can't trust the version. r=glandium, a=sledru
toolkit/xre/WindowsCrtPatch.h
--- a/toolkit/xre/WindowsCrtPatch.h
+++ b/toolkit/xre/WindowsCrtPatch.h
@@ -127,20 +127,24 @@ Init()
   MOZ_ASSERT(!GetModuleHandleA("msvcr120.dll"));
   MOZ_ASSERT(!GetModuleHandleA("msvcr120d.dll"));
 
   // Temporary until we fully switch over to VS 2013:
   MOZ_ASSERT(!GetModuleHandleA("msvcr100.dll"));
   MOZ_ASSERT(!GetModuleHandleA("msvcr100d.dll"));
 
 #if defined(_M_IX86) && defined(_MSC_VER) && _MSC_VER >= 1800
-  if (!mozilla::IsXPSP3OrLater()) {
-    NtdllIntercept.Init("ntdll.dll");
-    NtdllIntercept.AddHook("RtlImageNtHeader",
-                           reinterpret_cast<intptr_t>(patched_RtlImageNtHeader),
-                           reinterpret_cast<void**>(&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<intptr_t>(patched_RtlImageNtHeader),
+                             reinterpret_cast<void**>(&stub_RtlImageNtHeader));
+    }
   }
 #endif
 }
 
 } // namespace WindowsCrtPatch
 
 #endif // WindowsCrtPatch_h