ntdll: detach modules based on inter-module dependencies (try 2)

Lei Zhang thestig at google.com
Sat Dec 1 12:50:25 CST 2007


I've been trying to use xvid on Wine. Xvid works fine, but when I exit
the application, I get a memory access error. What happens is the

- winmm.dll gets loaded
- when trying to use xvid, xvidvfw.dll gets loaded
- when the application exits, ExitProcess() calls LdrShutdownProcess()
which calls process_detach() with bForceDetach set to TRUE
- xvidvfw.dll gets unloaded before winmm.dll
- while winmm.dll is getting unloaded, it sends DRV_CLOSE to
xvidvfw.dll, which has already been unloaded, causing a memory

This patch changes how process_detach() works when called with
bForceDetach set to TRUE. A module would get detached when that module
has no dependencies. After a module gets detached, process_detach()
scans through all the modules and update their dependencies. I'm
assuming there's no circular dependencies between modules.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ntdll-detach-modules-based-on-inter-module-dependen.patch
Type: application/octet-stream
Size: 4003 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20071201/0539b0a0/attachment.obj 

More information about the wine-patches mailing list