Windows 7 Device Driver (Addison-Wesley Microsoft Technology Series)

Windows 7 Device Driver (Addison-Wesley Microsoft Technology Series)

Language: English

Pages: 384

ISBN: 0321670213

Format: PDF / Kindle (mobi) / ePub


“The chapter on programming a KMDF hardware driver provides a great example for readers to see a driver being made.”

–Patrick Regan, network administrator, Pacific Coast Companies

 

The First Authoritative Guide to Writing Robust, High-Performance Windows 7 Device Drivers

 

Windows 7 Device Driver brings together all the information experienced programmers need to build exceptionally reliable, high-performance Windows 7 drivers. Internationally renowned driver development expert Ronald D. Reeves shows how to make the most of Microsoft’s powerful new tools and models; save time and money; and efficiently deliver stable, robust drivers.

 

Drawing on his unsurpassed experience as both a driver developer and instructor, Reeves demystifies Kernel and User Mode Driver development, Windows Driver Foundation (WDF) architecture, driver debugging, and many other key topics. Throughout, he provides best practices for all facets of the driver development process, illuminating his insights with proven sample code. Learn how to

  • Use WDF to reduce development time, improve system stability, and enhance serviceability
  • Take full advantage of both the User Mode Driver Framework (UMDF) and the Kernel Mode Driver Framework (KMDF)
  • Implement best practices for designing, developing, and debugging both User Mode and Kernel Mode Drivers
  • Manage I/O requests and queues, self-managed I/O, synchronization, locks, plug-and-play, power management, device enumeration, and more
  • Develop UMDF drivers with COM
  • Secure Kernel Mode Drivers with safe defaults, parameter validation, counted UNICODE strings, and safe device naming techniques
  • Program and troubleshoot WMI support in Kernel Mode Drivers
  • Utilize advanced multiple I/O queuing techniques

Whether you’re creating Windows 7 drivers for laboratory equipment, communications hardware, or any other device or technology, this book will help you build production code more quickly and get to market sooner!

Computability and Unsolvability

The Origin of Concurrent Programming: From Semaphores to Remote Procedure Calls

Windows Developer Power Tools: Turbocharge Windows Development with more than 170 free tools

Software Engineering: A Methodical Approach

 

 

 

 

 

 

 

 

 

 

requests through the Win32 API. Win32 API—In response to the application’s I/O request, the Win32 API calls I/O routines in the Windows kernel. 2.10 Windows Kernel The I/O manager in the Windows kernel creates IRPs to represent the requests and presents them to the target driver by calling the driver at a designated entry point. If the target of the request is a User Mode WDF Driver, however, the I/O manager cannot call the driver or the UMDF directly because these components run a user mode

that the object represents, UMDF automatically drops its reference on the object and any child Wow! eBook 3.7 I/O Request Objects 61 objects such as memory buffers. After the driver that was called completes the request, it must not attempt to access the request object or any of its child objects. 3.7.1 Retrieving Buffers from I/O Requests The IWDFMemory interface exposes a memory object, which encapsulates an I/O buffer that is associated with an I/O request. The memory

implements IDriverEntry. IDriverEntry defines three methods: OnDeviceAdd, OnInitialize, and OnDeInitialize. In the Skeleton driver, the OnInitialize and OnDeInitialize methods are stubs. When one of the driver’s devices is added, UMDF calls the OnDevice method, passing as parameters pointers to the IWdfDriver and IWdfDeviceInitialize interfaces, which the framework implements. The Skeleton driver does not support physical hardware, so its OnDeviceAdd method is minimal: HRESULT

144 Chapter 6 Windows 7 KMD Overview and Operations Table 6.4 KMDF Object Types (continued) Object Type Synchronization: wait lock Timer WDFWAITLOCK USB device USB interface USB pipe Windows Management Instrumentation (WMI) instance WMI provider Work item Description Represents a wait lock, which synchronizes access to data at PASSIVE_LEVEL. WDFTIMER Represents a timer that fires either once or periodically and causes a callback routine run. WDFUSBDEVICE Represents a USB

Synchronization Mechanisms Synchronization scope and execution level interact because of the way in which KMDF implements synchronization. By default, KMDF uses spin locks, which raise IRQL to DISPATCH_LEVEL, to synchronize callbacks. Therefore, if the driver specifies device or queue synchronization scope, its device and queue callbacks must be able to run at DISPATCH_LEVEL. Wow! eBook 180 Chapter 7 Plug and Play and Power Management If the driver sets the

Download sample

Download