/[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 937 - (show annotations)
Fri Jul 1 06:50:52 2005 UTC (18 years, 10 months ago) by astrand
File size: 1497 byte(s)
Indenting with astyle instead of indent

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)
21 return true;
22
23 while (true) {
24 // try to load hookdll.dll
25 if (!(mCbtDllHinst = LoadLibrary("hookdll.dll")))
26 break;
27
28 // check number of instances
29 if (!
30 (mGetInstanceCount =
31 (GETINSTANCECOUNT) GetProcAddress(mCbtDllHinst,
32 "GetInstanceCount")))
33 break;
34
35
36 // get our hook function
37 if (!
38 (mSetCbtHook =
39 (SETHOOKS) GetProcAddress(mCbtDllHinst, "SetCbtHook")))
40 break;
41
42 // get our unkook function
43 if (!
44 (mRemoveCbtHook =
45 (REMOVEHOOKS) GetProcAddress(mCbtDllHinst, "RemoveCbtHook")))
46 break;
47
48 // report success
49 return true;
50 }
51
52 // if we got here something went wrong
53 if (mCbtDllHinst) {
54 FreeLibrary(mCbtDllHinst);
55 mCbtDllHinst = 0;
56 }
57
58 return false;
59 }

  ViewVC Help
Powered by ViewVC 1.1.26