diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index bfad36c6f0b..d24eed34157 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -1883,11 +1883,11 @@ BOOL WINAPI InternetReadFileExA(HINTERNET hFile, LPINTERNET_BUFFERSA lpBuffersOu req = &workRequest.u.InternetReadFileExA; req->lpBuffersOut = lpBuffersOut; - retval = INTERNET_AsyncCall(&workRequest); - if (!retval) return FALSE; - - INTERNET_SetLastError(ERROR_IO_PENDING); - return FALSE; + if (!INTERNET_AsyncCall(&workRequest)) + WININET_Release( lpwh ); + else + INTERNET_SetLastError(ERROR_IO_PENDING); + goto end; } } @@ -1903,6 +1903,7 @@ BOOL WINAPI InternetReadFileExA(HINTERNET hFile, LPINTERNET_BUFFERSA lpBuffersOu sizeof(dwBytesReceived)); } +end: WININET_Release( lpwh ); TRACE("-- %s (bytes read: %d)\n", retval ? "TRUE": "FALSE", lpBuffersOut->dwBufferLength); diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index 699aaa01089..d69999895ae 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -704,6 +704,8 @@ static void InternetReadFileExA_test(int flags) abort: SET_EXPECT2(INTERNET_STATUS_HANDLE_CLOSING, (hor != 0x0) + (hic != 0x0)); if (hor) { + SET_WINE_ALLOW(INTERNET_STATUS_CLOSING_CONNECTION); + SET_WINE_ALLOW(INTERNET_STATUS_CONNECTION_CLOSED); rc = InternetCloseHandle(hor); ok ((rc != 0), "InternetCloseHandle of handle opened by HttpOpenRequestA failed\n"); rc = InternetCloseHandle(hor); @@ -721,6 +723,16 @@ abort: Sleep(100); CHECK_NOTIFIED2(INTERNET_STATUS_HANDLE_CLOSING, (hor != 0x0) + (hic != 0x0)); } + if (hor != 0x0) todo_wine + { + CHECK_NOT_NOTIFIED(INTERNET_STATUS_CLOSING_CONNECTION); + CHECK_NOT_NOTIFIED(INTERNET_STATUS_CONNECTION_CLOSED); + } + else + { + CHECK_NOT_NOTIFIED(INTERNET_STATUS_CLOSING_CONNECTION); + CHECK_NOT_NOTIFIED(INTERNET_STATUS_CONNECTION_CLOSED); + } CloseHandle(hCompleteEvent); first_connection_to_test_url = FALSE; }