[PATCH 1/2] urlmon: Call IInternetProtocolSink_AddRef in HttpProtocol where native does (but just once).

Misha Koshelev mk144210 at bcm.edu
Thu Aug 16 00:02:06 CDT 2007


This patchset is a part of the solution to fix an occasional race that Alexander pointed out to me in the 
urlmon/tests/url.c http tests. Specifically, this has to do with INTERNET_STATUS_REQUEST_COMPLETE's being
sent when IInternetProtocolSink pointer has already been release and zeroed out in HTTPPROTOCOL_Close function.
The way native deals with this is by releasing this object on INTERNET_STATUS_HANDLE_CLOSING. These two
patches reproduce this behavior in our urlmon here (as well as matching native on where it calls the
ProtocolSink_AddRef, although this is not strictly necessary for the fix).

This _won't_ fix the race yet, as on wine's wininet the INTERNET_STATUS_HANDLE_CLOSING is not yet sent at
the correct time (on native, as both documented with a fixme in dlls/wininet/inetrnet.c in InternetCloseHandle
and as determined by my own tests INTERNET_STATUS_HANDLE_CLOSING is sent in the equivalent of WININET_Release,
whereas we currently just send it in InternetCloseHandle). I will patch this up in a future patch as well,
but I need to think about how to do this properly further as currently when we call the info->destroy in
WININET_Release that actually can lead to other notifications such as CLOSING_CONNECTION being sent and
so if we send the HANDLE_CLOSING notification before calling info->destroy HANDLE_CLOSING won't _really_ be
the last notification and this won't match native, whereas if we call it after the info structure has been
freed and no longer exists so I would have to think of a "proper" way to do this.
---
 dlls/urlmon/http.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: a221606f38c7480f76db970b81a5ce63584c9016.diff
Type: text/x-patch
Size: 2371 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20070816/cbaf2bc8/a221606f38c7480f76db970b81a5ce63584c9016.bin


More information about the wine-patches mailing list