GdkGetSecurityId


Call the GdkGetSecurityId function to determine the security module associated with the specified GDK library handle.


Syntax

VdkUint2 GdkGetSecurityId(
   GdkHandle   gdkHandle)

Arguments

 


gdkHandle

GdkHandle   A GDK library handle.


Returns

This function returns one of the following values:

The ID of the security module, which is a positive number greater than 0

 

0 if the gateway is non-secure, i.e. a security module is not defined for this gateway

 


Discussion

If you set the GDK_NOSECURITY bit in the flags member of the GdkHandleNewArgRec structure that you passed to the GdkHandleNew function, the GdkGetSecurityId function returns a value of 0.


Example

static GdkHandle pGdkHandle;

static VdkError
VDK_CALLBACK VgwSessionNew(VgwSessionNewArg pNewArg,
VgwAppSession* ppSession)
{
/* modified code snippet from VgwSessionNewFnc example
implementation */
...

/*********************************************
* save session related objects for later use
*********************************************/

memset(pVSes, 0, sizeof(VgwAppSessionRec));

pVSes->drvAppData = pNewArg->drvAppData;
pVSes->vdkSession = pNewArg->vdkSession;
pVSes->collection = pNewArg->collection;
pVSes->docSource = pNewArg->docSource;
pVSes->configDirectory =
(VdkCString)strdup((const char*)pNewArg->configDirectory);
pVSes->securityModuleId = pNewArg->securityModuleId;
if (!pVSes->securityModuleId)
pVSes->securityModuleId = GdkGetSecurityId(pGdkHandle);

...
}