4.1 Query Enumeration of File Server Resource Manager Protocol Directory Quotas

File Server Resource Manager Protocol directory quota objects are retrievable through an enumeration via the IFsrmQuotaManager interface (section 3.2.4.2.18). The following describes how a client can enumerate FSRM directory quota objects:

  1. The client requests the creation of an instance of the Quota Manager on the local machine by calling CoCreateInstance with the class GUID of the Quota Manager, requesting an instance of the Quota Manager on the server.

  2. The server returns a reference to the IFsrmQuotaManager interface.

  3. The client calls the method IFsrmQuotaManager::EnumQuotas (section 3.2.4.2.18.8), passing it the path on a volume on the server for which the client wants to enumerate quotas.

  4. The server collects all the quota objects configured for the path specified and returns a reference to the IFsrmCommittableCollection interface (section 3.2.4.2.3) back to the client.

  5. The client calls IFsrmCommittableCollection::Count (section 3.2.4.2.3.1) to get the number of quotas in the collection.

  6. The server replies to the client with the number of quotas in the collection.

  7. The client calls IFsrmCollection::Item (section 3.2.4.2.1.2) with the index set to 1 to get the first quota in the collection.

  8. The server returns a VARIANT with the pDispVal element set to the IDispatch interface for the first quota in the collection.

  9. The client calls VARIANT.pDispVal::QueryInterface with the GUID of the IFsrmQuota interface (section 3.2.4.2.16).

  10. The server returns the IFsrmQuota interface of the quota.

  11. The client can make calls to any of the methods implemented by IFsrmQuota.

  12. The server responds appropriately to the client call.

  13. The client calls IFsrmQuota::Release.

  14. The server decrements the number of references to the quota.

  15. The client can repeat steps 7 through 13, incrementing the index used in the call to IFsrmCollection::Item (section 3.2.4.2.1.2) until the index is equal to, but not greater than, the count returned in step 5.

  16. The client calls IFsrmCommittableCollection::Release.

  17. The server decrements the number of references to the collection.

  18. The client calls IFsrmQuotaManager::Release.

Steps 4 through 10 are same for any IFsrmCollection interface (section 3.2.4.2.1), provided the client substitutes IFsrmQuota in steps 9 and 11 with an interface appropriate for the type of quota objects returned in the collection during step 3.

Flow diagram for query enumeration

Figure 1: Flow diagram for query enumeration