http://bugs.winehq.org/show_bug.cgi?id=9479
--- Comment #7 from Misha Koshelev mk144210@bcm.tmc.edu 2007-08-28 20:14:26 --- Ok, thank you very much for the log. I believe I know what the problem is; just in case, to confirm if someone could post a WINEDEBUG=+server,+wininet log would be great.
Basically, the problem is this: on native, CloseHandle and InternetCloseHandle have equivalent actions. However, on wine CloseHandle is handled in wineserver (passed on from process -> ntdll -> wineserver), whereas InternetCloseHandle is handled exclusively in wininet and in fact internet handles in wine are only supported within this framework.
A call to CloseHandle on a wininet handle would always have failed under wine, but what my patch did was to change to the native behavior of sending the INTERNET_STATUS_HANDLE_CLOSING when the handle was actually being freed, which is done on native (and is required for urlmon to not have a potential race on freeing some objects). However, what this means is that the CloseHandle call never "registers" in the wininet handle references and thus the handle's reference count never gets to 0, thus no INTERNET_STATUS_HANDLE_CLOSING is now sent.
Ideally, the fix would be to handle wininet handles in the wineserver, but from what I understand this would be a fairly significant task and would probably require Alexandre's guidance if not help, and I am not sure I have time for a project so extensive. However, I am open to any suggestions especially if someone can think of a simpler "native" fix that is acceptable to the wine tree.
Misha