Oct 20, 2010 at 8:27 PM
Edited Oct 20, 2010 at 8:31 PM
thanks for these pointers, but up until now I did not succeed using these pointers.
First according your hints I changed EasyHookDll->Properties->Configuration Properties->Configuration Type to "Static Library (.lib)".
As I do not have the ntddk.h on my machine I have to avoid setting DRIVER. So within EasyHook.h I changed the definition of the two macros EASYHOOK_API and DRIVER_SHARED_API to the values from the last #ifdef part like
#define EASYHOOK_API __stdcall
#define DRIVER_SHARED_API(type, decl) typedef type EASYHOOK_API PROC_##decl; EXTERN_C type EASYHOOK_API decl
In addition I added the following library dependencies to the EasyHookDll project: Aux_ulib_x86.lib;GS_x86.lib;psapi.lib, so these libs are already bundled within the resulting EasyHookDll.lib
As there is some initialization stuff done within DllMain I copied DllMain to my own sources, and added the following external statements to get access to some called functions:
extern "C" void __stdcall LhCriticalInitialize();
extern "C" void __stdcall DbgCriticalInitialize();
extern "C" void __stdcall LhBarrierProcessAttach();
extern "C" void __stdcall LhCriticalFinalize();
extern "C" void __stdcall LhModuleInfoFinalize();
extern "C" void __stdcall LhBarrierProcessDetach();
extern "C" void __stdcall DbgCriticalFinalize();
Now I was able to compile and link successfuly. However, starting my application now takes much longer than before, but I have no idea why? Any more hints? Any description of a real successful static linking against EasyHook.lib?