gentoo90 / winreg-rs

Rust bindings to MS Windows Registry API
MIT License
168 stars 36 forks source link

/reg:64 support? #45

Closed rustdesk closed 3 years ago

rustdesk commented 3 years ago

https://stackoverflow.com/questions/11808462/avoid-registry-wow6432node-redirection

gentoo90 commented 3 years ago

This should work:

use winreg::RegKey;
use winreg::enums::*;
let hklm = RegKey::predef(HKEY_LOCAL_MACHINE);
let (key, _disp) = hklm.create_subkey_with_flags("Software\\ACME", KEY_ALL_ACCESS | KEY_WOW64_64KEY)?;
                                                                                 // ^^^^^^^^^^^^^^^

See https://stackoverflow.com/a/12796797 for details