Author eryksun
Recipients SilentGhost, anshul6, eryksun, paul.moore, r.david.murray, random832, steve.dower, stutzbach, tim.golden, zach.ware
Date 2015-12-03.17:52:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1449165120.58.0.312405443791.issue25778@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.
History
Date User Action Args
2015-12-03 17:52:00eryksunsetrecipients: + eryksun, paul.moore, tim.golden, stutzbach, r.david.murray, SilentGhost, zach.ware, steve.dower, random832, anshul6
2015-12-03 17:52:00eryksunsetmessageid: <1449165120.58.0.312405443791.issue25778@psf.upfronthosting.co.za>
2015-12-03 17:52:00eryksunlinkissue25778 messages
2015-12-03 17:52:00eryksuncreate