Windows KMDF USB设备驱动程序:Read API挂起ReadCompletion例程永不调用 [英] Windows KMDF USB device Driver : Read API hangs ReadCompletion Routine Never gets called

查看:180
本文介绍了Windows KMDF USB设备驱动程序:Read API挂起ReadCompletion例程永不调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在根据USBSAMP示例编写KMDF USB驱动程序.

固件场景:
*.固件将按自己的意愿写入终点.例如,如果用户在设备上按下了静音按钮,则我的UI应用程序应该获取/读取这些消息并显示在GUI上.

*.我的应用程序只有一个线程用于读写另一个线程.

问题
*.从应用程序到设备的写操作都很好.
*.但是我的读取API挂起,因为我没有要从设备读取的数据.(设备将根据自己的意愿进行写入(基于某些处理)

代码
1 .ReadAPI readfile的调用,在我注册的read Callback事件中触发一个断点,该事件是

WDF_IO_QUEUE_CONFIG_INIT_DEFAULT_QUEUE(&ioQueueConfig,
WdfIoQueueDispatchParallel);
ioQueueConfig.EvtIoRead = UsbSamp_EvtIoRead;

2. Read Event调用具有正确I/0目标的WdfRequestSend,但从未调用其对应的寄存器完成例程,因为这次没有任何内容可读取...

3.我该如何解决这个问题...
4. IS KMDF连续阅读器是对此的解决方案.如果是,请指导我.

Hello ALL,

I am writing a KMDF USB driver based upon the USBSAMP sample.

Firmware Scenarior:
*. Firmware will write to end point at its own wish. For example user has press mute button on device if so then my UI application should get/read those message and display on GUI.

*. My application is having one single thread for read and write one below other.

Problem
*. Writing is works fine from application to device.
*. But my Read API got hangs since i dont have data to read from the device.(As Device will write at its own wish (based upon some processing)

Code
1 .Call of ReadAPI readfile , triggers a break point in my registerd read Callback event that is

WDF_IO_QUEUE_CONFIG_INIT_DEFAULT_QUEUE(&ioQueueConfig,
WdfIoQueueDispatchParallel);
ioQueueConfig.EvtIoRead = UsbSamp_EvtIoRead;

2. Read Event calls the WdfRequestSend with correct I/0 target but its corrosponds register completion routin is never getting called as this time there is nothing to read...

3. How do i solve this problem ...
4. IS KMDF Continous Reader a solution to this. If yes please guide me on the same.

推荐答案

如果它挂了,请提供崩溃转储分析(使用windbg或类似的工具),以便我们对到底发生了什么
if it is hanging provide a crash dump analysis (using windbg or a similar tool) so we can get an idea on whats happening exactly


这篇关于Windows KMDF USB设备驱动程序:Read API挂起ReadCompletion例程永不调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆