CVS: seamlessrdp/ServerExe/HookDll hook.cpp,1.1,1.2 hook.h,1.1,1.2 hookdll.cpp,1.1,1.2 hookdll.h,1.1,1.2
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-serv13454/ServerExe/HookDll
Modified Files:
hook.cpp hook.h hookdll.cpp hookdll.h
Log Message:
Should have UNIX LF linebreaks, when running CVS from UNIX.
Index: hook.cpp
===================================================================
RCS file: /cvsroot/rdesktop/seamlessrdp/ServerExe/HookDll/hook.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** hook.cpp 30 Jun 2005 08:53:04 -0000 1.1
--- hook.cpp 30 Jun 2005 14:14:56 -0000 1.2
***************
*** 1,53 ****
! //*********************************************************************************
! //
! //Title: Terminal Services Window Clipper
! //
! //Author: Martin Wickett
! //
! //Date: 2004
! //
! //*********************************************************************************
!
! #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;
! }
--- 1,53 ----
! //*********************************************************************************
! //
! //Title: Terminal Services Window Clipper
! //
! //Author: Martin Wickett
! //
! //Date: 2004
! //
! //*********************************************************************************
!
! #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.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** hook.h 30 Jun 2005 08:53:04 -0000 1.1
--- hook.h 30 Jun 2005 14:14:56 -0000 1.2
***************
*** 1,48 ****
! //*********************************************************************************
! //
! //Title: Terminal Services Window Clipper
! //
! //Author: Martin Wickett
! //
! //Date: 2004
! //
! //*********************************************************************************
!
! #ifndef __CBT_H__
! #define __CBT_H__
!
! #include <windows.h>
! #include "hookdll.h"
!
! //
! // a wrapper class to access the WTSWinClipperdll
! //
! 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
--- 1,48 ----
! //*********************************************************************************
! //
! //Title: Terminal Services Window Clipper
! //
! //Author: Martin Wickett
! //
! //Date: 2004
! //
! //*********************************************************************************
!
! #ifndef __CBT_H__
! #define __CBT_H__
!
! #include <windows.h>
! #include "hookdll.h"
!
! //
! // a wrapper class to access the WTSWinClipperdll
! //
! 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
Index: hookdll.cpp
===================================================================
RCS file: /cvsroot/rdesktop/seamlessrdp/ServerExe/HookDll/hookdll.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** hookdll.cpp 30 Jun 2005 08:53:04 -0000 1.1
--- hookdll.cpp 30 Jun 2005 14:14:56 -0000 1.2
***************
*** 1,527 ****
! //*********************************************************************************
! //
! //Title: Terminal Services Window Clipper
! //
! //Author: Martin Wickett
! //
! //Date: 2004
! //
! //*********************************************************************************
!
[...1025 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.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** hookdll.h 30 Jun 2005 08:53:04 -0000 1.1
--- hookdll.h 30 Jun 2005 14:14:56 -0000 1.2
***************
*** 1,32 ****
! //*********************************************************************************
! //
! //Title: Terminal Services Window Clipper
! //
! //Author: Martin Wickett
! //
! //Date: 2004
! //
! //*********************************************************************************
!
! #include <windows.h>
!
! #ifndef __CBTDLL_H__
! #define __CBTDLL_H__
!
! #define CHANNELNAME "CLIPPER"
!
! #pragma once
!
! //Hooking
! typedef void (*SETHOOKS) ();
! typedef void (*REMOVEHOOKS) ();
! typedef int (*GETINSTANCECOUNT) ();
!
! //Terminal Server
! int OpenVirtualChannel();
! int CloseVirtualChannel();
! int ChannelIsOpen();
! int WriteToChannel(PCHAR buffer);
!
! #endif
!
--- 1,32 ----
! //*********************************************************************************
! //
! //Title: Terminal Services Window Clipper
! //
! //Author: Martin Wickett
! //
! //Date: 2004
! //
! //*********************************************************************************
!
! #include <windows.h>
!
! #ifndef __CBTDLL_H__
! #define __CBTDLL_H__
!
! #define CHANNELNAME "CLIPPER"
!
! #pragma once
!
! //Hooking
! typedef void (*SETHOOKS) ();
! typedef void (*REMOVEHOOKS) ();
! typedef int (*GETINSTANCECOUNT) ();
!
! //Terminal Server
! int OpenVirtualChannel();
! int CloseVirtualChannel();
! int ChannelIsOpen();
! int WriteToChannel(PCHAR buffer);
!
! #endif
!
-------------------------------------------------------
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