diff --git a/reactos/drivers/bus/acpi/ospm/fdo.c b/reactos/drivers/bus/acpi/ospm/fdo.c index 7725f6a84aa..5d75e0f4808 100644 --- a/reactos/drivers/bus/acpi/ospm/fdo.c +++ b/reactos/drivers/bus/acpi/ospm/fdo.c @@ -209,7 +209,7 @@ AcpiCreateResourceList(PCM_RESOURCE_LIST* pResourceList, break; } } - resource = (RESOURCE *) ((NATIVE_UINT) resource + (NATIVE_UINT) resource->length); + resource = NEXT_RESOURCE(resource); } /* Allocate memory */ @@ -350,7 +350,7 @@ AcpiCreateResourceList(PCM_RESOURCE_LIST* pResourceList, break; } } - resource = (RESOURCE *) ((NATIVE_UINT) resource + (NATIVE_UINT) resource->length); + resource = NEXT_RESOURCE(resource); } acpi_rs_dump_resource_list(resource); diff --git a/reactos/drivers/bus/pci/fdo.c b/reactos/drivers/bus/pci/fdo.c index f0bc9d6cc68..7752bc43e87 100644 --- a/reactos/drivers/bus/pci/fdo.c +++ b/reactos/drivers/bus/pci/fdo.c @@ -368,16 +368,6 @@ FdoStartDevice( DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; AllocatedResources = IoGetCurrentIrpStackLocation(Irp)->Parameters.StartDevice.AllocatedResources; - /* HACK due to a bug in ACPI driver, which doesn't report the bus number */ - if (!FoundBuggyAllocatedResourcesList && - (!AllocatedResources || AllocatedResources->Count == 0)) - { - FoundBuggyAllocatedResourcesList = TRUE; - DPRINT1("No bus number resource found (bug in acpi.sys?), assuming bus number #0\n"); - DeviceExtension->BusNumber = 0; - goto next; - } - /* END HACK */ if (!AllocatedResources) { DPRINT("No allocated resources sent to driver\n"); @@ -412,6 +402,15 @@ FdoStartDevice( DPRINT1("Unknown resource descriptor type 0x%x\n", ResourceDescriptor->Type); } } + /* HACK due to a bug in ACPI driver, which doesn't report the bus number */ + if (!FoundBuggyAllocatedResourcesList && !FoundBusNumber) + { + FoundBuggyAllocatedResourcesList = TRUE; + DPRINT1("No bus number resource found (bug in acpi.sys?), assuming bus number #0\n"); + DeviceExtension->BusNumber = 0; + goto next; + } + /* END HACK */ if (!FoundBusNumber) { DPRINT("Some required resources were not found in allocated resources list\n");