/[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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1007 by astrand, Tue Aug 30 12:04:08 2005 UTC revision 1065 by ossman_, Wed Mar 8 16:12:49 2006 UTC
# Line 13  bool WTSWinClipper::Init() Line 13  bool WTSWinClipper::Init()
13  {  {
14      if ( mHookDllHinst )      if ( mHookDllHinst )
15          return true;          return true;
16            
17      while ( true ) {      while ( true ) {
18          // try to load hookdll.dll          // try to load hookdll.dll
19          if ( !( mHookDllHinst = LoadLibrary( "hookdll.dll" ) ) )          if ( !( mHookDllHinst = LoadLibrary( "hookdll.dll" ) ) )
20              break;              break;
21                
22          // check number of instances          // check number of instances
23          if ( !          if ( !
24                  ( mGetInstanceCount =                  ( mGetInstanceCount =
25                        ( GETINSTANCECOUNT ) GetProcAddress( mHookDllHinst,                        ( GETINSTANCECOUNT ) GetProcAddress( mHookDllHinst,
26                                                             "GetInstanceCount" ) ) )                                                             "GetInstanceCount" ) ) )
27              break;              break;
28                
29                
30          // get our hook function          // get our hook function
31          if ( !          if ( !
32                  ( mSetHooks =                  ( mSetHooks =
33                        ( SETHOOKS ) GetProcAddress( mHookDllHinst, "SetHooks" ) ) )                        ( SETHOOKS ) GetProcAddress( mHookDllHinst, "SetHooks" ) ) )
34              break;              break;
35                
36          // get our unkook function          // get our unkook function
37          if ( !          if ( !
38                  ( mRemoveHooks =                  ( mRemoveHooks =
39                        ( REMOVEHOOKS ) GetProcAddress( mHookDllHinst, "RemoveHooks" ) ) )                        ( REMOVEHOOKS ) GetProcAddress( mHookDllHinst, "RemoveHooks" ) ) )
40              break;              break;
41                
42          // report success          // report success
43          return true;          return true;
44      }      }
45        
46      // if we got here something went wrong      // if we got here something went wrong
47      if ( mHookDllHinst ) {      if ( mHookDllHinst ) {
48          FreeLibrary( mHookDllHinst );          FreeLibrary( mHookDllHinst );
49          mHookDllHinst = 0;          mHookDllHinst = 0;
50      }      }
51        
52      return false;      return false;
53  }  }

Legend:
Removed from v.1007  
changed lines
  Added in v.1065

  ViewVC Help
Powered by ViewVC 1.1.26