SHARE
TWEET

Untitled

a guest Oct 7th, 2017 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. __gshared HINSTANCE g_hInst;
  2.  
  3. extern(C) __gshared string[] rt_options = [ "gcopt=gc:manual" ];
  4.  
  5. import core.runtime;
  6. import test.hoard;
  7. import std.stdio;
  8.  
  9. extern (C) void gc_setProxy(void* p);
  10.  
  11. export void initPlugin(void* gc, Hoard* hoard)
  12. {
  13.     Runtime.initialize();
  14.     gc_setProxy(gc);
  15.  
  16.     initHoard(hoard);
  17. }
  18.  
  19. extern (Windows)
  20. BOOL DllMain(HINSTANCE hInstance, ULONG ulReason, LPVOID pvReserved)
  21. {
  22.     switch (ulReason)
  23.     {
  24.         case DLL_PROCESS_ATTACH:
  25.             g_hInst = hInstance;
  26.             dll_process_attach(hInstance, true);
  27.             break;
  28.  
  29.         case DLL_PROCESS_DETACH:
  30.             dll_process_detach(hInstance, true);
  31.             break;
  32.  
  33.         case DLL_THREAD_ATTACH:
  34.             dll_thread_attach(true, true);
  35.             break;
  36.  
  37.         case DLL_THREAD_DETACH:
  38.             dll_thread_detach(true, true);
  39.             break;
  40.  
  41.         default:
  42.             break;
  43.     }
  44.     return true;
  45. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top