Advertisement
Guest User

Untitled

a guest
Oct 8th, 2012
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 0.62 KB | None | 0 0
  1. module dllmain;
  2.  
  3. import std.c.windows.windows;
  4. import core.sys.windows.dll;
  5.  
  6. __gshared HINSTANCE g_hInst;
  7.  
  8. extern (Windows)
  9. BOOL DllMain(HINSTANCE hInstance, ULONG ulReason, LPVOID pvReserved)
  10. {
  11.     final switch (ulReason)
  12.     {
  13.     case DLL_PROCESS_ATTACH:
  14.         g_hInst = hInstance;
  15.         dll_process_attach( hInstance, true );
  16.         break;
  17.  
  18.     case DLL_PROCESS_DETACH:
  19.         dll_process_detach( hInstance, true );
  20.         break;
  21.  
  22.     case DLL_THREAD_ATTACH:
  23.         dll_thread_attach( true, true );
  24.         break;
  25.  
  26.     case DLL_THREAD_DETACH:
  27.         dll_thread_detach( true, true );
  28.         break;
  29.     }
  30.     return true;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement