Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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.

 

For GUI

...

modules

Code Block
languagecpp
extern "C" __declspec(dllexport) int InitialiseGUI(HostAPI* pHost, HostModuleHandle hModule)

Vardef
NamepHost
TypeMod*
Linkedtrue
TypeHostApi
StyleParameter

Pointer to the UI host API. This is the root interface used to interface to WinGate Management Console.

Vardef
NamehModule
Linkedtrue
TypeHostModuleHandle
StyleParameter

An opaque handle that references this instance of your module. Typically you can ignore this.

...

See InitialiseGUI

For Engine modules

Code Block
languagecpp
extern "C" __declspec(dllexport) int Initialise(HostAPI* pHost, HostModuleHandle hModule, LPCWSTR szRegistryPath)

Vardef
NamepHost
TypeMod*
Linkedtrue
TypeHostApi
StyleParameter

Pointer to the Engine host API. This is the root interface used to interface to WinGate.

Vardef
NamehModule
Linkedtrue
TypeHostModuleHandle
StyleParameter

An opaque handle that references this instance of your module. Typically you can ignore this.

Vardef
NameszRegistryPath
TypeLPCWSTR
StyleParameter

The registry key under HKLM where the module's package information is located. This is the same registry key that holds the manifest file path.

See Initialise

For all modules

Code Block
languagecpp
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 internal version. If they differ, the module will not be loaded.

 

Typically the function looks like so:

Code Block
languagecpp
extern "C" __declspec(dllexport) int ModuleGetAPIVersion()
{
	return COMPONENTS_API_VERSION;
}