This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 9th, 2010  |  syntax: D  |  size: 0.69 KB  |  views: 92  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }
clone this paste RAW Paste Data