// Hook structure.
SDLLHook D3DHook =
{
"DDRAW.DLL",
false, NULL, // Default hook disabled, NULL function pointer.
{
{ "DirectDrawCreate", MyDirectDrawCreate },
{ NULL, NULL }
}
};
BOOL APIENTRY DllMain( HINSTANCE hModule,
DWORD fdwReason,
LPVOID lpReserved )
{
// When initializing....
if ( fdwReason == DLL_PROCESS_ATTACH )
{
hDLL = hModule;
// We don't need thread notifications for what we're doing.
// Thus, get rid of them, thereby eliminating some of the
// overhead of this DLL
DisableThreadLibraryCalls( hModule );
// Only hook the APIs if this is the Everquest process.
GetModuleFileName( GetModuleHandle( NULL ),
Work,
sizeof(Work) );
PathStripPath( Work );
if ( stricmp( Work, "myhooktarget.exe" ) == 0 )
HookAPICalls( &D3DHook );
}
return TRUE;
}
SDLLHook D3DHook =
{
"DDRAW.DLL",
false, NULL, // Default hook disabled, NULL function pointer.
{
{ "DirectDrawCreate", MyDirectDrawCreate },
{ NULL, NULL }
}
};
BOOL APIENTRY DllMain( HINSTANCE hModule,
DWORD fdwReason,
LPVOID lpReserved )
{
// When initializing....
if ( fdwReason == DLL_PROCESS_ATTACH )
{
hDLL = hModule;
// We don't need thread notifications for what we're doing.
// Thus, get rid of them, thereby eliminating some of the
// overhead of this DLL
DisableThreadLibraryCalls( hModule );
// Only hook the APIs if this is the Everquest process.
GetModuleFileName( GetModuleHandle( NULL ),
Work,
sizeof(Work) );
PathStripPath( Work );
if ( stricmp( Work, "myhooktarget.exe" ) == 0 )
HookAPICalls( &D3DHook );
}
return TRUE;
}