Bypass i/o support query APIs

Hello, I am trying to query (via API) if both the filter and storage stacks support BypassIo. However, when only the volume/storage don’t support it (no NVMe disk), I get no failure in the API. Neither in the DIOC/FSCTL API return code nor the outputData.Query.Status. I tried using the file handle and the volume handle and also to send IOCTL and not FSCTL on a disk handle. How do I make the query and get results like fsutil bypassio state does? Regards, Dejan.

Hi Dejan-

Fsutil uses the documented FSCTL_MANAGE_BYPASS_IO IOCTL to query BypassIO support for a given volume. Can you please post the output from fsutil bypassio state <driveletter> /v from the system in question?

Thanks in advance,
Dave Buches
Windows CoreFS Dev

Hello,

This is the output:
BypassIo on “C:\Users\Dejan\Desktop” is supported.
Storage Type: SATA
Storage Driver: Not BypassIo Compatible
Driver Name: volmgr.sys

It is this volmgr.sys that I am curious about. Even BPIO enable IOCTL
succeeds on this system for a file, no errors at all. But obviously it
would not work.

Dejan.

Hi Dejan

There are a couple of things that are contributing to some confusion here.

The first is that the currently available documentation doesn’t do a great job of explaining that it is possible to enable bypass-IO on a file hosted on a volume where the filter stack supports bypass-IO, but the underlying storage stack does not. In such a scenario (which I suspect is what you’re seeing), reads for bypass-IO enabled files will bypass the filter stack, but still be sent down the volume stack. I will file a documentation bug to better explain this.

The second is that FsUtil wasn’t providing much help in understanding this. This has been addressed with more recent builds of Windows (this is output from one of my machines running Windows 11 22H2):

PS C:> fsutil.exe bypassio state c:
BypassIo on "c:" is partially supported
Volume stack bypass is disabled (iaStorAVC.sys)
Storage Type: RAID
Storage Driver: Not BypassIo Compatible

Dave Buches
Windows CoreFS Dev

Hello, Dave,

Thanks, that partially explains the output.
Which API/IOCTL can we use to query the volume stack for BPIO support? I
have tried using the BPIO query IOCTL (not FSCTL) but it does not fail
either.

Regards, Dejan.

Hi Dejan

If the volume stack supports BPIO, you should see the FSBPIO_OUTFL_COMPATIBLE_STORAGE_DRIVER bit inFS_BPIO_OUTPUT::OutFlags for FS_BPIO_OP_ENABLE, FS_BPIO_OP_QUERY, andFS_BPIO_OP_GET_INFO operations.

Dave Buches
Windows CoreFS Dev

Many thanks, Dave! That concludes the API baaed check the feature works!

Wow. secnvme.sys which is just driver Samsung provides is also partially compatible, “Volume stack bypass is disabled”. Had to uninstall it and it works now fully.

Same happens with EhStorClass.sys, whatever that is https://imgur.com/sV3wzts