/******************************************************************************* * Header Files * *******************************************************************************/ #include #include "kProfileR3.h" /** * The DLL Main for the IPRT DLL. * * This is required for profiling, it is not (currently) used for any * other purposes. (It could be used to track the death of alian threads * perhaps, if we decide to adopt them automatically.) * * @returns Success indicator. * @param hInstDll The instance handle of the DLL. (i.e. the module handle) * @param fdwReason The reason why we're here. This is a 'flag' for reasons of * tradition, it's really a kind of enum. * @param pReserved Reserved / undocumented something. */ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, PVOID pReserved) { switch (fdwReason) { case DLL_PROCESS_ATTACH: if (kPrfInitialize()) return FALSE; break; case DLL_PROCESS_DETACH: kPrfTerminate(); break; case DLL_THREAD_ATTACH: break; case DLL_THREAD_DETACH: kPrfTerminateThread(); break; } return TRUE; }