microsoft / 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.
Microsoft Public License
6.88k stars 4.91k forks source link

Write a Windows kernel driver sample use rust. #809

Open kouzhudong opened 1 year ago

kouzhudong commented 1 year ago

As the title.

nimaarek commented 1 year ago

Before I saw it here, I didn't even know that you can write windows driver with Rust!! I was very surprised and searched about it, I read these few links. It might be interesting for you too Examples on how to write Windows kernel drivers in Rust Writing a kernel driver with Rust. Windows drivers in rust Windows Kernel-Mode Drivers written in Rust PS/2 Keyboard Decoder in Rust and !!!!! Rusty Rootkit - Windows Kernel Rookit in Rust

PeterGV commented 1 year ago

I vote “no”… not that I really get a vote, of course.

What we need from Microsoft is a framework, equivalent to WDF, that supports fully idiomatic Rust driver development. Until that time, there’s little point in writing a driver that makes a bunch of unsafe calls to the same old exported C Language APIs.

Having done it purely as an experiment, I can say that hacking together a Windows driver in Rust today is do-able, but is mostly frustrating and ultimately unsatisfying on every level.

What we need is for MSFT to step up and provide industry leadership with a Rust Driver Framework.