[MPlayer-cygwin] [patch] small hddraw_dll cleanup

Sascha Sommer saschasommer at freenet.de
Thu Jan 6 19:00:28 CET 2005


On Thursday 06 January 2005 18:30, Rune Petersen wrote:
> Hi,
> It works on win2k I don't see why it shouldn't work on other versions.
>
> we have 2 handles to the dll-file:
>    - one though the ddraw headers.
>    - and the one made in Directx_InitDirectDraw().
>

If you unload the dl,l the code it provides is gone. It only stays if 
something else is using  the same instance of the dll when it loaded it with 
LoadLibrary or linked against it. We don't do static linking for the directx 
dlls. It may also work because the memory where it was, is not overwritten, 
yet. 

> when you remove on handle you don't unload the dll.
>

Yes, but FreeLibrary frees the dll. It does not change the handles. Just like
when you do free() on a block of memory and use it afterwards. It may still 
work, but most of the time it simply crashes.

Sascha




More information about the MPlayer-cygwin mailing list