禁用和启用接口时不会调用微型端口驱动程序的InitializeHandler
我正在为基于 USB 的硬件编写 Ndis 6 微型端口 802.11 驱动程序。该设备工作正常 - 当我安装驱动程序时,它工作正常。但是,如果我从控制面板禁用然后启用接口,则不会调用initializeHandler。残疾人工作得很好。当我启用该接口时,驱动程序条目也会返回成功。
有人可以帮我吗?原因是什么?
问候, 苏维克
I am writing a Ndis 6 miniport 802.11 driver for a usb based hardware. The device is working properly - in face when I install the driver it works fine. But if I disable and then enable interface from control panel the initializeHandler is not beeing invoked. Disabled is working perfectly fine. When I enable the interface the driver entry also returns success.
Can anybody please help me out? What would be the reason for it?
Regards,
Souvik
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通常这意味着之前的
DEVICE_OBJECT
尚未完全删除。它的名称仍在使用中,因此新的DEVICE_OBJECT
无法使用该名称注册新设备。如果设备有打开的句柄,则之前的设备可能会卡住。如果您有任何打开设备句柄的代码,您应该确保它们被关闭。还要确保您已释放微型端口分配的所有对象。例如,将对
NdisAllocateTimerObject
的调用与对NdisFreeTimerObject
的调用相匹配。确保您的MiniportHaltEx
处理程序正在被调用并且返回。另外,如果您连接了内核调试器,则可以使用
!ndiskd.miniport
检查情况。它会告诉您以前的微型端口是否仍然存在,如果存在,它处于什么状态。Usually this means that the previous
DEVICE_OBJECT
has not been fully deleted yet. Its name is still in-use, so the newDEVICE_OBJECT
cannot register a new device with that name.The previous device might get stuck if there are open handles to the device. If you have any code that opens device handles, you should make sure that they get closed. Also make sure that you've free'd all the objects that your miniport allocates. E.g., match calls to
NdisAllocateTimerObject
with calls toNdisFreeTimerObject
. Make sure that yourMiniportHaltEx
handler is being called and it returns.Also, if you have a kernel debugger attached, you can inspect the situation with
!ndiskd.miniport
. It will tell you if the previous miniport is still present, and if so, what state it is in.