wdext 0.1.0

A DbgEng wrapper framework
// SPDX-FileCopyrightText: 2026 takubokudori
// SPDX-License-Identifier: MIT OR Apache-2.0
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() } }
}