ruby-changes:30947
From: nobu <ko1@a...>
Date: Tue, 24 Sep 2013 12:51:20 +0900 (JST)
Subject: [ruby-changes:30947] nobu:r43026 (trunk): win32/registry.rb: fix runtime errors
nobu 2013-09-24 12:51:14 +0900 (Tue, 24 Sep 2013) New Revision: 43026 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43026 Log: 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 Modified files: trunk/ChangeLog trunk/ext/win32/lib/win32/registry.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 43025) +++ ChangeLog (revision 43026) @@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Tue Sep 24 12:51:07 2013 Nobuyoshi Nakada <nobu@r...> + + * 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@r...> * enc/encdb.c, enc/utf_16_32.h (ENC_DUMMY_UNICODE): Unicode with BOM Index: ext/win32/lib/win32/registry.rb =================================================================== --- ext/win32/lib/win32/registry.rb (revision 43025) +++ ext/win32/lib/win32/registry.rb (revision 43026) @@ -212,6 +212,7 @@ For detail, see the MSDN[http://msdn.mic https://github.com/ruby/ruby/blob/trunk/ext/win32/lib/win32/registry.rb#L212 # Win32 APIs # module API + include Constants extend Importer dlload "advapi32.dll" [ @@ -289,7 +290,7 @@ For detail, see the MSDN[http://msdn.mic https://github.com/ruby/ruby/blob/trunk/ext/win32/lib/win32/registry.rb#L290 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) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/