3.2.4.2.45.17 GetRule (Opnum 23)
The GetRule method returns a pointer to the classification rule with the specified Name and Rule type from the List of Persisted Rules (section 3.2.1.6).
-
[id(FSRM_DISPID_CLASSIFICATION_MANAGER | 0x06)] HRESULT GetRule( [in] BSTR ruleName, [in] FsrmRuleType ruleType, [out, retval] IFsrmRule** Rule );
ruleName: Contains the Name of the classification rule to return.
ruleType: Contains the FsrmRuleType (section 2.2.1.2.11) of the classification rule to return.
Rule: Pointer to an IFsrmRule interface pointer (section 3.2.4.2.41) that upon completion points to the classification rule with the specified Name and Rule type. The caller MUST release the rule 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 rule could not be found.
0x80045308
FSRM_E_INVALID_NAME
The ruleName parameter is empty or NULL.
0x80070057
E_INVALIDARG
This code is returned for the following reasons:
The ruleType parameter is a not a valid value. If ruleType is FsrmRuleType_Generic, the parameter MUST be considered an valid value.
The specified name exceeds the maximum length of 1000 characters.
Upon receiving this message, the server MUST validate parameters:
Verify that Rule is not NULL.
Verify that ruleType contains a valid FsrmRuleType value.
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 Rule Instance (section 3.2.1.6.3.2).
Populate the configuration data of the Non-Persisted Rule Instance from the Persisted Rule (section 3.2.1.6.3.1) in the List of Persisted Rules whose Rule.Name is equivalent to ruleName and whose Rule.Type is equivalent to ruleType.
Set Rule to the IFsrmRule interface pointer of the newly created Non-Persisted Rule Instance.
If a classification rule with the specified Name and Rule type does not exist, the server MUST return FSRM_E_NOT_FOUND.