In order for your module to be used within WinGate it needs to export a set of mandatory functions. The WinGate Module Wizard creates these for you if you use it to create your solution/project.
extern "C" __declspec(dllexport) int InitialiseGUI(HostAPI* pHost, HostModuleHandle hModule) |
See InitialiseGUI
extern "C" __declspec(dllexport) int Initialise(HostAPI* pHost, HostModuleHandle hModule, LPCWSTR szRegistryPath) |
See Initialise
extern "C" __declspec(dllexport) int ModuleGetAPIVersion() |
ModuleGetAPIVersion should return the version of the API that your module was compiled with. WinGate will check that the version returned from ModuleGetAPIVersion is the same as its own host API version. If they differ, the module will not be loaded. The host API version number does not change unless we make a significant change to the API that would break compatibility with current plugins.
Typically the function looks like so:
extern "C" __declspec(dllexport) int ModuleGetAPIVersion() { return COMPONENTS_API_VERSION; } |