Listing 5: sampdll.c Sample DLL source code
/* Sample DLL to demonstrate DllMain behavior */ #include <windows.h> BOOL WINAPI DllMain(HINSTANCE hDllInst, DWORD fdwReason, LPVOID lpvReserved) { switch (fdwReason) { case DLL_PROCESS_ATTACH: OutputDebugString("DLL_PROCESS_ATTACH\n"); break; case DLL_PROCESS_DETACH: OutputDebugString("DLL_PROCESS_DETACH\n"); break; case DLL_THREAD_ATTACH: OutputDebugString("DLL_THREAD_ATTACH\n"); break; case DLL_THREAD_DETACH: OutputDebugString("DLL_THREAD_DETACH\n"); break; } return TRUE; } int __declspec(dllexport) SampDllFunc(void) { return 53; } /* End of File */