Improved Microsoft Dev Drive detection#2873
Conversation
The `IsMsDevDrive` function has been refactored to use the `FSCTL_QUERY_PERSISTENT_VOLUME_STATE` control code for detecting Microsoft Dev Drives. This replaces the previous approach of analyzing drive layout which was not always correct.
|
Can I ask you where exactly you got the information that Especially, the Microsoft documentation for this flag shows that it has existed since Windows 7, and Windows 7 obviously did not have dev drives... My worry is that, by filtering out all drives with If the issue was that some non dev drives were listed by Rufus, and that these drives had the Otherwise, I fear that, in some months' time, someone will come with a new PR because they found that the approach of only checking |
|
Of course you may ask where I got the information from. I was looking for a similar solution for another project and looked at the current implementation from Rufus. In doing so, I noticed that the current implementation is more of a guessing approach and doesn't work for Dev Drives with different storage sizes. After a longer search, I found the solution shown in other GitHub repositories. With the knowledge about the flag, you can also find something in the WDK: ### -field VolumeFlags
The persistent state settings for a file system volume. This value is a bitwise OR combination of the following.
| Value | Meaning |
| ----- | ------- |
...
| PERSISTENT_VOLUME_STATE_DEV_VOLUME 0x00002000 | Indicates that this volume is formatted as a developer volume. This can be used by the file system and other system components to enable optimizations that don't require an administrator to trust the volume on a given machine. Valid starting with Windows 11, version 22H2 September Update. |And since I consider the current solution to be incorrect or insufficient, because anyone can create a VHD with this format ( |
|
Oh, it looks like I browsed your PR too fast and mistook Obviously the flag is designed to detect dev drives, in which case, this PR works for me, and can indeed greatly simplify the code. Sorry about the noise. |
|
Applied. Thanks again! |
The
IsMsDevDrivefunction has been refactored to use theFSCTL_QUERY_PERSISTENT_VOLUME_STATEcontrol code for detecting Microsoft Dev Drives. This replaces the previous approach of analyzing drive layout which was not always correct.Old:

New:
