Export (0) Print
Expand All

IRP_MJ_SET_VOLUME_INFORMATION

When Sent

The IRP_MJ_SET_VOLUME_INFORMATION request is sent by the I/O Manager. It can be sent, for example, when a user-mode application has called a Microsoft Win32 function such as SetVolumeLabel.

Operation: File System Drivers

The file system driver should extract and decode the file object to determine whether it represents a user volume open. If it does, the file system driver should set the appropriate volume information and complete the IRP. Otherwise, the file system should complete the IRP as appropriate without setting the volume information.

The types of volume information that can be set are file system-dependent, but generally include one or more of the following:

FileFsControlInformation

FileFsLabelInformation

FileFsObjectIdInformation

For a list of all possible information types, see the FS_INFORMATION_CLASS enumeration in ntifs.h.

Operation: File System Filter Drivers

The filter driver should pass this IRP down to the next-lower driver on the stack.

Parameters

A file system or filter driver calls IoGetCurrentIrpStackLocation with the given IRP to get a pointer to its own stack location in the IRP, shown in the following list as IrpSp. (The IRP is shown as Irp.) The driver can use the information that is set in the following members of the IRP and the IRP stack location in processing a set volume information request:

DeviceObject

Pointer to the target device object.

Irp->AssociatedIrp.SystemBuffer

Pointer to an input buffer that contains the values of the volume information to be set. This information is stored in one of the following structures:

FILE_FS_CONTROL_INFORMATION

FILE_FS_LABEL_INFORMATION

FILE_FS_OBJECTID_INFORMATION

Irp->IoStatus

Pointer to an IO_STATUS_BLOCK structure that receives the final completion status and information about the requested operation.

IrpSp->FileObject

Pointer to the file object that is associated with DeviceObject.

The IrpSp->FileObject parameter contains a pointer to the RelatedFileObject field, which is also a FILE_OBECT structure. The RelatedFileObject field of the FILE_OBJECT structure is not valid during the processing of IRP_MJ_SET_VOLUME_INFORMATION and should not be used.

IrpSp->MajorFunction

Specifies IRP_MJ_SET_VOLUME_INFORMATION.

IrpSp->Parameters.SetVolume.FsInformationClass

Specifies the type of information to be set for the volume. This value can be one of the following:

ValueMeaning

FileFsControlInformation

Set FILE_FS_CONTROL_INFORMATION for the volume.

FileFsLabelInformation

Set FILE_FS_LABEL_INFORMATION for the volume.

FileFsObjectIdInformation

Set FILE_FS_OBJECTID_INFORMATION for the volume.

 

IrpSp->Parameters.SetVolume.Length

Length, in bytes, of the buffer pointed to by Irp->AssociatedIrp.SystemBuffer.

See also

FILE_FS_CONTROL_INFORMATION
FILE_FS_LABEL_INFORMATION
FILE_FS_OBJECTID_INFORMATION
IO_STACK_LOCATION
IO_STATUS_BLOCK
IoGetCurrentIrpStackLocation
IRP
IRP_MJ_QUERY_VOLUME_INFORMATION
ZwQueryVolumeInformationFile
ZwSetVolumeInformationFile

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft