HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
microsoft
Windows-driver-samples
C2015–2025
microsoft / Windows-driver-samples

Windows-driver-samples

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.

10Distinct people
11Mentions
0Explicit recommenders
7.9KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

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.

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year11 dated mentions

Observed mentions: 2015-03-19 13:39:42 UTC to 2025-10-08 14:37:55 UTC.

0122015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20152016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC101
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC101
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC000
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC101
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC101
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC202
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC101
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC202
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC101
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC101

What Hacker News says

11 sources
Some parts have already been open-sourced. For example, the console host component has been open sourced here: https://github.com/microsoft/terminal And the FAT filesystem driver: https://github.com/microsoft/Windows-driver-samples/tree/mai... And also PowerShell: https://github.com/PowerShell/PowerShell And most of .NET: https://github.com/dotnet Maybe they could consider an Apple-style approach: open source the core of the kernel and text-mode user space but leave the GUI closed. Of course, open sourcing everything would be even better, but that might too big of a step for them. Open sourcing the non-GUI core could be a good initial step, whether or not it ends up going further.
In Microsoft formally deprecates the Windows Control Panel
The state machine example is definitely a very fitting use of goto, but it reminds me of another thing that seems to have become a rare skill but is very useful: flowcharting. Besides making people comfortable with goto in general, it also helps visualise control flow in ways that a lot of programmers these days don't realise, and it's unfortunate that a lot of courses seem to have omitted its teaching. Also worth reading is "GOTO Considered Harmful Considered Harmful": https://news.ycombinator.com/item?id=11056434 And here Microsoft provides us with lovely example of such ridiculous nesting. That's a very memorable example, but ultimately the true cause of that monstrosity is a clearly stupid API design; this is the API for a file picker, the recommended replacement for an existing one that they wanted to deprecate. In the existing one,
Read the rest
you fill in a structure and call a single function with a pointer to it. In its replacement, you need to call a dozen methods on an object, and check for "possible" errors on each call, even if probably 99% of them only do things like assign to a field in a now-opaque structure and can never produce an error. Then the example code must've been edited by someone with severe gotophobia. (Not all MS code is like that --- they have plenty of other example code that uses goto, e.g.: https://github.com/microsoft/Windows-driver-samples/blob/mai... ) The existing API was even extensible, since it used a structure with a size field that could differentiate between different versions and extensions, but they didn't.
In GOTOphobia considered harmful in C
> Is this something you have to sign an NDA with Microsoft to get access to the headers and docs for it? Or will I find the headers hidden away in the WDK somewhere? Turns out the header file is included in the Windows 10 SDK, as km/nthalext.h Not the very latest version, but someone posted it on GitHub here: https://github.com/tpn/winsdk-10/blob/master/Include/10.0.16... (You can download the multi-gigabyte Windows 10/11/2022 SDKs to get a more recent one, although not sure if anything has changed.) Still doesn't seem to be any public documentation. The header includes very detailed comments, but (as you'd expect for header file comments) they concentrate on the nitty-gritty and omit the big picture. Searching "nthalext.h" on GitHub finds source code for a handful of HAL extensions, so at least there is some sample code to look at. Micro
Read the rest
soft has even open-sourced a few – see https://github.com/ms-iot/imx-iotcore/tree/public_preview/ha... Microsoft used to include HAL extension samples in the Windows 10 driver samples – https://github.com/microsoft/Windows-driver-samples/tree/5b8... – but removed them as part of the Anniversary update – https://github.com/microsoft/Windows-driver-samples/tree/96e...
In Welcome to the M1 Windows project
Linux is the kernel, so really the equivalent on Windows is the Windows kernel API, not the Win32 (user) API. However, the kernel API seems to be somewhat similar to the Win32 version presented in the talk and not nearly as gnarly as the Linux equivalent: https://github.com/microsoft/Windows-driver-samples/blob/mas... https://docs.microsoft.com/en-us/windows-hardware/drivers/dd... That said I'm just an application programmer so I've only ever used the Win32 API.
In What Unix Cost Us [video]
That loop is totally fine. I wrote it many times in C#, C and C++, and I saw it many more times in other people’s code. Microsoft DDK sample: https://github.com/Microsoft/Windows-driver-samples/blob/mas... Microsoft MediaFoundation sample: https://github.com/Microsoft/Windows-classic-samples/blob/ma... OpenSSL: https://github.com/openssl/openssl/blob/master/crypto/sha/sh... And many others. Just because code looks unfamiliar doesn’t mean it’s something wrong with the code.
In Why OO Sucks by Joe Armstrong (2000)
I too have been finding it hard to find a single reliable and up-to-date source for learning windows drivers. There's a plethora of info online, but lots is out of date and/or scattered and redundant. Even decent paid training is hard to find, at least in my part of the world. There's a book, but it's old [1] There's samples, which are fresh [2] There's a multi part series on Code Project, but it's old (yet much of it still applies conceptually; samples not so much) Part 1 of 6: [3] If anybody has a good one-stop-shop and updated source of learning I'd very much appreciate it (I'd love a nicely written book on the matter that's not older than, say, 3 years old) [1]: http://www.amazon.com/Developing-Drivers-Foundation-Develope... [2]: https://github.com/Microsoft/Windows-driver-samples [3]: http://www.codeproject.com/Articles/9504/Driver-D
Read the rest
In The Windows Driver Frameworks are on GitHub

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.