CM_PARTIAL_RESOURCE_DESCRIPTOR

typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR {

    UCHAR Type;

    UCHAR ShareDisposition;

    USHORT Flags;

    union {

        //

        // Range of port numbers, inclusive. These are physical and

        // bus-relative values, which should be passed, unchanged,

        // to HalTranslateBusAddress to get the mapped logical port

        // range the driver uses to communicate with its device.

        //

        struct {

            PHYSICAL_ADDRESS Start;    // 8-byte physical address

            ULONG Length;

        } Port;

        //

        // Bus-relative IRQL or vector and affinity, which are returned

        // by IoQueryDeviceDescription or HalGetBusData and passed,

        // unchanged, to HalGetInterruptVector and/or

        // IoReportResourceUsage.

        //

        struct {

            ULONG Level;

            ULONG Vector;

            ULONG Affinity;

        } Interrupt;

        //

        // Range of device memory, inclusive. These are physical and

        // bus-relative values, which should be passed, unchanged,

        // to HalTranslateBusAddress to get the mapped logical address.

        // This, in turn, can be passed to MmMapIoSpace to get the virtual

        // address range that the driver uses to communicate with its device.

        //

        struct {

            PHYSICAL_ADDRESS Start;    // 8-byte physical addresses.

            ULONG Length;

        } Memory;

        //

        // The DMA channel number or MCA-type DMA port for the device.

        //

        struct {

            ULONG Channel;

            ULONG Port;

            ULONG Reserved1;

        } Dma;

        //

        // Device-specific information defined by the system or driver.

        // The DataSize field indicates the size of the data in bytes. The

        // data is located immediately after the Reserved2 member of

        // the structure.

        //

        struct {

            ULONG DataSize;

            ULONG Reserved1;

            ULONG Reserved2;

        } DeviceSpecificData;

    } u;

} CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR;

Each CM_PARTIAL_RESOURCE_DESCRIPTOR defines an element of an array  within a CM_PARTIAL_RESOURCE_LIST. Each CM_PARTIAL_RESOURCE_DESCRIPTOR describes only one type of resource used by a driver or device controlled by that driver.

Members

Type

Specifies which of the following is described by this partial descriptor: CmResourceTypePort, CmResourceTypeInterrupt, CmResourceTypeMemory, CmResourceTypeDma, CmResourceTypeDeviceSpecific.

ShareDisposition

Specifies whether or how the particular resource can be shared as one of the following: CmResourceShareDeviceExclusive, CmResourceShareDriverExclusive, CmResourceShareShared.

Flags

Specifies type-dependent information about this descriptor:

·When Type is set with CmResourceTypePort, can be either of the following: CM_RESOURCE_PORT_MEMORY, CM_RESOURCE_PORT_IO.

·When Type is set with CmResourceTypeInterrupt, can be either of the following: CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE, CM_RESOURCE_INTERRUPT_LATCHED.

·When Type is set with CmResourceTypeMemory can be one of the following: CM_RESOURCE_MEMORY_READ_WRITE, CM_RESOURCE_MEMORY_READ_ONLY, CM_RESOURCE_MEMORY_WRITE_ONLY.

u.Port

Describes a range of device ports in I/O space, as the following:

Start

Bus-specific, 8-byte base physical address for the range.

Length

The length, in bytes, of the range.

u.Interrupt

Describes a bus-relative interrupt, as the following:

Level

The IRQL at which the bus interrupts.

Vector

The vector at which the bus interrupts.

Affinity

The set of processors to which bus interrupts are dispatched. Set this to -1 in any partial resource descriptor describing interrupt configuration information that is passed to IoReportResourceUsage.

u.Memory

Describes a bus-relative range of device memory, which is in system memory space, as the following:

Start

Bus-specific, 8-byte base physical address for the range.

Length

Size in bytes of the range.

u.Dma

Describes a bus-relative DMA setting, as one of the following:

Channel

Number of the DMA channel on a system DMA controller that the device can use.

Port

Number of the DMA port that an MCA-type device can use.

u.DeviceSpecificData

Describes how much device-specific data follows immediately after the Reserved2 member, as the following:

DataSize

The size in bytes of the device-specific data area.

Comments

For some examples of DeviceSpecificData, see the CM_XXX_DEVICE_DATA structures also described in this chapter.

For partial resource descriptors with CmResourceTypeInterrupt information, either the Level or Vector member of u.Interrupt is set, depending on the platform and type of bus. The Affinity member should either be left as returned by IoQueryDeviceDescription or be set to -1 when claiming resources in the registry with IoReportResourceUsage.

See Also

CM_PARTIAL_RESOURCE_LIST, HalGetInterruptVector, HalTranslateBusAddress, IoAssignResources, IoQueryDeviceDescription, IoReportResourceUsage, MmMapIoSpace