A Windows kernel driver and user-mode agent that demonstrates IRP (I/O Request Packet) communication using Buffered I/O. Messages are sent from user space through the driver and printed to DebugView (DbgView) via DbgPrint.
IRP-DRIVER-AGENT/
├── DRIVER/ # Kernel-mode driver (WDM)
├── Agent/ # User-mode agent application
├── IRP-DRIVER-AGENT.sln
└── .gitignore
[ Agent (User Mode) ]
|
| DeviceIoControl / WriteFile
↓
[ Windows I/O Manager ]
|
| IRP (I/O Request Packet)
↓
[ Kernel Driver (DRIVER) ]
|
| DbgPrint()
↓
[ DebugView Output ]
- The Agent sends a message to the driver using
DeviceIoControlorWriteFile - The I/O Manager packages the request into an IRP and dispatches it to the driver
- The Driver handles the IRP, reads the buffered data, and prints it via
DbgPrint - Output is visible in DebugView (DbgView)
- Windows 10/11
- Visual Studio 2019 or later
- Windows Driver Kit (WDK) — matching your VS version
- DebugView (Sysinternals)
- Test signing enabled OR a VM with kernel debugging
- Open
IRP-DRIVER-AGENT.slnin Visual Studio - Set configuration to
Debug/x64 - Build the solution — both
DRIVERandAgentprojects
Run in an elevated CMD:
bcdedit /set testsigning onThen reboot.
sc create IRPDriver type= kernel binPath= "C:\path\to\DRIVER.sys"
sc start IRPDriverAgent.exeOpen DebugView as Administrator with Kernel Capture enabled — you should see the printed messages.
| Concept | Description |
|---|---|
| IRP | I/O Request Packet — the core data structure Windows uses for driver communication |
| Buffered I/O | Data is copied to/from a kernel buffer managed by the I/O manager — safer than Direct I/O |
| DbgPrint | Kernel-mode function to output debug strings, visible in DebugView |
| DeviceIoControl | Win32 API used by the agent to send custom control codes to the driver |
| DriverEntry | Kernel driver entry point, equivalent to main() |
| IRP_MJ_WRITE | IRP major function code for write operations |
This project is for educational purposes — learning Windows kernel internals, IRP handling, and driver/agent communication patterns. Always test kernel drivers in a VM to avoid system crashes (BSODs).
EynaExp — github.com/EynaExp