Preface
This section summarizes the specifications required for DLL files, which are the core of each subsystem, including SHIORI, SAORI, MAKOTO, PLUGIN, and HEADLINE.
Export Functions
Here is an example in C.
- extern "C" __declspec(dllexport) BOOL __cdecl load(HGLOBAL h, long len);
- extern "C" __declspec(dllexport) BOOL __cdecl unload(void);
- extern "C" __declspec(dllexport) HGLOBAL __cdecl request(HGLOBAL h, long *len);
☆Borland C/C++ compilers seem to add an underscore at the beginning like _load, so it would be better to support that as well.
load
HGLOBAL contains the path to the directory containing the DLL.
Since it is GlobalAlloc(GMEM_FIXED,xxx), please cast it to a pointer (char *) and use it as is.
Also, be sure to perform GlobalFree on the DLL side.
The return value is always true.
The default is false on load failure, but if false is returned, nothing is processed.
unload
Called just before opening the DLL (i.e., when SSP/CROW is closed & when overwriting installs, before DLL_PROCESS_DETACH).
The return value is always true.
The default is false on release failure, but if false is returned, it is ignored.
request
All processing other than loading and unloading is performed here.
The precautions are the same as for load.
The return value depends on the type of subsystem (SHIORI, SAORI, PLUGIN...) implemented by this DLL.
The return value HGLOBAL should also be the one allocated by GlobalAlloc(GMEM_FIXED,xxx).