summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/chef/monkey_patches/win32/registry.rb3
-rw-r--r--lib/chef/win32/registry.rb3
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/chef/monkey_patches/win32/registry.rb b/lib/chef/monkey_patches/win32/registry.rb
index a754949ca0..9471777c57 100644
--- a/lib/chef/monkey_patches/win32/registry.rb
+++ b/lib/chef/monkey_patches/win32/registry.rb
@@ -23,8 +23,7 @@ module Win32
# ::Win32::Registry#delete_key uses RegDeleteKeyW. We need to use
# RegDeleteKeyExW to properly support WOW64 systems.
def DeleteKey(hkey, name)
- arch_mask = win64? ? 0x0100 : 0x0200
- check RegDeleteKeyExW(hkey, name.to_wstring, KEY_WRITE | arch_mask, 0)
+ check RegDeleteKeyExW(hkey, name.to_wstring, 0, 0)
end
end
diff --git a/lib/chef/win32/registry.rb b/lib/chef/win32/registry.rb
index 3a01553445..e699a9bc06 100644
--- a/lib/chef/win32/registry.rb
+++ b/lib/chef/win32/registry.rb
@@ -154,8 +154,7 @@ class Chef
#Using the 'RegDeleteKeyEx' Windows API that correctly supports WOW64 systems (Win2003)
#instead of the 'RegDeleteKey'
def delete_key_ex(hive, key)
- hive_num = hive.hkey - (1 << 32)
- RegDeleteKeyExW(hive_num, wstring(key), ::Win32::Registry::KEY_WRITE | registry_system_architecture, 0) == 0
+ RegDeleteKeyExW(hive.hkey, wstring(key), 0, 0) == 0
end
def key_exists?(key_path)