Message255829
> I don't like the idea of having a mismatch between what we set and
> what we get, even if what we're setting technically shouldn't be
> allowed.
Currently if you set a string with null, you won't see it using either regedit.exe or reg.exe:
>>> import os, winreg
>>> data = "a string\x00 with a null"
>>> HKCU = winreg.HKEY_CURRENT_USER
>>> winreg.SetValueEx(HKCU, "test", 0, winreg.REG_SZ, data)
>>> winreg.QueryValueEx(HKCU, "test")
('a string\x00 with a null', 1)
>>> os.system('reg query HKCU /v test')
HKEY_CURRENT_USER
test REG_SZ a string
0
The registry saves the whole buffer, agnostic to the type, but clearly Microsoft has documented and treats REG_SZ as a null-terminated string. We should follow suit. |
|
Date |
User |
Action |
Args |
2015-12-03 17:52:00 | eryksun | set | recipients:
+ eryksun, paul.moore, tim.golden, stutzbach, r.david.murray, SilentGhost, zach.ware, steve.dower, random832, anshul6 |
2015-12-03 17:52:00 | eryksun | set | messageid: <1449165120.58.0.312405443791.issue25778@psf.upfronthosting.co.za> |
2015-12-03 17:52:00 | eryksun | link | issue25778 messages |
2015-12-03 17:52:00 | eryksun | create | |
|