JET_CALLBACK Callback Function

Applies to: Windows | Windows Server

JET_CALLBACK Callback Function

The JET_CALLBACK function is a multi-purpose callback function used by the database engine to inform the application of an event involving online defragmentation and cursor state notifications.

See JET_CBTYP for specific settings to use for the parameters of this function, as these settings will differ depending upon the JET_CBTYP option that is selected for use in the cbtyp parameter.

    JET_ERR JET_API* JET_CALLBACK(
      [in]                 JET_SESID sesid,
      [in]                 JET_DBID dbid,
      [in]                 JET_TABLEID tableid,
      [in]                 JET_CBTYP cbtyp,
      [in, out]            void* pvArg1,
      [in, out]            void* pvArg2,
      [in]                 void* pvContext,
      [in]                 JET_API_PTR ulUnused
    );

Parameters

sesid

The session for which the callback is being made.

dbid

The database for which the callback is being made.

tableid

The cursor for which the callback is being made.

cbtyp

The point in the operation at which the callback is being made. See JET_CBTYP for a list of values and the meaning of the following parameters in each case.

pvArg1

A parameter used to communicate with the application using the callback. See JET_CBTYP for information on the use of this parameter for each callback supported by the database engine.

pvArg2

A parameter used to communicate with the application using the callback. See JET_CBTYP for information on the use of this parameter for each callback supported by the database engine.

pvContext

A parameter used to communicate with the application using the callback. See JET_CBTYP for information on the use of this parameter for each callback supported by the database engine.

ulUnused

A parameter used to communicate with the application using the callback. See JET_CBTYP for information on the use of this parameter for each callback supported by the database engine.

Return Value

The function returns one of the Extensible Storage Engine error codes. For information about how to return these codes as HRESULTs, see Extensible Storage Engine Errors. On success, the operation that issued the callback can proceed normally. In some cases, the callback may return a warning that influences that operation. See JET_CBTYP for information on the use of these warnings by the operation.

On failure, the operation that issued the callback may proceed normally or may fail. See JET_CBTYP for information on the use of the error code by the operation.

Remarks

If the callback passes a cursor to the application then it is important to know that this cursor is intentionally limited to a smaller set of functionality to avoid recursion and other ugliness. The following operations are allowed:

When you design your callback, take into account that even with these restrictions, it is still possible for the callback to fail.

Requirements

Requirement Value

Client

Requires Windows Vista, Windows XP, or Windows 2000 Professional.

Server

Requires Windows Server 2008, Windows Server 2003, or Windows 2000 Server.

Header

Declared in Esent.h.

See Also

JET_API_PTR
JET_DBID
JET_SESID
JET_TABLEID
JET_CBTYP