Commit 0d1f2bf5 authored by Misha Koshelev's avatar Misha Koshelev Committed by Alexandre Julliard

wininet/tests: Properly handle ERROR_IO_PENDING from InternetQueryDataAvailable.

parent b25ad76a
...@@ -271,11 +271,18 @@ static void InternetReadFile_test(int flags) ...@@ -271,11 +271,18 @@ static void InternetReadFile_test(int flags)
length = 100; length = 100;
trace("Entering Query loop\n"); trace("Entering Query loop\n");
while (length) while (TRUE)
{ {
rc = InternetQueryDataAvailable(hor,&length,0x0,0x0); rc = InternetQueryDataAvailable(hor,&length,0x0,0x0);
ok(!(rc == 0 && length != 0),"InternetQueryDataAvailable failed\n"); ok(!(rc == 0 && length != 0),"InternetQueryDataAvailable failed\n");
if (flags & INTERNET_FLAG_ASYNC)
{
if (rc == 0 && GetLastError() == ERROR_IO_PENDING)
{
WaitForSingleObject(hCompleteEvent, INFINITE);
continue;
}
}
if (length) if (length)
{ {
char *buffer; char *buffer;
...@@ -289,6 +296,8 @@ static void InternetReadFile_test(int flags) ...@@ -289,6 +296,8 @@ static void InternetReadFile_test(int flags)
HeapFree(GetProcessHeap(),0,buffer); HeapFree(GetProcessHeap(),0,buffer);
} }
if (length == 0)
break;
} }
abort: abort:
if (hor != 0x0) { if (hor != 0x0) {
......
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