IDiskQuotaControl::FindUserName

[This is preliminary documentation and subject to change.]

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

HRESULT FindUserName(
  LPCWSTR pszDomain, 
  LPCWSTR pszName, 
  PDISKQUOTA_USER *ppUser
);
 

Parameters

pszDomain
Pointer to the user's domain name string.
pszName
Pointer to the user's account name string.
ppUser
Pointer to receive the IDiskQuotaUser interface pointer to the quota user object.
fNameResolution
Indicates how the user account information is to be obtained. The volume's quota information identifies users by security identifier (SID). The user account information (such as domain name, account name, and full name) must be obtained from the network domain controller, or the local computer if it is not on a network. This parameter can be one of the following values.
Value Meaning
DISKQUOTA_USERNAME_RESOLVE_NONE Do not resolve user account information.
DISKQUOTA_USERNAME_RESOLVE_SYNC Resolve user account information synchronously. FindUserName returns when the information has been resolved. If the information exists in the disk quota SID cache, it is returned immediately. Otherwise, the method must locate the information. This can take several seconds.
DISKQUOTA_USERNAME_RESOLVE_ASYNC Resolve user account information asynchronously. FindUserName returns immediately. The caller must implement the IDiskQuotaEvents interface to receive notification when the information is available. If the information was cached during a previous request, notification occurs as soon as the object is serviced. Otherwise, the method obtains the information from the network domain controller, then notifies IDiskQuotaEvents.

Return Values

This method returns one of the following values.

Value Meaning
S_OK Success.
DQC_E_FILE_NOT_FOUND The specified user account cannot be located.
E_POINTER Either the pUserSid or ppUser parameter is NULL.
E_OUTOFMEMORY Insufficient memory.
DQC_E_INVALID_SID The SID for the user is invalid.
DQC_E_ACCESS_DENIED The caller has insufficient access rights.
DQC_E_NO_SID_MAPPING There is no mapping available for the SID.

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.

QuickInfo

  Windows NT: Requires version 5.0 or later.
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in dskquota.h.

See Also

File Systems Overview, File System Interfaces, IDiskQuotaControl