Export (0) Print
Expand All

ZwSetQuotaInformationFile routine

The ZwSetQuotaInformationFile routine changes quota entries for the volume associated with the FileHandle parameter. All of the quota entries in the specified buffer are applied to the volume.

Syntax


NTSTATUS ZwSetQuotaInformationFile(
  _In_   HANDLE FileHandle,
  _Out_  PIO_STATUS_BLOCK IoStatusBlock,
  _In_   PVOID Buffer,
  _In_   ULONG Length
);

Parameters

FileHandle [in]

A handle for the file object that represents the file or volume for which the quota information is to be modified.

IoStatusBlock [out]

The address of the caller's I/O status block.

Buffer [in]

A buffer containing the new quota entries that should be applied to the volume. The quota information must be formatted as one or more FILE_QUOTA_INFORMATION structures. The NextEntryOffset field in the FILE_QUOTA_INFORMATION structure contains the offset, in bytes, of the next quota entry in the list. If there are no more entries after the current one, this member is zero.

Length [in]

The length in bytes of the buffer.

Return value

The ZwSetQuotaInformationFile routine returns STATUS_SUCCESS or an appropriate NTSTATUS value such as one of the following:

Return codeDescription
STATUS_INSUFFICIENT_RESOURCES

There were insufficient resources to complete the operation. This is an error code.

STATUS_INVALID_DEVICE_REQUEST

Quotas are not enabled on the volume. This is an error code.

STATUS_MEDIA_WRITE_PROTECTED

The volume is read only. This is an error code.

 

Remarks

The ZwSetQuotaInformationFile routine applies all of the quota entries in the specified Buffer parameter to the volume.

The IoCheckQuotaBufferValidity function can check whether the specified quota buffer passed as the Buffer parameter is valid.

A call to ZwSetQuotaInformationFile will result in an IRP_MJ_SET_QUOTA request being sent to the device object that is associated with the file object whose handle is stored in the FileHandle parameter.

If the underlying file system does not support quota information (FAT and CDFS file systems, for example), ZwSetQuotaInformationFile will fail returning STATUS_INVALID_DEVICE_REQUEST.

Note  If the call to the ZwSetQuotaInformationFile function occurs in user mode, you should use the name "NtSetQuotaInformationFile" instead of "ZwSetQuotaInformationFile".

Requirements

Version

Available in Windows 7 and later versions of Windows operating systems.

Header

Ntifs.h (include Ntifs.h or FltKernel.h)

Library

Ntoskrnl.lib

IRQL

PASSIVE_LEVEL

DDI compliance rules

PowerIrpDDis, HwStorPortProhibitedDDIs

See also

FILE_GET_QUOTA_INFORMATION
FILE_QUOTA_INFORMATION
IO_STATUS_BLOCK
IoCheckQuotaBufferValidity
IRP_MJ_QUERY_QUOTA
IRP_MJ_SET_QUOTA
ZwQueryQuotaInformationFile

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft