Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Rts.h>
- #include <windows.h>
- #include "../hs/kernel_stub.h"
- extern void __stginit_Kernel(void);
- BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID _Reserved)
- {
- switch(dwReason)
- {
- case DLL_PROCESS_ATTACH:
- //HookWinsockProcs();
- return TRUE;
- break;
- case DLL_THREAD_ATTACH:
- break;
- case DLL_THREAD_DETACH:
- break;
- case DLL_PROCESS_DETACH:
- return TRUE;
- break;
- }
- return TRUE;
- }
- void HsStart()
- {
- int argc = 1;
- char* argv[] = {"ghcDll", NULL}; // argv must end with NULL
- // Initialize Haskell runtime
- char** args = argv;
- hs_init(&argc, &args);
- // Tell Haskell about all root modules
- hs_add_root(__stginit_Kernel);
- }
- void HsEnd()
- {
- hs_exit();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement