Ticket #2834: dllMain.c

File dllMain.c, 505 bytes (added by lewissandy, 5 years ago)
Line 
1#include <windows.h>
2#include <Rts.h>
3
4extern void __stginit_Adder(void);
5
6static char* args[] = { "ghcDll", NULL };
7                       /* N.B. argv arrays must end with NULL */
8BOOL
9STDCALL
10DllMain
11   ( HANDLE hModule
12   , DWORD reason
13   , void* reserved
14   )
15{
16  if (reason == DLL_PROCESS_ATTACH) {
17      /* By now, the RTS DLL should have been hoisted in, but we need to start it up. */
18      startupHaskell(1, args, __stginit_Adder);
19      return TRUE;
20  }
21  return TRUE;
22}