The ZwQueryQuotaInformationFile routine retrieves quota entries associated with the volume specified by the FileHandle parameter.
NTSTATUS ZwQueryQuotaInformationFile( _In_ HANDLE FileHandle, _Out_ PIO_STATUS_BLOCK IoStatusBlock, _Out_ PVOID Buffer, _In_ ULONG Length, _In_ BOOLEAN ReturnSingleEntry, _In_opt_ PVOID SidList, _In_ ULONG SidListLength, _In_opt_ PSID StartSid, _In_ BOOLEAN RestartScan );
A handle for the file object that represents the file or volume for which the quota information is requested.
The address of the caller's I/O status block.
A buffer to receive the quota information for the volume. The quota information is 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.
The length in bytes of the buffer.
A Boolean value that indicates if only a single entry should be returned rather than filling the buffer with as many entries as possible.
SidList [in, optional]
An optional list of SIDs whose quota information is to be returned. Each entry in the list is a FILE_GET_QUOTA_INFORMATION structure. The NextEntryOffset field in the FILE_GET_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.
The length in bytes of the SID list, if one was specified.
StartSid [in, optional]
An optional pointer to the SID of the entry at which to begin scanning the quota information. This parameter should be set if the returned information is to start with an entry other than the first SID. This parameter is ignored if a SidList parameter is specified.
A Boolean value that indicates whether the scan of the quota information is to be restarted from the beginning. Set this parameter to TRUE if the scan of the quota information is to start at the first entry in the volume's quota information list. Set to FALSE if resuming the scan from a previous call to ZwQueryQuotaInformationFile. The caller must set this parameter to TRUE when calling ZwQueryQuotaInformationFile for the first time.
The ZwQueryQuotaInformationFile routine returns STATUS_SUCCESS if at least one FILE_QUOTA_INFORMATION structure is returned in the Buffer parameter or an appropriate NTSTATUS value such as one of the following:
There were insufficient resources to complete the operation. This is an error code.
Quotas are not enabled on the volume. This is an error code.
The StartSid parameter did not contain a valid SID. This is an error code.
The SidList parameter did not contain a valid, properly formed list. This is an error code.
The amount of information returned by ZwQueryQuotaInformationFile is based on the size of the quota information associated with the volume, the size of the buffer, and whether a specific set of entries has been requested.
A call to ZwQueryQuotaInformationFile will result in an IRP_MJ_QUERY_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), ZwQueryQuotaInformationFile will fail returning STATUS_INVALID_DEVICE_REQUEST.
Note If the call to the ZwQueryQuotaInformationFile function occurs in user mode, you should use the name "NtQueryQuotaInformationFile" instead of "ZwQueryQuotaInformationFile".
For calls from kernel-mode drivers, the NtXxx and ZwXxx versions of a Windows Native System Services routine can behave differently in the way that they handle and interpret input parameters. For more information about the relationship between the NtXxx and ZwXxx versions of a routine, see Using Nt and Zw Versions of the Native System Services Routines.
Available in Windows 7 and later versions of Windows operating systems.
|Ntifs.h (include Ntifs.h or FltKernel.h)|
DDI compliance rules