Skip to content

Commit 953402b

Browse files
committed
fix: access error for changing registry values
1 parent b830205 commit 953402b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/fixes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ pub async fn execute_nal_fix(http: &reqwest::Client) -> anyhow::Result<()> {
2525
}
2626

2727
pub fn set_hvci(enabled: bool) -> windows_registry::Result<()> {
28-
let key = LOCAL_MACHINE.open(r"System\CurrentControlSet\Control\DeviceGuard\Scenarios")?;
28+
let key = LOCAL_MACHINE.create(r"System\CurrentControlSet\Control\DeviceGuard\Scenarios")?;
2929
key.set_u32("HypervisorEnforcedCodeIntegrity", enabled.into())?;
3030
Ok(())
3131
}
3232

3333
pub fn set_driver_blocklist(enabled: bool) -> windows_registry::Result<()> {
34-
let key = LOCAL_MACHINE.open(r"System\CurrentControlSet\Control\CI\Config")?;
34+
let key = LOCAL_MACHINE.create(r"System\CurrentControlSet\Control\CI\Config")?;
3535
key.set_u32("VulnerableDriverBlocklistEnable", enabled.into())?;
3636
Ok(())
3737
}

0 commit comments

Comments
 (0)