You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Add Windows CPU temperature fallback chain to handle WBEM_E_NOT_FOUND (#103)
* fix: Add Windows CPU temperature fallback chain to handle WBEM_E_NOT_FOUND
Implements a cascading fallback mechanism for CPU temperature monitoring
on Windows to address the issue where MSAcpi_ThermalZoneTemperature is
not available on many systems (error 0x8004100C).
The fallback chain tries these sources in order:
1. MSAcpi_ThermalZoneTemperature (standard ACPI thermal zones)
2. AMD Ryzen Master SDK (AMD CPUs only, via FFI)
3. Intel WMI (Intel CPUs only, root/Intel namespace)
4. LibreHardwareMonitor WMI (any CPU, if app running)
5. None (graceful fallback without error spam)
Key changes:
- New module src/device/windows_temp/ with temperature sources
- TemperatureManager with OnceCell caching for availability status
- CPU vendor detection (AMD/Intel) for source selection
- Removed eprintln! calls that caused repeated error messages
- Updated documentation with Windows temperature limitations
Closes#102
* fix(security): Address security and robustness issues in Windows temperature module
Security fixes:
- Remove relative DLL path to prevent DLL hijacking attacks (CRITICAL)
- Only use absolute paths for AMD SDK DLL loading
Robustness improvements:
- Add compile-time struct size verification for RmQuickStats FFI safety
- Replace panic-on-lock-poisoning with graceful recovery pattern
- Use round() instead of truncation for temperature conversion accuracy
Code quality:
- Add Clone, Copy, PartialEq, Eq derives to TemperatureResult
- Add security and thread safety documentation to amd_ryzen.rs
- Simplify try_load_library() implementation
* fix: Resolve build warnings and improve WMI connection handling
- Add #[allow(dead_code)] to sensor_type field in libre_hwmon.rs
(required for WMI deserialization but not used in code)
- Refactor Intel/LibreHardwareMonitor WMI sources to avoid caching
WMIConnection (not Send + Sync), cache only namespace availability
- Fix AMD DLL path dereference in amd_ryzen.rs
- Use CpuRefreshKind::everything() for proper CPU vendor detection
* style: Apply rustfmt to intel_wmi.rs
* fix: Address cargo fmt and clippy warnings
- Use matches! macro instead of match expression in mod.rs
- Inline format arguments in eprintln! calls in amd_windows.rs
0 commit comments