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
This commit is contained in:
parent
e16d9c42cf
commit
aaccbfeda1
@ -1,3 +1,11 @@
|
|||||||
|
Tue Sep 24 12:51:07 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* 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
|
||||||
|
|
||||||
Mon Sep 23 22:16:09 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Mon Sep 23 22:16:09 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* enc/encdb.c, enc/utf_16_32.h (ENC_DUMMY_UNICODE): Unicode with BOM
|
* enc/encdb.c, enc/utf_16_32.h (ENC_DUMMY_UNICODE): Unicode with BOM
|
||||||
|
@ -212,6 +212,7 @@ For detail, see the MSDN[http://msdn.microsoft.com/library/en-us/sysinfo/base/pr
|
|||||||
# Win32 APIs
|
# Win32 APIs
|
||||||
#
|
#
|
||||||
module API
|
module API
|
||||||
|
include Constants
|
||||||
extend Importer
|
extend Importer
|
||||||
dlload "advapi32.dll"
|
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
|
name = WCHAR_NUL * Constants::MAX_KEY_LENGTH
|
||||||
size = packdw(Constants::MAX_KEY_LENGTH)
|
size = packdw(Constants::MAX_KEY_LENGTH)
|
||||||
check RegEnumValueW.call(hkey, index, name, size, 0, 0, 0, 0)
|
check RegEnumValueW.call(hkey, index, name, size, 0, 0, 0, 0)
|
||||||
name[0, unpackdw(size)/WCHAR_SIZE].encode
|
name[0, unpackdw(size)].encode
|
||||||
end
|
end
|
||||||
|
|
||||||
def EnumKey(hkey, index)
|
def EnumKey(hkey, index)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user