OPLOCK_KEY_CONTEXT structure (ntddk.h)

The OPLOCK_KEY_CONTEXT structure is returned from IoGetOplockKeyContextEx. This structure contains oplock keys for a specific file object.

Syntax

typedef struct _OPLOCK_KEY_CONTEXT {
  USHORT Version;
  USHORT Flags;
  GUID   ParentOplockKey;
  GUID   TargetOplockKey;
  ULONG  Reserved;
} OPLOCK_KEY_CONTEXT, *POPLOCK_KEY_CONTEXT;

Members

Version

The oplock key version. The version is set to one of the following values:

Value Meaning
OPLOCK_KEY_VERSION_WIN7 This is a Windows 7 oplock key.
OPLOCK_KEY_VERSION_WIN8 This is a Windows 8 oplock key.

Flags

A set of flags that indicate the oplock key type. Flags is set to one or both of the following values:

Value Meaning
OPLOCK_KEY_FLAG_PARENT_KEY A valid oplock key is present in ParentOplockKey.
OPLOCK_KEY_FLAG_TARGET_KEY A valid oplock key is present in TargetOplockKey.

ParentOplockKey

A GUID that represents the parent oplock key value.

TargetOplockKey

A GUID that represents the target oplock key value.

Reserved

Remarks

If an oplock is requested for a file during an IRP_MJ_CREATE request, a file system that supports oplocks will attach an oplock key context to the file object created. The oplock key context is later available through a pointer to an OPLOCK_KEY_CONTEXT structure. The OPLOCK_KEY_CONTEXT structure is returned from a call to IoGetOplockKeyContextEx.

Requirements

Requirement Value
Minimum supported client This structure is available starting in Windows 8.
Header ntddk.h (include Ntddk.h)

See also

IoGetOplockKeyContextEx

Oplock Semantics