[VERSION] Fix VerQueryValue when return Value is NULL. (#7449)

CORE-19783
Co-authored-by: Timo Kreuzer <timo.kreuzer@reactos.org>
This commit is contained in:
Doug Lyons 2024-10-22 05:28:10 -05:00 committed by GitHub
parent 8ba61029e1
commit 551c74123c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -979,6 +979,14 @@ static BOOL VersionInfo32_QueryValue( const VS_VERSION_INFO_STRUCT32 *info, LPCW
/* Return value */ /* Return value */
*lplpBuffer = VersionInfo32_Value( info ); *lplpBuffer = VersionInfo32_Value( info );
#ifdef __REACTOS__
/* If the wValueLength is zero, then set a UNICODE_NULL only return string.
* Use the NULL terminator from the key string for that. This is what Windows does, too. */
if (!info->wValueLength)
*lplpBuffer = (PVOID)(info->szKey + wcslen(info->szKey));
#endif
if (puLen) if (puLen)
*puLen = info->wValueLength; *puLen = info->wValueLength;
if (pbText) if (pbText)