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

JetGetLS Function

· 52CE 我爱测

Learn more about: JetGetLS Function

Applies to: Windows | Windows Server

JetGetLS Function

The JetGetLS function enables the application to retrieve the context handle known as Local Storage that is associated with a cursor or the table associated with that cursor. This context handle must have been previously set using JetSetLS. JetGetLS can also be used to simultaneously fetch the current context handle for a cursor or table and reset that context handle.

Windows XP:  JetGetLS is introduced in Windows XP.

    JET_ERR JET_API JetGetLS(
      __in          JET_SESID sesid,
      __in          JET_TABLEID tableid,
      __out         JET_LS* pls,
      __in          JET_GRBIT grbit
    );

Parameters

sesid

The session to use for this call.

tableid

The cursor to use for this call.

pls

The output buffer that receives the context handle currently associated with the cursor or table.

grbit

A group of bits specifying zero or more of the following options.

Value Meaning
JET_bitLSCursor Indicates that the context handle associated with the given cursor should be retrieved.If neither JET_bitLSCursor nor JET_bitLSTable is specified then JET_bitLSCursor is presumed.This option cannot be used with JET_bitLSTable. The operation will fail with JET_errInvalidgrbit if this is attempted.
JET_bitLSTable Indicates that the context handle associated to the table that contains the given cursor should be retrieved. It is illegal to use this option with JET_bitLSCursor. The operation will fail with JET_errInvalidgrbit if this is attempted.
JET_bitLSReset Indicates that the context handle for the chosen object should be reset to JET_LSNil. The current value of the context handle is returned in the output buffer.

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_errInvalidgrbit One of the options requested was invalid, used in an illegal manner, or not implemented.This can happen for JetGetLS when both JET_bitLSCursor and JET_bitLSTable are set.
JET_errLSNotSet The context handle could not be returned because no context handle is currently associated with the requested object.Note   This error is not returned if JET_bitLSReset is specified yet no context handle was associated with the requested object.
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_errTermInProgress It is not possible to complete the operation because the instance associated with the session is being shut down.

On success, the context handle was successfully retrieved from the requested object. If JET_bitLSReset was specified then that context handle was also successfully removed from the object. No change to the database state will occur.

On failure, no change to the state of the requested object has occurred. No change to the database state will occur.

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_ERR
JET_GRBIT
JET_LS
JET_SESID
JET_TABLEID
JetSetLS

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)

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

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