The NtQueryQuotaInformationFile routine retrieves quota entries associated with the volume specified by the FileHandle parameter.
__kernel_entry NTSYSCALLAPI NTSTATUS NtQueryQuotaInformationFile( HANDLE FileHandle, PIO_STATUS_BLOCK IoStatusBlock, PVOID Buffer, ULONG Length, BOOLEAN ReturnSingleEntry, PVOID SidList, ULONG SidListLength, PSID StartSid, 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.
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.
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 NtQueryQuotaInformationFile. The caller must set this parameter to TRUE when calling NtQueryQuotaInformationFile for the first time.
The NtQueryQuotaInformationFile 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 NtQueryQuotaInformationFile 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 NtQueryQuotaInformationFile 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), NtQueryQuotaInformationFile will fail returning STATUS_INVALID_DEVICE_REQUEST.
|Windows version||Available in Windows 7 and later versions of Windows operating systems.|
|Header||ntifs.h (include Ntifs.h, FltKernel.h)|
|DDI compliance rules||PowerIrpDDis, HwStorPortProhibitedDDIs|