Windows 2000驱动程序的设计
---- 本文介绍了Windows 2000 WDM驱动程序结构及其编写的注意事项,最后给出了一
个简单的WDM驱动程序及客户端程序的原码(Zip,24KB),希望能对大家有所帮助。
---- 1. 简介:
---- Windows 2000原名Windows NT 5.0是继Windows NT 4.0的新一代操作系统,它不
但继承了Windows NT 4.0的种种优点,而且在技术上又有了许多的突破,其中一项就是
对驱动程序结构的变化,即引入了全新的WDM (Win32 Driver Model)的驱动程序构架。
说是新技术,其实早在1997年Microsoft就提出了该项技术并在Windows 98中得到了充
分的应用,换句话说,Windows 98也支持WDM。这样WDM就成为了一个跨平台的驱动程序
模型,不仅如此WDM驱动程序还可以在不修改源代码的情况下经过重新编译后在非Intel
平台上运行,可以不夸张的讲WDM算得上是21世纪的驱动程序构架。
设备缺少驱动程序 当针对一个设备的设备驱动程序不可用的时候,设备管理器显示设
备是未知的,并且把它放置在Other devices文件夹中。这对于Universal Serial Bus
(USB) 和 Institute of Electrical and Electronics Engineering (IEEE) 1394
composite devices是非常普遍的。同样,当你查看设备管理器中的设备属性时,一个
"Error Code 1" 或者"Error Code 10"状态可以被显示。
点击 Start,用鼠标指向 Settings,然后点击 Control Panel。
双击 System,然后点击Hardware标签。
点击 Driver Signing,然后点击Block - Prevent installation of unsigned files
点击 OK, 然后点击 OK
为了查看一系列的载入的没有被数字标记得设备,我们可以使用现面两个方法中的任意
一个:
查看Setupapi.log文件的一些条目,与下面的条目相似: The file
(D:\WINNT\inf\ntapm.inf) is not digitally signed, ignoring driver date.
Installing section epatapi_inst from d:\documents and settings\user name\my
documents\parallel port test drivers\epatapnt.inf An unsigned or incorrectly
signed driver (d:\documents and settings\user name\my documents\parallel
port test drivers\epatapnt.inf) was installed for Parallel ATAPI Adapter..
Error 0xe000022f: The third-party INF does not contain digital signature
information. Copying file d:\documents and settings\user name\my
documents\parallel port test drivers\epatapnt.mpd to
D:\WINNT\System32\DRIVERS\epatapnt.mpd. An unsigned or incorrectly signed
driver (d:\documents and settings\user name\my documents\parallel port test
drivers\epatapnt.mpd) was installed for Parallel ATAPI Adapter.. Error
0xe000022f: The third-party INF does not contain digital signature
information. where user name is a user name. user name处是一个用户名。
使用Sigverif.exe工具,它允许你创建一个列出未被标记并且已经安装到你的基于
Windows 2000计算机上的驱动程序登录文件。由Sigverif.exe工具创建的Sigverif.txt
登录文件被定位于你的基于Windows 2000计算机上的%SystemRoot%文件夹中,并且可以
通过一个文本编辑器(例如记事本)来查看。为了运行Sigverif.exe工具,请按下面操
作:
点击 Start,点击 Run,键入sigverif,然后单击 OK。
点击 Advanced,然后在 Search标签下点击 Look for other files that are not
digitally signed。
点击选择 Include subfolders查询框,然后点击 Browse。
定位然后点击%SystemRoot%\System32\Drivers 文件夹,点击OK,然后点击 Start