IFsrmQuotaManager::CreateAutoApplyQuota method

[This method is supported for compatibility but it's recommended to use the FSRM WMI Classes to manage FSRM. Please see the MSFT_FSRMQuota class.]

Creates an automatic quota for the specified directory.

Syntax


HRESULT CreateAutoApplyQuota(
  [in]   BSTR quotaTemplateName,
  [in]   BSTR path,
  [out]  IFsrmAutoApplyQuota **quota
);

Parameters

quotaTemplateName [in]

The name of a template from which to derive the quota; automatic quotas must derive from a template. The string is limited to 4,000 characters.

path [in]

The local directory path to which the quota applies. The string is limited to 260 characters.

quota [out]

An IFsrmAutoApplyQuota interface to the newly created quota object. The specified template is used to initialize the quota. Use this interface to change the quota and to exclude specific subdirectories from the quota. To add the quota to FSRM, call IFsrmAutoApplyQuota::Commit method.

Return value

The method returns the following return values.

Return codeDescription
S_OK

Success

FSRM_E_ALREADY_EXISTS

A quota already exists for the specified directory.

FSRM_E_NOT_FOUND

The template was not found.

E_INVALIDARG

None of the parameters can be NULL.

 

Remarks

When you save the automatic quota, FSRM creates quotas for all existing subdirectories under the specified directory that do not already contain a quota. When a new subdirectory is created under the specified directory, FSRM uses the properties of the automatic quota to create a quota for the new subdirectory.

If you are creating both the automatic quota and the subdirectories at the same time, you should first create the subdirectories and then create the automatic quota because it provides better performance.

Examples

For an example, see Defining a Quota.

Requirements

Minimum supported client

None supported

Minimum supported server

Windows Server 2008

Header

FsrmQuota.h (include FsrmQuota.h or FsrmTlb.h)

DLL

SrmSvc.dll

CLSID

CLSID_FsrmQuotaManager is defined as 90dcab7f-347c-4bfc-b543-540326305fbe

IID

IID_IFsrmQuotaManager is defined as 8bb68c7d-19d8-4ffb-809e-be4fc1734014

IID_IFsrmQuotaManagerEx is defined as 4846cb01-d430-494f-abb4-b1054999fb09

See also

IFsrmQuotaManager
IFsrmQuotaManagerEx
FsrmQuotaManager
MSFT_FSRMQuota

 

 

Show:
© 2014 Microsoft