📄 dskquota.h
字号:
// Returns:
//
// NOERROR - Success.
// E_POINTER - pUser arg is NULL.
// E_OUTOFMEMORY - Insufficient memory.
// E_UNEXPECTED - Unexpected exception occured.
//
//
// IDiskQuotaUserBatch::Remove ------------------------------------------------
//
// Removes an IDiskQuotaUser pointer from the batch list.
//
// Arguments:
//
// pUser - Address of quota user object's IDiskQuotaUser interface.
//
// Returns:
//
// NOERROR - Success.
// S_FALSE - Quota user object not found in batch.
// E_POINTER - pUser arg is NULL.
// E_UNEXPECTED - An unexpected exception occured.
//
//
// IDiskQuotaUserBatch::RemoveAll ---------------------------------------------
//
// Removes all IDiskQuotaUser pointers from the batch list.
//
// Arguments: None.
//
// Returns:
//
// NOERROR - Success.
// E_UNEXPECTED - An unexpected exception occured.
//
//
// IDiskQuotaUserBatch::FlushToDisk -------------------------------------------
//
// Writes user object changes to disk in a single call to NTFS.
//
// Note that there are limitations as to how much information can be
// written to disk in a single call to the file system. The flush
// operation may require multiple calls to NTFS. Nonetheless, it will
// be much more efficient than a single call for each user object.
//
// Arguments: None.
//
// Returns:
//
// NOERROR - Success.
// E_FAIL - Error writing quota information.
// E_OUTOFMEMORY - Insufficient memory.
// E_UNEXPECTED - An unexpected exception occured.
// DQC_E_ACCESS_DENIED - No WRITE access to quota information.
//
///////////////////////////////////////////////////////////////////////////////
#undef INTERFACE
#define INTERFACE IDiskQuotaUserBatch
DECLARE_INTERFACE_(IDiskQuotaUserBatch, IUnknown)
{
STDMETHOD(Add)(THIS_
PDISKQUOTA_USER pUser) PURE;
STDMETHOD(Remove)(THIS_
PDISKQUOTA_USER pUser) PURE;
STDMETHOD(RemoveAll)(THIS) PURE;
STDMETHOD(FlushToDisk)(THIS) PURE;
};
typedef IDiskQuotaUserBatch DISKQUOTA_USER_BATCH, *PDISKQUOTA_USER_BATCH;
///////////////////////////////////////////////////////////////////////////////
// IDiskQuotaControl interface
//
// This interface is the principle point of control for the disk quota control
// library. A client instantiates this interface through CoCreateInstance
// using the the class ID CLSID_DiskQuotaControl. The resulting quota control
// object provides a layer of abstraction around the disk quota facilities of
// a single NTFS volume. Through the IDiskQuotaControl interface, the client
// may query and set volume-specific quota attributes as well as enumerate
// all quota user entries on the volume.
//
// The DiskQuotaControl object also implements IConnectionPointContainer
// to service the IDiskQuotaEvents connection point interface.
//
//
// IDiskQuotaControl::Initialize ----------------------------------------------
//
// Initializes a new QuotaControl object by opening the NTFS volume
// with the requested access rights. The return value indicates
// if the volume does not support NTFS disk quotas or if the caller
// does not have sufficient access rights.
//
// >>>>>> NOTE <<<<<<<
//
// Accessing quota information on remote volumes is not
// supported for NT5 Beta 1. Remote volume support will be
// added after Beta 1.
//
// Arguments:
//
// pszPath - Name of NTFS path to open.
// To obtain WRITE access, this string must be
// "\\.\X" where 'X' is the drive letter for the
// volume. If only READ access is desired, the
// path may be simply "X:\"
//
// bReadWrite - TRUE = Open for read/write.
// FALSE = Open for read only
//
// Returns:
//
// NOERROR - Success.
// E_FAIL - Error getting volume information.
// DQC_E_INITIALIZED - Controller object already initialized.
// DQC_E_ACCESS_DENIED - Caller has insufficient access rights.
// DQC_E_INVALID_NAME - Invalid path string at pszPath.
// DQC_E_FILE_NOT_FOUND - Specified path doesn't exist.
// DQC_E_PATH_NOT_FOUND - Specified path doesn't exist.
// DQC_E_BAD_PATHNAME - Specified path name is invalid.
// DQC_E_NO_QUOTAS_FS - File system isn't NTFS.
// DQC_E_NO_QUOTAS_FSVER - File system isn't NTFS v5.0 or greater.
//
//
// IDiskQuotaControl::SetQuotaState -------------------------------------------
//
// Sets the state of the quota system. Note that not all state attributes
// can be modified. The enable/disable and track/enforce attributes can
// be modified.
//
// Arguments:
//
// dwState - DWORD containing the state to be applied to the volume.
// Use the following macros to set the proper bits in the dwState
// argument:
//
// Enable? Track? Enforce?
// --------- ------- --------
// DISKQUOTA_SET_DISABLED - No No No
// DISKQUOTA_SET_TRACKED - Yes Yes No
// DISKQUOTA_SET_ENFORCED - Yes Yes Yes
//
// Returns:
//
// NOERROR - Success.
// E_INVALIDARG - dwState value is incorrect.
// DQC_E_ACCESS_DENIED - No WRITE access to quota information.
// E_FAIL - Failed writing quota information.
//
//
// IDiskQuotaControl::GetQuotaState -------------------------------------------
//
// Retrieves a set of flags describing the state of the quota system.
//
// Arguments:
//
// pdwState - Address of DWORD to receive the state flags. The flag
// bits are defined as follows:
//
// DISKQUOTA_STATE_DISABLED - Quotas are not enabled on the volume.
//
// DISKQUOTA_STATE_TRACK - Quotas are enabled but the limit value
// is not being enforced. Users may exceed their quota limit.
//
// DISKQUOTA_STATE_ENFORCE - Quotas are enabled and the limit
// value is enforced. Users cannot exceed their quota limit.
//
// DISKQUOTA_FILESTATE_INCOMPLETE - The volume's quota information
// is out of date. Quotas are probably disabled.
//
// DISKQUOTA_FILESTATE_REBUILDING - The volume is rebuilding it's
// quota information.
//
// Returns:
//
// NOERROR - Success.
// E_POINTER - pdwState argument is NULL.
// DQC_E_ACCESS_DENIED - No READ access to quota information.
// E_FAIL - Error reading quota information.
//
//
// IDiskQuotaControl::SetQuotaLogFlags ----------------------------------------
//
// Controls the logging of user-related quota events on the volume.
// Logging consists of an entry in the volume server system's event log.
//
// Arguments:
//
// dwFlags - DWORD containing the flags to be applied to the volume.
// Use the following macros to set the proper bits in the dwFlags
// argument:
//
// DISKQUOTA_SET_LOG_USER_THRESHOLD - Turn on/off logging of
// user quota threshold violations. If set, an event log
// entry will be created when the user exceeds their assigned
// quota warning threshold.
//
// DISKQUOTA_SET_LOG_USER_LIMIT - Turn on/off logging of user
// quota limit violations. If set, an event log entry will
// be created when the user exceeds their assigned quota
// limit.
//
// Returns:
//
// NOERROR - Success.
// DQC_E_ACCESS_DENIED - No WRITE access to quota information.
// E_FAIL - Failed writing quota information.
//
//
// IDiskQuotaControl::GetQuotaLogFlags ----------------------------------------
//
// Retrieves the flags that control the logging of user-related quota
// events on the volume. Logging consists of an entry in the volume
// server's event log.
//
// Arguments:
//
// pdwFlags - Address of DWORD variable to receive the volume's
// quota logging flags. Use the following macros to
// interrogate the contents of the flag value:
//
// DISKQUOTA_IS_LOGGED_USER_THRESHOLD
// DISKQUOTA_IS_LOGGED_USER_LIMIT
//
// Returns:
//
// NOERROR - Success.
// E_POINTER - pdwFlags argument is NULL.
// DQC_E_ACCESS_DENIED - No READ access to quota information.
// E_FAIL - Failed reading volume quota information.
//
//
// IDiskQuotaControl::SetDefaultQuotaLimit ------------------------------------
//
// Modifies the default quota limit applied automatically to new users
// of the volume.
//
// Arguments:
//
// llLimit - Default quota limit value.
//
// Returns:
//
// NOERROR - Success.
// DQC_E_ACCESS_DENIED - No WRITE access to quota information.
// E_FAIL - Failed writing quota information.
//
//
// IDiskQuotaControl::GetDefaultQuotaLimit ------------------------------------
//
// Retrieves the default quota limit applied automatically to new users
// of the volume.
//
// Arguments:
//
// pllLimit - Address of LONGLONG variable to receive the limit value.
//
// Returns:
//
// NOERROR - Success.
// E_POINTER - pllLimit argument is NULL.
// DQC_E_ACCESS_DENIED - No READ access to quota information.
// E_FAIL - Failed reading quota information.
//
//
// IDiskQuotaControl::GetDefaultQuotaLimitText --------------------------------
//
// Retrieves the volume's default quota "limit" expressed as a text
// string (i.e. "10.5 MB"). If the volume'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.
// E_FAIL - Failed reading quota information.
//
//
// IDiskQuotaControl::SetDefaultQuotaThreshold --------------------------------
//
// Modifies the default quota warning threshold applied automatically to
// new users of the volume.
//
// Arguments:
//
// llThreshold - Default quota threshold value.
//
// Returns:
//
// NOERROR - Success.
// DQC_E_ACCESS_DENIED - No WRITE access to quota information.
// E_FAIL - Failed writing quota information.
//
//
// IDiskQuotaControl::GetDefaultQuotaThreshold --------------------------------
//
// Retrieves the default quota warning threshold applied automatically to
// new users of the volume.
//
// Arguments:
//
// pllThreshold - Address of LONGLONG variable to receive the
// warning threshold value.
//
// Returns:
//
// NOERROR - Success.
// E_POINTER - pllThreshold argument is NULL.
// DQC_E_ACCESS_DENIED - No READ access to quota information.
// E_FAIL - Failed reading quota information.
//
//
// IDiskQuotaControl::GetDefaultQuotaThresholdText ----------------------------
//
// Retrieves the volume's default quota "threshold" expressed as a text
// string (i.e. "10.5 MB"). If the volume's threshold 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.
// E_FAIL - Failed reading quota information.
//
//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -