fix wmi missing last value and uefi detect now uses type instead description #7511
Signed-off-by: si458 <simonsmith5521@gmail.com>
si458 committed
Dec 23, 2025 at 10:21 UTC
61b9863cebab598cc83ae67758a49aa71be21f57
2 files changed
+6
-4
agents/modules_meshcore/computer-identifiers.js
+2
-2
@@ -511,12 +511,12 @@ function windows_identifiers()
511
ret.windows.osinfo = values[0];
512
}
513
514
- values = require('win-wmi').query('ROOT\\CIMV2', "SELECT * FROM Win32_DiskPartition");
514
+ values = require('win-wmi-fixed').query('ROOT\\CIMV2', "SELECT * FROM Win32_DiskPartition");
515
if(values[0]){
516
trimResults(values);
517
ret.windows.partitions = values;
518
for (var i in values) {
519
- if (values[i].Description=='GPT: System') {
519
+ if (values[i].Type=='GPT: System') {
520
ret['identifiers']['bios_mode'] = 'UEFI';
521
}
522
}
agents/modules_meshcore/win-wmi-fixed.js
+4
-2
@@ -247,9 +247,11 @@ function enumerateProperties(j, fields)
247
OleAut32.SafeArrayAccessData(nme.Deref(), nn);
248
249
250
- for (var i = 0; i < len - 1; ++i)
250
+ for (var i = 0; i < len; ++i)
251
{
252
- properties.push(nn.Deref().increment(i * GM.PointerSize).Deref().Wide2UTF8);
252
+ var propName = nn.Deref().increment(i * GM.PointerSize).Deref().Wide2UTF8;
253
+ if (propName.length === 0) { continue; }
254
+ properties.push(propName);
255
}
256
}
257