user32: Introduced ThreadDetach driver entry point.
commitf0e7bd248e7e2a2f2d49dde0ccc332e6b6d97306
authorJacek Caban <jacek@codeweavers.com>
Thu, 25 Aug 2016 12:33:45 +0000 (25 14:33 +0200)
committerAlexandre Julliard <julliard@winehq.org>
Sat, 27 Aug 2016 04:23:52 +0000 (27 13:23 +0900)
tree492d8bf355c60c2ee220050efe8b7cd5c4aca0f1
parent505406fc83b65dd1f9ebcbaabb582f0fabec1b0a
user32: Introduced ThreadDetach driver entry point.

The problem was diagnosed by Ken Thomases.

Currently drivers use DllMain(DLL_THREAD_DETACH) to release thread data.
The problem is that DLLs (like native urlmon.dll, esp. reproducible in
IE8) may still do user32 calls after driver detaches thread. Loader
ensures that since user32.dll was loaded before dependent DLLs, user32's
DllMain will be called in the right moment. Due to lazy loading of
drivers, we have no control over them. We may use a new entry point to
make sure that we detach user32 and driver at the same time.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
dlls/user32/driver.c
dlls/user32/user_main.c
dlls/user32/user_private.h