wininet: Always set last error in HttpQueryInfoW.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alistair Leslie-Hughes 2019-06-24 00:22:51 +00:00 committed by Alexandre Julliard
parent 223c3b4538
commit 3522b127a3
2 changed files with 5 additions and 2 deletions

View File

@ -3920,8 +3920,8 @@ lend:
WININET_Release( &request->hdr );
TRACE("%u <--\n", res);
if(res != ERROR_SUCCESS)
SetLastError(res);
SetLastError(res);
return res == ERROR_SUCCESS;
}

View File

@ -722,8 +722,11 @@ static void InternetReadFile_test(int flags, const test_data_t *test)
length = sizeof(buffer)-2;
memset(buffer, 0x77, sizeof(buffer));
SetLastError(0xdeadbeef);
res = HttpQueryInfoA(hor,HTTP_QUERY_RAW_HEADERS,buffer,&length,0x0);
ok(res, "HttpQueryInfoA(HTTP_QUERY_RAW_HEADERS) failed with error %d\n", GetLastError());
ok(GetLastError() == 0 ||
broken(GetLastError() == 0xdeadbeef /* XP/W2K3 */), "Last Error not reset %u\n", GetLastError());
/* show that the function writes data past the length returned */
ok(buffer[length-2], "Expected any header character, got 0x00\n");
ok(!buffer[length-1], "Expected 0x00, got %02X\n", buffer[length-1]);