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

Misha Koshelev mk144210 at
Fri Aug 17 00:55:28 CDT 2007

On asynchronous calls to this function the initial reference addition by WININET_GetObject was never
matched by a WININET_Release (and also when INTERNET_AsyncCall fails we must release the workrequest
hdr as it won't get released anywhere else). Unfortunately this adds the todo's with the CONNECTION_CLOSE as we
also have in the test_ReadFile function, but we did not need these before not because we were
actually not sending them intentionally (correctly) here but because the handle data was
never freed and HTTP_CloseConnection was never being called (so this fixes a small memory leak too).

This is also a necessary prereq for the patches I will prob send out this weekend that fix
INTERNET_STATUS_HANDLE_CLOSING to be sent when the handle is actually being destroyed like on native,
which will also fix the race in urlmon http protocol that exists.
 dlls/wininet/internet.c   |   11 ++++++-----
 dlls/wininet/tests/http.c |   12 ++++++++++++
 2 files changed, 18 insertions(+), 5 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1bc0bc217636137f413aab4fbbdd4bcfdf78f5c3.diff
Type: text/x-patch
Size: 2293 bytes
Desc: not available
Url :

More information about the wine-patches mailing list