Dynamic Data Access (DDA) Driver Initialization

The Verity engine locates the proper driver through the use of style files; see Configuring Style Files for more information. When the driver is first loaded, its entry point is called to set up an attributes array that contains control information and identifies the callback functions available for use by the Verity engine. The first element is the driver type, which must always be VgwDrv_Class. The last element must always be NULL.

Elements between the driver class and the terminating NULL are treated as pairs of elements that, with the exception of items such as the VdkDrv_MT, VdkDrv_VdkVersion, VdkDrv_NeedLock, and VdkDrv_GdkVersion pairs, define the call back functions as follows:

the first element defines a method, which represents a function signature that the Verity engine uses to call back to the driver


the second element is the actual name of the callback function defined in your driver


VdkDrv_MT is not a function signature; it is a flag used to specify the threading model. For information about multithreading, see Multithreading Models for more information.

The following example shows the organization of the attributes array:

static VdkVoidp vgwMethods[] =
  VgwDrv_Class, /* Driver type */
VdkDrv_VdkVersion, (VdkVoidp)VDK_RELEASE,
VdkDrv_MT, VdkDrv_MTReentrant,

VdkDrv_NeedLock, (VdkVoidp)lock,
VdkDrv_New, (VdkVoidp)VdkDrvNew,
VdkDrv_Free, (VdkVoidp)VdkDrvFree,

VgwDrv_SessionNew, (VdkVoidp)VgwSessionNew,

VgwDrv_GdkVersion, (VdkVoidp)GDK_RELEASE,

The main entry point returns the array of attributes to the Verity engine, as shown in the example from the vgwsamp sample:

VdkError VDK_EXPORT vgwsamp(VdkVoidp* attrsp)
if (attrsp)
*attrsp = vgwMethods;
return VdkSuccess;

The Verity engine converts your function name to a function pointer at runtime to execute the callback function.