- Fix 3 "kernel32_winetest environ" tests. All environ tests passed now

svn path=/trunk/; revision=41887
This commit is contained in:
Dmitry Chapyshev
2009-07-11 14:18:06 +00:00
parent 76d872ed01
commit e58af99cc1
+11 -2
View File
@@ -92,11 +92,19 @@ GetComputerNameFromRegistry(LPWSTR RegistryKey,
return FALSE;
}
if (*nSize > (KeyInfo->DataLength / sizeof(WCHAR)))
if (lpBuffer && *nSize > (KeyInfo->DataLength / sizeof(WCHAR)))
{
*nSize = KeyInfo->DataLength / sizeof(WCHAR) - 1;
lpBuffer[*nSize] = 0;
}
else
{
RtlFreeHeap(RtlGetProcessHeap(), 0, KeyInfo);
ZwClose(KeyHandle);
*nSize = ReturnSize;
SetLastErrorByStatus(STATUS_BUFFER_OVERFLOW);
return FALSE;
}
RtlCopyMemory(lpBuffer, KeyInfo->Data, *nSize * sizeof(WCHAR));
@@ -254,7 +262,8 @@ GetComputerNameExA(COMPUTER_NAME_FORMAT NameType,
if (!TempBuffer)
{
return ERROR_OUTOFMEMORY;
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return FALSE;
}
AnsiString.MaximumLength = (USHORT)*nSize;