Platform SDK: Files and I/O

IDiskQuotaControl::FindUserName

Locates a specific entry in the volume quota information. The user's account logon name is used as the search key.

HRESULT FindUserName(
  LPCWSTR pszLogonName, 
  PDISKQUOTA_USER *ppUser
);

Parameters

pszLogonName
Pointer to the user's account logon name.
ppUser
Pointer to receive the IDiskQuotaUser interface pointer to the quota user object.

Return Values

This method returns a file system error or one of the following values.

Value Meaning
NOERROR Success.
ERROR_ACCESS_DENIED The caller has insufficient access rights.
ERROR_INVALID_SID The SID for the user is invalid.
ERROR_NONE_MAPPED There is no mapping available for the SID.
ERROR_NOT_READY The DiskQuotaControl object is not initialized.
E_INVALIDARG The pUserSid or ppUser parameter is NULL.
E_OUTOFMEMORY Insufficient memory.
E_FAIL An unexpected file system error occurred.
E_UNEXPECTED An unexpected exception occurred.

Remarks

This method will return a user object even if there is no quota record for the user in the quota file. This is consistent with the idea of automatic user addition and default quota settings. If there is currently no quota entry for the requested user, and the user would be added to the quota file if he were to request disk space, the returned user object will have warning threshold and hard quota limits equal to the volume default settings.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Unsupported.
  Header: Declared in Dskquota.h.

See Also

File Systems Overview, File System Interfaces, IDiskQuotaControl