pub fn list() -> io::Result<Vec<Listing>> {
    let hklm = RegKey::predef(HKEY_LOCAL_MACHINE);

    let software = hklm.open_subkey("SOFTWARE")?;
    let passthru = software.open_subkey("PassThruSupport.04.04");
    if let Err(err) = passthru {
        if err.kind() == io::ErrorKind::NotFound {
            return Ok(Vec::new());
        }
        return Err(err);
    }
    let passthru = passthru.unwrap();
    let mut listings = Vec::new();

    for name in passthru.enum_keys() {
        let name = name?;
        let key = passthru.open_subkey(name)?;

        let device_name: String = key.get_value("Name")?;
        let vendor: String = key.get_value("Vendor")?;
        let path: String = key.get_value("FunctionLibrary")?;

        listings.push(Listing {name: device_name, vendor: vendor, path: path});
    }

    Ok(listings)
}
/// Returns a list of all installed PassThru drivers
Returns a list of all installed PassThru drivers
Returns a list of all installed PassThru drivers
pub fn list() -> io::Result<Vec<Listing>> {
    let hklm = RegKey::predef(HKEY_LOCAL_MACHINE);
    let software = hklm.open_subkey("SOFTWARE")?;
    let passthru = software.open_subkey("PassThruSupport.04.04");
    if let Err(err) = passthru {
        if err.kind() == io::ErrorKind::NotFound {
            return Ok(Vec::new());
        }
        return Err(err);
    }
    let passthru = passthru.unwrap();
    let mut listings = Vec::new();
    for name in passthru.enum_keys() {
        let name = name?;
        let key = passthru.open_subkey(name)?;
        let device_name: String = key.get_value("Name")?;
        let vendor: String = key.get_value("Vendor")?;
        let path: String = key.get_value("FunctionLibrary")?;
        listings.push(Listing {name: device_name, vendor: vendor, path: path});
    }
    Ok(listings)
}
pub fn list ( ) -> io :: Result < Vec < Listing > > { let hklm = RegKey :: predef ( HKEY_LOCAL_MACHINE ) ; let software = hklm . open_subkey ( " " ) ? ; let passthru = software . open_subkey ( " " ) ; if let Err ( err ) = passthru { if err . kind ( ) == io :: ErrorKind :: NotFound { return Ok ( Vec :: new ( ) ) ; } return Err ( err ) ; } let passthru = passthru . unwrap ( ) ; let mut listings = Vec :: new ( ) ; for name in passthru . enum_keys ( ) { let name = name ? ; let key = passthru . open_subkey ( name ) ? ; let device_name : String = key . get_value ( " " ) ? ; let vendor : String = key . get_value ( " " ) ? ; let path : String = key . get_value ( " " ) ? ; listings . push ( Listing { name : device_name , vendor : vendor , path : path } ) ; } Ok ( listings ) }
Returns a list of all installed PassThru drivers
Returns a list of all installed PassThru drivers