MRxQueryVolumeInfo routine

The MRxQueryVolumeInfo routine is called by RDBSS to request that a network mini-redirector query volume information.

Syntax

PMRX_CALLDOWN MRxQueryVolumeInfo;

NTSTATUS MRxQueryVolumeInfo(
  _Inout_ PRX_CONTEXT RxContext
)
{ ... }

Parameters

RxContext [in, out]
A pointer to the RX_CONTEXT structure. This parameter contains the IRP that is requesting the operation.

Return value

MRxQueryVolumeInfo returns STATUS_SUCCESS on success or an appropriate NTSTATUS value, such as one of the following:

Return code Description
STATUS_ACCESS_DENIED

The caller lacked the proper security for this operation.

STATUS_BUFFER_OVERFLOW

The buffer to receive the volume information was too small.

This return value should be considered success and as much valid data as possible should be returned in the Info.Buffer member of the RX_CONTEXT structure pointed to by the RxContext parameter.

STATUS_BUFFER_TOO_SMALL

The buffer is too small to receive the requested data.

If this value is returned, the InformationToReturn member of the RX_CONTEXT structure pointed to by the RxContext parameter should be set to the minimum size of the expected buffer for the call to succeed.

STATUS_CONNECTION_DISCONNECTED

The connection was disconnected.

STATUS_INSUFFICIENT_RESOURCES

There were insufficient resources to complete the query.

STATUS_INVALID_PARAMETER

An invalid parameter was specified.

STATUS_NETWORK_NAME_DELETED

A network name was deleted.

STATUS_NOT_IMPLEMENTED

A feature that is requested is not implemented.

Remarks

RDBSS issues a call to MRxQueryVolumeInfo in either of the following cases:

Before calling MRxQueryVolumeInfo in the case of an IRP_MJ_QUERY_VOLUME_INFORMATION request, RDBSS modifies the following members in the RX_CONTEXT structure pointed to by the RxContext parameter:

The Info.FsInformationClass member is set to IrpSp->Parameters.QueryVolume.FsInformationClass.

The Info.Buffer member is set to Irp->AssociatedIrp.SystemBuffer.

The Info.LengthRemaining member is set to IrpSp->Parameters.QueryVolume.Length.

For an IRP_MJ_QUERY_VOLUME_INFORMATION request, if the PostRequest member of the RX_CONTEXT structure is TRUE on return from MRxQueryVolumeInfo, RDBSS will call RxFsdPostRequest to post the request. For this case, the IRP_MJ_QUERY_VOLUME_INFORMATION request will pass the RX_CONTEXT structure to queue RX_CONTEXT to a worker queue for processing by the file system process (FSP).

If the PostRequest member of the RX_CONTEXT structure is FALSE on return from MRxQueryVolumeInfo, the network mini-redirector must set the Info.LengthRemaining member of the RX_CONTEXT structure to the length of the volume information returned. RDBSS sets the IoStatus.Information member of the IRP to IrpSp->Parameters.QueryVolume.Length minus the Info.LengthRemaining member of the RX_CONTEXT structure.

If the call to MRxQueryVolumeInfo is successful, the network mini-redirector should set the Info.LengthRemaining member of the RX_CONTEXT structure to the Info.Length member minus the length of the volume information returned. If the call to MRxQueryVolumeInfo was successful, RDBSS sets the IoStatus.Information member of the IRP to IrpSp->Parameters.QueryVolume.Length minus the Info.LengthRemaining member of the RX_CONTEXT structure.

For an IRP_MJ_QUERY_VOLUME_INFORMATION request with the Info.FsInformationClass member set to FileFsDeviceInformation, the network mini-redirector returns the following information in the RX_CONTEXT structure pointed to by the RxContext parameter:

The Info.Buffer member contains an FILE_FS_DEVICE_INFORMATION structure

The Info.Buffer.Characteristics member is set to the characteristics of the volume, which must include FILE_REMOTE_DEVICE as one of the options.

The Info.Buffer.DeviceType member is set to the DeviceType member of the associated NET_ROOT structure. If the Type member of the associated NET_ROOT is NET_ROOT_PIPE, Info.Buffer.DeviceType member is set to FILE_DEVICE_NAMED_PIPE.

For an IRP_MJ_QUERY_VOLUME_INFORMATION request with the Info.FsInformationClass member set to FileFsVolumeInformation, the network mini-redirector returns the following information in the RX_CONTEXT structure pointed to by the RxContext parameter:

The Info.Buffer member contains a FILE_FS_VOLUME_INFORMATION structure.

The Info.Buffer member is set to the VolumeInfo member of the associated NET_ROOT structure.

The Info.LengthRemaining member is set to the VolumeInfoLength member of the associated NET_ROOT structure.

An MRxQueryVolumeInfo call from RDBSS for IRP_MJ_FILE_SYSTEM_CONTROL is a request for the link tracking information. Before calling MRxQueryVolumeInfo for IRP_MJ_FILE_SYSTEM_CONTROL, RDBSS modifies the following members in the RX_CONTEXT structure pointed to by the RxContext parameter:

The Info.FsInformationClass member is set to FileFsObjectIdInformation.

The Info.Buffer member is set to a FILE_FS_OBJECTID_INFORMATION structure.

The Info.LengthRemaining member is set to sizeof(FILE_FS_OBJECTID_INFORMATION).

For this case of an IRP_MJ_FILE_SYSTEM_CONTROL request, the AssociatedIrp.SystemBuffer member of the IRP points to a LINK_TRACKING_INFORMATION structure.

If a request is initiated as an IRP_MJ_FILE_SYSTEM_CONTROL to MRxQueryVolumeInfo with a return value of STATUS_SUCCESS or STATUS_BUFFER_OVERFLOW, RDBSS copies the ObjectId member of the FILE_FS_OBJECTID_INFORMATION structure passed in the Info.Buffer member of RX_CONTEXT structure to the NetRoot->DiskParameters.VolumeId member of the FCB structure and to the AssociatedIrp.SystemBuffer.VolumeId member of the IRP. If the call to MRxQueryVolumeInfo was successful, RDBSS sets the Type member of the LINK_TRACKING_INFORMATION structure. If the NetRoot->Flags member of the FCB structure has the NETROOT_FLAG_DFS_AWARE_NETROOT bit set, the Type member is set by RDBSS to DfsLinkTrackingInformation. If the NetRoot->Flags member of the FCB structure does not have the NETROOT_FLAG_DFS_AWARE_NETROOT bit set, the Type member is set by RDBSS to NtfsLinkTrackingInformation. On success, RDBSS sets the IoStatus.Information member of the IRP to the size of a LINK_TRACKING_INFORMATION structure.

Requirements

Target platform

Desktop

Header

Mrx.h (include Mrx.h)

See also

MRxIsValidDirectory

MRxQueryDirectory

MRxQueryEaInfo

MRxQueryFileInfo

MRxQueryQuotaInfo

MRxQuerySdInfo

MRxSetEaInfo

MRxSetFileInfo

MRxSetFileInfoAtCleanup

MRxSetQuotaInfo

MRxSetSdInfo

MRxSetVolumeInfo

RxFsdPostRequest