Advertisement
Guest User

Untitled

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