I re-ran my test code with the new INF setting and excitedly waited for something to correctly show up after the first 7F ports. Still got an error 998. Then realized you said I needed to modify my driver. Doh.
I didn't realize that AddDevice was going to receive two sets of ranges. So I'm guessing that I need to keep track of the two sets of base addresses as well.
NTSTATUS
PortIOEvtDevicePrepareHardware(
__in WDFDEVICE Device,
__in WDFCMRESLIST ResourcesRaw,
__in WDFCMRESLIST ResourcesTranslated
{
<snip>
for (i=0; i < WdfCmResourceListGetCount(ResourcesRaw); i++) {
deviceContext[i] -> PortBase = ULongToPtr(descTranslated->u.Port.Start.LowPart);
deviceContext[i] -> PortCount = descTranslated ->u.Port.Length;
}
<snip>
}
So when I'm ready to write to one the two ranges, I use the appropriate PortBase address (translated) and offset accordingly. Right? And it just happened to be the case that with only 1 range, the PortBase address was zero.
-Gene