Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results
The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.
Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/
I'm trying to veto the bypassed operation. To do this, in PreCallback in case of receiving IRP_MJ_FILE_SYSTEM_CONTROL and Data->Iopb->Parameters.File System Control.Common.FsControlCode == FSCTL_MANAGE_BYPASS_IOS calling this function
Then I finish PreCallback with the status FLT_PREOP_COMPLETE.
The problem is that in USER_SPACE, in this case, garbage arrives in the outputbuffer. And I don't understand why.
Can someone suggest?
I act according to the instructions: https://learn.microsoft.com/en-us/windows-hardware/drivers/ifs/bypassio-operations
Example code
if (Data->Iopb->Parameters.FileSystemControl.Common.FsControlCode == FSCTL_MANAGE_BYPASS_IO) { UNICODE_STRING reason; PFS_BPIO_INPUT in; in = Data->Iopb->Parameters.FileSystemControl.Buffered.SystemBuffer; if (in) { if (in->Operation == FS_BPIO_OP_ENABLE || in->Operation == FS_BPIO_OP_QUERY) { RtlInitUnicodeString(&reason, L"does not support bypassio"); status = FltVetoBypassIo(Data, FltObjects, STATUS_ACCESS_DENIED, &reason); return FLT_PREOP_COMPLETE; } } } ...
Upcoming OSR Seminars | ||
---|---|---|
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead! | ||
Kernel Debugging | 13-17 May 2024 | Live, Online |
Developing Minifilters | 1-5 Apr 2024 | Live, Online |
Internals & Software Drivers | 11-15 Mar 2024 | Live, Online |
Writing WDF Drivers | 26 Feb - 1 Mar 2024 | Live, Online |
Comments
Did you do this bit:
Your code doesn't show that bit.
Yes, I figured it out, thank you very much. A rather strange situation, you need to update the structure in Data->Iopb->Parameters.FileSystemControl.Buffered.SystemBuffer in PostCallback.
PostCallback!! What the documentation does not say a word about. And it confuses me
And theoretically, it is not necessary to call FltVetoBypassIo at all
Which is very strange...
That makes 0 sense, as the I/O already went down. FltMgr would need to
renegotiate with the FS after.
Dejan.