Callback Function Calling Conventions

Callback functions are defined to the Verity engine by their name and signature; see Dynamic Data Access (DDA) Driver Initialization for information about the names of these functions. VDK uses the VdkFdecl macro to define callback functions, as follows:

#define VdkFdecl(type, tname, args)
typedef type (VDK_CALLBACK * tname) args

Thus, the VgwSessionNewFnc callback function in vdk_vgw.h, is defined as follows:

VdkFdecl(VdkError, VgwSessionNewFnc,
(VgwSessionNewArg, VgwAppSession *));

Your definition of the callback function must match the type definition; for example, it might look as follows:

static VdkError
VDK_CALLBACK VgwSessionNew(VgwSessionNewArg pNewArg,
VgwAppSession* ppSession)

Callback functions must be defined as type VDK_CALLBACK, which guarantees that the functions will perform properly, regardless of platform. Callback functions do not need to be static functions. For more information about organizing your driver, see Entry Points.