gentoo90 / winreg-rs

Rust bindings to MS Windows Registry API
MIT License
168 stars 36 forks source link

REG_NONE type causes deserialization abort #66

Open marekr opened 6 months ago

marekr commented 6 months ago

I'm doing something somewhat simple as enumerating the list of installed apps

let uninstall_key = root
    .open_subkey_with_flags(path, KEY_READ | KEY_WOW64_32KEY)
    .expect("key is missing");

// let apps: HashMap<String, InstalledApp> = uninstall_key.decode().unwrap_or_default(); let apps_result = uninstall_key.decode();

It turns out on my PC, one of the installed apps in the 32-bit view must have a key declared as REG_NONE incorrectly.

winreg does check the type in serialization_serde.rs, but the problem is, returning the DecodeResult with a error causes the entire deserialization to fail, even if the rest of the keys I'm attempting to extract are valid.

I modified line 39 of serializationserde.rs to ` => no_impl!(format!("value type deserialization not implemented {:?}", v.vtype)),`

so that I could confirm the error:

Problem opening the file: DecodeNotImplemented("value type deserialization not implemented REG_NONE")