Misha Koshelev : wininet/tests: Properly handle ERROR_IO_PENDING from InternetQueryDataAvailable.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jul 16 08:23:39 CDT 2007


Module: wine
Branch: master
Commit: 0d1f2bf5268248eeac684f24587899d800a98159
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=0d1f2bf5268248eeac684f24587899d800a98159

Author: Misha Koshelev <mk144210 at bcm.edu>
Date:   Sun Jul 15 16:29:46 2007 -0500

wininet/tests: Properly handle ERROR_IO_PENDING from InternetQueryDataAvailable.

---

 dlls/wininet/tests/http.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c
index 92ef629..7953b8d 100644
--- a/dlls/wininet/tests/http.c
+++ b/dlls/wininet/tests/http.c
@@ -271,11 +271,18 @@ static void InternetReadFile_test(int flags)
     length = 100;
     trace("Entering Query loop\n");
 
-    while (length)
+    while (TRUE)
     {
         rc = InternetQueryDataAvailable(hor,&length,0x0,0x0);
         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)
         {
             char *buffer;
@@ -289,6 +296,8 @@ static void InternetReadFile_test(int flags)
 
             HeapFree(GetProcessHeap(),0,buffer);
         }
+        if (length == 0)
+            break;
     }
 abort:
     if (hor != 0x0) {




More information about the wine-cvs mailing list