/[rdesktop]/sourceforge.net/trunk/seamlessrdp/ServerExe/HookDll/hook.cpp
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /sourceforge.net/trunk/seamlessrdp/ServerExe/HookDll/hook.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 930 - (show annotations)
Thu Jun 30 14:14:56 2005 UTC (18 years, 11 months ago) by astrand
File size: 1220 byte(s)
Should have UNIX LF linebreaks, when running CVS from UNIX.

1 //*********************************************************************************
2 //
3 //Title: Terminal Services Window Clipper
4 //
5 //Author: Martin Wickett
6 //
7 //Date: 2004
8 //
9 //*********************************************************************************
10
11 #include "hook.h"
12
13 HINSTANCE WTSWinClipper::mCbtDllHinst = 0;
14 SETHOOKS WTSWinClipper::mSetCbtHook = 0;
15 REMOVEHOOKS WTSWinClipper::mRemoveCbtHook = 0;
16 GETINSTANCECOUNT WTSWinClipper::mGetInstanceCount = 0;
17
18 bool WTSWinClipper::Init()
19 {
20 if (mCbtDllHinst) return true;
21
22 while (true)
23 {
24 // try to load hookdll.dll
25 if (! (mCbtDllHinst = LoadLibrary("hookdll.dll")))
26 break;
27
28 // check number of instances
29 if (! (mGetInstanceCount = (GETINSTANCECOUNT)GetProcAddress(mCbtDllHinst, "GetInstanceCount")))
30 break;
31
32
33 // get our hook function
34 if (! (mSetCbtHook = (SETHOOKS)GetProcAddress(mCbtDllHinst, "SetCbtHook")))
35 break;
36
37 // get our unkook function
38 if (! (mRemoveCbtHook = (REMOVEHOOKS)GetProcAddress(mCbtDllHinst, "RemoveCbtHook")))
39 break;
40
41 // report success
42 return true;
43 }
44
45 // if we got here something went wrong
46 if (mCbtDllHinst)
47 {
48 FreeLibrary(mCbtDllHinst);
49 mCbtDllHinst = 0;
50 }
51
52 return false;
53 }

  ViewVC Help
Powered by ViewVC 1.1.26