wininet: The buffer is returned from InternetGetLastResponseInfo() even when the error is 0.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com> Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
e4e2e33806
commit
0f958ec3b0
|
@ -1099,14 +1099,12 @@ BOOL WINAPI InternetGetLastResponseInfoA(LPDWORD lpdwError,
|
|||
return FALSE;
|
||||
}
|
||||
*lpdwError = lpwite->dwError;
|
||||
if (lpwite->dwError && *lpdwBufferLength)
|
||||
if (*lpdwBufferLength)
|
||||
{
|
||||
memcpy(lpszBuffer, lpwite->response, *lpdwBufferLength);
|
||||
lpszBuffer[*lpdwBufferLength - 1] = 0;
|
||||
*lpdwBufferLength = strlen(lpszBuffer);
|
||||
}
|
||||
else
|
||||
*lpdwBufferLength = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1149,10 +1147,8 @@ BOOL WINAPI InternetGetLastResponseInfoW(LPDWORD lpdwError,
|
|||
return FALSE;
|
||||
}
|
||||
*lpdwError = lpwite->dwError;
|
||||
if (lpwite->dwError && *lpdwBufferLength)
|
||||
if (*lpdwBufferLength)
|
||||
*lpdwBufferLength = MultiByteToWideChar(CP_ACP, 0, lpwite->response, -1, lpszBuffer, *lpdwBufferLength);
|
||||
else
|
||||
*lpdwBufferLength = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -706,6 +706,8 @@ static void test_command(HINTERNET hFtp)
|
|||
BOOL ret;
|
||||
DWORD error;
|
||||
unsigned int i;
|
||||
BOOL had_error_zero = FALSE;
|
||||
BOOL had_error_zero_size_positive = FALSE;
|
||||
static const struct
|
||||
{
|
||||
BOOL ret;
|
||||
|
@ -776,8 +778,12 @@ static void test_command(HINTERNET hFtp)
|
|||
ret = InternetGetLastResponseInfoA(&error, buffer, &size);
|
||||
ok(ret, "%d: got ret %d\n", i, ret);
|
||||
ok(size == 0 || strlen(buffer) == size, "%d: size %d, buffer size %d\n", i, size, size ? strlen(buffer) : 0);
|
||||
had_error_zero |= (error == 0);
|
||||
had_error_zero_size_positive |= (error == 0 && size > 0);
|
||||
HeapFree(GetProcessHeap(), 0, buffer);
|
||||
}
|
||||
|
||||
ok(!had_error_zero || had_error_zero_size_positive, "never observed error 0 with positive size\n");
|
||||
}
|
||||
|
||||
static void test_find_first_file(HINTERNET hFtp, HINTERNET hConnect)
|
||||
|
|
Loading…
Reference in New Issue