*** empty log message ***

svn path=/trunk/boinc/; revision=10157
This commit is contained in:
Rom Walton 2006-05-17 22:56:08 +00:00
parent aa3b8430af
commit e40962d2ad
2 changed files with 23 additions and 1 deletions

View File

@ -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

View File

@ -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;
}