Implements RegistryReader using the Windows API to access the registry of a live system.
fn test_reg(reg : &mut Box<dyn RegistryReader>) {
let keys = reg.enumerate_keys(HkeyCurrentUser).unwrap();
assert!(keys.contains("SOFTWARE"));
assert!(keys.contains("Microsoft"));
}
let registry = Box::new(LiveRegistryReader::new());
let key = registry.open_key(HkeyCurrentUser, "Volatile Environment").unwrap();
let value : String = registry.read_value(key, "USERNAME").unwrap().try_into().unwrap();
assert!(value.len() > 1);
let values : Vec<String> = registry.enumerate_values(key).unwrap();
test_reg(&mut registry);