Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ssrlive committed Dec 4, 2024
1 parent f7d9189 commit e20697d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,11 +410,13 @@ impl Drop for Adapter {
self.adapter = UnsafeHandle(ptr::null_mut());
if let Ok(name) = name {
// Delete registry related to network card
_ = delete_reg(&name);
_ = delete_adapter_info_from_reg(&name);
}
}
}
pub fn delete_reg(dev_name: &str) -> std::io::Result<()> {

/// This function is used to avoid the adapter name and guid being recorded in the registry
pub(crate) fn delete_adapter_info_from_reg(dev_name: &str) -> std::io::Result<()> {
use winreg::{enums::HKEY_LOCAL_MACHINE, enums::KEY_ALL_ACCESS, RegKey};
let hklm = RegKey::predef(HKEY_LOCAL_MACHINE);
let profiles_key = hklm.open_subkey_with_flags(
Expand Down

0 comments on commit e20697d

Please sign in to comment.