#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;
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 referenceNo description available.
The OPLOCK_KEY_CONTEXT structure is returned from IoGetOplockKeyContextEx. This structure contains oplock keys for a specific file object.
VersionThe 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. |
FlagsA 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. |
ParentOplockKeyA GUID that represents the parent oplock key value.
TargetOplockKeyA GUID that represents the target oplock key value.
ReservedIf 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.