c - RegEnumValue and REG_MULTI_SZ type -
msdn says string data got regenumvalue that
if data has reg_sz, reg_multi_sz or reg_expand_sz type, string may not have been stored proper null-terminating characters. therefore, if function returns error_success, application should ensure string terminated before using it; otherwise, may overwrite buffer. (note reg_multi_sz strings should have 2 null-terminating characters.)
suppose value reg_multi_sz, mean each of strings in sequence can or cannot null-terminated, or last double null terminator may absent, inner null terminators present?
suppose value reg_multi_sz, mean each of strings in sequence can or cannot null-terminated
the strings in sequence must null terminated or else impossible determine 1 of string ends , next string begins. registry value types describing reg_multi_sz:
sequence of null-terminated strings, terminated empty string (\0). following example: string1\0string2\0string3\0laststring\0\0 first \0 terminates first string, second last \0 terminates last string, , final \0 terminates sequence. note final terminator must factored length of string.
the documentation vague interpretation last null terminators may missing:
string1\0string2\0string3\0laststring and code reading value must ensure present subsequent string extraction.
if buffer being used contain value large enough, including space terminating null characters, long code ensures trailing nulls present there nothing concerned about.
Comments
Post a Comment