- 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 

svn path=/branches/GSoC_2011/ThemesSupport/; revision=52949
This commit is contained in:
Giannis Adamopoulos 2011-07-28 13:06:56 +00:00
parent 4c2f096717
commit 23e86250fb

View file

@ -438,6 +438,14 @@ HINSTANCE ClientLoadLibrary(PUNICODE_STRING pstrLibName,
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 @@ HINSTANCE ClientLoadLibrary(PUNICODE_STRING pstrLibName,
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
{