📄 dskquota.h
字号:
PDISKQUOTA_USER_BATCH *ppBatch) PURE;
STDMETHOD(InvalidateSidNameCache)(THIS) PURE;
STDMETHOD(GiveUserNameResolutionPriority)(THIS_
PDISKQUOTA_USER pUser) PURE;
STDMETHOD(ShutdownNameResolution)(THIS_
VOID) PURE;
};
typedef IDiskQuotaControl DISKQUOTA_CONTROL, *PDISKQUOTA_CONTROL;
///////////////////////////////////////////////////////////////////////////////
// IDiskQuotaEvents interface
//
// A client must implement this interface as an OLE event sink in order to
// receive quota-related event notifications such as asynchronous account
// name resolution.
//
// IDiskQuotaEvents::OnUserNameChanged ----------------------------------------
//
// Notifies client's connection sink whenever a user's SID has been
// asynchronously resolved so that the user's domain, account and full
// name strings are available in the quota user object.
//
// Arguments:
//
// pUser - Address of IDiskQuotaUser interface for quota user object.
// It is not necessary to call Release() on this pointer.
// The DiskQuotaControl object controls the lifetime of the
// user object.
//
// Returns: Return value is ignored.
//
///////////////////////////////////////////////////////////////////////////////
#undef INTERFACE
#define INTERFACE IDiskQuotaEvents
DECLARE_INTERFACE_(IDiskQuotaEvents, IUnknown)
{
STDMETHOD(OnUserNameChanged)(THIS_
PDISKQUOTA_USER pUser) PURE;
};
typedef IDiskQuotaEvents DISKQUOTA_EVENTS, *PDISKQUOTA_EVENTS;
///////////////////////////////////////////////////////////////////////////////
// DiskQuotaEventSink
//
// Declaration for a class that implements IDiskQuotaEvents. A client may
// implement this class as it is declared or create their own class. The only
// requirement is that it implement IDiskQuotaEvents as an OLE connection
// point. See the SDK documentation for details on OLE connection points and
// OLE connection point containers.
//
///////////////////////////////////////////////////////////////////////////////
class DiskQuotaEventSink : public IDiskQuotaEvents
{
private:
LONG m_cRef; // Interface reference count.
public:
DWORD m_dwCookie; // Connection point cookie.
DiskQuotaEventSink(VOID);
~DiskQuotaEventSink(VOID);
//
// IUnknown methods.
//
STDMETHODIMP QueryInterface(REFIID, LPVOID *);
STDMETHODIMP_(ULONG) AddRef(VOID);
STDMETHODIMP_(ULONG) Release(VOID);
//
// IDiskQuotaEvents
//
STDMETHODIMP OnUserNameChanged(PDISKQUOTA_USER pUser);
};
///////////////////////////////////////////////////////////////////////////////
// Error codes specific to the public disk quota interfaces.
// "DQC" = Disk Quota Control
///////////////////////////////////////////////////////////////////////////////
//
// Security ID for user is invalid.
//
#define DQC_E_INVALID_SID MAKE_HRESULT(SEVERITY_ERROR, \
FACILITY_ITF, \
ERROR_INVALID_SID)
//
// Insufficient memory to complete operation.
//
#define DQC_E_INSUFFICIENT_BUFFER MAKE_HRESULT(SEVERITY_ERROR, \
FACILITY_ITF, \
ERROR_INSUFFICIENT_BUFFER)
//
// An operation/capability is not supported.
//
#define DQC_E_NOT_SUPPORTED MAKE_HRESULT(SEVERITY_ERROR, \
FACILITY_ITF, \
ERROR_NOT_SUPPORTED)
//
// No access to perform the requested operation.
//
#define DQC_E_ACCESS_DENIED MAKE_HRESULT(SEVERITY_ERROR, \
FACILITY_ITF, \
ERROR_ACCESS_DENIED)
//
// Requested file or object not found.
//
#define DQC_E_FILE_NOT_FOUND MAKE_HRESULT(SEVERITY_ERROR, \
FACILITY_ITF, \
ERROR_FILE_NOT_FOUND)
//
// Requested file path not found.
//
#define DQC_E_PATH_NOT_FOUND MAKE_HRESULT(SEVERITY_ERROR, \
FACILITY_ITF, \
ERROR_PATH_NOT_FOUND)
//
// Requested file path is invalid.
//
#define DQC_E_INVALID_NAME MAKE_HRESULT(SEVERITY_ERROR, \
FACILITY_ITF, \
ERROR_INVALID_NAME)
//
// Requested file path is invalid.
//
#define DQC_E_BAD_PATHNAME MAKE_HRESULT(SEVERITY_ERROR, \
FACILITY_ITF, \
ERROR_BAD_PATHNAME)
//
// Failed to obtain exclusive lock on a shared resource.
//
#define DQC_E_LOCK_FAILED MAKE_HRESULT(SEVERITY_ERROR, \
FACILITY_ITF, \
ERROR_LOCK_FAILED)
//
// No mapping available for security ID to user name.
//
#define DQC_E_NO_SID_MAPPING MAKE_HRESULT(SEVERITY_ERROR, \
FACILITY_ITF, \
ERROR_NONE_MAPPED)
//
// No more items in enumeration.
//
#define DQC_S_NO_MORE_ITEMS MAKE_HRESULT(SEVERITY_SUCCESS, \
FACILITY_ITF, \
ERROR_NO_MORE_ITEMS)
//
// User owns files on volume.
//
#define DQC_E_USER_HAS_FILES MAKE_HRESULT(SEVERITY_ERROR, \
FACILITY_ITF, \
0x8002)
//
// File system doesn't support quotas.
// Currently, must be NTFS.
//
#define DQC_E_NO_QUOTAS_FS MAKE_HRESULT(SEVERITY_ERROR, \
FACILITY_ITF, \
0x8003)
//
// File system version doesn't support quotas.
// Currently, must be NTFS 5.0 or greater.
//
#define DQC_E_NO_QUOTAS_FSVER MAKE_HRESULT(SEVERITY_ERROR, \
FACILITY_ITF, \
0x8004)
//
// Object has already been initialized.
// Multiple initialization is not allowed.
//
#define DQC_E_INITIALIZED MAKE_HRESULT(SEVERITY_ERROR, \
FACILITY_ITF, \
0x8005)
//
// Object has not been initialized.
// Initialization must be completed before operation can be performed.
//
#define DQC_E_NOT_INITIALIZED MAKE_HRESULT(SEVERITY_ERROR, \
FACILITY_ITF, \
0x8006)
//
// Specified user is unknown.
//
#define DQC_E_USER_UNKNOWN MAKE_HRESULT(SEVERITY_ERROR, \
FACILITY_ITF, \
0x8007)
//=============================================================================
//=============================================================================
// ActiveX Control Description
//=============================================================================
//=============================================================================
//
// DSKQUOTA.DLL also provides an ActiveX control that performs much of the
// functionality found in the vtable interfaces IDiskQuotaControl,
// IDiskQuotaUser and IDiskQuotaEvents.
//
// The following section describes the properties and methods for each
// OLE automation interface supported.
//
// ActiveX object ProgID = "Microsoft.DiskQuota.1"
// ActiveX object CLSID = {7988B571-EC89-11cf-9C00-00AA00A14F56}
// Type library CLSID = {7988B57C-EC89-11cf-9C00-00AA00A14F56}
//
// The object supports 3 automation-compatible interfaces:
//
// IID_DIDiskQuotaControl [default]
// IID_DIDiskQuotaUser
// IID_DIDiskQuotaControlEvents [default, source]
//
//
// ----------------------------------------------------------------------------
// IID_DIDiskQuotaControl - Disk Quota Controller
//
// This interface is the default controlling interface for the DiskQuota
// ActiveX component. It implements much the same functionality as
// the vtable interface IDiskQuotaControl.
//
// Properties:
//
// QuotaState
//
// Desc: The "state" of NTFS disk quotas on the volume.
// The state can be either "disabled", "tracking quota usage"
// or "enforcing quota limits". Enforcement implies
// tracking.
//
// Type: QuotaStateConstants (enumeration)
//
// Domain: dqStateDisable (0)
// qsStateTrack (1)
// qsStateEnforce (2)
//
// QuotaFileIncomplete (read only)
//
// Desc: Determines if the quota file on the volume is marked
// as "incomplete". An incomplete volume is usually the
// result of a disabled quota system.
//
// Type: VARIANT_BOOL
//
// Domain: True/False
//
// QuotaFileRebuilding (read only)
//
// Desc: Determines if the quota file on the volume is being
// rebuilt. Rebuilding automatically occurs whenever
// quotas are enabled on the system or when one or more
// user entries are marked for deletion.
//
// Type: VARIANT_BOOL
//
// Domain: True/False
//
// LogQuotaThreshold
//
// Desc: Indicates if a system event log entry should be created
// whenever a user exceeds their assigned quota warning
// threshold.
//
// Type: VARIANT_BOOL
//
// Domain: True/False
//
// LogQuotaLimit
//
// Desc: Indicates if a system event log entry should be created
// whenever a user exceeds their assigned quota limit.
//
// Type: VARIANT_BOOL
//
// Domain: True/False
//
// DefaultQuotaThreshold
//
// Desc: The default warning threshold value assigned to new users
// of the volume.
//
// Type: double
//
// Domain: Value is expressed in bytes.
//
// DefaultQuotaThresholdText (read only)
//
// Desc: The default threshold value expressed as a text
// string suitable for display. The recipient of
// the string is responsible for deleting the string
// using SysFreeString().
//
// Type: BSTR
//
// Domain: Threshold value formatted as a decimal number
// and appended with a units suffix.
//
// i.e.: "10.5 MB"
// "No Limit" if unlimited.
//
// DefaultQuotaLimit
//
// Desc: The default quota limit value assigned to new users
// of the volume.
//
// Type: double
//
// Domain: Value is expressed in bytes.
// -1 is special case meaning "no limit".
//
// DefaultQuotaLimitText (read only)
//
// Desc: The default quota limit value expressed as a text
// string suitable for display. The recipient of
// the string is responsible for deleting the string
// using SysFreeString().
//
// Type: BSTR
//
// Domain: Limit value formatted as a decimal number
// and appended with a units suffix.
//
// i.e.: "10.5 MB"
// "No Limit" if unlimited.
//
// UserNameResolution
//
// Desc: Controls the behavior of the security ID-to-Name
// resolution processing. The process may be bypassed,
// performed synchronously or performed asynchronously.
// If Asynchronous name resolution is chosen, the caller
//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -