3.2.4.7.5 RenameAllocationPolicy (Opnum 11)
The RenameAllocationPolicy method renames an existing resource allocation policy (RAP).
-
[id(5), helpstring("method RenameAllocationPolicy")] HRESULT RenameAllocationPolicy( [in] BSTR bstrNewPolicyName, [in] BSTR bstrOldPolicyName );
bstrNewPolicyName: The new policy name that replaces the old one.
-
If this parameter is NULL, E_INVALIDARG MUST be returned.
-
The following RAP names are reserved. If this parameter specifies a reserved name, WRM_ERR_POLICYID_RESERVED_WORD SHOULD be returned: "\", "current", "none", and "Residual". Reserved words are case-insensitive.
bstrOldPolicyName: The old policy name to be replaced.
-
If this parameter is NULL, E_INVALIDARG MUST be returned.
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.
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:
-
\ / ? * | : < > " , ;
0xC1FF00C8
WRM_ERR_TOO_LONG_POLICY_ID
The request has been aborted, because the RAP name has exceeded an implementation-defined limit.<108>
0xC1FF00C9
WRM_ERR_POLICYID_INVALID
The specified RAP does not exist.
0xC1FF00CA
WRM_ERR_POLICYID_ALREADY_EXISTS
A RAP with the specified name already exists.
0xC1FF00CB
WRM_ERR_POLICYID_RESERVED_WORD
The specified RAP name is a reserved word used by WSRM and cannot be used as a name. Reserved words for RAPs are "current", "none", "\" and "Residual". Reserved words are case-insensitive.
0xC1FF00E0
WRM_ERR_WSRM_RESERVED_POLICY
The specified policy is a built-in policy. It cannot be altered.
0xC1FF0070
WRM_ERR_TAGS_NOT_IN_ORDER
The XML data that is maintained by the management service is invalid or cannot be processed.<109>
0xC1FF00E5
WRM_ERR_RENAME_ACTIVE_POLICY
The specified RAP is being used by WSRM and cannot be renamed.
-
Additional IWRMPolicy interface methods are specified in section 3.2.4.7.