MCPcopy Create free account
hub / github.com/PowerShell/DSC / open_regkey

Function open_regkey

lib/dsc-lib-registry/src/lib.rs:414–424  ·  view source on GitHub ↗
(path: &str, permission: Security)

Source from the content-addressed store, hash-verified

412}
413
414fn open_regkey(path: &str, permission: Security) -> Result<(RegKey, &str), RegistryError> {
415 let (hive, subkey) = get_hive_from_path(path)?;
416 match hive.open(subkey, permission) {
417 Ok(regkey) => Ok((regkey, subkey)),
418 // handle NotFound error
419 Err(key::Error::NotFound(_, _)) => {
420 Err(RegistryError::RegistryKeyNotFound(path.to_string()))
421 },
422 Err(e) => Err(RegistryError::RegistryKey(e)),
423 }
424}
425
426fn get_parent_key_path(key_path: &str) -> &str {
427 match key_path.rfind('\\') {

Callers 1

openMethod · 0.85

Calls 3

get_hive_from_pathFunction · 0.85
RegistryKeyClass · 0.85
openMethod · 0.45

Tested by

no test coverage detected