-
Notifications
You must be signed in to change notification settings - Fork 3
Description
When using wmi.query without the third argument, it is supposed to return all properties from the query.
I was stumped because wmi.query('root/StandardCimv2', 'SELECT * FROM MSFT_NetConnectionProfile') did not return the NetworkCategory property.
If I specify the list of properties, then NetworkCategory is correctly returned.
It looks like in https://github.com/intel/wmi-native-module/blob/main/src/wmi_wrapper.cpp in GetAllPropertyValues, start and end indices into the array are retrieved via SafeArrayGetLBound and SafeArrayGetUBound. There's then a for (int i = start; i < end; ++i) to iterate over them.
However SafeArrayGetUBound is the actual upper bound, i.e. the indices are inclusive.
It's probably enough to change the loop's condition to i <= end to fix the issue. I haven't had the opportunity to try it yet, if someone has the time to try it and (if I'm correct) fix it before I can, please do.