3.2.4.2.14.10 CreateThresholdAction (Opnum 20)

The CreateThresholdAction method creates an action and associates it with the specified threshold.

 [id(FSRM_DISPID_QUOTA_BASE | 0x04)] HRESULT CreateThresholdAction(
   [in] FSRM_QUOTA_THRESHOLD threshold,
   [in] FsrmActionType actionType,
   [out, retval] IFsrmAction** action
 );

threshold: Contains the threshold to create the action for.

actionType: Contains the type of action to be created.

action: Pointer to an IFsrmAction interface pointer (section 3.2.4.2.4) that upon completion points to the newly created action. The caller MUST release the object 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

0x80045301

FSRM_E_NOT_FOUND

An object with the specified threshold could not be found.

0x80045303

FSRM_E_ALREADY_EXISTS

An action of the same type as the actionType parameter already exists for the threshold.

0x8004530D

FSRM_E_OUT_OF_RANGE

The content of the threshold parameter is less than 1 or greater than 250.

0x80070057

E_INVALIDARG

This code is returned for the following reasons:

  • The action parameter is NULL.

  • The actionsType parameter is not a valid type.

Upon receiving this message, the server MUST validate parameters:

  • Verify that threshold is greater than 0 and less than 251.

  • Verify that actionType is a valid FsrmActionType (section 2.2.1.2.9) value. If actionType is FsrmActionType_Unknown, the parameter MUST be considered an invalid value.

  • Verify that action is not NULL.

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

The server MUST create a new action object of the specified type and associate it with the specified threshold or return a nonzero error code. If the threshold does not exist for the quota object, the server MUST return FSRM_E_NOT_FOUND.