ruby-changes:48143
From: usa <ko1@a...>
Date: Sat, 21 Oct 2017 21:12:58 +0900 (JST)
Subject: [ruby-changes:48143] usa:r60257 (trunk): Treat REG_NONE just like REG_BINARY
usa 2017-10-21 21:12:52 +0900 (Sat, 21 Oct 2017) New Revision: 60257 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60257 Log: Treat REG_NONE just like REG_BINARY * ext/win32/lib/win32/registry.rb (read, write): treat REG_NONE just like REG_BINARY when reading and writing. cf. [Bug #7526] Modified files: trunk/ext/win32/lib/win32/registry.rb Index: ext/win32/lib/win32/registry.rb =================================================================== --- ext/win32/lib/win32/registry.rb (revision 60256) +++ ext/win32/lib/win32/registry.rb (revision 60257) @@ -635,7 +635,7 @@ For detail, see the MSDN[http://msdn.mic https://github.com/ruby/ruby/blob/trunk/ext/win32/lib/win32/registry.rb#L635 # Array of String # :REG_DWORD, REG_DWORD_BIG_ENDIAN, REG_QWORD # Integer - # :REG_BINARY + # :REG_BINARY, REG_NONE # String (contains binary data) # # When rtype is specified, the value type must be included by @@ -652,7 +652,7 @@ For detail, see the MSDN[http://msdn.mic https://github.com/ruby/ruby/blob/trunk/ext/win32/lib/win32/registry.rb#L652 [ type, data.encode(name.encoding, WCHAR).chop ] when REG_MULTI_SZ [ type, data.encode(name.encoding, WCHAR).split(/\0/) ] - when REG_BINARY + when REG_BINARY, REG_NONE [ type, data ] when REG_DWORD [ type, API.unpackdw(data) ] @@ -748,7 +748,7 @@ For detail, see the MSDN[http://msdn.mic https://github.com/ruby/ruby/blob/trunk/ext/win32/lib/win32/registry.rb#L748 when REG_MULTI_SZ data = data.to_a.map {|s| s.encode(WCHAR)}.join(WCHAR_NUL) << WCHAR_NUL termsize = WCHAR_SIZE - when REG_BINARY + when REG_BINARY, REG_NONE data = data.to_s when REG_DWORD data = API.packdw(data.to_i) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/