From e40962d2ad97916a3d53d0830f842c6b666d27a8 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Wed, 17 May 2006 22:56:08 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=10157 --- checkin_notes | 8 ++++++++ client/win/hostinfo_win.cpp | 16 +++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/checkin_notes b/checkin_notes index 0b1437fe5d..6140cc9a1e 100755 --- a/checkin_notes +++ b/checkin_notes @@ -4809,3 +4809,11 @@ Rom 16 May 2006 lib/ diagnostics_win.C hostinfo.C, .h + +Rom 16 May 2006 + - Core client needs to still support Win95, so make the processor + feature detection code work on Win95. + + client/win/ + hostinfo_win.cpp + \ No newline at end of file diff --git a/client/win/hostinfo_win.cpp b/client/win/hostinfo_win.cpp index bc5eee8dba..1e33de7c08 100755 --- a/client/win/hostinfo_win.cpp +++ b/client/win/hostinfo_win.cpp @@ -480,6 +480,10 @@ BOOL test_processor_feature(DWORD feature) { // Detect to see if a processor feature is available for use + +// IsProcessorFeaturePresent() +typedef BOOL (__stdcall *tIPFP)( IN DWORD dwFeature ); + BOOL is_processor_feature_supported(DWORD feature) { // Detect platform information OSVERSIONINFO osvi; @@ -491,7 +495,17 @@ BOOL is_processor_feature_supported(DWORD feature) { // run a quick test. return test_processor_feature(feature); } else { - return IsProcessorFeaturePresent(feature); + HMODULE hKernel32Lib = GetModuleHandle("kernel32.dll"); + tIPFP pIPFP = (tIPFP)GetProcAddress(hKernel32Lib, "IsProcessorFeaturePresent"); + if (pIPFP) { + // IsProcessorFeaturePresent is available, use it. + return pIPFP(feature); + } else { + // Ooooppppssss, whichever version of Windows we are running on + // doesn't support IsProcessorFeaturePresent, so just test things + // out. + return test_processor_feature(feature); + } } return 0; }