Don't blindly progress past errors...
@@ -175,7 +175,7 @@ impl SystemExt for System {
};
if status != PDH_MORE_DATA as i32 {
eprintln!("PdhEnumObjectItems invalid status: {:x}", status);
- }
+ } else {
let mut pwsCounterListBuffer: Vec<u16> =
Vec::with_capacity(dwCounterListSize as usize);
let mut pwsInstanceListBuffer: Vec<u16> =
@@ -199,8 +199,7 @@ impl SystemExt for System {
};
if status != ERROR_SUCCESS as i32 {
eprintln!("PdhEnumObjectItems invalid status: {:x}", status);
- }
-
+ } else {
for (pos, x) in pwsInstanceListBuffer
.split(|x| *x == 0)
.filter(|x| x.len() > 0)
@@ -241,6 +240,8 @@ impl SystemExt for System {
}
}
}
+ }
+ }
query.start();
}
s.refresh_specifics(refreshes);
