Sorry, forget about the last versions, I mistook where the WM_DESTROY is coming from. It's not coming from imm32 DllMain. That means it simply ignores the deinitialization... Sorry about that.
This is a new approach that should also fix the issue, this time preventing the loader lock that causes the issue in the first place.
Not 100% sure if that's the right way to go about it, though.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1456#note_16584
This is my first time implementing an interface so thorough feedback would be appreciated.
--
v6: windows.media: Implement IClosedCaptionPropertiesStatics interface.
include/windowscontracts: Bump contractversion to 14.
windows.media: Add stub DLL.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1343
We need to make sure all (important) cleanup is finished when we exit DllMain,
otherwise we might already unload krnl386 and deadlock
Since we can't have a synchronous DestroyWindow, use an extra message
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52511
Signed-off-by: Fabian Maurer <dark.shadow4(a)web.de>
Code flow is like follows:
- DOSVM_Exit -> RtlExitUserThread -> LdrShutdownThread
- acquire loader lock
- send DLL_THREAD_DETACH to imm32
- - calls DestroyWindow on its window
- - WM_DESTROY is handled asynchonously!
- send DLL_THREAD_DETACH to krnl386.exe
- - TASK_ExitTask
- - try get win16 lock, is blocked by ime32
meanwhile, at ime32
- handles WM_DESTROY
- already have win16 lock from user32
- __wine_ime_wnd_proc (WM_DESTROY) -> imm_couninit_thread -> CoRevokeInitializeSpy
- LdrGetProcedureAddress (want CoRevokeInitializeSpy)
- try get loader_lock, is blocked
Solution is to wait in ime32 DllMain until the cleanup as happened, aka CoRevokeInitializeSpy has finished.
--
v2: imm32: Prevent deadlock on unload
https://gitlab.winehq.org/wine/wine/-/merge_requests/1456
On Sat Nov 19 18:56:07 2022 +0000, Etaash Mathamsetty wrote:
> instead of saving the return value to a temp variable and returning the
> temp variable, I think you could moving the FIXME before the call and
> just return MoveFileWithProgressA, thus removing the need of the variable
I thought about it. But having the fixme after provides feedback in the event something goes wrong inside of MoveFile... Although maybe that is no with the memory allocation thats going to be held onto for the life the the call.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1444#note_16564
We need to make sure all (important) cleanup is finished when we exit DllMain,
otherwise we might already unload krnl386 and deadlock
Since we can't have a synchronous DestroyWindow, use an extra message
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52511
Signed-off-by: Fabian Maurer <dark.shadow4(a)web.de>
Code flow is like follows:
- DOSVM_Exit -> RtlExitUserThread -> LdrShutdownThread
- acquire loader lock
- send DLL_THREAD_DETACH to imm32
- - calls DestroyWindow on its window
- - WM_DESTROY is handled asynchonously!
- send DLL_THREAD_DETACH to krnl386.exe
- - TASK_ExitTask
- - try get win16 lock, is blocked by ime32
meanwhile, at ime32
- handles WM_DESTROY
- already have win16 lock from user32
- __wine_ime_wnd_proc (WM_DESTROY) -> imm_couninit_thread -> CoRevokeInitializeSpy
- LdrGetProcedureAddress (want CoRevokeInitializeSpy)
- try get loader_lock, is blocked
Solution is to wait in ime32 DllMain until the cleanup as happened, aka CoRevokeInitializeSpy has finished.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1456