Commit 8f5b9f4d authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

wininet: Always set last error in InternetReadFile.

parent 3522b127
......@@ -2193,8 +2193,7 @@ BOOL WINAPI InternetReadFile(HINTERNET hFile, LPVOID lpBuffer,
TRACE("-- %s (%u) (bytes read: %d)\n", res == ERROR_SUCCESS ? "TRUE": "FALSE", res,
pdwNumOfBytesRead ? *pdwNumOfBytesRead : -1);
if(res != ERROR_SUCCESS)
SetLastError(res);
SetLastError(res);
return res == ERROR_SUCCESS;
}
......
......@@ -987,7 +987,10 @@ static void InternetReadFile_chunked_test(void)
{
char *buffer = HeapAlloc(GetProcessHeap(),0,length+1);
SetLastError(0xdeadbeef);
res = InternetReadFile(hor,buffer,length,&got);
ok(GetLastError() == 0 ||
broken(GetLastError() == 0xdeadbeef /* XP/W2K3 */), "Last Error not reset %u\n", GetLastError());
buffer[got]=0;
trace("ReadFile -> %i %i\n",res,got);
......@@ -1000,8 +1003,11 @@ static void InternetReadFile_chunked_test(void)
if (length == 0)
{
got = 0xdeadbeef;
SetLastError(0xdeadbeef);
res = InternetReadFile( hor, buffer, 1, &got );
ok( res, "InternetReadFile failed: %u\n", GetLastError() );
ok(GetLastError() == 0 ||
broken(GetLastError() == 0xdeadbeef /* XP/W2K3 */), "Last Error not reset %u\n", GetLastError());
ok( !got, "got %u\n", got );
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment