3.2.4.2.22.1 CreateTemplate (Opnum 7)

The CreateTemplate method creates a blank Non-Persisted Directory Quota Template Instance (section 3.2.1.2.3.2).

 [id(FSRM_DISPID_QUOTA_TEMPLATE_MANAGER | 0x01)] HRESULT CreateTemplate(
   [out, retval] IFsrmQuotaTemplate** quotaTemplate
 );

quotaTemplate: Pointer to an IFsrmQuotaTemplate interface pointer (section 3.2.4.2.20) that upon completion points to a blank directory quota template. The caller MUST release the template when it is done with it.

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

Return value/code

Description

0x80070057

E_INVALIDARG

The quotaTemplate parameter is NULL.

Upon receiving this message, the server MUST validate parameters:

  • Verify that quotaTemplate 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 Template Instance.

    • Set FSRM Base Object.Id to a GUID.

    • Set Directory Quota Template.Name to an empty string.

    • 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 a date in the distant past.

  • Set quotaTemplate to the IFsrmQuotaTemplate interface pointer (section 3.2.4.2.20) for the new Non-Persisted Directory Quota Template Instance.

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