Windows Driver Kit (WDK) 包含各類驅動程序的示例源代碼。這些示例可在您編寫本身的驅動程序時提供有用指導。在安裝 WDK 時,示例將安裝到 \src 目錄的子目錄中。windows
下表列出了一些 示例子目錄及其內容。網絡
示例子目錄 | 內容 |
---|---|
src\audioapp |
音頻驅動程序的各類示例。框架 |
src\filesyside |
文件系統驅動程序的各類示例。函數 |
src\general工具 |
用戶模式驅動程序和內核模式驅動程序的各類示例,其中包括全面的「toaster」示例。包括使用用戶模式驅動程序框架 (UMDF)、內核模式驅動程序框架 (KMDF) 和 Windows 驅動模型 (WDM) 接口的驅動程序。ui |
src\inputlua |
鍵盤和鼠標類篩選器驅動程序。spa |
src\mmedia |
音頻壓縮管理器 (ACM) 軟件編解碼器。 |
src\network |
各類類型的網絡驅動程序的示例。 |
src\print |
打印機和繪圖儀的示例驅動程序以及其餘 DLL 和工具。 |
src\setup |
示例 INF 文件和安裝應用程序。 |
src\smartcard |
串行和 PCMCIA 智能卡讀卡器的驅動程序。 |
src\storage |
各類類型的存儲設備的示例驅動程序。 |
src\usb |
USB 設備的示例驅動程序。包括基於 UMDF 的驅動程序和基於 KMDF 的驅動程序。 |
src\video |
示例顯示驅動程序和鏡像驅動程序。 |
有關 WDK 示例的更多信息,請參見 Windows Driver Kit 示例。此外,請參見此 WDK 中設備類型特定的文檔。
若是選擇將代碼基於一個或多個示例,請記住如下幾點:
一些示例不是完整的驅動程序,但提供了有關如何編寫此類驅動程序的指南。例如,爲了簡潔明確起見,示例可能忽略錯誤處理代碼。
確保使用針對正在編寫的驅動程序的類型編寫的驅動程序示例。例如,若是正在編寫 WDM 函數驅動程序,則使用示例 WDM 函數驅動程序。若是正在編寫存儲篩選器驅動程序,則使用示例存儲篩選器驅動程序。
確保更新驅動程序的示例 INF 文件。特別是,確保硬件的設備 ID 與 INF 文件中指定的設備 ID 匹配。
https://msdn.microsoft.com/zh-cn/library/ff554845(v=VS.85).aspx
Get the Windows 10 Driver Kit (WDK) and other tools you need to build, test, and deploy your drivers and Windows Store apps. With Windows 10, the driver development environment and the Windows debuggers are integrated into Visual Studio.
Take a look at the compilation of the new and changed driver-related content for Windows 10. Areas of improvement include camera, print, display, Near Field Communication (NFC), WLAN, Bluetooth, and more.
Find out what’s new in the WDK
Write one driver that runs on both Windows 10 for desktop editions and Windows 10 for mobile devices, as well as other Windows 10 editions that share a common set of interfaces.
Build your Universal Windows drivers
If you're writing your first driver, use these exercises to get started. Each exercise is independent of the others, so you can do them in any order.
Write a UMDF driver based on a template
Write a KMDF Hello World driver
Write a KMDF driver based on a template
Use samples to guide your Windows driver development. Whether you’re just getting started or porting an older driver to the newest version of Windows, code samples are valuable guides on how to write drivers.
Windows Driver Frameworks (WDF) is a set of libraries that you can use to develop device drivers that are interoperable with Windows. WDF is comprised of Kernel-Mode Driver Framework (KMDF) and User-Mode Driver Framework (UMDF).
Windows compatible hardware development boards offer an affordable, yet powerful development system targeted towards the hardware developer, IHV, OEM or any other developer that loves to incorporate hardware in their projects and needs the power of a full PC.
Learn about Windows compatible hardware development boards
Make your apps available to customers at first boot. With Windows 10, OEMs can create preinstalled apps for immediate brand differentiation and functionality, create system settings apps that let users control hardware properties, and configure mobile broadband on PCs.