1*c2c66affSColin Finck #include <windef.h>
2*c2c66affSColin Finck 
3*c2c66affSColin Finck #ifdef BUILD_DLL
4*c2c66affSColin Finck     #define DLL_EXPORT __declspec(dllexport)
5*c2c66affSColin Finck #else
6*c2c66affSColin Finck     #define DLL_EXPORT
7*c2c66affSColin Finck #endif
8*c2c66affSColin Finck 
DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)9*c2c66affSColin Finck BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
10*c2c66affSColin Finck {
11*c2c66affSColin Finck     switch (fdwReason)
12*c2c66affSColin Finck     {
13*c2c66affSColin Finck         case DLL_PROCESS_ATTACH:
14*c2c66affSColin Finck             // attach to process
15*c2c66affSColin Finck             // return FALSE to fail DLL load
16*c2c66affSColin Finck             break;
17*c2c66affSColin Finck 
18*c2c66affSColin Finck         case DLL_PROCESS_DETACH:
19*c2c66affSColin Finck             // detach from process
20*c2c66affSColin Finck             break;
21*c2c66affSColin Finck 
22*c2c66affSColin Finck         case DLL_THREAD_ATTACH:
23*c2c66affSColin Finck             // attach to thread
24*c2c66affSColin Finck             break;
25*c2c66affSColin Finck 
26*c2c66affSColin Finck         case DLL_THREAD_DETACH:
27*c2c66affSColin Finck             // detach from thread
28*c2c66affSColin Finck             break;
29*c2c66affSColin Finck     }
30*c2c66affSColin Finck     return TRUE; // succesful
31*c2c66affSColin Finck }
32