imm32: Don't call functions that use graphics driver in THREAD_DETACH/PROCESS_DETACH

Piotr Caban piotr at
Thu Aug 27 05:24:01 CDT 2015

The graphics driver may be already uninitialized when imm32 is detached.

It's still possible to write an application that will fail in similar 
way as imm32. The only solution I can think of is to add a thread_detach 
driver call and call it in user32->DllMain instead of doing the cleanup 
in driver->DllMain. Thanks to it user32 remains usable as long as its 
DllMain was not called. Is it a better solution? I haven't seen "real 
world" application that fails this way.
  dlls/imm32/imm.c         |  1 -
  dlls/imm32/tests/imm32.c | 24 ++++++++++++++++++++++++
  2 files changed, 24 insertions(+), 1 deletion(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-imm32-Don-t-use-functions-that-use-graphics-driver-in-.txt
Type: text/x-patch
Size: 2194 bytes
Desc: not available
URL: <>

More information about the wine-patches mailing list