3.2.4.10.3 CreateResourceGroup (Opnum 9)

The CreateResourceGroup function creates a new resource group.

 [id(3), helpstring("method CreateResourceGroup")] HRESULT CreateResourceGroup(
   [in] BSTR bstrResourceGroupInfo
 );

bstrResourceGroupInfo: A string that specifies a new resource group, in the form of a ProcessMatchingCriteria (section 2.2.5.24) element (section 2.2.5.24). For an example, see ProcessMatchingCriteria example (section 4.2.20).

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

The operation was successfully done.

0x80070057

E_INVALIDARG

One or more arguments are invalid.

0xC1FF006F

WRM_ERR_ID_VALUE

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

 \   / ? * | : < > " , ;

0xC1FF012F

WRM_ERR_RESOURCEGROUPID_ALREADY_EXISTS

The request has been aborted because the resource group with the specified name already exists.

0xC1FF0136

WRM_ERR_PMC_LIMIT_EXCEEDED

The total number of resource groups has exceeded an implementation-defined limit.<120>.

0xC1FF0139

WRM_ERR_CANNOT_CREATE_RESERVED_RESOURCEGROUP

A user-created resource group cannot have the same name as that of a built-in resource group.

Additional IWRMResourceGroup interface methods are specified in section 3.2.4.10.