
A01T623743.fm Page 1 Thursday, March 22, 2007 9:58 AM Developing Drivers with the Windows® Driver Foundation Penny Orwick Guy Smith PUBLISHED BY Microsoft Press A Division of Microsoft Corporation One Microsoft Way Redmond, Washington 98052-6399 Copyright © 2007 by Microsoft Corporation All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the publisher. Library of Congress Control Number: 2007922586 Printed and bound in the United States of America. 1 2 3 4 5 6 7 8 9 QWT 2 1 0 9 8 7 Distributed in Canada by H.B. Fenn and Company Ltd. A CIP catalogue record for this book is available from the British Library. Microsoft Press books are available through booksellers and distributors worldwide. For further infor- mation 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 www.microsoft.com/mspress. Send comments to [email protected]. Microsoft, Microsoft Press, Excel, Internet Explorer, MSDN, MS-DOS, Outlook, SideShow, Visual Studio, Win32, Windows, Windows Media, Windows NT, Windows Server, Windows Vista, Xbox, and Xbox 360 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, domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious. No association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred. 7KLVERRNH[SUHVVHVWKHDXWKRU¶VYLHZVDQGRSLQLRQV7KHLQIRUPDWLRQFRQWDLQHGLQWKLVERRNLVSURYLGHG without any express, statutory, or implied warranties. Neither the authors, Microsoft Corporation, nor its resellers, or distributors will be held liable for any damages caused or alleged to be caused either directly or indirectly by this book. Acquisitions Editor: Ben Ryan Developmental Editor: Devon Musgrave Project Editor: Denise Bankaitis Body Part No. X13-62472 A03C623743.fm Page iii Wednesday, March 21, 2007 7:56 PM Contents at a Glance Part 1 Getting Started with WDF 1 Introduction to WDF . 3 2 Windows Driver Fundamentals. 23 3 WDF Fundamentals. 51 Part 2 Exploring the Frameworks 4 Overview of the Driver Frameworks . 67 5 WDF Object Model . 91 6 Driver Structure and Initialization . 129 Part 3 Applying WDF Fundamentals 7 Plug and Play and Power Management . 165 8 I/O Flow and Dispatching . 223 9 I/O Targets . 307 10 Synchronization. 379 11 Driver Tracing and Diagnosability . 411 12 WDF Support Objects. 441 13 UMDF Driver Template. 475 Part 4 Additional Topics for KMDF Drivers 14 Beyond the Frameworks . 497 15 Scheduling, Thread Context, and IRQL . 507 16 Hardware Resources and Interrupts . 529 17 Direct Memory Access . 549 18 An Introduction to COM . 583 iii A03C623743.fm Page iv Wednesday, March 21, 2007 7:56 PM iv Table of Contents Part 5 Building, Installing, and Testing a WDF Driver 19 How to Build WDF Drivers. 617 20 How to Install WDF Drivers . 635 21 Tools for Testing WDF Drivers. 667 22 How to Debug WDF Drivers . 697 23 PREfast for Drivers . 731 24 Static Driver Verifier . 823 A04T623743.fm Page v Wednesday, March 21, 2007 7:58 PM Table of Contents Foreword. xxiii Acknowledgments . xxvii Part 1 Getting Started with WDF 1 Introduction to WDF . 3 About This Book . 4 Who Should Read This Book . 4 About Part 1: Getting Started with WDF . 5 About Part 2: Exploring the Frameworks. 6 About Part 3: Applying WDF Fundamentals . 6 About Part 4: Digging Deeper: More Topics for WDF Drivers . 8 About Part 5: Building, Installing, and Testing a WDF Driver . 9 Conventions Used in This Book. 10 Getting Started with Driver Development. 11 System Requirements for Driver Development. 12 How to Obtain and Install the WDK. 13 WDK Libraries. 14 WDK Documentation . 14 WDK Tools. 15 WDK Samples. 16 How to Obtain Checked Builds of Windows . 17 How to Obtain Debugging Tools . 18 How to Obtain OSR Learning Devices . 19 Key Information Sources . 20 Key References . 22 What do you think of this book? We want to hear from you! Microsoft is interested in hearing your feedback so we can continually improve our books and learning resources for you. To participate in a brief online survey, please visit: www.microsoft.com/learning/booksurvey/ v A04T623743.fm Page vi Wednesday, March 21, 2007 7:58 PM vi Table of Contents 2 Windows Driver Fundamentals. 23 What Is a Driver?. 24 Core Windows Architecture . 25 Driver Architecture . 27 Kernel Objects and Data Structures . 31 The Windows I/O Model . 31 I/O Requests. 32 How a Device Stack Handles IRPs. 33 Data Buffers and I/O Transfer Types . 34 How to Transfer Data to or from a Device . 35 About Plug and Play and Power Management . 36 Basic Kernel-Mode Programming . 36 Interrupts and IRQLs. 37 Concurrency and Synchronization . 39 Memory . 42 Tips for Programming in Kernel Mode . 44 A Basic Vocabulary . 47 3 WDF Fundamentals . 51 WDF and WDM. 51 What Is WDF? . 52 WDF Object Model. 53 Programming Interface . ..
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages105 Page
-
File Size-