CVS: seamlessrdp/ServerExe/HookDll hook.cpp,1.6,1.7 hook.h,1.6,1.7 hookdll.cpp,1.19,1.20 hookdll.h,1.5,1.6

Peter Åstrand <[email protected]>
Newsgroups gmane.network.rdesktop.cvs
Message-ID <[email protected]>
Update of /cvsroot/rdesktop/seamlessrdp/ServerExe/HookDll
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25071/ServerExe/HookDll

Modified Files:
	hook.cpp hook.h hookdll.cpp hookdll.h 
Log Message:
Removed cbt from lots of variables, where it doesn't belong. Disabling hook of CbtProc.

Index: hook.cpp
===================================================================
RCS file: /cvsroot/rdesktop/seamlessrdp/ServerExe/HookDll/hook.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** hook.cpp	28 Aug 2005 12:56:38 -0000	1.6
--- hook.cpp	30 Aug 2005 12:04:08 -0000	1.7
***************
*** 5,21 ****
  #include "hook.h"
  
! HINSTANCE WTSWinClipper::mCbtDllHinst = 0;
! SETHOOKS WTSWinClipper::mSetCbtHook = 0;
! REMOVEHOOKS WTSWinClipper::mRemoveCbtHook = 0;
  GETINSTANCECOUNT WTSWinClipper::mGetInstanceCount = 0;
  
  bool WTSWinClipper::Init()
  {
!     if ( mCbtDllHinst )
          return true;
          
      while ( true ) {
          // try to load hookdll.dll
!         if ( !( mCbtDllHinst = LoadLibrary( "hookdll.dll" ) ) )
              break;
              
--- 5,21 ----
  #include "hook.h"
  
! HINSTANCE WTSWinClipper::mHookDllHinst = 0;
! SETHOOKS WTSWinClipper::mSetHooks = 0;
! REMOVEHOOKS WTSWinClipper::mRemoveHooks = 0;
  GETINSTANCECOUNT WTSWinClipper::mGetInstanceCount = 0;
  
  bool WTSWinClipper::Init()
  {
!     if ( mHookDllHinst )
          return true;
          
      while ( true ) {
          // try to load hookdll.dll
!         if ( !( mHookDllHinst = LoadLibrary( "hookdll.dll" ) ) )
              break;
              
***************
*** 23,27 ****
          if ( !
                  ( mGetInstanceCount =
!                       ( GETINSTANCECOUNT ) GetProcAddress( mCbtDllHinst,
                                                             "GetInstanceCount" ) ) )
              break;
--- 23,27 ----
          if ( !
                  ( mGetInstanceCount =
!                       ( GETINSTANCECOUNT ) GetProcAddress( mHookDllHinst,
                                                             "GetInstanceCount" ) ) )
              break;
***************
*** 30,41 ****
          // get our hook function
          if ( !
!                 ( mSetCbtHook =
!                       ( SETHOOKS ) GetProcAddress( mCbtDllHinst, "SetCbtHook" ) ) )
              break;
              
          // get our unkook function
          if ( !
!                 ( mRemoveCbtHook =
!                       ( REMOVEHOOKS ) GetProcAddress( mCbtDllHinst, "RemoveCbtHook" ) ) )
              break;
              
--- 30,41 ----
          // get our hook function
          if ( !
!                 ( mSetHooks =
!                       ( SETHOOKS ) GetProcAddress( mHookDllHinst, "SetHooks" ) ) )
              break;
              
          // get our unkook function
          if ( !
!                 ( mRemoveHooks =
!                       ( REMOVEHOOKS ) GetProcAddress( mHookDllHinst, "RemoveHooks" ) ) )
              break;
              
***************
*** 45,51 ****
      
      // if we got here something went wrong
!     if ( mCbtDllHinst ) {
!         FreeLibrary( mCbtDllHinst );
!         mCbtDllHinst = 0;
      }
      
--- 45,51 ----
      
      // if we got here something went wrong
!     if ( mHookDllHinst ) {
!         FreeLibrary( mHookDllHinst );
!         mHookDllHinst = 0;
      }
      

Index: hook.h
===================================================================
RCS file: /cvsroot/rdesktop/seamlessrdp/ServerExe/HookDll/hook.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** hook.h	28 Aug 2005 12:56:38 -0000	1.6
--- hook.h	30 Aug 2005 12:04:08 -0000	1.7
***************
*** 3,8 ****
  //
  
! #ifndef __CBT_H__
! #define __CBT_H__
  
  #include <windows.h>
--- 3,8 ----
  //
  
! #ifndef __HOOK_H__
! #define __HOOK_H__
  
  #include <windows.h>
***************
*** 15,21 ****
  {
      protected:
!         static HINSTANCE mCbtDllHinst;
!         static SETHOOKS mSetCbtHook;
!         static REMOVEHOOKS mRemoveCbtHook;
          static GETINSTANCECOUNT mGetInstanceCount;
          
--- 15,21 ----
  {
      protected:
!         static HINSTANCE mHookDllHinst;
!         static SETHOOKS mSetHooks;
!         static REMOVEHOOKS mRemoveHooks;
          static GETINSTANCECOUNT mGetInstanceCount;
          
***************
*** 24,46 ****
          static void Done()
          {
!             if ( mCbtDllHinst )
!                 FreeLibrary( mCbtDllHinst );
          }
          
!         static void SetCbtHook()
          {
!             if ( mCbtDllHinst )
!                 mSetCbtHook();
          }
          
!         static void RemoveCbtHook()
          {
!             if ( mCbtDllHinst )
!                 mRemoveCbtHook();
          }
          
          static int GetInstanceCount()
          {
!             if ( mCbtDllHinst )
                  return mGetInstanceCount();
              else
--- 24,46 ----
          static void Done()
          {
!             if ( mHookDllHinst )
!                 FreeLibrary( mHookDllHinst );
          }
          
!         static void SetHooks()
          {
!             if ( mHookDllHinst )
!                 mSetHooks();
          }
          
!         static void RemoveHooks()
          {
!             if ( mHookDllHinst )
!                 mRemoveHooks();
          }
          
          static int GetInstanceCount()
          {
!             if ( mHookDllHinst )
                  return mGetInstanceCount();
              else

Index: hookdll.cpp
===================================================================
RCS file: /cvsroot/rdesktop/seamlessrdp/ServerExe/HookDll/hookdll.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** hookdll.cpp	30 Aug 2005 11:52:38 -0000	1.19
--- hookdll.cpp	30 Aug 2005 12:04:08 -0000	1.20
***************
*** 159,163 ****
                        details->hwnd,
                        cs->lpszName,
!                       1,  // FIXME: Check for WS_MAXIMIZE/WS_MINIMIZE
                        0 );
              result[ sizeof( result ) - 1 ] = '\0';
--- 159,163 ----
                        details->hwnd,
                        cs->lpszName,
!                       1,    // FIXME: Check for WS_MAXIMIZE/WS_MINIMIZE
                        0 );
              result[ sizeof( result ) - 1 ] = '\0';
***************
*** 356,360 ****
  }
  
! DLL_EXPORT void SetCbtHook( void )
  {
      if ( !bHooked ) {
--- 356,360 ----
  }
  
! DLL_EXPORT void SetHooks( void )
  {
      if ( !bHooked ) {
***************
*** 363,370 ****
--- 363,372 ----
      }
      
+ #if 0
      if ( !bHooked2 ) {
          hhook2 = SetWindowsHookEx( WH_SHELL, ( HOOKPROC ) ShellProc, hInst, ( DWORD ) NULL );
          bHooked2 = true;
      }
+ #endif
      
      if ( !bHooked3 ) {
***************
*** 374,378 ****
  }
  
! DLL_EXPORT void RemoveCbtHook( void )
  {
      if ( bHooked ) {
--- 376,380 ----
  }
  
! DLL_EXPORT void RemoveHooks( void )
  {
      if ( bHooked ) {

Index: hookdll.h
===================================================================
RCS file: /cvsroot/rdesktop/seamlessrdp/ServerExe/HookDll/hookdll.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** hookdll.h	28 Aug 2005 12:56:38 -0000	1.5
--- hookdll.h	30 Aug 2005 12:04:08 -0000	1.6
***************
*** 5,10 ****
  #include <windows.h>
  
! #ifndef __CBTDLL_H__
! #define __CBTDLL_H__
  
  #define CHANNELNAME "CLIPPER"
--- 5,10 ----
  #include <windows.h>
  
! #ifndef __HOOKDLL_H__
! #define __HOOKDLL_H__
  
  #define CHANNELNAME "CLIPPER"



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.