From 115b293ff55c0f8b228c259dcf6f71fd169e382b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sat, 27 Apr 2024 23:27:16 +0800 Subject: [PATCH] CPU (Windows): fix silly bug... --- src/detection/cpu/cpu_windows.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/detection/cpu/cpu_windows.c b/src/detection/cpu/cpu_windows.c index 534ec74b4..6a4d8195e 100644 --- a/src/detection/cpu/cpu_windows.c +++ b/src/detection/cpu/cpu_windows.c @@ -139,7 +139,7 @@ static const char* detectByRegistry(FFCPUResult* cpu) if(!ffRegOpenKeyForRead(HKEY_LOCAL_MACHINE, L"HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0", &hKey, NULL)) return "ffRegOpenKeyForRead(HKEY_LOCAL_MACHINE, L\"HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0\", &hKey, NULL) failed"; - if (detectSpeedByCpuid(cpu) == NULL && cpu->frequencyBase == 0) + if (detectSpeedByCpuid(cpu) != NULL || cpu->frequencyBase != cpu->frequencyBase) { uint32_t mhz; if(ffRegReadUint(hKey, L"~MHz", &mhz, NULL)) @@ -167,7 +167,7 @@ const char* ffDetectCPUImpl(const FFCPUOptions* options, FFCPUResult* cpu) if (error) return error; - if (cpu->frequencyMax == 0) + if (cpu->frequencyMax != cpu->frequencyMax) detectMaxSpeedBySmbios(cpu); if(options->temp)