IResourceList::AddEntryFromParent method

The AddEntryFromParent method adds to a resource list an entry found in the resource list's parent list.

Syntax

NTSTATUS AddEntryFromParent(
  IResourceList    *Parent,
  CM_RESOURCE_TYPE Type,
  ULONG            Index
);

Parameters

Parent

Pointer to parent IResourceList object from which the entry is to be taken.

Type

Identifies the resource type of the entry that is to be added. For a list of valid resource-type values, see the description of the Type member of the CM_PARTIAL_RESOURCE_DESCRIPTOR structure.

Index

Specifies the index in the parent list of the entry to add. If the parent's IResourceList::NumberOfEntriesOfType method returns a value n for the number of entries of type Type, valid indices range from 0 to n-1. If Index is zero, for example, the method adds the first occurrence of an entry of the specified type from the parent list.

Return value

AddEntryFromParent returns STATUS_SUCCESS if the call was successful. Otherwise, the method returns an appropriate error code. The following table shows some of the possible return status codes.

Return code Description
STATUS_INSUFFICIENT_RESOURCES
Indicates there are no free entries in the list.
STATUS_INVALID_PARAMETER
Indicates the entry was not found in the parent list.

Remarks

For each resource type, a macro is defined to call this method. See IResourceList.

The Parent parameter follows the reference-counting conventions for COM objects.

Requirements

   
Target Platform Universal
Header portcls.h (include Portcls.h)
IRQL PASSIVE_LEVEL

See also

CM_PARTIAL_RESOURCE_DESCRIPTOR

IResourceList

IResourceList::NumberOfEntriesOfType