大网数据广告活动
磁盘与文件系统

JetRegisterCallback Function

· 52CE 我爱测

Learn more about: JetRegisterCallback Function

Applies to: Windows | Windows Server

JetRegisterCallback Function

The JetRegisterCallback function allows the application to configure the database engine to issue notifications to the application for specific events. These notifications are associated with a specific table and remain in effect only until the instance containing the table is shut down using JetTerm.

Windows XP:  JetRegisterCallback is introduced in Windows XP.

    JET_ERR JET_API JetRegisterCallback(
      __in          JET_SESID sesid,
      __in          JET_TABLEID tableid,
      __in          JET_CBTYP cbtyp,
      __in          JET_CALLBACK pCallback,
      __in          void* pvContext,
      __out         JET_HANDLE* phCallbackId
    );

Parameters

sesid

The session to use for this call.

tableid

The cursor to use for this call.

cbtyp

A bit mask composed of the callback reasons for which the application wishes to receive notifications.

To create this bit mask, simply or together valid callback reasons from the JET_CBTYP enumeration.

pCallback

The function pointer to the callback function for the application.

pvContext

Specifies a context pointer that will be given to the callback function for the application.

phCallbackId

Returns a handle that can later be used to cancel the registration of the given callback function using JetUnregisterCallback.

Return Value

This function returns the JET_ERR datatype with one of the following return codes. For more information about the possible ESE errors, see Extensible Storage Engine Errors and Error Handling Parameters.

Return code Description
JET_errSuccess The operation completed successfully.
JET_errClientRequestToStopJetService It is not possible to complete the operation because all activity on the instance associated with the session has ceased as a result of a call to <a href="gg269240(v=exchg.10).md">JetStopService</a>.
JET_errInstanceUnavailable It is not possible to complete the operation because the instance associated with the session has encountered a fatal error that requires that access to all data be revoked to protect the integrity of that data. This error will only be returned by Windows XP and later releases.
JET_errInvalidParameter One of the parameters provided contained an unexpected value or contained a value that did not make sense when combined with the value of another parameter. This error will be returned by JetRegisterCallback when:<ul><li>cbtyp is zero,</li><li>pCallback is NULL.</li><li>phCallbackId is NULL.</li></ul>
JET_errNotInitialized It is not possible to complete the operation because the instance associated with the session has not been initialized yet.
JET_errRestoreInProgress It is not possible to complete the operation because a restore operation is in progress on the instance associated with the session.
JET_errSessionSharingViolation The same session cannot be used for more than one thread at the same time. This error will only be returned by Windows XP and later releases.
JET_errTermInProgress It is not possible to complete the operation because the instance associated with the session is being shut down.

On success, the specified callback will be registered for the given callback reasons with the table associated with the given cursor. No change to the database state will occur.

On failure, the callback will not be registered. No change to the database state will occur.

Remarks

This method provides a means for the application to associate volatile callbacks with a table in a database. If the application wishes to associate persisted callbacks with a table in the database then it should pass the callback to JET_TABLECREATE using JetCreateTableColumnIndex.

Requirements
Requirement Value
Client Requires Windows Vista or Windows XP.
Server Requires Windows Server 2008 or Windows Server 2003.
Header Declared in Esent.h.
Library Use ESENT.lib.
DLL Requires ESENT.dll.
See Also

JET_CALLBACK
JET_CBTYP
JET_ERR
JET_HANDLE
JET_SESID
JET_TABLEID
JetCreateTableColumnIndex
JetTerm
JetUnregisterCallback

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 04/11/2016
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。