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.
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:
For a list of all possible information types, see the FS_INFORMATION_CLASS enumeration in ntifs.h.
The filter driver should pass this IRP down to the next-lower driver on the stack.
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:
Pointer to the target device object.
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:
Pointer to an IO_STATUS_BLOCK structure that receives the final completion status and information about the requested operation.
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.
Specifies the type of information to be set for the volume. This value can be one of the following:
Set FILE_FS_CONTROL_INFORMATION for the volume.
Set FILE_FS_LABEL_INFORMATION for the volume.
Set FILE_FS_OBJECTID_INFORMATION for the volume.
Length, in bytes, of the buffer pointed to by Irp->AssociatedIrp.SystemBuffer.