3.2.4.2.18.4 CreateAutoApplyQuota (Opnum 10)

The CreateAutoApplyQuota method creates a Non-Persisted Auto Apply Quota Instance (section 3.2.1.2.2.2) for the specified path.

 [id(FSRM_DISPID_QUOTA_MANAGER | 0x02)] HRESULT CreateAutoApplyQuota(
   [in] BSTR quotaTemplateName,
   [in] BSTR path,
   [out, retval] IFsrmAutoApplyQuota** quota
 );

quotaTemplateName: Contains the Name property of the directory quota template from which to derive the auto apply quota. The maximum length of this string MUST be 4,000 characters.

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

quota: Pointer to an IFsrmAutoApplyQuota interface pointer (section 3.2.4.2.17) that upon completion points to the newly created Non-Persisted Auto Apply Quota Instance. To have the Non-Persisted Auto Apply Quota Instance added to the server's List of Persisted Auto Apply Quota Instances (section 3.2.1.2), the caller MUST call Commit (section 3.2.4.2.17.1).

The caller MUST release the Non-Persisted Auto Apply 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

0x80045301

FSRM_E_NOT_FOUND

The specified auto apply quota could not be found.

0x80045303

FSRM_E_ALREADY_EXISTS

The auto apply 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 or return a nonzero error code.

  • Create a new Non-Persisted Auto Apply Quota Instance with the properties of the named directory quota template and the Folder path set to path.

  • Set quota to the IFsrmAutoApplyQuota interface of the new Non-Persisted Auto Apply Quota Instance.

The new Non-Persisted Auto Apply Quota Instance MUST NOT be associated with an existing Persisted Auto Apply Quota (section 3.2.1.2.2.1).

If a directory quota template with the specified name does not exist, the server MUST return FSRM_E_NOT_FOUND.