[KERNEL32] GetComputerNameExW: Fix crash in kernel32_winetest environ test
authorEric Kohl <eric.kohl@reactos.org>
Mon, 7 Jan 2019 21:45:33 +0000 (22:45 +0100)
committerEric Kohl <eric.kohl@reactos.org>
Mon, 7 Jan 2019 21:45:33 +0000 (22:45 +0100)
dll/win32/kernel32/client/compname.c

index 96aa505..cfe9df5 100644 (file)
@@ -236,7 +236,8 @@ GetComputerNameExW(COMPUTER_NAME_FORMAT NameType,
                                                L"ComputerName",
                                                lpBuffer,
                                                nSize);
-            if (ret == FALSE)
+            if ((ret == FALSE) &&
+                (GetLastError() != ERROR_MORE_DATA))
             {
                 ret = GetComputerNameFromRegistry(L"\\Registry\\Machine\\System\\CurrentControlSet"
                                                   L"\\Control\\ComputerName\\ComputerName",