Home COM GDI+ WebBrowser Data Access

DIDiskQuotaUser  Object

 

IID_DIDiskQuotaUser

{7988B57A-EC89-11CF-9C00-00AA00A14F56}

 

 

The DiskQuotaControl object allows a client to manage an NTFS volume's global disk quota settings. This object makes the essential functionality of the DIDiskQuotaUser interface available to scripting and Microsoft Visual Basic-based applications.

 

Remarks

Each user on the volume that is managed by the DiskQuotaControl object has a DIDiskQuotaUser object associated with it. This object allows a client to manage an individual user's settings. There are several ways to obtain a user's DIDiskQuotaUser object:

  • The DIDiskQuotaUser objects for all users with quotas on the volume are exposed as a collection and can be enumerated. A discussion of how to enumerate DIDiskQuotaUser objects is found below.

  • When you add a new user, the AddUser method returns the user's DIDiskQuotaUser object.

  • If you have the user's name, the FindUser method returns the user's DIDiskQuotaUser object.

Enumerating Disk Quota Users

 

The DIDiskQuotaUser objects for all users with a quota on the volume are exposed as a collection. The DiskQuotaControl object exports a standard enumerator method that allows you to enumerate the collection of DIDiskQuotaUser objects. The following procedure illustrates how to perform the enumeration with Microsoft JScript (compatible with ECMA 262 language specification). You can use a similar procedure with Visual Basic or Visual Basic Scripting Edition (VBScript).

  1. Create a new DiskQuotaControl object.

  2. Initialize it with Initialize.

  3. Create a new JScript Enumerator object.

  4. Use a for loop to enumerate the DIDiskQuotaUser objects. There is no need to set a starting value. The enumerator object's moveNext method notifies the item method to return the next DIDiskQuotaUser object. The atEnd method returns false when you reach the end of the list.

  5. As needed, use the DIDiskQuotaUser object returned by the enumerator's item method to retrieve or set one or more of the associated user's disk quota properties.

The following code fragment illustrates how to enumerate DIDiskQuotaUser objects with JScript. The Volume_Label argument that is passed to the EnumUsers function is a string value containing a volume label such as "C:\\".

 

 

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.

DIDiskQuotaUser Methods and Properties

Description

ID

Retrieves an identifier (ID) that uniquely identifies the user.

AccountContainerName

Retrieves the name of the user's account container.

LogonName

Retrieves the user's logon account name.

DisplayName

Retrieves the user's display name.

QuotaThreshold

Sets or retrieves the user's warning threshold, in bytes.

QuotaThresholdText

Retrieves the user's warning threshold as a text string.

QuotaLimit

Sets or retrieves the user's current quota limit, in bytes.

QuotaLimitText

Retrieves the user's current quota limit as a text string.

QuotaUsed

Retrieves the user's current disk usage, in bytes.

QuotaUsedText

Retrieves the user's current disk usage as a text string.

AccountStatus

Retrieves the status of the user's account.

Invalidate

Clears the object's cached user information.

 

AccountStatusConstants

 

%dqAcctResolved = 0

%dqAcctUnavailable = 1
%dqAcctDeleted = 2
%dqAcctInvalid = 3
%dqAcctUnknown = 4
%dqAcctUnresolved = 5

 

 

QuotaStateConstants

 

%dqStateDisable = 0
%dqStateTrack = 1
%dqStateEnforce = 2

 

 

UserNameResolutionConstants

 

%dqResolveNone = 0
%dqResolveSync = 1
%dqResolveAsync = 2

 

 

ID

 

FUNCTION DIDiskQuotaUser_get_ID ( _
  BYVAL pthis AS DWORD PTR _
, BYREF pID AS LONG _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[7] USING DIDiskQuotaUser_get_ID (pthis, pID) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

AccountContainerName

 

FUNCTION DIDiskQuotaUser_get_AccountContainerName ( _
  BYVAL pthis AS DWORD PTR _
, BYREF pContainerName AS STRING _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[8] USING DIDiskQuotaUser_get_AccountContainerName (pthis, pContainerName) TO HRESULT
  FUNCTION = HRESULT
  pContainerName = ACODE$(pContainerName)

END FUNCTION

 

 

LogonName

 

FUNCTION DIDiskQuotaUser_get_LogonName ( _
  BYVAL pthis AS DWORD PTR _
, BYREF pLogonName AS STRING _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[9] USING DIDiskQuotaUser_get_LogonName (pthis, pLogonName) TO HRESULT
  FUNCTION = HRESULT
  pLogonName = ACODE$(pLogonName)

END FUNCTION

 

 

DisplayName

 

FUNCTION DIDiskQuotaUser_get_DisplayName ( _
  BYVAL pthis AS DWORD PTR _
, BYREF pDisplayName AS STRING _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[10] USING DIDiskQuotaUser_get_DisplayName (pthis, pDisplayName) TO HRESULT
  FUNCTION = HRESULT
  pDisplayName = ACODE$(pDisplayName)

END FUNCTION

 

 

QuotaThreshold

 

FUNCTION DIDiskQuotaUser_get_QuotaThreshold ( _
  BYVAL pthis AS DWORD PTR _
, BYREF pThreshold AS DOUBLE _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[11] USING DIDiskQuotaUser_get_QuotaThreshold (pthis, pThreshold) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

FUNCTION DIDiskQuotaUser_put_QuotaThreshold ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL pThreshold AS DOUBLE _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[12] USING DIDiskQuotaUser_put_QuotaThreshold (pthis, pThreshold) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

QuotaThresholdText

 

FUNCTION DIDiskQuotaUser_get_QuotaThresholdText ( _
  BYVAL pthis AS DWORD PTR _
, BYREF pThresholdText AS STRING _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[13] USING DIDiskQuotaUser_get_QuotaThresholdText (pthis, pThresholdText) TO HRESULT
  FUNCTION = HRESULT
  pThresholdText = ACODE$(pThresholdText)

END FUNCTION
 

 

QuotaLimit

 

FUNCTION DIDiskQuotaUser_get_QuotaLimit ( _
  BYVAL pthis AS DWORD PTR _
, BYREF pLimit AS DOUBLE _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[14] USING DIDiskQuotaUser_get_QuotaLimit (pthis, pLimit) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

FUNCTION DIDiskQuotaUser_put_QuotaLimit ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL pLimit AS DOUBLE
_
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[15] USING DIDiskQuotaUser_put_QuotaLimit (pthis, pLimit) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION
 

 

QuotaLimitText

 

FUNCTION DIDiskQuotaUser_get_QuotaLimitText ( _
  BYVAL pthis AS DWORD PTR _
, BYREF pLimitText AS STRING _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[16] USING DIDiskQuotaUser_get_QuotaLimitText (pthis, pLimitText) TO HRESULT
  FUNCTION = HRESULT
  pLimitText = ACODE$(pLimitText)

END FUNCTION
 

 

QuotaUsed

 

FUNCTION DIDiskQuotaUser_get_QuotaUsed ( _
  BYVAL pthis AS DWORD PTR _
, BYREF pUsed AS DOUBLE _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[17] USING DIDiskQuotaUser_get_QuotaUsed (pthis, pUsed) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION
 

 

QuotaUsedText

 

FUNCTION DIDiskQuotaUser_get_QuotaUsedText ( _
  BYVAL pthis AS DWORD PTR _
, BYREF pUsedText AS STRING _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[18] USING DIDiskQuotaUser_get_QuotaUsedText (pthis, pUsedText) TO HRESULT
  FUNCTION = HRESULT
  pUsedText = ACODE$(pUsedText)

END FUNCTION
 

 

AccountStatus

 

FUNCTION DIDiskQuotaUser_get_AccountStatus ( _
  BYVAL pthis AS DWORD PTR _
, BYREF pStatus AS LONG _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[19] USING DIDiskQuotaUser_get_AccountStatus (pthis, pStatus) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION
 

 

Invalidate

 

FUNCTION DIDiskQuotaUser_Invalidate ( _
  BYVAL pthis AS DWORD PTR _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[20] USING DIDiskQuotaUser_Invalidate (pthis) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION
 

 

Page last updated on Monday, 20 March 2006 02:23:34 +0100