Commit 1ee9ea91 authored by Misha Koshelev's avatar Misha Koshelev Committed by Alexandre Julliard

wininet: Fix reference count on internet handle for asynchronous InternetReadFileEx call.

parent 5320d3e3
...@@ -1883,11 +1883,11 @@ BOOL WINAPI InternetReadFileExA(HINTERNET hFile, LPINTERNET_BUFFERSA lpBuffersOu ...@@ -1883,11 +1883,11 @@ BOOL WINAPI InternetReadFileExA(HINTERNET hFile, LPINTERNET_BUFFERSA lpBuffersOu
req = &workRequest.u.InternetReadFileExA; req = &workRequest.u.InternetReadFileExA;
req->lpBuffersOut = lpBuffersOut; req->lpBuffersOut = lpBuffersOut;
retval = INTERNET_AsyncCall(&workRequest); if (!INTERNET_AsyncCall(&workRequest))
if (!retval) return FALSE; WININET_Release( lpwh );
else
INTERNET_SetLastError(ERROR_IO_PENDING); INTERNET_SetLastError(ERROR_IO_PENDING);
return FALSE; goto end;
} }
} }
...@@ -1903,6 +1903,7 @@ BOOL WINAPI InternetReadFileExA(HINTERNET hFile, LPINTERNET_BUFFERSA lpBuffersOu ...@@ -1903,6 +1903,7 @@ BOOL WINAPI InternetReadFileExA(HINTERNET hFile, LPINTERNET_BUFFERSA lpBuffersOu
sizeof(dwBytesReceived)); sizeof(dwBytesReceived));
} }
end:
WININET_Release( lpwh ); WININET_Release( lpwh );
TRACE("-- %s (bytes read: %d)\n", retval ? "TRUE": "FALSE", lpBuffersOut->dwBufferLength); TRACE("-- %s (bytes read: %d)\n", retval ? "TRUE": "FALSE", lpBuffersOut->dwBufferLength);
......
...@@ -704,6 +704,8 @@ static void InternetReadFileExA_test(int flags) ...@@ -704,6 +704,8 @@ static void InternetReadFileExA_test(int flags)
abort: abort:
SET_EXPECT2(INTERNET_STATUS_HANDLE_CLOSING, (hor != 0x0) + (hic != 0x0)); SET_EXPECT2(INTERNET_STATUS_HANDLE_CLOSING, (hor != 0x0) + (hic != 0x0));
if (hor) { if (hor) {
SET_WINE_ALLOW(INTERNET_STATUS_CLOSING_CONNECTION);
SET_WINE_ALLOW(INTERNET_STATUS_CONNECTION_CLOSED);
rc = InternetCloseHandle(hor); rc = InternetCloseHandle(hor);
ok ((rc != 0), "InternetCloseHandle of handle opened by HttpOpenRequestA failed\n"); ok ((rc != 0), "InternetCloseHandle of handle opened by HttpOpenRequestA failed\n");
rc = InternetCloseHandle(hor); rc = InternetCloseHandle(hor);
...@@ -721,6 +723,16 @@ abort: ...@@ -721,6 +723,16 @@ abort:
Sleep(100); Sleep(100);
CHECK_NOTIFIED2(INTERNET_STATUS_HANDLE_CLOSING, (hor != 0x0) + (hic != 0x0)); 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); CloseHandle(hCompleteEvent);
first_connection_to_test_url = FALSE; first_connection_to_test_url = FALSE;
} }
......
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