use crate::{dbgeng::WinResult, dbgmodel::*, impl_debug_interface};
use windows::Win32::{
Foundation::E_BOUNDS,
System::Diagnostics::Debug::Extensions::IDebugHostSymbolEnumerator,
};
impl_debug_interface!(
DebugHostSymbolEnumerator,
DebugHostSymbolEnumeratorRef,
IDebugHostSymbolEnumerator
);
impl DebugHostSymbolEnumerator {
pub fn get_next(&self) -> Option<WinResult<DebugHostSymbol>> {
unsafe {
match self.0.GetNext() {
Ok(symbol) => Some(Ok(symbol.into())),
Err(e) if e.code() == E_BOUNDS => None,
Err(e) => Some(Err(e)),
}
}
}
pub fn reset(&self) -> WinResult<()> { unsafe { self.0.Reset() } }
}