3.2.4.2.18.3 CreateQuota (Opnum 9)

The CreateQuota method creates a blank Non-Persisted Directory Quota Instance (section 3.2.1.2.1.2) for the specified path.

 [id(FSRM_DISPID_QUOTA_MANAGER | 0x01)] HRESULT CreateQuota(
   [in] BSTR path,
   [out, retval] IFsrmQuota** quota
 );

path: Contains the path of the local directory for the directory quota. The maximum length of this string MUST be 260 characters.

quota: Pointer to an IFsrmQuota interface pointer (section 3.2.4.2.16) that upon completion points to the newly created Non-Persisted Directory Quota Instance. To have the Non-Persisted Directory Quota Instance added to the server's List of Persisted Directory Quota Instances (section 3.2.4.2.16.1), the caller MUST call Commit (section 3.2.4.2.10.5).

The caller MUST release the Non-Persisted Directory Quota Instance when the caller is done with it.

Return Values: The method MUST return zero on success, or a nonzero error code on failure.

Return value/code

Description

0x80045303

FSRM_E_ALREADY_EXISTS

The quota for the specified path already exists.

0x80070057

E_INVALIDARG

One of the quota parameters is NULL.

Upon receiving this message, the server MUST validate parameters:

  • Verify that quota is not NULL.

If any validation fails, the server MUST terminate processing and return a nonzero error code.

Upon successful validation of parameters, the server MUST perform the following actions.

  • Create a new Non-Persisted Directory Quota Instance with the Folder path set to path.

    • Set FSRM Base Object.Id to a GUID.

    • Set Directory Quota.Folder path to an empty string.

    • Set Quota limit to zero.

    • Set Quota limit mode to Hard quota.

    • Set Quota enable/disable to enable.

    • Set Thresholds to empty set.

    • Set Notifications to Hard quota.

    • Set Template id to a GUID.

    • Set Auto apply quota id to a GUID.

    • Set Notification status to reset.

    • Set Quota state to complete.

    • Set Quota usage to zero.

    • Set Peak quota usage to zero.

    • Set Peak quota usage time stamp to date in the distant past.

  • Set quota to the IFsrmQuota interface of the new Non-Persisted Directory Quota Instance.

The new Non-Persisted Directory Quota Instance MUST NOT be associated with an existing Persisted Directory Quota (section 3.2.1.2.1.1).