Convert Figma logo to code with AI

MicrosoftDocs logowindows-driver-docs

The official Windows Driver Kit documentation sources

1,053
861
1,053
5

Top Related Projects

This repo contains driver samples prepared for use with Microsoft Visual Studio and the Windows Driver Kit (WDK). It contains both Universal Windows Driver and desktop-only driver samples.

WDF makes it easy to write high-quality Windows drivers

This repo contains samples that demonstrate the API used in Windows classic desktop applications.

252,721

Linux kernel source tree

18,275

A free Windows-compatible Operating System

Legacy mirror of Darwin Kernel. Replaced by https://github.com/apple-oss-distributions/xnu

Quick Overview

The MicrosoftDocs/windows-driver-docs repository contains the source content for Windows driver documentation. This repository is used to maintain and update the official documentation for developing drivers for Windows operating systems, which is published on Microsoft's official documentation website.

Pros

  • Comprehensive and authoritative source for Windows driver development documentation
  • Open-source nature allows community contributions and improvements
  • Regularly updated to reflect the latest Windows driver development practices
  • Well-organized structure makes it easy to navigate and find specific information

Cons

  • May be overwhelming for beginners due to the vast amount of information
  • Some sections might not be updated as frequently as others
  • Requires familiarity with GitHub and Markdown for effective contributions
  • Documentation may sometimes lag behind the latest Windows updates or features

Note: As this is a documentation repository and not a code library, the code example and getting started sections have been omitted.

Competitor Comparisons

This repo contains driver samples prepared for use with Microsoft Visual Studio and the Windows Driver Kit (WDK). It contains both Universal Windows Driver and desktop-only driver samples.

Pros of Windows-driver-samples

  • Provides practical, hands-on examples of driver code
  • Allows developers to experiment with and modify real driver implementations
  • Includes a wide range of sample drivers for various device types

Cons of Windows-driver-samples

  • May require more technical expertise to understand and utilize
  • Samples might not always reflect the most up-to-date best practices
  • Less comprehensive coverage of driver development concepts compared to documentation

Code Comparison

Windows-driver-samples:

NTSTATUS
DriverEntry(
    _In_ PDRIVER_OBJECT  DriverObject,
    _In_ PUNICODE_STRING RegistryPath
)
{
    // Driver initialization code
}

windows-driver-docs:

# Driver Entry Point

The `DriverEntry` routine is the entry point for all drivers. It is responsible for initializing the driver.

## Syntax

```c
NTSTATUS DriverEntry(
  _In_ PDRIVER_OBJECT  DriverObject,
  _In_ PUNICODE_STRING RegistryPath
);

The Windows-driver-samples repository provides actual code implementations, while the windows-driver-docs repository offers detailed explanations and documentation about driver concepts and functions.

WDF makes it easy to write high-quality Windows drivers

Pros of Windows-Driver-Frameworks

  • Contains actual source code for Windows Driver Frameworks
  • Allows direct contributions to the framework
  • Provides a more hands-on approach for developers

Cons of Windows-Driver-Frameworks

  • Less comprehensive documentation compared to windows-driver-docs
  • May be more challenging for beginners to understand
  • Focuses primarily on the framework itself, not broader driver development concepts

Code Comparison

windows-driver-docs (documentation example):

# Writing a KMDF driver

To write a Kernel-Mode Driver Framework (KMDF) driver:

1. Include the framework header files
2. Implement the driver's callback functions
3. Register the callbacks with the framework

Windows-Driver-Frameworks (code example):

NTSTATUS
DriverEntry(
    _In_ PDRIVER_OBJECT     DriverObject,
    _In_ PUNICODE_STRING    RegistryPath
    )
{
    WDF_DRIVER_CONFIG config;
    NTSTATUS status;

    WDF_DRIVER_CONFIG_INIT(&config, EvtDriverDeviceAdd);
    status = WdfDriverCreate(DriverObject, RegistryPath, WDF_NO_OBJECT_ATTRIBUTES, &config, WDF_NO_HANDLE);
    return status;
}

This repo contains samples that demonstrate the API used in Windows classic desktop applications.

Pros of Windows-classic-samples

  • Provides practical, ready-to-use code examples for Windows development
  • Covers a wide range of Windows APIs and features
  • Allows developers to quickly implement and test specific functionalities

Cons of Windows-classic-samples

  • May not always reflect the most up-to-date best practices
  • Lacks comprehensive documentation and explanations
  • Focuses on specific use cases rather than providing a complete learning resource

Code Comparison

windows-driver-docs (documentation example):

# Write a Universal Windows driver (KMDF) based on a template

This topic describes how to write a Universal Windows driver using Kernel-Mode Driver Framework (KMDF). You'll start with a Microsoft Visual Studio template and then deploy and install your driver on a separate computer.

Windows-classic-samples (code example):

// HelloWorldDriver.cpp
#include <ntddk.h>

DRIVER_INITIALIZE DriverEntry;
DRIVER_UNLOAD DriverUnload;

NTSTATUS DriverEntry(_In_ PDRIVER_OBJECT DriverObject, _In_ PUNICODE_STRING RegistryPath)
{
    // Driver initialization code
}

The windows-driver-docs repository focuses on providing detailed documentation and guidance for driver development, while Windows-classic-samples offers practical code examples for various Windows development scenarios. The former is more suitable for learning and understanding concepts, while the latter is better for quick implementation and testing of specific features.

252,721

Linux kernel source tree

Pros of linux

  • Larger community and more contributors, leading to faster development and bug fixes
  • More comprehensive and detailed documentation for kernel development
  • Supports a wider range of hardware architectures and devices

Cons of linux

  • Steeper learning curve for new contributors due to its complexity
  • Less standardized coding style and documentation format
  • May require more effort to set up a development environment

Code comparison

linux:

static int __init start_kernel(void)
{
    char *command_line;
    char *after_dashes;

    set_task_stack_end_magic(&init_task);
    smp_setup_processor_id();
    debug_objects_early_init();

windows-driver-docs:

NTSTATUS
DriverEntry (
    _In_ PDRIVER_OBJECT  DriverObject,
    _In_ PUNICODE_STRING RegistryPath
    )
{
    NTSTATUS status;

The linux code snippet shows the kernel initialization process, while the windows-driver-docs example demonstrates a typical driver entry point. The linux code is more low-level and complex, reflecting the nature of kernel development, whereas the windows-driver-docs code is more focused on driver-specific functionality.

18,275

A free Windows-compatible Operating System

Pros of ReactOS

  • Open-source project with a community-driven development approach
  • Aims to create a fully functional Windows-compatible operating system
  • Provides hands-on experience with low-level system programming

Cons of ReactOS

  • Less comprehensive documentation compared to Windows Driver Docs
  • May not always reflect the latest Windows driver development practices
  • Smaller community and fewer resources for troubleshooting

Code Comparison

ReactOS (driver initialization):

NTSTATUS
DriverEntry(
    _In_ PDRIVER_OBJECT DriverObject,
    _In_ PUNICODE_STRING RegistryPath)
{
    // Driver initialization code
}

Windows Driver Docs (driver initialization):

NTSTATUS
DriverEntry(
    _In_ PDRIVER_OBJECT     DriverObject,
    _In_ PUNICODE_STRING    RegistryPath
    )
{
    // Driver initialization code
}

Both repositories showcase driver development, but ReactOS focuses on implementing a Windows-compatible OS, while Windows Driver Docs provides official documentation for Windows driver development. The code snippets demonstrate similarities in driver entry point structure, reflecting ReactOS's goal of Windows compatibility.

Legacy mirror of Darwin Kernel. Replaced by https://github.com/apple-oss-distributions/xnu

Pros of darwin-xnu

  • Open-source kernel code, allowing for deeper understanding and modification
  • Includes comprehensive documentation within the codebase
  • Provides insights into Apple's low-level system architecture

Cons of darwin-xnu

  • Less frequent updates and potentially outdated information
  • Steeper learning curve for developers not familiar with Apple's ecosystem
  • Limited community contributions due to Apple's control over the project

Code Comparison

darwin-xnu (XNU kernel initialization):

void kernel_bootstrap_thread(void)
{
    kernel_bootstrap();
    kernel_bootstrap_thread_end();
}

windows-driver-docs (Windows driver initialization example):

NTSTATUS DriverEntry(
    _In_ PDRIVER_OBJECT  DriverObject,
    _In_ PUNICODE_STRING RegistryPath
)
{
    // Driver initialization code
}

The darwin-xnu repository contains the actual kernel source code, while windows-driver-docs provides documentation and examples for Windows driver development. The code snippets show the entry points for kernel and driver initialization, respectively, highlighting the different approaches to system-level programming in these environments.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Microsoft Open Source Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Windows Driver Documentation

Welcome to the Windows driver docs repository, housing the source for the official Windows hardware developer documentation.

If you're looking for the driver reference (API/DDI) documentation, it's in the windows-driver-docs-ddi GitHub repository.

Contributing

We actively merge contributions into this repository via pull request into the staging branch (for the public repo) or the main branch (for the private repo).

For more information on contributing, read our contributions guide.