Discuss this help topic in CBFS Forum

OnSetQuotas event/delegate/callback


Pascal    C++ (Lib)    C++ (VCL)    C++ (.NET)    C#    VB.NET    Java 

CallbackFileSystem     See also    


The event is fired when the OS needs to update quota information.


    property OnSetQuotas : TCbFSetQuotasEvent;
    TCbFSetQuotasEvent = procedure( Sender : TObject; EnumerationInfo: TCbFsDiskQuotasEnumerationInfo; Sid: PSID; SidLength: LongWord; var DiskQuotaInformation: TDiskQuotaUserInformation (* DISKQUOTA_USER_INFORMATION *); RemoveQuota: boolean; var QuotaFound: boolean ) of object;

[C++ (Lib)]
    void (__stdcall *CbFSetQuotasEvent)(void* Sender, CbFsDiskQuotasEnumerationInfo* EnumerationInfo, PSID Sid, unsigned long SidLength, PDISKQUOTA_USER_INFORMATION DiskQuotaInformation, bool RemoveQuota, bool * QuotaFound );

[C++ (VCL)]
    typedef void (__closure *TCbFSetQuotasEvent)( System::TObject* Sender, TCbFsDiskQuotasEnumerationInfo* EnumerationInfo, void* Sid, unsigned long SidLength, Cbfsapi::DISKQUOTA_USER_INFORMATION & DiskQuotaInformation, bool RemoveQuota, bool & QuotaFound );

[C++ (.NET)]
    public __delegate void CbFSetQuotasEvent( CallbackFileSystem^ Sender, CbFsDiskQuotasEnumerationInfo^ EnumerationInfo, SecurityIdentifier^ Sid, CallbackFS::DISKQUOTA_USER_INFORMATION% DiskQuotaInformation, bool RemoveQuota, bool & QuotaFound );

    public void CbFSetQuotasEvent( CallbackFileSystem Sender, CbFsDiskQuotasEnumerationInfo EnumerationInfo, SecurityIdentifier Sid, ref CallbackFS.DISKQUOTA_USER_INFORMATION DiskQuotaInformation, bool RemoveQuota, ref bool QuotaFound );

    Sub CbFSetQuotasEvent( ByVal Sender As CallbackFileSystem, ByVal EnumerationInfo As CbFsDiskQuotasEnumerationInfo, ByVal Sid SecurityIdentifier , ByRef DiskQuotaInformation as DISKQUOTA_USER_INFORMATION, ByVal RemoveQuota As Boolean, ByRef QuotaFound As Boolean )

    void ICbFsDiskQuotaEvents.onSetQuotas( CallbackFileSystem sender, );


  • Sender - reference to the class that called the delegate/event handler
  • EnumerationInfo - information about current enumeration
  • Sid - Sid of the user, for whom the quota is requested
  • SidLength - The length of Sid parameter
  • DiskQuotaInformation - place quota-related information in this structure. The format of the structure is described in MSDN.
  • RemoveQuota - specifies whether the quota of the user with the given Sid should be set/updated or removed
  • QuotaFound - set this parameter to specify if the quota for the given Sid has been found


This event is fired when the OS needs to set, update or remove quota information for the given Sid. If RemoveQuota parameter is set to true, Quota for the given Sid must be removed.

Both OnSetQuotas and OnQueryQuotas start the enumeration (hence the use of EnumerationInfo parameter). After the operation is complete, OnCloseQuotasEnumeration event is fired, and there you can release the allocated resources.

The callback / event is optional, i.e. you don't have to handle it if you don't support disk quotas.

Error handling

See Error handling topic for detailed information about how to report errors, which occur in the event handlers, back to Callback File System.

See also

OnCloseQuotasEnumeration event     OnQueryQuotas event    

Discuss this help topic in CBFS Forum