OPLOCK_KEY_CONTEXT - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTIOAPI_H
#if (PHNT_MODE != PHNT_MODE_KERNEL)

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

#endif
#endif

View code on GitHub
// ntddk.h

typedef struct _OPLOCK_KEY_CONTEXT {
  USHORT Version;
  USHORT Flags;
  GUID   ParentOplockKey;
  GUID   TargetOplockKey;
  ULONG  Reserved;
} OPLOCK_KEY_CONTEXT, *POPLOCK_KEY_CONTEXT;
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (ns-ntddk-_oplock_key_context)

Description

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

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.

See also

IoGetOplockKeyContextEx

Oplock Semantics