The FsRtlInitPerFileContext macro initializes a FSRTL_PER_FILE_CONTEXT structure.
VOID FsRtlInitPerFileContext( FSRTL_PER_FILE_CONTEXT FileContext, PVOID OwnerId, PVOID InstanceId, PFREE_FUNCTION FreeCallback );
The FSRTL_PER_FILE_CONTEXT object to be initialized.
A pointer to a filter driver-allocated variable that uniquely identifies the owner of the per-file context structure. The format is filter driver-specific. This parameter must have a non-NULL value.
A pointer to a filter driver-allocated variable that can be used to distinguish among the per-file context structures that are created by the same filter driver. The format of this variable is filter driver-specific. This parameter can be NULL.
A pointer to a callback routine that frees the per-file context structure.
This macro must be used before calling FsRtlInsertPerFileContext.
Filter writers should choose an OwnerID value that is both meaningful and convenient, such as the address of a driver object or device object.
Filter writers should use an InstanceID value that is both meaningful and convenient, such as the address of the file context object for the file. Use the FsRtlGetPerFileContextPointer macro to retrieve that address from a file object.
For more information about how to use and create context objects, see Tracking Per-File Context in a Legacy File System Filter Driver.
|Available in Windows Vista and later versions of the Windows operating system.|