Hi,
I have to start a DMA scatter/gather transfer from a device to a kernel
mode buffer (allocated in nonpageable pool). I wanted to use
GetScatterGatherList(), but I haven't got any IRP to get the MDL from, so
I tried using IoAllocateMdl() to allocate a custom MDL mapping my buffer.
The code I use is the following:
MDLForDma = IoAllocateMdl((PVOID)(MyBuffer->BufferHead), Length, FALSE,
FALSE, NULL);
if(MDLForDma == NULL)
{
Status = STATUS_INSUFFICIENT_RESOURCES;
return Status;
}
The allocation goes fine, but when I afterwards call GetScatterGatherList
what should I put into CurrentVa parameter?
Peeking inside the MDLForDma that IoAllocateMdl() returns I noticed that
StartVa is 0, and I guess that 0 is not a valid virtual address. Is there
something I'm doing wrong?
Bye
Alex