CVS: seamlessrdp/ServerExe/HookDll hook.cpp,1.2,1.3 hook.h,1.2,1.3 hookdll.cpp,1.2,1.3 hookdll.h,1.2,1.3

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-serv28857/ServerExe/HookDll

Modified Files:
	hook.cpp hook.h hookdll.cpp hookdll.h 
Log Message:
Fixed indentation, by running indent-all.

Index: hook.cpp
===================================================================
RCS file: /cvsroot/rdesktop/seamlessrdp/ServerExe/HookDll/hook.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** hook.cpp	30 Jun 2005 14:14:56 -0000	1.2
--- hook.cpp	30 Jun 2005 14:46:14 -0000	1.3
***************
*** 11,53 ****
  #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;
  
! 		// check number of instances
! 		if (! (mGetInstanceCount = (GETINSTANCECOUNT)GetProcAddress(mCbtDllHinst, "GetInstanceCount")))
! 			break;
  
  
! 		// get our hook function
! 		if (! (mSetCbtHook = (SETHOOKS)GetProcAddress(mCbtDllHinst, "SetCbtHook")))
! 			break;
  
! 		// get our unkook function
! 		if (! (mRemoveCbtHook = (REMOVEHOOKS)GetProcAddress(mCbtDllHinst, "RemoveCbtHook")))
! 			break;
  
! 		// report success
! 		return true;
! 	}
  
! 	// if we got here something went wrong
! 	if (mCbtDllHinst)
! 	{
! 		FreeLibrary(mCbtDllHinst);
! 		mCbtDllHinst = 0;
! 	}
  
! 	return false;
  }
--- 11,59 ----
  #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;
  
!         // check number of instances
!         if (!
!             (mGetInstanceCount =
!              (GETINSTANCECOUNT) GetProcAddress(mCbtDllHinst,
!                                                "GetInstanceCount")))
!             break;
  
  
!         // get our hook function
!         if (!
!             (mSetCbtHook =
!              (SETHOOKS) GetProcAddress(mCbtDllHinst, "SetCbtHook")))
!             break;
  
!         // get our unkook function
!         if (!
!             (mRemoveCbtHook =
!              (REMOVEHOOKS) GetProcAddress(mCbtDllHinst, "RemoveCbtHook")))
!             break;
  
!         // report success
!         return true;
!     }
  
!     // if we got here something went wrong
!     if (mCbtDllHinst) {
!         FreeLibrary(mCbtDllHinst);
!         mCbtDllHinst = 0;
!     }
  
!     return false;
  }

Index: hook.h
===================================================================
RCS file: /cvsroot/rdesktop/seamlessrdp/ServerExe/HookDll/hook.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** hook.h	30 Jun 2005 14:14:56 -0000	1.2
--- hook.h	30 Jun 2005 14:46:14 -0000	1.3
***************
*** 20,48 ****
  class WTSWinClipper
  {
! protected:
! 	static HINSTANCE			mCbtDllHinst;
! 	static SETHOOKS  			mSetCbtHook;
! 	static REMOVEHOOKS			mRemoveCbtHook;
! 	static GETINSTANCECOUNT		mGetInstanceCount;
  
! public:
! 	static bool Init();
! 	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
! 			return 0;
! 	}
  };
  
! #endif 
\ No newline at end of file
--- 20,57 ----
  class WTSWinClipper
  {
!   protected:
!     static HINSTANCE mCbtDllHinst;
!     static SETHOOKS mSetCbtHook;
!     static REMOVEHOOKS mRemoveCbtHook;
!     static GETINSTANCECOUNT mGetInstanceCount;
  
!   public:
!     static bool Init();
!     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
!             return 0;
!     }
  };
  
! #endif

Index: hookdll.cpp
===================================================================
RCS file: /cvsroot/rdesktop/seamlessrdp/ServerExe/HookDll/hookdll.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** hookdll.cpp	30 Jun 2005 14:14:56 -0000	1.2
--- hookdll.cpp	30 Jun 2005 14:46:14 -0000	1.3
***************
*** 21,27 ****
  #pragma data_seg ( "SHAREDDATA" )
  
! 	// this is the total number of processes this dll is currently attached to
! 	int				iInstanceCount		= 0;
! 	HWND			hWnd				= 0;
  
  #pragma data_seg ()
--- 21,27 ----
  #pragma data_seg ( "SHAREDDATA" )
  
[...972 lines suppressed...]
!         return 1;
!     }
  }
  
  int WriteToChannel(PCHAR buffer)
  {
!     PULONG bytesRead = 0;
!     PULONG pBytesWritten = 0;
  
!     BOOL result =
!         WTSVirtualChannelWrite(m_vcHandle, buffer, (ULONG) strlen(buffer),
!                                pBytesWritten);
! 
!     if (result) {
!         return 1;
!     }
!     else {
!         return 0;
!     }
  }

Index: hookdll.h
===================================================================
RCS file: /cvsroot/rdesktop/seamlessrdp/ServerExe/HookDll/hookdll.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** hookdll.h	30 Jun 2005 14:14:56 -0000	1.2
--- hookdll.h	30 Jun 2005 14:46:14 -0000	1.3
***************
*** 21,25 ****
  typedef void (*SETHOOKS) ();
  typedef void (*REMOVEHOOKS) ();
! typedef int  (*GETINSTANCECOUNT) ();
  
  //Terminal Server
--- 21,25 ----
  typedef void (*SETHOOKS) ();
  typedef void (*REMOVEHOOKS) ();
! typedef int (*GETINSTANCECOUNT) ();
  
  //Terminal Server
***************
*** 30,32 ****
  
  #endif
- 
--- 30,31 ----



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
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.