summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaire McQuin <claire@chef.io>2015-09-03 10:16:49 -0700
committerClaire McQuin <claire@chef.io>2015-09-03 11:18:26 -0700
commitc00a3bdc8e00e512f4c3cbb2ff7169ff20a66672 (patch)
tree9e38eac5c94ac5f9648927f88a4c9b2ba90ff5bf
parent89aaa6076b7c4c4aea0e797d8cfcf6639c90816a (diff)
downloadchef-c00a3bdc8e00e512f4c3cbb2ff7169ff20a66672.tar.gz
Remove access mask to RegDeleteKeyExW, it's not useful
-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)