|
|
|
DIDiskQuotaControl Object |
|
PROGID |
"Microsoft.DiskQuota.1" |
|
CLSID_DIDiskQuotaControl |
{7988B571-EC89-11CF-9C00-00AA00A14F56} |
|
IID_DIDiskQuotaControl |
{7988B575-EC89-11CF-9C00-00AA00A14F56} |
|
The NTFS file system allows an administrator to manage disk usage on a shared volume by allocating a specified amount of disk space, or quota limit, to each user. The DiskQuotaControl object allows an administrator to manage a volume's disk quota properties. For instance, you can use this object to set the default quota limit that will be automatically assigned to all new users.
Remarks
|
|
Methods in VTable order |
|
|
IUnknown Methods |
Description |
|
QueryInterface |
Returns pointers to supported interfaces. |
|
AddRef |
Increments reference count. |
|
Release |
Decrements reference count. |
|
IDispatch Methods |
Description |
|
GetTypeInfoCount |
Retrieves the number of type information interfaces that an object provides (either 0 or 1). |
|
GetTypeInfo |
Gets the type information for an object. |
|
GetIDsOfNames |
Maps a single member and an optional set of argument names to a corresponding set of integer DISPIDs. |
|
Invoke |
Provides access to properties and methods exposed by an object. |
|
DIDiskQuotaControl Methods and Properties |
Description |
|
QuotaState |
Sets or retrieves the state of the volume's disk quotas. |
|
QuotaFileIncomplete |
Retrieves a Boolean value that indicates whether the quota file for the volume is complete. |
|
QuotaFileRebuilding |
Retrieves a Boolean value that indicates whether the quota file for the volume is currently being rebuilt. |
|
LogQuotaThreshold |
Sets or retrieves a Boolean value that indicates whether a system event log entry will be made when a user exceeds his or her assigned quota threshold. |
|
LogQuotaLimit |
Sets or retrieves a Boolean value that indicates whether a system event log entry will be made when a user exceeds his or her assigned quota limit. |
|
DefaultQuotaThreshold |
Sets or retrieves the default quota threshold, in bytes. |
|
DefaultQuotaThresholdText |
Retrieves the default quota threshold as a text string. |
|
DefaultQuotaLimit |
Sets or retrieves the default quota limit, in bytes. |
|
DefaultQuotaLimitText |
Retrieves the default quota limit as a text string. |
|
UserNameResolution |
Sets or retrieves a value that controls how user security identifier (SID) are resolved to user names. |
|
Initialize |
Opens a specified volume and initializes its quota control object. |
|
ShutdownNameResolution |
Shuts down the user name resolution thread. |
|
AddUser |
Assigns a nondefault disk quota to a new user. |
|
DeleteUser |
Deletes a user from the volume. |
|
FindUser |
Finds a user's entry, by name, in the volume's quota file. |
|
InvalidateSidNameCache |
Invalidates the security identifier (ID) user name cache. |
|
GiverUserNameResolutionPriority |
Places the specified user object next in line for name resolution. |
|
TranslateLogonNameToSID |
Translates a logon name to the corresponding user security ID in string format. |
|
_NewEnum |
Create a Collection object for user quota entry enumeration. |
|
DIDiskQuotaControl Event |
Description |
|
OnUserNameChanged |
Occurs when the name information for a DIDiskQuotaUser object has been resolved. |
|
AccountStatusConstants |
|
%dqAcctResolved = 0 %dqAcctUnavailable =
1
|
|
QuotaStateConstants |
|
%dqStateDisable = 0
|
|
UserNameResolutionConstants |
|
%dqResolveNone = 0
|
|
QuotaState |
|
FUNCTION
DIDiskQuotaControl_put_QuotaState ( _
FUNCTION
DIDiskQuotaControl_get_QuotaState ( _
|
|
QuotaFileIncomplete |
|
FUNCTION
DIDiskQuotaControl_get_QuotaFileIncomplete ( _
|
|
QuotaFileRebuilding |
|
FUNCTION
DIDiskQuotaControl_get_QuotaFileRebuilding ( _
|
|
LogQuotaThreshold |
|
FUNCTION
DIDiskQuotaControl_put_LogQuotaThreshold ( _
FUNCTION
DIDiskQuotaControl_get_LogQuotaThreshold ( _
|
|
LogQuotaLimit |
|
FUNCTION
DIDiskQuotaControl_put_LogQuotaLimit ( _
FUNCTION
DIDiskQuotaControl_get_LogQuotaLimit ( _
|
|
DefaultQuotaThreshold |
|
FUNCTION
DIDiskQuotaControl_put_DefaultQuotaThreshold ( _
FUNCTION
DIDiskQuotaControl_get_DefaultQuotaThreshold ( _ |
|
DefaultQuotaThresholdText |
|
FUNCTION
DIDiskQuotaControl_get_DefaultQuotaThresholdText ( _ |
|
DefaultQuotaLimit |
|
FUNCTION
DIDiskQuotaControl_put_DefaultQuotaLimit ( _
FUNCTION
DIDiskQuotaControl_get_DefaultQuotaLimit ( _ |
|
DefaultQuotaLimitText |
|
FUNCTION
DIDiskQuotaControl_get_DefaultQuotaLimitText ( _ |
|
UserNameResolution |
|
FUNCTION
DIDiskQuotaControl_put_UserNameResolution ( _
FUNCTION
DIDiskQuotaControl_get_UserNameResolution ( _ |
|
Initialize |
|
FUNCTION
DIDiskQuotaControl_Initialize ( _ |
|
ShutdownNameResolution |
|
FUNCTION
DIDiskQuotaControl_ShutdownNameResolution ( _ |
|
AddUser |
|
FUNCTION
DIDiskQuotaControl_AddUser ( _ |
|
DeleteUser |
|
FUNCTION
DIDiskQuotaControl_DeleteUser ( _ |
|
FindUser |
|
FUNCTION
DIDiskQuotaControl_FindUser ( _ |
|
InvalidateSidNameCache |
|
FUNCTION
DIDiskQuotaControl_InvalidateSidNameCache ( _ |
|
GiveUserNameResolutionPriority |
|
FUNCTION
DIDiskQuotaControl_GiveUserNameResolutionPriority ( _ |
|
TranslateLogonNameToSID |
|
FUNCTION
DIDiskQuotaControl_TranslateLogonNameToSID ( _ |
|
_NewEnum |
|
FUNCTION
DIDiskQuotaControl_NewEnum ( _ |
|
DIDiskQuotaControl Events |
' ****************************************************************************************
' DIDiskQuotaControlEvents dispatch interface
' IID = {7988B581-EC89-11CF-9C00-00AA00A14F56}
' Help string = DIDiskQuotaControlEvents Interface
' Attributes = 4224 [&H1080] [Nonextensible] [Dispatchable]
' Number of functions = 1
' ****************************************************************************************
' ****************************************************************************************
' EXCEPINFO structure
' ****************************************************************************************
TYPE DIDiskQuotaControlEvents_EXCEPINFO
wCode AS WORD ' An error code describing the error.
wReserved AS WORD ' Reserved
bstrSource AS DWORD ' Source of the exception.
bstrDescription AS DWORD ' Textual description of the error.
bstrHelpFile AS DWORD ' Help file path.
dwHelpContext AS DWORD ' Help context ID.
pvReserved AS DWORD ' Reserved.
pfnDeferredFillIn AS DWORD ' Pointer to function that fills in Help and description info.
scode AS DWORD ' An error code describing the error.
END TYPE
' ****************************************************************************************
' ****************************************************************************************
' Returns a pointer to a specified interface on an object to which a client currently holds an
' interface pointer.
' ****************************************************************************************
FUNCTION DIDiskQuotaControlEvents_IUnknown_QueryInterface (BYVAL pthis AS DWORD PTR, _
BYREF riid AS GUID, BYREF ppvObj AS DWORD) AS LONG
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[0] USING DIDiskQuotaControlEvents_IUnknown_QueryInterface(pthis, riid, ppvObj) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Decrements the reference count for the calling interface on a object. If the reference count
' on the object falls to 0, the object is freed from memory.
' ****************************************************************************************
FUNCTION DIDiskQuotaControlEvents_IUnknown_Release (BYVAL pthis AS DWORD PTR) AS DWORD
LOCAL DWRESULT AS DWORD
CALL DWORD @@pthis[2] USING DIDiskQuotaControlEvents_IUnknown_Release(pthis) TO DWRESULT
FUNCTION = DWRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IConnectionPointContainer::FindConnectionPoint
' Returns a pointer to the IConnectionPoint interface of a connection point for a specified IID,
' if that IID describes a supported outgoing interface.
' ****************************************************************************************
FUNCTION DIDiskQuotaControlEvents_IConnectionPointContainer_FindConnectionPoint ( _
BYVAL pthis AS DWORD PTR, BYREF riid AS GUID, BYREF ppCP AS DWORD) AS LONG
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[4] USING DIDiskQuotaControlEvents_IConnectionPointContainer_FindConnectionPoint(pthis, riid, ppCP) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IConnectionPoint::Advise
' Establishes a connection between the connection point object and the client's sink.
' ****************************************************************************************
FUNCTION DIDiskQuotaControlEvents_IConnectionPoint_Advise (BYVAL pthis AS DWORD PTR, _
BYVAL pUnkSink AS DWORD, BYREF pdwCookie AS DWORD) AS LONG
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[5] USING DIDiskQuotaControlEvents_IConnectionPoint_Advise(pthis, pUnkSink, pdwCookie) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IConnectionPoint::Unadvise
' Terminates an advisory connection previously established through IConnectionPoint_Advise.
' The dwCookie parameter identifies the connection to terminate.
' ****************************************************************************************
FUNCTION DIDiskQuotaControlEvents_IConnectionPoint_Unadvise (BYVAL pthis AS DWORD PTR, BYVAL dwCookie AS DWORD) AS LONG
LOCAL HRESULT AS LONG
CALL DWORD @@pthis[6] USING DIDiskQuotaControlEvents_IConnectionPoint_Unadvise(pthis, dwCookie) TO HRESULT
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IDispatch virtual table
' ****************************************************************************************
TYPE DIDiskQuotaControlEvents_IDispatchVtbl
QueryInterface AS DWORD ' Returns pointers to supported interfaces
AddRef AS DWORD ' Increments reference count
Release AS DWORD ' Decrements reference count
GetTypeInfoCount AS DWORD ' Retrieves the number of type descriptions
GetTypeInfo AS DWORD ' Retrieves a description of object's programmable interface
GetIDsOfNames AS DWORD ' Maps name of method or property to DispId
Invoke AS DWORD ' Calls one of the object's methods, or gets/sets one of its properties
pVtblAddr AS DWORD ' Address of the virtual table
cRef AS DWORD ' Reference counter
pthis AS DWORD ' IUnknown or IDispatch of the control that fires the events
END TYPE
' ****************************************************************************************
' ****************************************************************************************
' UI4 AddRef()
' Increments the reference counter.
' ****************************************************************************************
FUNCTION DIDiskQuotaControlEvents_AddRef (BYVAL pCookie AS DIDiskQuotaControlEvents_IDispatchVtbl PTR) AS DWORD
INCR @@pCookie.cRef
FUNCTION = @@pCookie.cRef
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' HRESULT QueryInterface([in] *GUID riid, [out] **VOID ppvObj)
' Returns the IUnknown of our class and increments the reference counter.
' ****************************************************************************************
FUNCTION DIDiskQuotaControlEvents_QueryInterface (BYVAL pCookie AS DIDiskQuotaControlEvents_IDispatchVtbl PTR, _
BYREF riid AS GUID, BYREF ppvObj AS DWORD) AS LONG
ppvObj = pCookie
DIDiskQuotaControlEvents_AddRef pCookie
FUNCTION = %S_OK
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' UI4 Release()
' Releases our class if there is only a reference to him and decrements the reference counter.
' ****************************************************************************************
FUNCTION DIDiskQuotaControlEvents_Release (BYVAL pCookie AS DIDiskQuotaControlEvents_IDispatchVtbl PTR) AS DWORD
LOCAL pVtblAddr AS DWORD
IF @@pCookie.cRef = 1 THEN
pVtblAddr = @@pCookie.pVtblAddr
IF ISTRUE HeapFree(GetProcessHeap(), 0, BYVAL pVtblAddr) THEN
FUNCTION = 0
EXIT FUNCTION
ELSE
FUNCTION = @@pCookie.cRef
EXIT FUNCTION
END IF
END IF
DECR @@pCookie.cRef
FUNCTION = @@pCookie.cRef
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' HRESULT GetTypeInfoCount([out] *UINT pctinfo)
' ****************************************************************************************
FUNCTION DIDiskQuotaControlEvents_GetTypeInfoCount (BYVAL pCookie AS DIDiskQuotaControlEvents_IDispatchVtbl PTR, BYREF pctInfo AS DWORD) AS LONG
FUNCTION = %E_NOTIMPL
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' HRESULT GetTypeInfo([in] UINT itinfo, [in] UI4 lcid, [out] **VOID pptinfo)
' ****************************************************************************************
FUNCTION DIDiskQuotaControlEvents_GetTypeInfo (BYVAL pCookie AS DIDiskQuotaControlEvents_IDispatchVtbl PTR, _
BYVAL itinfo AS DWORD, BYVAL lcid AS DWORD, BYREF pptinfo AS DWORD) AS LONG
FUNCTION = %E_NOTIMPL
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' HRESULT GetIDsOfNames([in] *GUID riid, [in] **I1 rgszNames, [in] UINT cNames, [in] UI4 lcid, [out] *I4 rgdispid)
' ****************************************************************************************
FUNCTION DIDiskQuotaControlEvents_GetIDsOfNames ( BYVAL pCookie AS DIDiskQuotaControlEvents_IDispatchVtbl PTR, _
BYREF riid AS GUID, BYVAL rgszNames AS DWORD, BYVAL cNames AS DWORD, BYVAL lcid AS DWORD, BYREF rgdispid AS LONG) AS LONG
FUNCTION = %E_NOTIMPL
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Builds the IDispatch Virtual Table
' ****************************************************************************************
FUNCTION DIDiskQuotaControlEvents_BuildVtbl (BYVAL pthis AS DWORD) AS DWORD
LOCAL pVtbl AS DIDiskQuotaControlEvents_IDispatchVtbl PTR
LOCAL pUnk AS DIDiskQuotaControlEvents_IDispatchVtbl PTR
pVtbl = HeapAlloc(GetProcessHeap(), %HEAP_ZERO_MEMORY, SIZEOF(@pVtbl))
IF pVtbl = 0 THEN EXIT FUNCTION
@pVtbl.QueryInterface = CODEPTR(DIDiskQuotaControlEvents_QueryInterface)
@pVtbl.AddRef = CODEPTR(DIDiskQuotaControlEvents_AddRef)
@pVtbl.Release = CODEPTR(DIDiskQuotaControlEvents_Release)
@pVtbl.GetTypeInfoCount = CODEPTR(DIDiskQuotaControlEvents_GetTypeInfoCount)
@pVtbl.GetTypeInfo = CODEPTR(DIDiskQuotaControlEvents_GetTypeInfo)
@pVtbl.GetIDsOfNames = CODEPTR(DIDiskQuotaControlEvents_GetIDsOfNames)
@pVtbl.Invoke = CODEPTR(DIDiskQuotaControlEvents_Invoke)
@pVtbl.pVtblAddr = pVtbl
@pVtbl.pthis = pthis
pUnk = VARPTR(@pVtbl.pVtblAddr)
FUNCTION = pUnk
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Establishes a connection between the connection point object and the client's sink.
' Returns a token that uniquely identifies this connection.
' ****************************************************************************************
FUNCTION DIDiskQuotaControlEvents_ConnectEvents (BYVAL pthis AS DWORD, BYREF pdwCookie AS DWORD) AS LONG
LOCAL HRESULT AS LONG ' HRESULT code
LOCAL pCPC AS DWORD ' IConnectionPointContainer
LOCAL pCP AS DWORD ' IConnectionPoint
LOCAL IID_CPC AS GUID ' IID_IConnectionPointContainer
LOCAL IID_CP AS GUID ' Events dispinterface
LOCAL dwCookie AS DWORD ' Returned token
LOCAL pUnkSink AS DWORD ' IUnknown of the class
IID_CPC = GUID$("{B196B284-BAB4-101A-B69C-00AA00341D07}")
IID_CP = GUID$("{7988B581-EC89-11CF-9C00-00AA00A14F56}")
IF pthis = 0 THEN FUNCTION = -1 : EXIT FUNCTION
HRESULT = DIDiskQuotaControlEvents_IUnknown_QueryInterface(pthis, IID_CPC, pCPC)
IF HRESULT <> %S_OK THEN FUNCTION = HRESULT : EXIT FUNCTION
HRESULT = DIDiskQuotaControlEvents_IConnectionPointContainer_FindConnectionPoint(pCPC, IID_CP, pCP)
DIDiskQuotaControlEvents_IUnknown_Release pCPC
IF HRESULT <> %S_OK THEN FUNCTION = HRESULT : EXIT FUNCTION
pUnkSink = DIDiskQuotaControlEvents_BuildVtbl(pthis)
IF ISTRUE pUnkSink THEN HRESULT = DIDiskQuotaControlEvents_IConnectionPoint_Advise(pCP, pUnkSink, dwCookie)
DIDiskQuotaControlEvents_IUnknown_Release pCP
pdwCookie = dwCookie
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Releases the events connection identified with the cookie returned by the ConnectEvents function
' ****************************************************************************************
FUNCTION DIDiskQuotaControlEvents_DisconnectEvents (BYVAL pthis AS DWORD, BYVAL dwCookie AS DWORD) AS LONG
LOCAL HRESULT AS LONG ' HRESULT code
LOCAL pCPC AS DWORD ' IConnectionPointContainer
LOCAL pCP AS DWORD ' IConnectionPoint
LOCAL IID_CPC AS GUID ' IID_IConnectionPointContainer
LOCAL IID_CP AS GUID ' ConnectionEvents dispinterface
IID_CPC = GUID$("{B196B284-BAB4-101A-B69C-00AA00341D07}")
IID_CP = GUID$("{7988B581-EC89-11CF-9C00-00AA00A14F56}")
IF pthis = 0 THEN FUNCTION = -1 : EXIT FUNCTION
HRESULT = DIDiskQuotaControlEvents_IUnknown_QueryInterface(pthis, IID_CPC, pCPC)
IF HRESULT <> %S_OK THEN FUNCTION = HRESULT : EXIT FUNCTION
HRESULT = DIDiskQuotaControlEvents_IConnectionPointContainer_FindConnectionPoint(pCPC, IID_CP, pCP)
DIDiskQuotaControlEvents_IUnknown_Release pCPC
IF HRESULT <> %S_OK THEN FUNCTION = HRESULT : EXIT FUNCTION
HRESULT = DIDiskQuotaControlEvents_IConnectionPoint_Unadvise(pCP, dwCookie)
DIDiskQuotaControlEvents_IUnknown_Release pCP
FUNCTION = HRESULT
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Function name: OnUserNameChanged
' Dispatch interface name: DIDiskQuotaControlEvents
' Member identifier: &H00000001 (1)
' ****************************************************************************************
SUB DIDiskQuotaControlEvents_OnUserNameChanged (BYVAL pCookie AS DIDiskQuotaControlEvents_IDispatchVtbl PTR, BYREF pdispparams AS DISPPARAMS)
' =======================================================================================
' Retrieve the IDispatch reference of the control that has fired the event.
' =======================================================================================
LOCAL pthis AS DWORD : pthis = @@pCookie.pthis
' =======================================================================================
' =======================================================================================
' Pointer variables to access the parameters
' =======================================================================================
LOCAL pv AS VARIANT PTR : pv = pdispparams.VariantArgs
LOCAL pvapi AS VARIANTAPI PTR : pvapi = pv
' =======================================================================================
' =======================================================================================
' Parameters in DISPPARAMS are zero based and in reverse order
' =======================================================================================
' *** pUser - VarType: VT_PTR->VT_USERDEFINED - Resolved VarType: *DIDiskQuotaUser <dispinterface> - Attributes: &H0 - [None] ***
LOCAL pUser AS DWORD : pUser = VARIANT#(@pv[0])
' =======================================================================================
' =======================================================================================
' *** Put your code here ***
' =======================================================================================
END SUB
' ****************************************************************************************
' ****************************************************************************************
' HRESULT Invoke([in] I4 dispidMember, [in] *GUID riid, [in] UI4 lcid, [in] UI2 wFlags, [in] *DISPPARAMS pdispparams, [out] *VARIANT pvarResult, [out] *EXCEPINFO pexcepinfo, [out] *UINT puArgErr)
' ****************************************************************************************
FUNCTION DIDiskQuotaControlEvents_Invoke (BYVAL pCookie AS DIDiskQuotaControlEvents_IDispatchVtbl PTR, BYVAL dispidMember AS LONG, BYREF riid AS GUID, _
BYVAL lcid AS DWORD, BYVAL wFlags AS WORD, BYREF pdispparams AS DISPPARAMS, BYREF pvarResult AS VARIANT, _
BYREF pexcepinfo AS DIDiskQuotaControlEvents_EXCEPINFO, BYREF puArgErr AS DWORD) AS LONG
FUNCTION = %S_OK
IF VARPTR(pdispparams) THEN
SELECT CASE AS LONG dispidMember
CASE &H00000001 ' (1) ' // OnUserNameChanged
DIDiskQuotaControlEvents_OnUserNameChanged(pCookie, pdispparams)
CASE ELSE
FUNCTION = %DISP_E_MEMBERNOTFOUND
END SELECT
END IF
END FUNCTION
' ****************************************************************************************
|
Page last updated on Monday, 03 April 2006 20:37:21 +0200