共用方式為


資源清單物件

The PortCls system driver implements the IResourceList interface for the benefit of miniport drivers. IResourceList 物件代表組態資源清單,這是隨插即用管理員在裝置啟動時指派給裝置的系統硬體資源清單。 如需啟動時資源指派的詳細資訊,請參閱 在函式驅動程式中啟動裝置

資源清單包含下列類型的資源:

  • Interrupt vectors

  • DMA channels

  • I/O 連接埠位址

  • 匯流排相對記憶體位址區塊

For information about resource types, see Hardware Resources.

An IResourceList object encapsulates both the translated and untranslated (or "raw") versions of a resource list. 如需已轉換和未轉換資源的詳細資訊,請參閱 將 Bus-Relative 位址對應至虛擬位址

The IResourceList interface supports the following methods:

IResourceList::AddEntry

IResourceList::AddEntryFromParent

IResourceList::FindTranslatedEntry

IResourceList::FindUntranslatedEntry

IResourceList::NumberOfEntries

IResourceList::NumberOfEntriesOfType

IResourceList::TranslatedList

IResourceList::UntranslatedList

標頭檔 Portcls.h 會定義一組宏,以簡化資源清單物件的處理。 These macros generate calls to the IResourceList methods. 如需詳細資訊,請參閱 IResourceList。

此外,Portcls.h 定義了一對用於建立資源清單的函數:

PcNewResourceList

PcNewResourceSublist

To start up the devices on an audio adapter card, the operating system calls the adapter driver's start-device routine (see Startup Sequence) and passes in a resource list object as an input parameter. 此清單包含作業系統已指派給配接卡驅動程式的所有系統資源。

在啟動裝置常式中,配接器驅動程式會啟動配接器驅動程式的所有裝置 (波形裝置、MIDI 裝置等等) 。 若要管理每個裝置,配接器驅動程式會建立迷你埠驅動程式物件及其相關聯的埠驅動程式物件。 配接卡驅動程式會在配接卡中的各種裝置之間分割資源清單中的資源。 For this purpose, the driver typically calls PcNewResourceSublist to create a resource list object for each device. The driver then calls IResourceList::AddEntryFromParent as many times as necessary to copy selected resources from the parent list into the various child lists. 此外,配接卡驅動程式可能會將一些資源指派給本身。

Next, the start-device routine calls each port driver's IPort::Init method and passes in the device's resource list object (containing the child list) as an input parameter. Each port driver's IPort::Init method calls the corresponding miniport driver's IMiniportXxx::Init method, which is one of the following:

IMiniportDMus::Init

IMiniportMidi::Init

IMiniportTopology::Init

IMiniportWaveCyclic::Init

IMiniportWavePci::Init

The IPort::Init method passes its resource list object to the IMiniportXxx::Init method as an input parameter. 迷你埠驅動程式接著可以使用資源清單中的 DMA 通道、中斷和其他系統資源。

如需程式碼範例,請參閱 Microsoft Windows 驅動程式套件 (WDK) 中的 Sb16 範例音訊驅動程式。