IResourceList interface (portcls.h)

The IResourceList interface provides an abstraction of a configuration resource list, which is a list of the system hardware resources that the Plug and Play manager assigns to a device at startup time. The resources in the list can include interrupt vectors, DMA channels, I/O port addresses, and blocks of bus-relative memory addresses. For more information, see Starting a Device in a Function Driver.

The PortCls system driver implements the IResourceList interface and exposes it to adapter drivers. When PortCls calls an adapter driver's device-startup routine (see Starting a Device), it passes an IResourceList object as one of the call parameters.

The header file portcls.h defines set of macros to simplify the handling of resource list objects. For each type of resource, the following four macros are defined:

ULONG
  NumberOfpluralresourcename(
    void
 ); 

PCM_PARTIAL_RESOURCE_DESCRIPTOR
  FindTranslatedsingularresourcename(
    ULONG  Index
    );

PCM_PARTIAL_RESOURCE_DESCRIPTOR
  FindUntranslatedsingularresourcename(
    ULONG  Index
    );

NTSTATUS
  AddsingularresourcenameFromParent(
    PRESOURCELIST  Parent,
    ULONG  Index
    );

The following table shows the resource types for which these macros are defined.

Resource Type Name Singular Form Plural Form
CmResourceTypePort Port Ports
CmResourceTypeInterrupt Interrupt Interrupts
CmResourceTypeMemory Memory Memories
CmResourceTypeDma Dma Dmas
CmResourceTypeDeviceSpecific DeviceSpecific DeviceSpecifics
CmResourceTypeBusNumber BusNumber BusNumbers
CmResourceTypePrivate Private Privates
CmResourceTypeAssignedResource AssignedResource AssignedResources
CmResourceTypeSubAllocateFrom SubAllocateFrom SubAllocateFroms
 

For the meanings of the resource type names in the left column above, see CM_PARTIAL_RESOURCE_DESCRIPTOR.

The following table explicitly lists the four macros that portcls.h defines for each of the nine resource types. To the right of each macro is the equivalent call to an IResourceList method.

Macro Equivalent IResourceList call
NumberOfPorts() NumberOfEntriesOfType(CmResourceTypePort)
FindTranslatedPort(n) FindTranslatedEntry(CmResourceTypePort,(n))
FindUntranslatedPort(n) FindUntranslatedEntry(CmResourceTypePort,(n))
AddPortFromParent(p,n) AddEntryFromParent((p),CmResourceTypePort,(n))
NumberOfInterrupts() NumberOfEntriesOfType(CmResourceTypeInterrupt)
FindTranslatedInterrupt(n) FindTranslatedEntry(CmResourceTypeInterrupt,(n))
FindUntranslatedInterrupt(n) FindUntranslatedEntry(CmResourceTypeInterrupt,(n))
AddInterruptFromParent(p,n) AddEntryFromParent((p),CmResourceTypeInterrupt,(n))
NumberOfMemories() NumberOfEntriesOfType(CmResourceTypeMemory)
FindTranslatedMemory(n) FindTranslatedEntry(CmResourceTypeMemory,(n))
FindUntranslatedMemory(n) FindUntranslatedEntry(CmResourceTypeMemory,(n))
AddMemoryFromParent(p,n) AddEntryFromParent((p),CmResourceTypeMemory,(n))
NumberOfDmas() NumberOfEntriesOfType(CmResourceTypeDma)
FindTranslatedDma(n) FindTranslatedEntry(CmResourceTypeDma,(n))
FindUntranslatedDma(n) FindUntranslatedEntry(CmResourceTypeDma,(n))
AddDmaFromParent(p,n) AddEntryFromParent((p),CmResourceTypeDma,(n))
NumberOfDeviceSpecifics() NumberOfEntriesOfType(CmResourceTypeDeviceSpecific)
FindTranslatedDeviceSpecific(n) FindTranslatedEntry(CmResourceTypeDeviceSpecific,(n))
FindUntranslatedDeviceSpecific(n) FindUntranslatedEntry(CmResourceTypeDeviceSpecific,(n))
AddDeviceSpecificFromParent(p,n) AddEntryFromParent((p),CmResourceTypeDeviceSpecific,(n))
NumberOfBusNumbers() NumberOfEntriesOfType(CmResourceTypeBusNumber)
FindTranslatedBusNumber(n) FindTranslatedEntry(CmResourceTypeBusNumber,(n))
FindUntranslatedBusNumber(n) FindUntranslatedEntry(CmResourceTypeBusNumber,(n))
AddBusNumberFromParent(p,n) AddEntryFromParent((p),CmResourceTypeBusNumber,(n))
NumberOfDevicePrivates() NumberOfEntriesOfType(CmResourceTypeDevicePrivate)
FindTranslatedDevicePrivate(n) FindTranslatedEntry(CmResourceTypeDevicePrivate,(n))
FindUntranslatedDevicePrivate(n) FindUntranslatedEntry(CmResourceTypeDevicePrivate,(n))
AddDevicePrivateFromParent(p,n) AddEntryFromParent((p),CmResourceTypeDevicePrivate,(n))
NumberOfAssignedResources() NumberOfEntriesOfType(CmResourceTypeAssignedResource)
FindTranslatedAssignedResource(n) FindTranslatedEntry(CmResourceTypeAssignedResource,(n))
FindUntranslatedAssignedResource(n) FindUntranslatedEntry(CmResourceTypeAssignedResource,(n))
AddAssignedResourceFromParent(p,n) AddEntryFromParent((p),CmResourceTypeAssignedResource,(n))
NumberOfSubAllocateFroms() NumberOfEntriesOfType(CmResourceTypeSubAllocateFrom)
FindTranslatedSubAllocateFrom(n) FindTranslatedEntry(CmResourceTypeSubAllocateFrom,(n))
FindUntranslatedSubAllocateFrom(n) FindUntranslatedEntry(CmResourceTypeSubAllocateFrom,(n))
AddSubAllocateFromFromParent(p,n) AddEntryFromParent((p),CmResourceTypeSubAllocateFrom,(n))

Inheritance

The IResourceList interface inherits from the IUnknown interface.

Methods

The IResourceList interface has these methods.

 
IResourceList::AddEntry

The AddEntry method adds an entry to a resource list.
IResourceList::AddEntryFromParent

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

The FindTranslatedEntry method returns a pointer to a translated entry of the specified type, or NULL if no such entry is found.
IResourceList::FindUntranslatedEntry

The FindUntranslatedEntry method returns a pointer to an untranslated entry of the specified type, or NULL if no such pointer is found.
IResourceList::NumberOfEntries

The NumberOfEntries method returns the number of resource items in the resource list.
IResourceList::NumberOfEntriesOfType

The NumberOfEntriesOfType method returns the number of resource items of a given type in the resource list. For each resource type, a macro is defined to call this method as previously described.
IResourceList::TranslatedList

The TranslatedList method returns the list of translated resources.
IResourceList::UntranslatedList

The UntranslatedList method returns the list of untranslated resources.

Requirements

Requirement Value
Target Platform Windows
Header portcls.h