Copyright© 1999 by Walter Oney
PUBLISHED BY
微软出版社
微软公司的子公司
One Microsoft Way Redmond, Washington 98052-6399
版权 沃尔特 oney 1999 所有版权保留.
没有出版者的书面许可这本书的内容的任何部份不可以复制或传播不论何种形式的或无论如何。
Library of Congress Cataloging-in-Publication Data Oney, Walter.
Programming the Microsoft Windows Driver Model p. cm. Includes index.
ISBN 0-7356-0588-2
1. Microsoft Windows NT device drivers (Computer programs)
2. Computer programming. I. Title QA76.76.D49O54 1999 005.7'126--dc21 99-33878 CIP
印刷和装订于美国。
1 2 3 4 5 6 7 8 9 QMQM 4 3 2 1 0 9
发行在加拿大 by 企鹅书业加拿大股份有限公司
此书的 CIP 目录分类档案生效在英国图书馆。
Microsoft Press books are available through booksellers and distributors worldwide. For further information about international editions,
contact your local Microsoft Corporation office or contact Microsoft Press International directly at fax (425) 936-7329. Visit our Web site
at mspress.microsoft.com. Intel is a registered trademark of Intel Corporation. Microsoft, Microsoft Press, MSDN, Visual C++, Visual
Studio, Win32, Windows, and Windows NT are either registered trademarks or trademarks of Microsoft Corporation in the United States
and/or other countries. Other product and company names mentioned herein may be the trademarks of their respective owners. The
example companies, organizations, products, people, and events depicted herein are fictitious. No association with any real company,
organization, product, person, or event is intended or should be inferred.
采集编辑: Ben Ryan
项目编辑: Devon Musgrave
技术编辑: Robert Lyon
献给
我的父母亲,他们给了我生命并教会我做一切。
前言
Windows Driver Model(WDM)的根源可追溯到几年前一种叫做 Windows for Workgroups 3.10 的操作系统。那时候我们努力
地支持无数不同的 SCSI 控制器,我长期地注意 WindowsNT 开发组创建的小端口驱动程序类型。不久就认识到重新构造必要的映象
加载器(image loader)和小端口驱动程序需要的执行环境比把这些小端口驱动程序重写成某些 VXD形式的驱动程序并调试完毕所花
费的努力要少得多。
不幸的是,Windows from Workgroups 3.10已经停止发行带有 SCSI小端口支持的版本,主要是由于象 ASPI(高级 SCSI编程接口)
这样的外围问题。然而,跨 Windows 和 windows NT 操作系统共享同样的驱动程序执行映象的基础是适当的并且可以在 win95 中
见到,它(win95)可以与 NT 共享 SCSI 和 NDIS 小端口驱动程序二进制代码。
共享驱动程序模式的潜在意义是重大的。驱动程序开发人员感兴趣的是支持双平台,共享驱动模式能降低开发和调试的一半开消。对
微软来说,共享模式意味着更容易地从 win9x 迁移到 Windows2000 或这个平台的未来版本。对最终用户来说,大量不同种类的稳
定驱动程序可以在这个家族中的所有成员之间通用。
下一个(逻辑)步骤是
The next logical step, then, was to create a driver model with the ability to share general purpose drivers across both platforms. But what
form should it take? Three requirements were immediately obvious: it must be multiprocessor-capable, it must be processor-independent,
and it must support Plug and Play (PnP). Fortunately, the Windows NT 4.0 driver model met the first two requirements, and it seemed
clear that the next major release of Windows NT would support PnP as well. As a result, WDM can be considered a proper subset of what
is now the Windows NT driver model.
The potential benefits of a shared driver model can be realized today for many classes of devices, and choosing the WDM driver model will
continue to pay dividends in the future. For example, a correctly written WDM driver requires only a recompile before functioning in an NT
64-bit environment prototype.
WDM will continue to evolve as new platforms and device classes are supported. Future versions of Windows 9x and Windows 2000 will
contain upwardly revised WDM execution environments. Fortunately, WDM is designed to be "backward compatible," meaning that WDM
drivers written according to the Windows 2000 DDK and designed to work for the intended environment will continue to work in a
subsequent WDM environments.
There is a lot to WDM, and in this book Walter does an excellent job in offering an in-depth tour of every aspect as well as the philosophy
of the Windows Driver Model.
Forrest Foltz
微软公司 Windows 开发体系结构设计者
致谢
我感谢所有帮助我完成此书的人们. Devon Musgrave, Robert Lyon, 和其余为把此书从原始的 winword 手稿转换成在你手中的
精美作品而服务的微软出版社工作人员。我清楚为了这个项目采编 Ben Ryan 花费无数小时并飞行数千英里寻找好的作者和有用的新
书,祝他下次好运。 微软的 Sandy Spinrad,在百忙之中还有力地协助查找技术资料,作硬件测试,更新版本,和我所依赖的其它许多
资料。许多 windows98 和 windows2000 基本开发组成员审阅了这些材料,值得个别提起,他们要求匿名,但至少我知道他们是
谁。我们研究会的学者和网上团体在大大小小的各个方面给予帮助,提出深刻的问题和共享难得的洞察力。 最后,我要感谢我的妻子
Marty, 她总是在我工作最困难时在我身边。
Walter Oney
http://www.oneysoft.com
驱动开发网的全体翻译人员也要感谢网上为我们提供工具和协助翻译的人们。znsoft 要感谢他的女友每天打电话问候他。