IoCheckQuotaBufferValidity function

The IoCheckQuotaBufferValidity routine checks whether the specified quota buffer is valid.

Syntax

NTSTATUS IoCheckQuotaBufferValidity(
  _In_  PFILE_QUOTA_INFORMATION QuotaBuffer,
  _In_  ULONG                   QuotaLength,
  _Out_ PULONG                  ErrorOffset
);

Parameters

QuotaBuffer

Pointer to the buffer containing the quota entries to be checked.

QuotaLength

Length, in bytes, of QuotaBuffer.

ErrorOffset

A variable to receive the offset of the offending entry in the quota buffer if an error is found. This variable is only valid if an error occurs.

Return Value

IoCheckQuotaBufferValidity returns STATUS_SUCCESS if the quota buffer is valid. Otherwise, it returns STATUS_DATATYPE_MISALIGNMENT if the quota buffer is not ULONG-aligned. For all other errors, including misalignment of entries in the buffer, IoCheckQuotaBufferValidity returns STATUS_QUOTA_LIST_INCONSISTENT.

Remarks

IoCheckQuotaBufferValidity checks each FILE_QUOTA_INFORMATION entry in the specified quota buffer to ensure that the following conditions are met:

  • The entire entry must fall within the buffer.

  • The value of Sid must be a security identifier (SID).

  • The value of SidLength must match the length in bytes of the value of Sid.

  • For all entries except the last, the value of NextEntryOffset must be greater than zero and must fall on a ULONG boundary.

In addition, IoCheckQuotaBufferValidity checks the quota buffer to ensure that the following conditions are met:

  • The buffer must be ULONG-aligned.

  • The length passed in QuotaLength matches the actual length of the buffer.

  • The actual buffer length is nonnegative.

To be valid, the quota buffer must meet all of these conditions.

Requirements

   
Windows version This routine is available on Microsoft Windows 2000 and later. This routine is available on Microsoft Windows 2000 and later.
Target Platform Universal
Header ntifs.h (include Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL "< DISPATCH_LEVEL"

See Also

IRP_MJ_QUERY_QUOTA

IRP_MJ_SET_QUOTA

FILE_QUOTA_INFORMATION

Send comments about this topic to Microsoft