-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UseAsteriskInWMI option #76
Comments
Look at the lines with I admit that the possibility of someone running this code on some obscure Windows version that I haven't considered is very low, but that is exactly what happened one time, so I added this option and left it there - for the one in a million chance someone needs it. |
I'm afraid I still don't understand. Even when using the SELECT* query, on some obscure Windows version the code will crash on this line: https://github.com/Jinjinov/Hardware.Info/blob/master/Hardware.Info/Windows/HardwareInfoRetrieval.cs#L551 |
I had to go look at the old commits to figure out why I wrote this in the README file. I had a bug when I wrote that using I will look into |
Library version
101.0.0
OS, version, architecture (32 bit / 64 bit)
Windows 11, 64-bit
Describe the bug
This is not a bug but a clarification request. I noticed that the library provides the UseAsteriskInWMI option, which allows switching between using SELECT * and a specific list of properties in WMI queries. However, given that the library typically maps results to strongly typed objects (e.g., the BIOS class in GetBiosList), using SELECT * seems slower and unnecessary as only specific properties are extracted in the code. The documentation says is safer to use asterisk because certain WMI properties might be missing and throw an exception when queried by name, but the application will crash anyway if the property is missing because explicitly extracted a few lines above (e.g. Caption = GetPropertyString(mo["Caption"]).
The text was updated successfully, but these errors were encountered: