3.2.4.7.3 ModifyPolicy (Opnum 9)

The ModifyPolicy method modifies an existing resource allocation policy (RAP).

 [id(3), helpstring("method ModifyPolicy")] HRESULT ModifyPolicy(
   [in] BSTR bstrPolicyInfo,
   [in] BOOL bOverwrite
 );

bstrPolicyInfo: A string that contains the policy to modify, in the form of a Policy element (section 2.2.5.21). For an example, see Policy example (section 4.2.19).

If this parameter is NULL, E_INVALIDARG MUST be returned.

bOverwrite: A Boolean value that specifies whether to ignore the timestamp of the specified policy when validating.

A timestamp MUST be defined inside a common node at the root level of an XML element, as shown in the Calendar example (section 4.2.6). The format of a timestamp is specified in section 2.2.1.4.

Value

Meaning

FALSE

0x00000000

The timestamp of the new policy MUST specify a time that is later than or equal to the timestamp of any modifications made to a policy object on the server. Otherwise, the modification MUST fail, and WRM_ERR_OLD_INFORMATION MUST be returned.

TRUE

0x00000001

The policy is validated and modified without checking the timestamp.

Return Values: This method returns 0x00000000 for success or a negative HRESULT value (in the following table or in [MS-ERREF] section 2.1.1) if an error occurs.

Return value/code

Description

0x00000000

S_OK

Operation successful.

0x80070057

E_INVALIDARG

One or more arguments are invalid.

0xC1FF0069

WRM_ERR_OLD_INFORMATION

The XML timestamp is out of date.

0xC1FF006F

WRM_ERR_ID_VALUE

The specified name contains characters that are invalid. The name cannot start with a hyphen ("-"), cannot contain spaces, and cannot contain any of the following characters:

 \   / ? * | : < > " , ;

0xC1FF0070

WRM_ERR_TAGS_NOT_IN_ORDER

The XML data that is maintained by the management service is invalid or cannot be processed.<107>

0xC1FF00C9

WRM_ERR_POLICYID_INVALID

The specified RAP does not exist.

0xC1FF00E0

WRM_ERR_WSRM_RESERVED_POLICY

The specified policy is a built-in policy. It cannot be altered.

0xC1FF012E

WRM_ERR_RESOURCEGROUPID_INVALID

The request has been aborted because the process matching criteria (PMC) name could not be found.

Additional IWRMPolicy interface methods are specified in section 3.2.4.7.