IResourceList

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.

In Windows 98/Me and in Windows 2000 and later, 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. IResourceList inherits from the IUnknown interface.

In addition to the methods that IResourceList inherits from the IUnknown interface, IResourceList supports the following methods:

IResourceList::AddEntry

IResourceList::AddEntryFromParent

IResourceList::FindTranslatedEntry

IResourceList::FindUntranslatedEntry

IResourceList::NumberOfEntries

IResourceList::NumberOfEntriesOfType

IResourceList::TranslatedList

IResourceList::UntranslatedList

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 NameSingular FormPlural 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.

MacroEquivalent 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))

 

 

 

Send comments about this topic to Microsoft

Show: