On Wed, Jan 29, 2020 at 17:52 ToddAndMargo via perl6-users < perl6-us...@perl.org> 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?