00404 :
00405
00406 This routine takes an input request of RequestedResources, and returned
00407 allocated resources in pAllocatedResources. The allocated resources are
00408 automatically recorded in
the registry under
the ResourceMap
for the
00409 DriverClassName/DriverObject/DeviceObject requestor.
00410
00411 Arguments:
00412
00413 RegistryPath
00414 For a simple driver,
this would be
the value passed to
the drivers
00415 initialization function. For drivers call
IoAssignResources with
00416 multiple DeviceObjects are responsible
for passing in a unique
00417 RegistryPath
for each object.
00418
00419 The registry
path is checked
for:
00420 RegitryPath:
00421 AssignedSystemResources.
00422
00423 AssignSystemResources
is of
type REG_RESOURCE_REQUIREMENTS_LIST
00424
00425 If present,
IoAssignResources will attempt to use these settings to
00426 satisify
the requested resources. If
the listed settings
do
00427 not conform to
the resource requirements, then
IoAssignResources
00428 will fail.
00429
00430 Note:
IoAssignResources may store other internal binary information
00431 in
the supplied RegisteryPath.
00432
00433 DriverObject:
00434 The driver object of
the caller.
00435
00436 DeviceObject:
00437 If non-null, then requested resoruce list refers to
this device.
00438 If null,
the requested resource list refers to
the driver.
00439
00440 DriverClassName
00441 Used to partition allocated resources into different device classes.
00442
00443 RequestedResources
00444
A list of resources to allocate.
00445
00446 Allocated resources may be appended or freed by re-invoking
00447
IoAssignResources with
the same RegistryPath, DriverObject and
00448 DeviceObject. (editing requirements on a resource list by
using
00449 sucessive calls
is not preferred driver behaviour).
00450
00451 AllocatedResources
00452 Returns
the allocated resources
for the requested resource list.
00453
00454 Note that
the driver
is responsible
for passing in a pointer to
00455 an uninitialized pointer.
IoAssignResources will initialize
the
00456 pointer to point to
the allocated CM_RESOURCE_LIST. The driver
00457
is responisble
for returning
the memory back to
pool when
it is
00458 done with them structure.
00459
00460 Return Value:
00461
00462 The status returned
is the final completion status of
the operation.
00463
00464 --*/
00465 {
00466
if (DeviceObject) {
00467
00468
if ( DeviceObject->DeviceObjectExtension->DeviceNode &&
00469 !(((
PDEVICE_NODE)DeviceObject->DeviceObjectExtension->DeviceNode)->Flags &
DNF_LEGACY_RESOURCE_DEVICENODE)) {
00470
00471
KeBugCheckEx(PNP_DETECTED_FATAL_ERROR, PNP_ERR_INVALID_PDO, (ULONG_PTR)DeviceObject, 0, 0);
00472
00473 }
00474
00475 }
00476
00477
if (RequestedResources) {
00478
00479
if (RequestedResources->AlternativeLists == 0 ||
00480 RequestedResources->List[0].Count == 0) {
00481
00482 RequestedResources =
NULL;
00483
00484 }
00485 }
00486
00487
if (pAllocatedResources) {
00488
00489 *pAllocatedResources =
NULL;
00490
00491 }
00492
00493
return IopLegacyResourceAllocation ( ArbiterRequestLegacyAssigned,
00494 DriverObject,
00495 DeviceObject,
00496 RequestedResources,
00497 pAllocatedResources);
00498 }
#if 0