Windows driver model and

Choosing a driver model

Microsoft Windows provides a variety of driver models that you can use to write drivers. The strategy for choosing the best driver model depends on the type of driver you are planning to write. Here are the options:

  • Device function driver
  • Device filter driver
  • Software driver
  • File system filter driver
  • File system driver

For a discussion about the differences between the various types of drivers, see What is a driver? and Device nodes and device stacks. The following sections explain how to choose a model for each type of driver.

Choosing a driver model for a device function driver

As you design a hardware device, one of the first things to consider is whether you need to write a function driver. Ask the following questions:

Can you avoid writing a driver entirely? If you must write a function driver, what is the best driver model to use? To answer these questions, determine where your device fits in the list of technologies described in Device and driver technologies. See the documentation for that particular technology to determine whether you need to write a function driver and to learn about which driver models are available for your device.

Some of the individual technologies have minidriver models. In a minidriver model, the device driver consists of two parts: one that handles general tasks, and one that handles device-specific tasks. Typically, Microsoft writes the general portion and the device manufacturer writes the device-specific portion. The device specific portions have a variety of names, most of which share the prefix mini. Here are some of the names used in minidriver models:

  • Display miniport driver
  • Audio miniport driver
  • Battery miniclass driver
  • Bluetooth protocol driver
  • HID minidriver
  • WIA minidriver
  • NDIS miniport driver
  • Storage miniport driver
  • Streaming minidriver

For an overview of minidriver models, see Minidrivers and driver pairs.

Not every technology listed in Device and driver technologies has a dedicated minidriver model. The documentation for a particular technology might advise you to use the Kernel-Mode Driver Framework (KMDF); the documentation for another technology might advise you to use the User-Mode Driver Framework (UMDF). The key point is that you should start by studying the documentation for your specific device technology. If your device technology has a minidriver model, you must use the minidriver model. Otherwise follow the advice in the your technology-specific documentation about whether to use the UMDF, KMDF, or the Windows Driver Model (WDM).

Choosing a driver model for a device filter driver

Frequently several drivers participate in a single I/O request (like reading data from a device). The drivers are layered in a stack, and the conventional way to visualize the stack is with the first driver at the top and the last driver at the bottom. The stack has one function driver and can also have filter drivers. For a discussion about function drivers and filter drivers, see What is a driver? and Device nodes and device stacks.

If you are preparing to write a filter driver for a device, determine where your device fits in the list of technologies described in Device and driver technologies. Check to see whether the documentation for your particular device technology has any guidance on choosing a filter driver model. If the documentation for your device technology does not offer this guidance, then first consider using UMDF as your driver model. If your filter driver needs access to data structures that are not available through UMDF, consider using KMDF as your driver model. In the extremely rare case that your driver needs access to data structures not available through KMDF, use WDM as your driver model.

Читайте также:  Реестр windows очистка диска

Choosing a driver model for a software driver

A driver that is not associated with a device is called a software driver. For a discussion about software drivers, see the What is a driver? topic. Software drivers are useful because they can run in kernel mode, which gives them access to protected operating system data. For information about processor modes, see User mode and kernel mode.

For a software driver, your two options are KMDF and the legacy WindowsВ NT driver model. With both KMDF and the legacy WindowsВ NT model, you can write your driver without being concerned about Plug and Play (PnP) and power management. You can concentrate instead on your driver’s primary tasks. With KMDF, you do not have to be concerned with PnP and power because the framework handles PnP and power for you. With the legacy WindowsВ NT model, you do not have to be concerned about PnP and power because kernel-mode services operate in an environment that is completely independent from PnP and power management.

Our recommendation is that you use KMDF, especially if you are already familiar with it. If you want your driver to be completely independent from PnP and power management, use the legacy WindowsВ NT model. If you need to write a software driver that is aware of power transitions or PnP events, you cannot use the legacy WindowsВ NT model; you must use KMDF.

NoteВ В In the very rare case that you need to write a software driver that is aware of PnP or power events, and your driver needs access to data that is not available through KMDF, you must use WDM.

Choosing a driver model for a file system driver

For help with choosing a model for a file system filter driver, see File system driver samples. Note that file system drivers can be quite complex and may require knowledge of advanced concepts for driver development.

Choosing a driver model for a file system filter driver

For help with choosing a model for a file system filter driver, see File system minifilter drivers and File system filter drivers.

Choosing a driver model for a file system minifilter driver

For help choosing a model for a file system minifilter driver, see File System Minifilter Drivers.

Windows Driver Model

Windows Driver Model (WDM) – фреймворк для драйверов устройств (также известен как Win32 Driver Model и Windows NT Driver Model), был введен в Windows 98 и Windows 2000 для замены устаревшего VxD, который использовался в старых версиях Windows таких как Windows 95 и Windows 3.1.

Содержание

Обзор

Microsoft Windows Driver Model определяет унифицированную модель драйвера для операционных систем Windows 98, Windows 2000 и старше, стандартизируя требования и уменьшая количество кода, необходимое для написания драйвера. В соответствии с концепцией WDM, драйверы могут быть бинарно совместимы. Так, например, драйвер для платформы x86, написанный для Windows 98 может подойти и к Windows Me, и к Windows 2000, и даже к Windows Vista. WDM-драйвера спроектированы для прямой совместимости, поэтому такой драйвер может быть запущен на более поздней версии Windows, чем та, для которой он был изначально написан. Но это также означает, что драйвер не сможет использовать новые возможности новой версии WDM-фреймворка. WDM-драйвера, главным образом, обратно не совместимы. Это означает, что нет никаких гарантий, что такой драйвер запустится на версии Windows, более старой чем та, для которой он был написан. Например, Windows XP может использовать драйвер, написанный для Windows 2000, но этот драйвер не может использовать новые возможности, добавленные в Windows XP. Однако, драйвер, написанный для Windows XP, может работать в Windows 2000, а может и не работать.

WDM-драйверы взаимодействуют друг с другом через пакеты запроса ввода — вывода (IRPs).

Технология WDM была разработана для увеличения функциональности и облегчения написания драйверов для Windows. Хотя WDM в основном был разработан для бинарной совместимости и совместимости на уровне исходного кода между Windows 98 и Windows 2000, зачастую это не всегда ожидаемо и поэтому специфические драйвера разрабатываются для каждой операционной системы отдельно.

WDM драйвера предназначены в общем для расширения стандартных возможностеи основного драйвера.

Читайте также:  Клавиатура apple windows print screen

VxD, WDM и Windows 98

Операционные системы, основанные на Windows 98 (Windows 98, Windows 98 Second Edition и Windows Me), могут использовать оба стандарта драйверов — WDM и VxD. Обе модели драйверов могут предоставлять уникальные и различные возможности для одного и того же устройства. Однако, обычно более новый стандарт WDM предоставляет больше возможностей. Например, если TV-тюнер использует VxD-драйвер, это позволяет захватывать изображение разрешением 384 x 288 пикселей. Тот же TV-тюнер с драйвером WDM может захватывать изображение разрешением 768 x 576 пикселей.

Критика

Windows Driver Model, даже несмотря на значительные улучшения по сравнению с предшествующими ему VxD и Windows NT driver model, критикуется разработчиками драйверов [1], в основном по следующим причинам:

  • WDM слишком сложен для изучения.
  • Сложное взаимодействие с событиями управления питанием и Plug and Play. Это приводит ко множеству ситуаций, когда компьютеры, управляемые Windows, не могут перейти в спящий режим или правильно выйти из него из-за ошибок в коде драйвера.
  • Отмену ввода/вывода практически невозможно правильно определить.
  • Для каждого драйвера требуются тысячи строк сопровождающего кода.
  • Нет поддержки для написания «чистых» драйверов пользовательского режима.

Было также много проблем из-за качества документации и примеров, предоставляемых Microsoft.

Из-за этих проблем Microsoft выпустила новый фреймворк, заменяющий WDM, названный Windows Driver Foundation, который включает в себя Kernel-Mode Driver Framework (KMDF) и User-Mode Driver Framework (UMDF). Windows Vista поддерживает оба стандарта: и WDM, и новый Windows Driver Foundation. KMDF также доступен для скачивания для Windows XP и даже Windows 2000, в то время, как UMDF доступен начиная только с Windows XP.

См. также

Литература

  • Finnel, Lynn (2000). MCSE Exam 70-215, Microsoft Windows 2000 Server. Microsoft Press. ISBN 1-57231-903-8.
  • Oney, Walter (2003). Programming the Windows Driver Model, Microsoft Press, ISBN 0-7356-1803-8.

Ссылки

  • Windows driver API basics — Статья об основах разработки драйверов для звуковых карт, таких как WDM: ASIO, MME, DirectX и т.д. (англ.)
  • Channel 9 Video — Интервью с командой, занимающейся разработкой управления устройствами и установкой в Microsoft, в основном Plug and Play (англ.)
  • Kernel Survival guide — Свободный блокнот лекций описывающий основы создания Windows Drivers, программирование уровня ядра и управление памятью (англ.)
API и фреймворкиMicrosoft
Графика Desktop Window Manager ·Direct2D·Direct3D (extensions) ·GDI / GDI+·WPF· Windows Color System ·Windows Image Acquisition· Windows Imaging Component
Аудио DirectMusic ·DirectSound· DirectX plugin · XACT ·Speech API· XAudio2
Мультимедиа DirectX (Media Objects ·Video Acceleration) · DirectInput ·DirectShow·Image Mastering API· Managed DirectX ·Media Foundation·XNA·Windows Media·Video for Windows
Web MSHTML· RSS Platform ·JScript·VBScript·BHO·XDR· SideBar Gadgets
Доступ к данным Data Access Components· Extensible Storage Engine ·ADO.NET·ADO.NET Entity Framework· Sync Framework · Jet Engine ·MSXML·OLE DB· OPC
Сеть Winsock (LSP) · Winsock Kernel · Filtering Platform ·Network Driver Interface Specification· Windows Rally ·BITS· P2P API · MSMQ · MS MPI ·DirectPlay
Коммуникации Messaging API·Telephony API·WCF
Win32 console · Windows Script Host · WMI (extensions) · PowerShell · Task Scheduler · Offline Files · Shadow Copy · Windows Installer · Error Reporting · Event Log · Common Log File System
Компонентная модель COM · COM+ · ActiveX · Distributed Component Object Model · .NET Framework
Библиотеки Base Class Library (BCL) · Microsoft Foundation Classes (MFC) · Active Template Library (ATL) · Windows Template Library (WTL)
Драйверы устройств Windows Driver Model · Windows Driver Foundation (KMDF · UMDF) · WDDM · NDIS · UAA · Broadcast Driver Architecture · VxD
Безопасность Crypto API (CAPICOM) · Windows CardSpace · Data Protection API · Security Support Provider Interface (SSPI)
.NET ASP.NET · ADO.NET · Base Class Library (BCL) · Remoting · Silverlight · TPL · WCF · WCS · WPF · WF
Программное обеспечение EFx Factory · Enterprise Library · Composite UI · CCF · CSF
IPC MSRPC · Dynamic Data Exchange (DDE) · Remoting · WCF
Доступность Active Accessibility · UI Automation
DirectWrite · Text Services Framework · Text Object Model · Input method editor · Language Interface Pack · Multilingual User Interface · Uniscribe
Читайте также:  Windows server standard to datacenter upgrade
Программные интерфейсы и фреймворки Microsoft Windows
Графика Проводник Windows • DirectX • Direct3D • GDI • Windows Presentation Foundation • Windows Color System • Windows Image Acquisition • Windows Imaging Component
Звук DirectSound • DirectMusic • XACT • Speech API • MME
Мультимедиа DirectShow • Windows Media • Media Foundation
Веб MSHTML • MSXML • Платформа RSS для Windows • JScript • ActiveX • XMLHttpRequest • Гаджеты
Доступ к данным Компоненты Microsoft Data Access • Extensible Storage Engine • ADO.NET • Sync Framework • Jet-механизм
Сети Winsock (LSP) • Filtering Platform • NDIS • Windows Rally • Сервис фоновой интеллектуальой передачи данных • P2P API
Коммуникации TAPI
Администрирование Консоль Win32 • Windows Script Host • Инструментарий управления Windows • PowerShell • Планировщик задач • Offline Files • Теневое копирование • Windows Installer • Диспетчер ошибок Windows • Журнал событий Windows
Модель компонентов COM • COM+ • DCOM • .NET Framework
Библиотеки Microsoft Foundation Classes (MFC) • Active Template Library (ATL) • Windows Template Library (WTL) • Base Class Library (BCL)
Разработка драйверов Windows Driver Model • Windows Driver Foundation (KMDF • UMDF)
Безопасность CryptoAPI (CAPICOM) • Windows CardSpace • Data protection API • Security Support Provider Interface
.NET .NET Framework • ASP.NET • ADO.NET • .NET Remoting • Windows Presentation Foundation • Windows Workflow Foundation • Windows Communication Foundation • Windows CardSpace • XNA Framework • Silverlight • Библиотека параллельного программирования
Межпроцессное
взаимодействие
Dynamic Data Exchange (DDE) • MSRPC • Именованные каналы
Текст и
поддержка языков
Framework Текстовых сервисов • Объектная модель текстов • Редактор метода ввода • Языковые пакеты • Многоязычный интерфейс
Игры XNA Framework • DirectX

Wikimedia Foundation . 2010 .

Смотреть что такое «Windows Driver Model» в других словарях:

Windows Driver Model — ou WDM est le nom général des pilotes pour les systèmes d’exploitation Windows 98 et Windows 2000 de Microsoft[1]. WDM a remplacée VxD introduit sous Windows 3.x[2] … Wikipédia en Français

Windows Driver Model — (WDM) es una estrategia de Microsoft para facilitar un desarrollo simple de drivers para dispositivos compatibles Microsoft Windows 98, Windows 2000, Windows Millennium y Windows XP. WDM utiliza una aproximación basada en niveles, en los que las… … Wikipedia Español

Windows Driver Model — Windows Driver Model, WDM … Universal-Lexikon

Windows Driver Model — In computing, the Windows Driver Model (WDM) mdash; also known at one point as the Win32 Driver Model mdash; is a framework for device drivers that was introduced with Windows 98 and Windows 2000 to replace VxD, which was used on older versions… … Wikipedia

Windows Driver Model — Ein Gerätetreiber, häufig kurz nur Treiber genannt, ist ein Computerprogramm oder modul, das die Interaktion mit angeschlossenen oder eingebauten Geräten (Hardware) steuert. Dazu nutzt es Schnittstellen zum Kommunikationsbus oder anderen… … Deutsch Wikipedia

Windows Driver Model — noun The Windows Driver Model (WDM) is a framework for device drivers for the Microsoft Windows operating system … Wiktionary

Windows Driver Foundation — Разработчик Microsoft Операционная система Windows Языки интерфейса Английский Последняя версия 1.9 Состояние Active Windows Driver Foundation (WDF) набор программных инструментов от корп … Википедия

Windows Display Driver Model — Эта статья содержит незавершённый перевод с иностранного языка. Вы можете помочь проекту, переведя её до конца. Если вы знаете, на каком языке написан фрагмент, укажите его в этом шаблоне. Windows Display Driver … Википедия

Windows Driver Foundation — Infobox Software name = Windows Driver Foundation caption = author = developer = Microsoft released = latest release version = 1.7 latest release date = latest preview version = latest preview date = operating system = Windows platform = language … Wikipedia

Windows Driver Kit — Infobox Software name = Windows Driver Kit caption = author = developer = Microsoft released = latest release version = 6001.18001 latest release date = latest preview version = latest preview date = operating system = Windows platform = language … Wikipedia

Оцените статью