Author: gadamopoulos
Date: Thu Jul 28 13:06:56 2011
New Revision: 52949
URL: http://svn.reactos.org/svn/reactos?rev=52949&view=rev
Log:
[user32]
- When ClearUserApiHook returns false, this means that the library will be freed in EndUserApiHook. In this case return success to let win32k know that the process has removed the api hook. Fixes reloading the api hook after unloading it
Modified:
branches/GSoC_2011/ThemesSupport/dll/win32/user32/windows/hook.c
Modified: branches/GSoC_2011/ThemesSupport/dll/win32/user32/windows/hook.c
URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2011/ThemesSupport/dll/win…
==============================================================================
--- branches/GSoC_2011/ThemesSupport/dll/win32/user32/windows/hook.c [iso-8859-1] (original)
+++ branches/GSoC_2011/ThemesSupport/dll/win32/user32/windows/hook.c [iso-8859-1] Thu Jul 28 13:06:56 2011
@@ -438,6 +438,14 @@
ANSI_STRING InitFuncName;
BOOL Result = FALSE;
+ TRACE("ClientLoadLibrary: pid: %d, strLibraryName: %S, "
+ "strInitFuncName: %S, Unload: %d, ApiHook:%d\n",
+ GetCurrentProcessId(),
+ pstrLibName->Buffer,
+ pstrInitFunc->Buffer,
+ Unload,
+ ApiHook);
+
/* Check if we have to load the module */
if(Unload == FALSE)
{
@@ -485,7 +493,14 @@
if(ApiHook == TRUE)
{
Result = ClearUserApiHook(ghmodUserApiHook);
- hLibrary = Result ? ghmodUserApiHook : 0;
+ hLibrary = ghmodUserApiHook;
+ /* Check if we can we unload it now */
+ if(Result == FALSE)
+ {
+ /* Return success because we are going to free
+ the library in EndUserApiHook*/
+ return hLibrary;
+ }
}
else
{