When I try to obtain I/O memory resources I get back good addresses but the lengths are zero. This card has two banks of memory. When I look at the card’s allocated resources via the device manager they show up as expected with addresses ranges that would indicate that a zero length should not be being returned. I doubt that it’s a device problem. The device works under Linux and a previous version worked under Windows as well. A code fragment follows. Any ideas on what might cause the zero length and/or how to handle it?
Wayne King
PIO_STACK_LOCATION stack;
PCM_PARTIAL_RESOURCE_LIST raw, translated;
PCM_PARTIAL_RESOURCE_DESCRIPTOR resource;
PHYSICAL_ADDRESS membase;
ULONG memsize;
PAGED_CODE ();
pdx = (PDEVICE_EXTENSION) fdo->DeviceExtension;
stack = IoGetCurrentIrpStackLocation (Irp);
raw = &stack->Parameters.StartDevice.
AllocatedResources->List[0].PartialResourceList;
translated = &stack->Parameters.StartDevice.
AllocatedResourcesTranslated->List[0].PartialResourceList;
resource = translated->PartialDescriptors;
for(Idx = 0; Idx < translated->Count; Idx++, resource++)
{
switch(resource->Type)
{
case CmResourceTypeMemory:
membase = resource->u.Memory.Start;
memsize = resource->u.Memory.Length;
KdPrint((LOGNAME “Mem Resource %8.8lX, len %8.8lX\n”, membase, memsize));
break;
}
}