Compatible with REG_MULTI_SZ when set value.

This commit is contained in:
Green-m 2018-11-29 15:47:09 +08:00
parent 691546334a
commit 3e571ff71a
1 changed files with 2 additions and 2 deletions

View File

@ -215,7 +215,7 @@ class Registry
request.add_tlv(TLV_TYPE_VALUE_NAME, name)
request.add_tlv(TLV_TYPE_VALUE_TYPE, type)
if (type == REG_SZ)
if type == REG_SZ || type == REG_MULTI_SZ
data += "\x00"
elsif (type == REG_DWORD)
data = [ data.to_i ].pack("V")
@ -237,7 +237,7 @@ class Registry
request.add_tlv(TLV_TYPE_VALUE_NAME, name)
request.add_tlv(TLV_TYPE_VALUE_TYPE, type)
if type == REG_SZ
if type == REG_SZ || type == REG_MULTI_SZ
data += "\x00"
elsif type == REG_DWORD
data = [data.to_i].pack('V')