develooper Front page | perl.perl6.users | Postings from January 2020

Re: stolen uint's

Thread Previous | Thread Next
ToddAndMargo via perl6-users
January 29, 2020 23:32
Re: stolen uint's
Message ID:
On 2020-01-29 15:22, Trey Harris wrote:
> On Wed, Jan 29, 2020 at 17:52 ToddAndMargo via perl6-users 
> < <>> wrote:
>     On 2020-01-29 14:20, Trey Harris wrote:
>      > I don’t care about IpData or ValueData—those are completely
>     unremarkable
>      > fields. Showing me more code relating to them—or any other fields
>      > besides cData—isn’t helpful to understanding how the 3-bytes UTF
>     + null
>      > cData field works.
>     hi Trey,
>     I think what I am missing is your "3-bytes UTF + null" question.
>     It is only four bytes long when addressed as a REG_DWORD
>     (32 bit unsigned integer).  There is no nul at the end.
>     The bounds are 0x0..0xFFFF_FFFF.  No boxing allowed
>     $cbData = 4;
>     If your are addressing is as a REG_SZ (registry string),
>     it can be as many bytes as you want when.  You just have
>     to terminate it with a 0x0000
>     $cbData = $lpData.elems * 2;  # words are two bytes long
>     Does that help?
> Could you show the API definition again, please? The copy I see says 
> that field is a `DWORD cbData`. I don’t see the “as many bytes as you 
> want when. You just have to terminate it with a 0x0000” part of the 
> definition. Could you highlight it?


        The data to be stored.

        For string-based types, such as REG_SZ, the string must
        be null-terminated.


        The size of the information pointed to by the lpData
        parameter, in bytes. If the data is of type REG_SZ,
        REG_EXPAND_SZ, or REG_MULTI_SZ, cbData must include
        the size of the terminating null character or

Any better?

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About