The information in this article applies to:
SUMMARY
When writing a string to the registry, you must specify the length of the
string, including the terminating null character (\0). A common error is to
use strlen() to determine the length of the string, but to forget that
strlen() returns only the number of characters in the string, not including
the null terminator.
strlen( string ) + 1Note that a REG_MULTI_SZ string, which contains multiple null-terminated strings, ends with two (2) null characters, which must be factored into the length of the string. For example, a REG_MULTI_SZ string might resemble the following in memory: string1\0string2\0string3\0laststring\0\0When calculating the length of a REG_MULTI_SZ string, add the length of each of the component strings, as above, and add one for the final terminating null. Additional query words: 3.10 3.50
Keywords : kbKernBase kbNTOS310 kbNTOS350 kbNTOS351 kbNTOS400 kbWinOS2000 kbRegistry kbWinOS95 kbDSupport kbGrpKernBase |
Last Reviewed: January 11, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |