Previous Next

CM_PARTIAL_RESOURCE_DESCRIPTOR

The CM_PARTIAL_RESOURCE_DESCRIPTOR structure specifies one or more system hardware resources, of a single type, assigned to a device. This structure is used to create an array within a CM_PARTIAL_RESOURCE_LIST structure.

typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR {
    UCHAR Type;
    UCHAR ShareDisposition;
    USHORT Flags;
    union {
        struct {
            PHYSICAL_ADDRESS Start;
            ULONG Length;
        } Generic;
        struct {
            PHYSICAL_ADDRESS Start;
            ULONG Length;
        } Port;
        struct {
            ULONG Level;
            ULONG Vector;
            KAFFINITY Affinity;
        } Interrupt;
        struct {
            PHYSICAL_ADDRESS Start;
            ULONG Length;
        } Memory;
        struct {
            ULONG Channel;
            ULONG Port;
            ULONG Reserved1;
        } Dma;
        struct {
            ULONG Data[3];
        } DevicePrivate;
        struct {
            ULONG Start;
            ULONG Length;
            ULONG Reserved;
        } BusNumber;
        struct {
            ULONG DataSize;
            ULONG Reserved1;
            ULONG Reserved2;
        } DeviceSpecificData;
    } u;
} CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR;

Members

Type
Identifies the resource type. The constant value specified for Type indicates which structure within the u union is valid, as indicated in the following table. (These flags are used within both CM_PARTIAL_RESOURCE_DESCRIPTOR and IO_RESOURCE_DESCRIPTOR structures, except where noted.)
Type Value u Member Substructure
CmResourceTypePort u.Port
CmResourceTypeInterrupt u.Interrupt
CmResourceTypeMemory u.Memory
CmResourceTypeDma u.Dma
CmResourceTypeDevicePrivate u.DevicePrivate
CmResourceTypeBusNumber u.BusNumber
CmResourceTypeDeviceSpecific u.DeviceSpecificData (Not used within IO_RESOURCE_DESCRIPTOR.)
CmResourceTypePcCardConfig u.DevicePrivate
CmResourceTypeMfCardConfig u.DevicePrivate
CmResourceTypeConfigData Reserved for system use.
CmResourceTypeNonArbitrated Not used.

ShareDisposition
Indicates whether the described resource can be shared. Valid constant values are listed in the following table.
Value Definition
CmResourceShareDeviceExclusive The device requires exclusive use of the resource.
CmResourceShareDriverExclusive The driver requires exclusive use of the resource. (Not supported for WDM drivers.)
CmResourceShareShared The resource can be shared without restriction.

Flags
Contains bit flags that are specific to the resource type, as indicated in the following table. Flags can be ORed together as appropriate.
Resource
Type

Flag

Definition
CmResourceTypePort
  CM_RESOURCE_PORT_MEMORY The device is accessed in memory address space.
  CM_RESOURCE_PORT_IO The device is accessed in I/O address space.
  CM_RESOURCE_PORT_10_BIT_DECODE The device decodes 10 bits of the port address.
  CM_RESOURCE_PORT_12_BIT_DECODE The device decodes 12 bits of the port address.
  CM_RESOURCE_PORT_16_BIT_DECODE The device decodes 16 bits of the port address.
  CM_RESOURCE_PORT_POSITIVE_DECODE The device uses "positive decode" instead of "subtractive decode". (In general, PCI devices use positive decode and ISA buses use subtractive decode.)
  CM_RESOURCE_PORT_PASSIVE_DECODE The device decodes the port but the driver does not use it.
  CM_RESOURCE_PORT_WINDOW_DECODE Reserved for system use.
CmResourceTypeInterrupt
  CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE The IRQ line is level-triggered. (These IRQs are usually shareable.)
  CM_RESOURCE_INTERRUPT_LATCHED The IRQ line is edge-triggered.
CmResourceTypeMemory
  CM_RESOURCE_MEMORY_READ_WRITE The memory range is readable and writable.
  CM_RESOURCE_MEMORY_READ_ONLY The memory range is read-only.
  CM_RESOURCE_MEMORY_WRITE_ONLY The memory range is write-only.
  CM_RESOURCE_MEMORY_PREFETCHABLE The memory range is prefetchable.
  CM_RESOURCE_MEMORY_COMBINEDWRITE Combined-write caching is allowed.
  CM_RESOURCE_MEMORY_24 The device uses 24-bit addressing.
  CM_RESOURCE_MEMORY_CACHEABLE The memory range is cacheable.
CmResourceTypeDma
  CM_RESOURCE_DMA_8 8-bit DMA channel
  CM_RESOURCE_DMA_16 16-bit DMA channel
  CM_RESOURCE_DMA_32 32-bit DMA channel
  CM_RESOURCE_DMA_8_AND_16 8-bit and 16-bit DMA channel
  CM_RESOURCE_DMA_BUS_MASTER The device supports bus master DMA transfers.
  CM_RESOURCE_DMA_TYPE_A Type A DMA
  CM_RESOURCE_DMA_TYPE_B Type B DMA
  CM_RESOURCE_DMA_TYPE_F Type F DMA

u.Generic
Not used.
u.Port
Specifies a range of I/O port addresses, using the following members:
Start
For raw resources: Bus-relative physical address of the lowest of a range of contiguous I/O port addresses allocated to the device.

For translated resources: System physical address of the lowest of a range of contiguous I/O port addresses allocated to the device.

Length
The length, in bytes, of the range of allocated I/O port addresses.
u.Interrupt
Specifies an interrupt vector and level, using the following members:
Level
For raw resources: The device's bus-specific IRQL (if appropriate for the platform and bus).

For translated resources: The DIRQL assigned to the device.

Vector
For raw resources: The device's bus-specific interrupt vector (if appropriate for the platform and bus).

For translated resources: The global system vector assigned to the device.

Affinity
A bit mask KAFFINITY-typed value indicating the set of processors the device can interrupt. If the device can interrupt any processor, set this to -1.
u.Memory
Specifies a range of memory addresses, using the following members:
Start
For raw resources: Bus-relative physical address of the lowest of a range of contiguous memory addresses allocated to the device.

For translated resources: System physical address of the lowest of a range of contiguous memory addresses allocated to the device.

Length
The length, in bytes, of the range of allocated memory addresses.
u.Dma
Specifies a DMA setting, using one of the following members:
Channel
The number of the DMA channel on a system DMA controller that the device can use.
Port
The number of the DMA port that an MCA-type device can use.
Reserved1
Not used.
u.DevicePrivate
Reserved for system use.
u.BusNumber
Specifies bus numbers, using the following members:
Start
The lowest-numbered of a range of contiguous buses allocated to the device.
Length
The number of buses allocated to the device.
Reserved
Not used.
u.DeviceSpecificData
Specifies the size of a device-specific, private structure that is appended to the end of the CM_PARTIAL_RESOURCE_DESCRIPTOR structure. If u.DeviceSpecificData is used, the CM_PARTIAL_RESOURCE_DESCRIPTOR structure must be the last one in the CM_PARTIAL_RESOURCE_LIST array.
DataSize
The number of bytes appended to the end of the CM_PARTIAL_RESOURCE_DESCRIPTOR structure.
Reserved1
Not used.
Reserved2
Not used.

Examples of device-specific structures include:
CM_FLOPPY_DEVICE_DATA,
CM_KEYBOARD_DEVICE_DATA,
CM_SCSI_DEVICE_DATA,
CM_SERIAL_DEVICE_DATA

Headers

Defined in wdm.h and ntddk.h. Include wdm.h or ntddk.h.

Comments

A CM_PARTIAL_RESOURCE_DESCRIPTOR structure can describe either a raw (bus-relative) resource or a translated (system physical) resource, depending on the routine or IRP with which it is being used (see See Also).

See Also

CM_RESOURCE_LIST,
CM_FULL_RESOURCE_DESCRIPTOR,
CM_PARTIAL_RESOURCE_LIST,
CM_FLOPPY_DEVICE_DATA,
CM_KEYBOARD_DEVICE_DATA,
CM_SCSI_DEVICE_DATA,
CM_SERIAL_DEVICE_DATA,
IoConnectInterrupt,
IoGetDeviceProperty,
IoReportResourceForDetection,
IO_RESOURCE_DESCRIPTOR,
IRP_MN_START_DEVICE