summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-24 03:51:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-24 03:51:14 +0000
commitaaccbfeda10964119766c69949e563c5430f2b4d (patch)
tree82c4111dbe66e0bc32776f89f1e755bd3ee276d3 /ext
parente16d9c42cf7f7d6b8f56cb8cf627591b6bd57f5d (diff)
win32/registry.rb: fix runtime errors
* ext/win32/lib/win32/registry.rb (Win32::Registry::API): need Constants. * ext/win32/lib/win32/registry.rb (Win32::Registry::API#EnumValue): size of the name is in WCHARs, not in bytes git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/win32/lib/win32/registry.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/win32/lib/win32/registry.rb b/ext/win32/lib/win32/registry.rb
index 6c678e49db..0b4e5870a5 100644
--- a/ext/win32/lib/win32/registry.rb
+++ b/ext/win32/lib/win32/registry.rb
@@ -212,6 +212,7 @@ For detail, see the MSDN[http://msdn.microsoft.com/library/en-us/sysinfo/base/pr
# Win32 APIs
#
module API
+ include Constants
extend Importer
dlload "advapi32.dll"
[
@@ -289,7 +290,7 @@ For detail, see the MSDN[http://msdn.microsoft.com/library/en-us/sysinfo/base/pr
name = WCHAR_NUL * Constants::MAX_KEY_LENGTH
size = packdw(Constants::MAX_KEY_LENGTH)
check RegEnumValueW.call(hkey, index, name, size, 0, 0, 0, 0)
- name[0, unpackdw(size)/WCHAR_SIZE].encode
+ name[0, unpackdw(size)].encode
end
def EnumKey(hkey, index)