The IRP_MJ_SET_QUOTA request is sent by the I/O Manager. It can be sent, for example, when a user-mode application has called a Microsoft Win32 method such as IDiskQuotaControl::SetQuotaState.
IRP_MJ_SET_QUOTA and IRP_MJ_QUERY_QUOTA existed in Windows NT 4.0 but were not used by file systems. On Windows 2000 and later systems, they are used for disk quota support in NTFS. Support for these IRPs by new file systems is optional.
The filter driver should pass this IRP down to the next-lower driver on the stack, unless it needs to explicitly override quota behavior.
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 quota information request:
Pointer to the target device object.
If the DO_BUFFERED_IO flag is set, the caller has requested METHOD_BUFFERED I/O. Otherwise, the caller has requested METHOD_NEITHER I/O.
Pointer to a system-supplied buffer to be used as an intermediate system buffer, if the DO_BUFFERED_IO flag is set in DeviceObject->Flags. Otherwise, this member is set to NULL.
Pointer to an IO_STATUS_BLOCK structure that receives the final completion status and information about the requested operation.
Pointer to a caller-supplied buffer that contains the quota entries to be added or modified for the volume.
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_QUOTA and should not be used.
Specifies the length, in bytes, of the buffer pointed to by Irp->UserBuffer.