Fix shared memory reading to capture all sensor data from HWiNFO#7
Fix shared memory reading to capture all sensor data from HWiNFO#7gon3456 wants to merge 1 commit intozachstence:mainfrom
Conversation
|
As additional information, it should be noted that this problem is environment-dependent. It tends to occur especially under the following conditions
When a problem occurs, the data in the back part of the sensor index (in this case, after index 23) is completely missing. The logs appear to show that the sensor was read successfully, but the readings associated with that sensor are reported as zero. This occurs because the shared memory reading method is designed for environments with a small number of sensors and readings, and not enough memory space is reserved for larger systems. This correction will ensure that all sensor data is captured regardless of the environment. Test environment:
|
|
This fix is expected to resolve the issue reported in Issue #5. |

Problem
Some of HWiNFO's sensor data (sensors with indices 23-27) were not being retrieved. Upon examination of the debug logs, the readings associated with these sensors were reported as 0, when in fact they existed.
Cause
The cause of the problem was in the way shared memory was read. The previous code was reading headers, sensors, and readings separately, so it was not reading all the data. Particularly with the specified buffer size, some of the reading sections were missing.
Solution.
Modified HWiNFO's shared memory to read as a whole at a time:
This ensures that data from all sensors is retrieved correctly.
Technical Background
This problem was solved with the assistance of AI. Although I myself was new to Go and not familiar with HWiNFO's internal structure, I was able to identify the memory mapping issue by analyzing the debug logs and the
hwisenssm2.hheader file.With the fix, we are now getting data correctly from sensors (PresentMon, network interface, etc.) that previously had 0 readings.