(v13) Source requirements
This page applies to Harlequin v13.1r0 and later; and to Harlequin MultiRIP but not Harlequin Core
Windows must initialize the plugin DLL when it is loaded. This can often be accomplished by specifying the system call CRT_INIT
as the entry point when the plugin is linked (see below).
However, if the plugin needs its Windows instance handle
(which is passed to the plugin initialization routine), an explicit function must be written for this, which must itself call CRT_INIT
. This routine is conventionally called DllInit
.
#include <windows.h>
...
static HANDLE hInst;
...
int APIENTRY DllInit (HANDLE h, DWORD r, LPVOID v)
{
CRT_INIT (h, r, v);
hInst = h return 1;
}
A routine to do this is provided in libmain.obj
in the plugin library.