Re: RegCreateKeyEx help



"Andy Kennedy" <spamtrap@xxxxxxxxxx> wrote:

I am looking for help regarding comment on RegistryText
line.

szStringValue db "Some String" ,0
RegistryText db "This is our text. Cool, huh?" ,0
; Only This is our [shows in reg]
; For some reason only 12 chars are displayed ?

Not so hard to figure out:

invoke SetRegKeysz , ADDR RegistryText, ADDR szKeyName,
ADDR szStringValue, SIZEOF szStringValue

Look what you are passing as the size of the string: "SIZEOF
szStringValue". That happens to be 12 bytes. I suspect you really wanted
"SIZEOF RegistryText" here.

Many registry strings are of type REG_MULTI_SZ, which consists of multiple
zero-terminated strings, where the end is denoted by two 0 characters.
Thus, passing the string length into a registry routine is generally good
practice.

However, it is easy to find a string's length with the "repne scasb"
instruction.
--
- Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.

.