-
Notifications
You must be signed in to change notification settings - Fork 7
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
IDiaEnumSymbols::Next mismatch with docs #27
Comments
I believe this is a documentation bug. Closing for now, but feel free to continue the discussion. |
Oh, just realized this method accepts a fetch count. So this is indeed a bug. |
Possibly related: microsoft/windows-rs#3402 (comment) |
Yep, something we can tweak in metadata generation (in this repository). Will try it out later today. |
That's a bug, but it isn't fatal in rendering the
I'm just leaving this here in case someone else is blocked on this bug. |
The next method does works for one element currently. But I am not sure how much is it accidental. I am using this abstractions: pub struct IDiaSymbolIterator {
symbols: IDiaEnumSymbols,
}
impl Iterator for IDiaSymbolIterator {
type Item = IDiaSymbol;
fn next(&mut self) -> Option<Self::Item> {
unsafe {
let mut result = ::core::mem::zeroed();
let mut count = 0;
self.symbols.Next(1, &mut result, &mut count).ok()?;
if count == 0 || result.is_none() {
None
} else {
result
}
}
}
} |
Arrays in C are expressed as a pointer to the first element and a length. A pointer to a single object is identical to an array of length 1. The That aside, consider keeping |
Am working on this method, but just a heads up--it's much easier to work with the for i in 0..symbols.Count()? {
println!("{}", symbols.Item(i as u32)?.name()?);
} |
Hi, I think I have found mis-generated binding,
dia-rs/src/bindings.rs
Line 1715 in 62849f0
Rust says (out) pointer to optional (1x) and DIA (https://learn.microsoft.com/en-us/visualstudio/debugger/debug-interface-access/idiaenumsymbols-next?view=vs-2022) says pointer to array.
The text was updated successfully, but these errors were encountered: