DeviceIoControl Lost

I have an IOCTl on my device to do DMA and it works great until I hit some sort of threshold. I haven’t determined the exact value but know that when I attempt a transfer of size count = 0x1000000 my driver never enters the EvtIoDeviceControl(…) function.

DeviceIoControl( hDevice,
IOCTL_WRITE_DMA,
&input[0],
(3*sizeof(ULONG)),
buf, // Pointer to the large buffer
(count*sizeof(ULONG)), // This is 0x1000000*4
&bytesReturned,
&ol );

Since this is a blocking call my application sits here waiting but the driver trace messages never show up indicating it even entered EvtIoDeviceControl(…). Smaller transfers act as expected an print in traceview as well as complete successfully. I’m not sure if I should focus n the application or driver. It seems to be stuck in limbo.

Ideas?

Is your queue that processes IOCTLs a sequential or parallel queue? When you get to this point where it is lost, what does !wdfkd.wdfdevicequeues say about the pending and active requests in your queue(s)?

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Tuesday, November 6, 2012 12:21 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] DeviceIoControl Lost

I have an IOCTl on my device to do DMA and it works great until I hit some sort of threshold. I haven’t determined the exact value but know that when I attempt a transfer of size count = 0x1000000 my driver never enters the EvtIoDeviceControl(…) function.

DeviceIoControl( hDevice,
IOCTL_WRITE_DMA,
&input[0],
(3*sizeof(ULONG)),
buf, // Pointer to the large buffer
(count*sizeof(ULONG)), // This is 0x1000000*4
&bytesReturned,
&ol );

Since this is a blocking call my application sits here waiting but the driver trace messages never show up indicating it even entered EvtIoDeviceControl(…). Smaller transfers act as expected an print in traceview as well as complete successfully. I’m not sure if I should focus n the application or driver. It seems to be stuck in limbo.

Ideas?


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

This is 64MB. You may be hitting some quote for amount of locked pages per process. Does DeviceIoControl hang in there or returns LastError of ERROR_IO_PENDING or any other error?

It was a matter of handling the return value incorrectly. It wasn’t ERROR_IO_PENDING as expected. After including the error check before getoverlappedresult it turn out the system is lacking the resources needed to handle the transaction.

ERROR_NO_SYSTEM_RESOURCES
1450 (0x5AA)
Insufficient system resources exist to complete the requested service.

Thanks for the help

Idea. The system validates your buffer before entering the driver,
if the validation fails, you won’t see the call in the driver.
– pa

On 06-Nov-2012 22:21, xxxxx@gmail.com wrote:

I have an IOCTl on my device to do DMA and it works great until I hit some sort of threshold. I haven’t determined the exact value but know that when I attempt a transfer of size count = 0x1000000 my driver never enters the EvtIoDeviceControl(…) function.

DeviceIoControl( hDevice,
IOCTL_WRITE_DMA,
&input[0],
(3*sizeof(ULONG)),
buf, // Pointer to the large buffer
(count*sizeof(ULONG)), // This is 0x1000000*4
&bytesReturned,
&ol );

Since this is a blocking call my application sits here waiting but the driver trace messages never show up indicating it even entered EvtIoDeviceControl(…). Smaller transfers act as expected an print in traceview as well as complete successfully. I’m not sure if I should focus n the application or driver. It seems to be stuck in limbo.

Ideas?

Also, in pre-Vista, you can only have 32MB in a single I/O.

xxxxx@gmail.com wrote:

I have an IOCTl on my device to do DMA and it works great until I hit some sort of threshold. I haven’t determined the exact value but know that when I attempt a transfer of size count = 0x1000000 my driver never enters the EvtIoDeviceControl(…) function.

DeviceIoControl( hDevice,
IOCTL_WRITE_DMA,
&input[0],
(3*sizeof(ULONG)),
buf, // Pointer to the large buffer
(count*sizeof(ULONG)), // This is 0x1000000*4
&bytesReturned,
&ol );

Which operating system is this? I assume this is a METHOD_OUT_DIRECT
ioctl, which means the system has to create an MDL for your buffer.
There used to be a limit of 64MB on a single MDL, and that’s what you
have here.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.