HalAssignSlotResources
NTSTATUS
HalAssignSlotResources(
IN PUNICODE_STRING RegistryPath,
IN PUNICODE_STRING DriverClassName, /*
optional */
IN PDRIVER_OBJECT DriverObject,
IN PDEVICE_OBJECT DeviceObject, /*
optional */
IN INTERFACE_TYPE BusType,
IN ULONG BusNumber,
IN ULONG SlotNumber,
IN OUT PCM_RESOURCE_LIST *AllocatedResources
);
For drivers of devices connected to dynamically configurable I/O buses of a
type with a published standard interface, HalAssignSlotResources
determines the resource requirements of the target device, calls IoAssignResources
to allocate them, sets the target device with its assigned resources, and
returns the assignments to the caller.
Parameters
-
RegistryPath
-
Is the RegistryPath pointer passed in to the DriverEntry routine during
initialization if the DeviceObject pointer is NULL. The buffered
Unicode string is read-only, giving access to the driver-specific registry key
\Registry\Machine\System\CurrentControlSet\Services\DriverName
with its \Parameters subkey(s). The caller is responsible for creating
and updating the RegistryPath string if it calls this routine to claim
one or more sets of device-specific resources for the device(s) on a
multifunction adapter at the given SlotNumber.
-
DriverClassName
-
Points to a Unicode string that describes the class of driver under which
driver-specific information should be stored in the registry. A default type
of Other is used if none is given, and a new key is created in the
registry if a unique name is supplied. If this pointer is nonNULL, the caller
is claiming a set of resources it uses in common for the device(s) at the
given SlotNumber.
-
DriverObject
-
Points to the driver object that was input to the DriverEntry routine.
-
DeviceObject
-
Points to the driver-created device object representing the physical device
for which the driver is attempting to claim device-specific resources. If this
pointer is nonNULL, the caller usually supports more than one device on a
multifunction adapter at the given SlotNumber. For each nonNULL DeviceObject,
such a driver’s calls to this routine must write resource data into the
registry under a unique, device-specific subkey of the RegistryPath
pointer that was input to the DriverEntry routine.
-
BusType
-
Specifies the type of bus on which the device is connected. Currently, this
value can be the following: PCIBus. However, additional types of
dynamically configurable buses will be supported in future versions of Windows
NT. The upper bound on the interface types supported is always MaximumInterfaceType.
-
BusNumber
-
Specifies the zero-based and system-assigned number of the bus.
-
SlotNumber
-
Specifies the logical slot number at which the driver found its device(s) when
it called HalGetBusData.
-
*AllocatedResources
-
Specifies a pointer to an uninitialized pointer. If the call is successful, HalAssignSlotResources
allocates a buffer, fills in the assigned resource list, and resets the
embedded pointer to the start of the CM_RESOURCE_LIST buffer.
Return Value
HalAssignSlotResources returns STATUS_SUCCESS if a set of resources was
claimed for the caller under the registry \ResourceMap key.
Comments
A driver cannot call this routine unless its device(s) are connected to a
dynamically configurable I/O bus of a type that has a defined, publically
documented, industry-standard interface. Drivers of devices that do not meet
this condition can call IoAssignResources or IoReportResourceUsage
instead.
The driver should save pertinent values from the AllocatedResources
list so it can pass the appropriate values in calls to other configuration
routines, such as HalGetInterrupt and HalGetAdapter. The caller
is responsible for releasing the AllocatedResources buffer with ExFreePool.
Callers of HalAssignSlotResources must be running at IRQL
PASSIVE_LEVEL.
See Also
CM_RESOURCE_LIST, ExFreePool,
HalGetBusData, IoAssignResources