Expand Minimize

FsRtlLookupPerStreamContext function

The FsRtlLookupPerStreamContext macro retrieves a per-stream context structure for a file stream.

Syntax


PFSRTL_PER_STREAM_CONTEXT FsRtlLookupPerStreamContext(
  _In_     PFSRTL_ADVANCED_FCB_HEADER StreamContext,
  _In_opt_ PVOID                      OwnerId,
  _In_opt_ PVOID                      InstanceId
);

Parameters

StreamContext [in]

Pointer to the FSRTL_ADVANCED_FCB_HEADER structure for the file stream. To get this pointer from a file object, use the FsRtlGetPerStreamContextPointer macro.

OwnerId [in, optional]

Pointer to a caller-allocated variable that uniquely identifies the owner of the per-stream context structure. The format of this variable is filter driver − specific. Must be non-NULL if a non-NULL value is supplied for InstanceId.

InstanceId [in, optional]

Pointer to a filter driver − allocated variable that can be used to distinguish among per-stream context structures created by the same filter driver. The format of this variable is filter driver − specific.

If OwnerId and InstanceId are both NULL, FsRtlLookupPerStreamContext returns the first per-stream context found.

If a non-NULL value is supplied for OwnerId and InstanceId is NULL, FsRtlLookupPerStreamContext returns the first per-stream context found whose OwnerId member matches the OwnerId parameter.

Return value

FsRtlLookupPerStreamContext returns a pointer to the first matching per-stream context that is found. If no match is found, or if the file system does not support filter contexts, FsRtlLookupPerStreamContext returns NULL.

Remarks

A file system filter driver calls FsRtlLookupPerStreamContext to retrieve its per-stream context structure for a file stream. The per-stream context structure contains context information that the filter driver maintains for the file stream.

Note  FsRtlLookupPerStreamContext can only be used on file systems that support per-stream contexts.

To initialize a per-stream context structure, use the FsRtlInitPerStreamContext macro.

To associate an initialized per-stream context structure with a file stream, call FsRtlInsertPerStreamContext.

To remove a per-stream context structure that is associated with a file stream, call FsRtlRemovePerStreamContext.

For more information, see Tracking Per-Stream Context in a Legacy File System Filter Driver.

Requirements

Target platform

Desktop

Version

This routine is available on Update Rollup for Windows 2000 Service Pack 4 (SP4) and on Windows XP and later.

Header

Ntifs.h (include Ntifs.h)

Library

Ntoskrnl.lib

IRQL

<= APC_LEVEL

See also

FSRTL_ADVANCED_FCB_HEADER
FSRTL_PER_STREAM_CONTEXT
FsRtlGetPerStreamContextPointer
FsRtlInitPerStreamContext
FsRtlInsertPerStreamContext
FsRtlRemovePerStreamContext
FsRtlSetupAdvancedHeader
FsRtlSupportsPerStreamContexts
FsRtlTeardownPerStreamContexts

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft