From cf8d09b13c9e36102b97e1c3632f5363a9dfd014 Mon Sep 17 00:00:00 2001 From: Giannis Adamopoulos Date: Tue, 12 Jul 2011 09:24:16 +0000 Subject: [PATCH] [win32k] - Call UserUnregisterUserApiHook from the process cleanup routine if the process has registered the user api hook svn path=/branches/GSoC_2011/ThemesSupport/; revision=52652 --- subsystems/win32/win32k/main/dllmain.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/subsystems/win32/win32k/main/dllmain.c b/subsystems/win32/win32k/main/dllmain.c index d6d2147934d..41750c057aa 100644 --- a/subsystems/win32/win32k/main/dllmain.c +++ b/subsystems/win32/win32k/main/dllmain.c @@ -382,6 +382,18 @@ Win32kThreadCallback(struct _ETHREAD *Thread, } while (pti); } + + /* Do now some process cleanup that requires a valid win32 thread */ + if(Win32Thread->ppi->cThreads == 0) + { + /* Check if we have registered the user api hook */ + if(Win32Thread->ppi == ppiUahServer) + { + /* Unregister the api hook without blocking */ + UserUnregisterUserApiHook(FALSE); + } + } + DceFreeThreadDCE(Win32Thread); HOOK_DestroyThreadHooks(Thread); EVENT_DestroyThreadEvents(Thread);