[ros-diffs] [gadamopoulos] 53123: [user32] - Store ghmodUserApiHook before calling ClearUserApiHook because it will be zeroed during this call - Fix a typo in ClearUserApiHook

gadamopoulos at svn.reactos.org gadamopoulos at svn.reactos.org
Sun Aug 7 20:10:08 UTC 2011


Author: gadamopoulos
Date: Sun Aug  7 20:10:07 2011
New Revision: 53123

URL: http://svn.reactos.org/svn/reactos?rev=53123&view=rev
Log:
[user32]
- Store ghmodUserApiHook before calling ClearUserApiHook because it will be zeroed during this call
- Fix a typo in ClearUserApiHook

Modified:
    branches/GSoC_2011/ThemesSupport/dll/win32/user32/misc/usrapihk.c
    branches/GSoC_2011/ThemesSupport/dll/win32/user32/windows/hook.c

Modified: branches/GSoC_2011/ThemesSupport/dll/win32/user32/misc/usrapihk.c
URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2011/ThemesSupport/dll/win32/user32/misc/usrapihk.c?rev=53123&r1=53122&r2=53123&view=diff
==============================================================================
--- branches/GSoC_2011/ThemesSupport/dll/win32/user32/misc/usrapihk.c [iso-8859-1] (original)
+++ branches/GSoC_2011/ThemesSupport/dll/win32/user32/misc/usrapihk.c [iso-8859-1] Sun Aug  7 20:10:07 2011
@@ -199,7 +199,7 @@
   if ( ghmodUserApiHook == hInstance )
   {
      pfn1 = gpfnInitUserApi;
-     if ( --gcLoadUserApiHook == 1 )
+     if ( --gcLoadUserApiHook == 0 )
      {
         gfUserApiHook = 0;
         ResetUserApiHook(&guah);
@@ -227,7 +227,7 @@
      RtlEnterCriticalSection(&gcsUserApiHook);
      pfn1 = gpfnInitUserApi;
 
-     if ( --gcLoadUserApiHook == 1 )
+     if ( --gcLoadUserApiHook == 0 )
      {
         if ( gcCallUserApiHook )
         {

Modified: branches/GSoC_2011/ThemesSupport/dll/win32/user32/windows/hook.c
URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2011/ThemesSupport/dll/win32/user32/windows/hook.c?rev=53123&r1=53122&r2=53123&view=diff
==============================================================================
--- 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] Sun Aug  7 20:10:07 2011
@@ -492,8 +492,8 @@
         /* Cleanup user api hook before unloading */
         if(ApiHook == TRUE)
         {
+            hLibrary = ghmodUserApiHook;
             Result = ClearUserApiHook(ghmodUserApiHook);
-            hLibrary = ghmodUserApiHook;
             /* Check if we can we unload it now */
             if(Result == FALSE)
             {




More information about the Ros-diffs mailing list