Skip to main content
Version: 16.8.2

GW2RegisterLicenceFile

The GW2RegisterLicenceFile registers the licence file to a session.

If neither GW2RegisterLicenceFile or GW2RegisterLicenceMemory is registered with a session, the Editor will attempt to search for the licence in the default location. This is a file called gwkey.lic located in the same folder as the Editor library. If that cannot be found then the library will be considered unlicenced and some processes may fail with licence expiry issues.

Synopsis

The GW2RegisterLicenceFile function requests that session session uses the licence specified in the file whose name is the string pointed to by filename. The Licence will be applied to all processing performed by Glasswall for that session.


#include "glasswall.core2.api.h"
int GW2RegisterLicenceFile(Session session, const char *filename);

Returns

Returns an integer GW2_RetStatus enum value. Negative numbers indicate a failure.

Example


#include "glasswall.core2.api.h"

HANDLE session = GW2OpenSession();
if (!session)
/* deal with error */
else
if (GW2RegisterLicenceFile(session, "gwkey.lic") < 0)
/* deal with error */
else
/* the file has been successfully registered */

...

/* later */
if (GW2CloseSession(session) < 0)
/* error closing session */