Skip to content

Commit 551c741

Browse files
Doug-Lyonstkreuzer
andauthored
[VERSION] Fix VerQueryValue when return Value is NULL. (reactos#7449)
CORE-19783 Co-authored-by: Timo Kreuzer <[email protected]>
1 parent 8ba6102 commit 551c741

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

dll/win32/version/version.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,14 @@ static BOOL VersionInfo32_QueryValue( const VS_VERSION_INFO_STRUCT32 *info, LPCW
979979

980980
/* Return value */
981981
*lplpBuffer = VersionInfo32_Value( info );
982+
983+
#ifdef __REACTOS__
984+
/* If the wValueLength is zero, then set a UNICODE_NULL only return string.
985+
* Use the NULL terminator from the key string for that. This is what Windows does, too. */
986+
if (!info->wValueLength)
987+
*lplpBuffer = (PVOID)(info->szKey + wcslen(info->szKey));
988+
#endif
989+
982990
if (puLen)
983991
*puLen = info->wValueLength;
984992
if (pbText)

0 commit comments

Comments
 (0)