NTSTATUS
SoundReportResourceUsage(
IN PDEVICE_OBJECT DeviceObject,
IN INTERFACE_TYPE BusType,
IN ULONG BusNumber,
IN PULONG InterruptNumber OPTIONAL,
IN KINTERRUPT_MODE InterruptMode,
IN BOOLEAN InterruptShareDisposition,
IN PULONG DmaChannel OPTIONAL,
IN PULONG FirstIoPort OPTIONAL,
IN ULONG IoPortLength
);
The SoundReportResourceUsage function reserves hardware resources for use by the specified device or driver. This function does not allow reservation of resources already reserved for another device or driver.
Parameters
DeviceObject
Pointer to either a DEVICE_OBJECT or DRIVER_OBJECT structure. Represents the device or driver for which resources will be reserved.
BusType
Type of bus the device is on. INTERFACE_TYPE is defined in ntddk.h.
BusNumber
Number of the bus the device is on.
InterruptNumber
Pointer to the interrupt number, or NULL if no interrupt.
InterruptMode
Interrupt mode (Latched or LevelSensitive). Ignored if InterruptNumber is NULL. KINTERRUPT_MODE is defined in ntddk.h.
InterruptShareDisposition
TRUE if interrupt can be shared, FALSE otherwise. Ignored if InterruptNumber is NULL.
DmaChannel
Pointer to the device's DMA channel, or NULL if there is no DMA channel.
FirstIoPort
Pointer to the device's first I/O port address, or NULL if there are no I/O ports.
IoPortLength
Number of bytes of I/O space the device uses, starting at FirstIoPort. Ignored if FirstIoPort is NULL.
Return Value
Returns one of the following values.
Value | Definition |
STATUS_SUCCESS | Success. |
STATUS_DEVICE_CONFIGURATION_ERROR | Resources already assigned. |
STATUS_INSUFFICIENT_RESOURCES | Resources unavailable. |
Comments
Before attempting to access device hardware, call SoundReportResourceUsage to ensure the resources you intend to use are not already assigned to another device.
You can associate resources with either the driver object or with one of the device objects created by SoundCreateDevice. If the driver supports multiple cards, you must associate resources with device objects.
Each time you call SoundReportResourceUsage for a particular device object or driver object, you override the resource reservation made with any previous call for the same object.
Typically, a driver acquires resources for each device in turn, and then calls SoundReportResourceUsage a final time to declare (to the rest of the system) all the resources used by the card instance.
To free reserved resources, call SoundFreeDevice.