RE: Crash upon WdfDmaTransactionInitializeUsingRequest called from IOCTL handler

Do you have a debugger attached? If so can you post the crash details (call stack, bug check values)? If not, attach one and then re-read this message :slight_smile:

-p

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Zvi Vered
Sent: Wednesday, November 09, 2011 12:11 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Crash upon WdfDmaTransactionInitializeUsingRequest called from IOCTL handler

Hello,

I want to initiate a DMA from FPGA to RAM upon IOCTL request.
So as I was advised here I sent an IOCTL request with the following code:

#define DMA_IOCTL CODE CTL_CODE( FILE_DEVICE_UNKNOWN, 0x901,
METHOD_OUT_DIRECT , FILE_ANY_ACCESS )

int Size = 16*1024*1024; //16MB
VOID *VirtualAddress = VirtualAlloc (0,Size,MEM_COMMIT,0); DeviceIoControl (hDevice,DMA_IOCTL CODE,NULL,0, VirtualAddress, Size,&BytesReturned,NULL);

On the kernel side, I called to:

status = WdfRequestRetrieveOutputWdmMdl (Request,&Mdl).
Mdl has a valid value and status = 0.

KernelVirtualAddress = (PUCHAR) MmGetMdlVirtualAddress(Mdl); KernelVirtualAddress has the same value like VirtualAddress returned from VirtualAlloc

Then I called to:
WdfDmaTransactionInitializeUsingRequest (devExt->ReadDmaTransaction,

Request,

PLxEvtProgramReadDma,

WdfDmaDirectionReadFromDevice)

The value of devExt->ReadDmaTransaction is set exactly as in the sample code in “Plx9x5x\sys\Read.c”

PLxEvtProgramReadDma is also taken from “Plx9x5x\sys\Read.c” and currently does nothing.

What can cause the crash ?

Should I use WdfDmaTransactionInitialize instead ?

Thanks,
Zvika.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Dear Mr. Wieland,

My mistake.

After calling to WdfDmaTransactionInitializeUsingRequest I called to: WdfRequestCompleteWithInformation (Request, STATUS_SUCCESS, bytesReturned).

When I called to WdfRequestCompleteWithInformation from the context of PlxEvtProgramReadDma, it worked fine.

Thank you for your help.