📄 dskquota.h
字号:
// NOERROR - Success.
// DQC_E_ACCESS_DENIED - No READ access to quota information.
// DQC_E_LOCK_FAILED - Couldn't lock user object.
// E_OUTOFMEMORY - Insufficient memory.
// E_FAIL - Failed reading quota information.
//
//
// IDiskQuotaUser::GetQuotaLimit ----------------------------------------------
//
// Retrieves the user's quota "limit" value on the volume. The
// limit is set as the maximum amount of disk space available to the
// volume user. There are two special-case values associated with the
// quota limit.
//
// -1 = User has unlimited quota on the volume.
// -2 = User's quota entry is marked for deletion. If the entry's
// value for quota "used" is 0, the record will be deleted by
// NTFS at some future time.
//
// Arguments:
//
// pllLimit - Address of LONGLONG variable to receive the limit value.
//
// Returns:
//
// NOERROR - Success.
// DQC_E_ACCESS_DENIED - No READ access to quota information.
// DQC_E_LOCK_FAILED - Couldn't lock user object.
// E_POINTER - pllLimit is NULL.
// E_OUTOFMEMORY - Insufficient memory.
// E_FAIL - Failed reading quota information.
//
//
// IDiskQuotaUser::GetQuotaLimitText ------------------------------------------
//
// Retrieves the user's quota "limit" value expressed as a text
// string (i.e. "10.5 MB"). If the user's limit is unlimited,
// the string "No Limit" is returned (localized).
//
// Arguments:
//
// pszText - Address of character buffer to receive text.
//
// cchText - Size of destination buffer in bytes.
//
// Returns:
//
// NOERROR - Success.
// DQC_E_ACCESS_DENIED - No READ access to quota information.
// DQC_E_LOCK_FAILED - Couldn't lock user object.
// E_OUTOFMEMORY - Insufficient memory.
// E_FAIL - Failed reading quota information.
//
//
// IDiskQuotaUser::GetQuotaUsed -----------------------------------------------
//
// Retrieves the user's quota "used" value on the volume. This is the
// amount of information stored on the volume by the user. Note that
// this is the amount of uncompressed information. Therefore, the
// use of NTFS compression does not affect this value.
//
// Arguments:
//
// pllUsed - Address of LONGLONG variable to receive the
// quota used value.
//
// Returns:
//
// NOERROR - Success.
// DQC_E_ACCESS_DENIED - No READ access to quota information.
// DQC_E_LOCK_FAILED - Couldn't lock user object.
// E_POINTER - pllUsed is NULL.
// E_OUTOFMEMORY - Insufficient memory.
// E_FAIL - Failed reading quota information.
//
//
// IDiskQuotaUser::GetQuotaUsedText -------------------------------------------
//
// Retrieves the user's quota "used" value expressed as a text
// string (i.e. "10.5 MB").
//
// Arguments:
//
// pszText - Address of character buffer to receive text.
//
// cchText - Size of destination buffer in bytes.
//
// Returns:
//
// NOERROR - Success.
// DQC_E_ACCESS_DENIED - No READ access to quota information.
// DQC_E_LOCK_FAILED - Couldn't lock user object.
// E_OUTOFMEMORY - Insufficient memory.
// E_FAIL - Failed reading quota information.
//
//
// IDiskQuotaUser::GetQuotaInformation ----------------------------------------
//
// Retrieves the user's quota "threshold", "used" and "limit" values in
// a single function call.
//
// Arguments:
//
// pQuotaInfo - Address of DISKQUOTA_USER_INFORMATION structure to
// receive the quota information.
//
// cbQuotaInfo - Size of the desination buffer in bytes.
//
// Returns:
//
// NOERROR - Success.
// DQC_E_ACCESS_DENIED - No READ access to quota information.
// DQC_E_LOCK_FAILED - Couldn't lock user object.
// E_POINTER - pQuotaInfo is NULL.
// E_OUTOFMEMORY - Insufficient memory.
// E_FAIL - Failed reading quota information.
//
//
// IDiskQuotaUser::SetQuotaThreshold ------------------------------------------
//
// Sets the user's quota "threshold" value on the volume. The
// threshold is an arbitrary value set by the volume's quota
// administrator. It may be used to identify users who are approaching
// their quota limit.
//
// Arguments:
//
// llThreshold - Threshold value.
//
// fWriteThrough - Set this to TRUE if you want to immediately write
// the value to the volume's quota file. Otherwise, the value
// is only written to the quota user object's local memory.
// This value should normally be set to TRUE. Set it to FALSE
// when using the IDiskQuotaUserBatch interface to modify
// multiple user quota entries at once.
//
// Returns:
//
// NOERROR - Success.
// DQC_E_ACCESS_DENIED - No WRITE access to quota information.
// DQC_E_LOCK_FAILED - Couldn't lock user object.
// E_FAIL - Failed writing quota information.
//
//
// IDiskQuotaUser::SetQuotaLimit ----------------------------------------------
//
// Sets the user's quota "limit" value on the volume. The
// limit is set as the maximum amount of disk space available to the
// volume user.
//
// Arguments:
//
// llLimit - Limit value (bytes). -1 = Unlimitd quota.
//
// fWriteThrough - Set this to TRUE if you want to immediately write
// the value to the volume's quota file. Otherwise, the value
// is only written to the quota user object's local memory.
// This value should normally be set to TRUE. Set it to FALSE
// when using the IDiskQuotaUserBatch interface to modify
// multiple user quota entries at once.
//
// Returns:
//
// NOERROR - Success.
// DQC_E_ACCESS_DENIED - No WRITE access to quota information.
// DQC_E_LOCK_FAILED - Couldn't lock user object.
// E_FAIL - Failed writing quota information.
//
//
// IDiskQuotaUser::Invalidate -------------------------------------------------
//
// Invalidates the quota information stored in the quota user object.
// The next time information is requested, it is refreshed from disk.
//
// Arguments: None.
//
// Returns: NOERROR.
//
//
// IDiskQuotaUser::GetAccountStatus -------------------------------------------
//
// Retrieves the status of the user object's account. User information
// is identified in the quota system by user security ID (SID). This
// SID must be resolved to a user account for the user's domain,
// account name or full name to be retrieved. This status information
// may be used to determine why a user's name string(s) are not available.
//
// Arguments:
//
// pdwStatus - Address of DWORD variable to receive user's account
// status. The status value may be one of the following:
//
// DISKQUOTA_USER_ACCOUNT_RESOLVED - SID has been resolved to
// a user account. Names are available through GetName().
//
// DISKQUOTA_USER_ACCOUNT_UNAVAILABLE - User's account is
// unavailable at this time. Network domain controller
// may not be available. Name information will not be
// available.
//
// DISKQUOTA_USER_ACCOUNT_DELETED - User's account has been
// deleted from the domain. Name information will not be
// available.
//
// DISKQUOTA_USER_ACCOUNT_INVALID - User's account is invalid.
// Name information will not be available.
//
// DISKQUOTA_USER_ACCOUNT_UNKNOWN - User's account is unknown.
// Name information will not be available.
//
// DISKQUOTA_USER_ACCOUNT_UNRESOLVED - SID has yet to be resolved
// to a user account.
//
//
// Returns: NOERROR - Success.
// E_POINTER - pdwStatus argument is NULL.
//
///////////////////////////////////////////////////////////////////////////////
#undef INTERFACE
#define INTERFACE IDiskQuotaUser
DECLARE_INTERFACE_(IDiskQuotaUser, IUnknown)
{
STDMETHOD(GetName)(THIS_
LPWSTR pszDomain,
DWORD cchDomain,
LPWSTR pszName,
DWORD cchName,
LPWSTR pszFullName,
DWORD cchFullName) PURE;
STDMETHOD(GetSidLength)(THIS_
LPDWORD pdwLength) PURE;
STDMETHOD(GetSid)(THIS_
LPBYTE pbSidBuffer,
DWORD cbSidBuffer) PURE;
STDMETHOD(GetQuotaThreshold)(THIS_
PLONGLONG pllThreshold) PURE;
STDMETHOD(GetQuotaThresholdText)(THIS_
LPWSTR pszText,
DWORD cchText) PURE;
STDMETHOD(GetQuotaLimit)(THIS_
PLONGLONG pllLimit) PURE;
STDMETHOD(GetQuotaLimitText)(THIS_
LPWSTR pszText,
DWORD cchText) PURE;
STDMETHOD(GetQuotaUsed)(THIS_
PLONGLONG pllUsed) PURE;
STDMETHOD(GetQuotaUsedText)(THIS_
LPWSTR pszText,
DWORD cchText) PURE;
STDMETHOD(GetQuotaInformation)(THIS_
LPVOID pbQuotaInfo,
DWORD cbQuotaInfo) PURE;
STDMETHOD(SetQuotaThreshold)(THIS_
LONGLONG llThreshold,
BOOL fWriteThrough) PURE;
STDMETHOD(SetQuotaLimit)(THIS_
LONGLONG llLimit,
BOOL fWriteThrough) PURE;
STDMETHOD(Invalidate)(THIS) PURE;
STDMETHOD(GetAccountStatus)(THIS_
LPDWORD pdwStatus) PURE;
};
typedef IDiskQuotaUser DISKQUOTA_USER, *PDISKQUOTA_USER;
///////////////////////////////////////////////////////////////////////////////
// IEnumDiskQuotaUsers interface
//
// Implementation of a standard OLE IEnumXXXX interface for enumerating
// IDiskQuotaUser objects. IEnumDiskQuotaUsers is instantiated
// with IDiskQuotaControl::CreateEnumUsers.
//
// For a description of argument and return values, see the OLE documentation
// for IEnumXXXX.
//
///////////////////////////////////////////////////////////////////////////////
#undef INTERFACE
#define INTERFACE IEnumDiskQuotaUsers
DECLARE_INTERFACE_(IEnumDiskQuotaUsers, IUnknown)
{
STDMETHOD(Next)(THIS_
DWORD cUsers,
PDISKQUOTA_USER *rgUsers,
LPDWORD pcUsersFetched) PURE;
STDMETHOD(Skip)(THIS_
DWORD cUsers) PURE;
STDMETHOD(Reset)(THIS) PURE;
STDMETHOD(Clone)(THIS_
IEnumDiskQuotaUsers **ppEnum) PURE;
};
typedef IEnumDiskQuotaUsers ENUM_DISKQUOTA_USERS, *PENUM_DISKQUOTA_USERS;
///////////////////////////////////////////////////////////////////////////////
// IDiskQuotaUserBatch interface
//
// This interface provides a mechanism for optimizing updates of quota
// information on multiple users. Through this interface, you can add quota
// user objects to a container that is then submitted for update in a single
// call. This reduces the number of calls to the underlying file system
// providing optimal performance when large numbers of user objects must
// be updated.
//
// IDiskQuotaUserBatch::Add ---------------------------------------------------
//
// Adds an IDiskQuotaUser pointer to the batch list. When setting values
// on a quota user object in preparation for batch processing, specify
// FALSE for the fWriteThrough flag in the SetQuotaLimit and
// SetQuotaThreshold functions. This will store the values in memory
// without writing through to disk. Calling FlushToDisk will write the
// changes to disk.
// This function calls AddRef() on the pUser interface pointer.
// Release() is automatically called on each contained IDiskQuotaUser
// interface pointer when the batch object is destroyed.
//
// Arguments:
//
// pUser - Address of quota user object's IDiskQuotaUser interface.
//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -