Kernel-Mode Drivers Documentation
Welcome to the comprehensive documentation for Windows Kernel-Mode Drivers. This section provides essential information for developers building drivers that operate in the kernel-mode space of the Windows operating system.
Kernel-mode drivers have direct access to the operating system's core functionalities and hardware. Developing robust and secure kernel-mode drivers requires a deep understanding of the Windows architecture, driver models, and best practices.
Key Concepts
What are Kernel-Mode Drivers?
Kernel-mode drivers are software components that run with the highest level of system privileges. They are responsible for managing hardware devices, providing low-level system services, and interacting directly with the operating system kernel. Unlike user-mode applications, kernel-mode drivers execute in a protected memory space and have unrestricted access to system resources.
Driver Models
Microsoft provides two primary driver development frameworks:
- Windows Driver Foundation (WDF): A modern, object-oriented framework that simplifies driver development. WDF includes both Kernel-Mode Driver Framework (KMDF) and User-Mode Driver Framework (UMDF). KMDF is recommended for most new kernel-mode driver development.
- Windows Driver Model (WDM): The legacy driver model. While still supported, new development is generally encouraged to use WDF.
Essential Resources
This documentation suite covers a wide range of topics, including:
- Understanding the kernel-mode driver architecture.
- Using the Windows Driver Kit (WDK) and Visual Studio.
- Developing drivers with KMDF and UMDF.
- Handling I/O requests and power management.
- Debugging kernel-mode drivers effectively.
- Security considerations for kernel-mode development.
- Interacting with hardware and system components.
Getting Started
To begin your journey into kernel-mode driver development, we recommend starting with the following sections:
Commonly Used APIs
Familiarize yourself with fundamental kernel-mode routines and structures:
IoCreateDevice: Creates a device object.WdfDeviceCreate: Creates a WDF device object.IRP(I/O Request Packet): The primary mechanism for communication between drivers and the operating system.WDFREQUEST: The WDF equivalent of an IRP.KeAcquireSpinLock/KeReleaseSpinLock: For managing access to shared resources.DbgPrint/KdPrint: For debugging output.
Explore the navigation pane on the left for detailed information on specific topics, programming references, and tutorials. Happy coding!