Windows driver examples

Windows driver examples with free source code related to file systems, virtual disks and network communication from kernel mode. Published by Bo Brantén.
Please send comments, suggestions and corrections to


wdkundoc.h New file! Subset of ntifs.h to use with the WDK.

ntifs.h Small update so you still can compile Matt Wu's ext2fsd with it.

If you are interested in network communication from kernel mode on Windows, so called TDI clients, you may want to read my report High performance kernel mode web server for Windows.


Release 1 (2015-03-26)
Information that is undocumented in the Microsoft Windows Driver Kit (WDK).


Release 57 (2015-03-23)
I maintain a free version of the file ntifs.h. It is a collection of information of interrest to people building file system and file system filter drivers for Windows NT, Windows 2000 and Windows XP. The information has been found in books, magazines, on the Internet and received from contributors.


Release 15 (2009-04-19)
I want to provide an example file system driver for Windows NT/2000/XP. For some time I have worked on an implementation of RomFs. RomFs is a small filesystem originally implemented in Linux, because of its simple disk layout its a good choice for an example driver. The current status is a working read-only driver that supports caching of file data, the create functionallity still needs some work but I'm releasing it due to the high public demand. Also included is a file system recognizer for romfs, a file system recognizer is a small driver that loads the real file system driver when it recognizes a file system it can handle on a disk partition or removable media.
Here is a romfs floppy image that you can write to a floppy using RaWriteNT to test the driver.
Screenshot showing the debug prints from the driver when executing the command 'type a:\hello.c' on the floppy image above.

Links to other file system drivers for Windows with free source code

Ext2Fsd by Matt Wu is an ext2 file system driver for Windows NT/2000/XP.
FSDEXT2 by Peter van Sebille is an ext2fs driver for Windows 95/98.
EXT2IFS by John Newbigin is an ext2fs driver for Windows NT.
Ext2 File System Driver for Windows NT 4.0 by Manoj Paul Joseph.
Win2fs by Satish kumar Janarthanan is an Ext2 file system driver for the Microsoft Windows 2000 family of operating systems.
The arla project by Stacken at KTH is a free AFS implementation for many platforms including Windows.
OpenAFS is a free and portable AFS implementation. It contains an native network redirector for Windows that is in beta stage in the repository branch openafs-windows-kdfs-ifs-branch.
Creating User-Mode Device Drivers with a Proxy by Galen C. Hunt.
FIFS A Fremework for Implementing User-Mode File Systems in Windows NT by Danilo Almeida.
FFS File System Driver for Windows by Lee Jae-Hong allows you to get a read access to FreeBSD, NetBSD and OpenBSD FFS partitions.
ReiserDriver is an Installable File System Driver (IFSD) that allows ReiserFS partitions to be accessed under Windows. This driver has been updated by me to fix bugs and support newer versions of Windows.
Dokan is a user mode file system for windows.


Release 3.0 (2010-07-21)
SwapFs-3.0 is a driver for Windows that let you use a Linux swap partition for temporary storage like a RAM-disk. It is possible to put Windows page file on it and it has support for Plug and Play and Power Management so that standby and hibernation works. SwapFs is implemented as a disk filter driver.
New in release 3: Support for swap partitions bigger than 4GB and 64-bit systems.
New in release 2: Support for standby and hibernation on Windows 2000/XP.
SwapFs release 2 for Windows 2000/XP
SwapFs release 1 for Windows NT 4.0


Release 17 (2009-10-21)
FileDisk is a virtual disk driver for Windows that uses one or more files to emulate physical disks. A console application is included that let you dynamically mount and unmount files. An example of use for this driver is if you have made plans spending the weekend writing an RAID driver for NT but find you are short of disks. FileDisk can also use CD/DVD images.
Latest news: Allow to mount images without administrative privileges, works better on Windows Vista and Windows 7, support for 64-bit systems.
Screenshot of an example of use.
FileDisk will use sparse files as disk images if the underlying file system supports it. A sparse file is a file were suficiently large blocks of zeros isn't allocated disk space. To see how much disk space a file actually uses right click on the file and choose properties. If you for example create a sparse file of 4GB, mounts it in FileDisk and formats it to NTFS, it will only take up 24MB on disk but look like a normal disk of 4GB. When you copy files to it the used disk space will automatically increase.
FileDisk with support for .bin CD-ROM images.


Release 7 (2009-10-21)
HttpDisk is a virtual disk driver for Windows that uses HTTP to mount disk or CD/DVD images from a web server. It is also a demonstration on how to do network communication from kernel mode on Windows using the TDI interface.
Latest news: Allow to mount images without administrative privileges, works better on Windows Vista and Windows 7, support for 64-bit systems.


Release 2 (2009-10-21)
Khttpd is a simple kernel mode web server for Windows that demonstrates how to do network communication from kernel mode and how to use the MDL interface to the filesystem (IRP_MN_MDL and IRP_MN_COMPLETE_MDL). Using chained MDL:s the HTTP header and file data can be sent in one packet without any memory copy operation - so called zero-copy networking.
Latest news: Support for 64-bit systems.

Other links

Tools and utilities for Windows by Olof Lagerkvist.

Last modified: Thursday, 26-Mar-2015 01:22:10 CET