以下是 IDiskQuotaUser 接口的定义:
DECLARE_INTERFACE_(IDiskQuotaUser, IUnknown) {
STDMETHOD(GetID)(DWORD *pdwID) = 0;
STDMETHOD(GetSID)(PSID *ppSID) = 0;
STDMETHOD(GetPath)(LPWSTR pszPath) = 0;
STDMETHOD(GetUserType)(DWORD *pdwUserType) = 0;
STDMETHOD(GetQuotaThreshold)(DWORD dwQuotaType, LONGLONG *pllThreshold) = 0;
STDMETHOD(SetQuotaThreshold)(DWORD dwQuotaType, LONGLONG llThreshold) = 0;
STDMETHOD(GetQuotaThresholdEx)(DWORD dwQuotaType, LONGLONG *pllThreshold) = 0;
STDMETHOD(SetQuotaThresholdEx)(DWORD dwQuotaType, LONGLONG llThreshold) = 0;
STDMETHOD(GetQuotaLimit)(DWORD dwQuotaType, LONGLONG *pllLimit) = 0;
STDMETHOD(SetQuotaLimit)(DWORD dwQuotaType, LONGLONG llLimit) = 0;
STDMETHOD(GetQuotaLimitEx)(DWORD dwQuotaType, LONGLONG *pllLimit) = 0;
STDMETHOD(SetQuotaLimitEx)(DWORD dwQuotaType, LONGLONG llLimit) = 0;
STDMETHOD(GetQuotaUsed)(DWORD dwQuotaType, LONGLONG *pllUsed) = 0;
STDMETHOD(GetQuotaUsedEx)(DWORD dwQuotaType, LONGLONG *pllUsed) = 0;
STDMETHOD(GetQuotaProperties)(DWORD dwQuotaType, DWORD *pdwQuotaFlags) = 0;
STDMETHOD(GetQuotaFlags)(DWORD dwQuotaType, DWORD *pdwFlags) = 0;
STDMETHOD(SetQuotaFlags)(DWORD dwQuotaType, DWORD dwFlags) = 0;
STDMETHOD(Initialize)(DWORD dwQuotaVersion, __RPC__in_opt LPVOID pvReserved) = 0;
};
该接口包含了一系列用于管理特定用户的磁盘配额信息的方法,包括获取用户的唯一标识符、获取用户的安全标识符、获取用户的路径、获取用户类型、获取和设置配额阈值、限制、使用量等信息。
在使用该接口之前,通常需要通过调用 CoCreateInstance 或其他相应的函数来获取 IDiskQuotaUser 接口的实例。
请注意,这是 COM 接口,因此需要使用 COM 的初始化和清理函数。在使用完接口后,需要调用 Release 方法释放资源。
转载请注明出处:http://www.pingtaimeng.com/article/detail/27328/Win32 API/Dskquota.h/IDiskQuotaUser