diff options
author | PrajaktaPurohit <prajakta@opscode.com> | 2013-01-25 16:14:58 -0800 |
---|---|---|
committer | danielsdeleo <dan@opscode.com> | 2013-01-28 10:30:19 -0800 |
commit | 73d5fd493198ba6fdd86f988c29191aae86d2301 (patch) | |
tree | b86a926e4b25742794d9439adf7ef4ec6b59f9fb | |
parent | 525b416e0cf0377e8067d6288b5c5b972a1603aa (diff) | |
download | chef-73d5fd493198ba6fdd86f988c29191aae86d2301.tar.gz |
Ading/Editing comments
-rw-r--r-- | lib/chef/win32/registry.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/chef/win32/registry.rb b/lib/chef/win32/registry.rb index b8a6b20ca4..a1e9a6d237 100644 --- a/lib/chef/win32/registry.rb +++ b/lib/chef/win32/registry.rb @@ -116,10 +116,11 @@ class Chef Chef::Log.debug("Registry key #{key_path}, does not exist, not deleting") return true end - #Get the hive(HKLM), - #hive_namespace(::Win32::Registry::HKEY_LOCAL_MACHINE) - hive = key_path.split("\\").shift #HKLM - hive_namespace, key_including_parent = get_hive_and_key(key_path) #::Win32::Registry::HKEY_LOCAL_MACHINE + #key_path is in the form "HKLM\Software\Opscode" for example, extracting + #hive = HKLM, + #hive_namespace = ::Win32::Registry::HKEY_LOCAL_MACHINE + hive = key_path.split("\\").shift + hive_namespace, key_including_parent = get_hive_and_key(key_path) if has_subkeys?(key_path) if recursive == true subkeys = get_subkeys(key_path) @@ -139,6 +140,8 @@ class Chef true end + #Using the 'RegDeleteKeyEx' Windows API that correctly supports WOW64 systems (Win2003) + #instead of the 'RegDeleteKey' def delete_key_ex(hive, key) regDeleteKeyEx = ::Win32::API.new('RegDeleteKeyEx', 'LPLL', 'L', 'advapi32') hive_num = hive.hkey - (1 << 32) |