https://git.reactos.org/?p=reactos.git;a=commitdiff;h=551c74123c11e80b05edad7dde141a84f1de70e7

commit 551c74123c11e80b05edad7dde141a84f1de70e7
Author:     Doug Lyons <dougly...@douglyons.com>
AuthorDate: Tue Oct 22 05:28:10 2024 -0500
Commit:     GitHub <nore...@github.com>
CommitDate: Tue Oct 22 05:28:10 2024 -0500

    [VERSION] Fix VerQueryValue when return Value is NULL. (#7449)
    
    CORE-19783
    Co-authored-by: Timo Kreuzer <timo.kreu...@reactos.org>
---
 dll/win32/version/version.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/dll/win32/version/version.c b/dll/win32/version/version.c
index 0e2f35dd107..8ecabae01a3 100644
--- a/dll/win32/version/version.c
+++ b/dll/win32/version/version.c
@@ -979,6 +979,14 @@ static BOOL VersionInfo32_QueryValue( const 
VS_VERSION_INFO_STRUCT32 *info, LPCW
 
     /* Return value */
     *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)
         *puLen = info->wValueLength;
     if (pbText)

Reply via email to