Expand Minimize

FsRtlLookupPerFileContext routine

The FsRtlLookupPerFileContext routine returns a pointer to a FSRTL_PER_FILE_CONTEXT object that is associated with a specified file.

Syntax


PFSRTL_PER_FILE_CONTEXT FsRtlLookupPerFileContext(
  _In_      PVOID *PerFileContextPointer,
  _In_opt_  PVOID OwnerId,
  _In_opt_  PVOID InstanceId
);

Parameters

PerFileContextPointer [in]

A pointer to an opaque pointer that is used by the file system runtime library (FSRTL) package to track file contexts. To retrieve this pointer from a file object, use the FsRtlGetPerFileContextPointer macro.

OwnerId [in, optional]

A pointer to a filter driver-allocated variable that uniquely identifies the owner of the per-file context structure. The format of this variable is filter driver-specific. This parameter is optional, but must be non-NULL if InstanceId is non-NULL.

InstanceId [in, optional]

A pointer to a filter driver-allocated variable that can be used to distinguish among per-file context structures that are created by the same filter driver. The format of this variable is filter driver-specific. This parameter is optional.

Return value

A pointer to the first FSRTL_PER_FILE_CONTEXT structure that matches the OwnerId and InstanceId, if specified, or NULL if no match is found or the file system does not support per-file contexts.

Remarks

By not specifying OwnerID and InstanceId, a filter driver can search for the first context that is associated with a file.

If the file system does not support per-file context objects, NULL is returned. Use the FsRtlSupportsPerFileContexts macro to determine whether a file system supports per-file context objects.

Requirements

Version

Available in Windows Vista and later versions of the Windows operating system.

Header

Ntifs.h (include FltKernel.h or Ntifs.h)

Library

Ntoskrnl.lib

IRQL

<= APC_LEVEL

See also

FSRTL_PER_FILE_CONTEXT
FsRtlGetPerFileContextPointer
FsRtlInsertPerFileContext
FsRtlRemovePerFileContext
Tracking Per-File Context in a Legacy File System Filter Driver

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft