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

Function remove_key

archive/registry/src/regconfighelper.rs:146–159  ·  view source on GitHub ↗
(key_path: &str)

Source from the content-addressed store, hash-verified

144}
145
146fn remove_key(key_path: &str) -> Result<(), RegistryError> {
147 match RegistryKey::new(key_path) {
148 Ok(key) => {
149 key.delete(true)?;
150 Ok(())
151 },
152 Err(NtStatusError { status: NtStatusErrorKind::ObjectNameNotFound, ..}) => {
153 Ok(()) // key doesn't exist, so we're good
154 }
155 Err(err) => {
156 Err(RegistryError::NtStatus(err))
157 }
158 }
159}
160
161fn open_or_create_key(key_path: &str) -> Result<RegistryKey, RegistryError> {
162 let reg_key: RegistryKey;

Callers 1

config_setFunction · 0.85

Calls 2

newFunction · 0.50
deleteMethod · 0.45

Tested by

no test coverage detected