mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-29 19:26:33 +00:00
- Fix 3 "kernel32_winetest environ" tests. All environ tests passed now
svn path=/trunk/; revision=41887
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user