Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results


Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging

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:

FSCTL_OFFLOAD_WRITE: getting file change offsets for offloaded data transfers

WinCPPWinCPP Member Posts: 6


I am writing a file system filter driver to intercept the writes to a file. I have handled IRP_MJ_WRITE to obtain the offset and length when a file is being modified.

Also, I have handled the minor function code FSCTL_OFFLOAD_WRITE for the major function code IRP_MJ_FILE_SYSTEM_CONTROL to intercept offloaded writes. The intention is to obtain the offset and lengths for the changes that happen to the file during offloaded data transfer. However, I am not able to find any data structure/member which will give offset and length. FSCTL_OFFLOAD_WRITE is accompanied by FSCTL_OFFLOAD_WRITE_INPUT and FSCTL_OFFLOAD_WRITE_OUTPUT but they appear to be for initiating the ODX operation in conjunction with FSCTL_OFFLOAD_READ and do not appear to be related to FLT_PARAMETERS::FileSystemControl::Buffered that is available on intercepting IRP_MJ_FILE_SYSTEM_CONTROL.

Given that, I am now wondering if Microsoft provided minor function code FSCTL_OFFLOAD_WRITE in major function code IRP_MJ_FILE_SYSTEM_CONTROL, only to give file system filter drivers a right of first refusal in case they want to explicitly block offloaded data transfers. Perhaps, providing the offset and lengths was never the intention? And if it is indeed true, then I am not sure where and how can I obtain the offset and length for the changes that happen within a file on ODX operations.

Highly appreciate any help/advice on how I could possibly obtain the offsets and lengths for offloaded data transfers.

Thanks in advance,

ODX Considerations for Filter Drivers:
ODX usage in HyperV/MSSQL:


  • Scott_Noone_(OSR)Scott_Noone_(OSR) Administrator Posts: 3,482

    Aren't FileOffset and CopyLength what you're looking for? Or are you trying to see the data as well?


  • WinCPPWinCPP Member Posts: 6

    Hi Scott,

    Thanks for the reply.

    Yes, those are the values that I am interested in. Due to oversight, I had missed the fact that the FSCTL_OFFLOAD_WRITE_INPUT is provided through the FLT_PARAMETERS::FileSystemControl::Buffered::SystemBuffer member and it needs to be reinterpreted back to FSCTL_OFFLOAD_WRITE_INPUT to obtain the necessary offset and length. So I think I am good for now.


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

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!
Writing WDF Drivers 12 September 2022 Live, Online
Internals & Software Drivers 23 October 2022 Live, Online
Kernel Debugging 14 November 2022 Live, Online
Developing Minifilters 5 December 2022 Live, Online