将驱动程序从 XP 升级到 W7
我有一个定制 PCI 卡的驱动程序,它可以在 XP 上构建并运行良好。我正在尝试在 W7 上使用此自定义硬件,并尝试构建并运行我的驱动程序。
我从 Microsoft 获得了最新的 DDK,并使用 Windows XP“x86 免费构建环境”构建了 XP 驱动程序。一切都已安装&工作正常。 (使用 DDK“build”命令进行构建)
如果我使用 Windows 7“x86 Free Build Environment”构建环境,则一切都会正常构建。我通过 PREfast 和 staticdv 代码检查器运行它,没有任何错误。 (我收到一些关于“调度函数‘FooFnc’没有任何 __drv_dispatchType 注释”的警告 - 这些可能是问题吗?)
当我安装时,安装开始正常(有关驱动程序未签名的标准错误),但到达某个点后挂起,然后因超时错误而失败。然后,该设备将在设备管理器中显示为已安装。此时,电脑不会关闭或启动,而是无限期挂起。我被迫启动进入安全模式并从那里卸载驱动程序。
所以我的问题是:
如果 XP 和 W7 之间的驱动程序模型发生了变化,找到它的最佳方法是什么?我在 MSDN 上看不到任何内容。
我该如何调试驱动程序?该盒子没有启动,所以我无法运行 WinDBG。
有任何隐藏的特定 W7 驱动程序陷阱吗?
我试图尽可能保持通用,但如果更多细节有帮助,我会提供更多
I've got a driver for a custom PCI card, which builds and runs fine on XP. I'm trying to use this custom hardware on W7, and am trying to build and run my driver.
I've got the latest DDK from Microsoft, and build my driver for XP using Windows XP "x86 Free Build Environment". Everything installs & works fine. (Build using a DDK "build" command)
If I use the Windows 7 "x86 Free Build Environment" build environment, everything builds fine. I run it through the PREfast and staticdv code checkers, no errors from either. ( I get a couple of warnings about "The dispatch function 'FooFnc' does not have any __drv_dispatchType annotations" - are these likely to be the issue? )
When I install, the install starts OK (standard error about drivers not being signed), but gets to a certain point and then hangs, then fails with a timeout error. The device then shows up in device manager as installed. At this point the PC won't shutdown or boot, but hangs indefinitely. I'm forced to boot into Safe Mode and uninstall the driver from there.
So my question(s) are:
If there has been a change in the driver model between XP and W7, what's the best way to find it? I can't see anything on MSDN.
How would I go about debugging the driver? The box doesn't start, so it's not like I can run up WinDBG.
Any specific W7 driver gotchas that are hidden away?
I've tried to keep this as generic as possible, but if more detail would be helpful I'll provide more
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
AFAIK,最大的变化是视频和网络驱动程序。其他驱动程序保留向后兼容性,无需重新编译即可在 W7 上运行。
在驱动程序验证程序下运行您的驱动程序并打开使用键盘生成故障转储(在系统挂起时非常有用,您可以手动生成crashdump,分析它并找出问题所在)。
希望这有帮助!
AFAIK, the biggest changes have been made in video and network drivers. Other drivers retain backward compatibility and can be run on W7 even with no recompiling.
Run your driver under driver verifier and turn on generating crash dumps with a keyboard (very helpful in case of system hangs, you can manually generate crashdump, analyze it and find what was wrong).
Hope this helps!