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/
In my testing it looks like FILE_COMPLETE_IF_OPLOCKED flag is working fine on windows 7 but is being ignored on windows 10.
1. Open a file with FILE_OPEN_REQUIRING_OPLOCK (desired access aren't of much interest but I have tried with various combination of Read/Write flags)
2. Without closing the file, in the same thread open another instance of same file with FILE_COMPLETE_IF_OPLOCKED flag. This open returns STATUS_OPLOCK_BREAK_IN_PROGRESS on windows 7 but returns STATUS_SUCCESS on windows 10. On Windows 7 Ntfs!NtfsFsdCreate returns STATUS_OPLOCK_BREAK_IN_PROGRESS and IoStatus.Status is also the same. In case of windows 10, both of those return a value of STATUS_SUCCESS.
3. Try to read/write/delete on second handle, it hangs (as expected waiting on oplock to be broken, which will never happen)
Same behavior observed even when Oplock is requested using FSCTL_REQUEST_OPLOCK before attempt to open the file again and it still succeeds.
Is this change in behavior from windows 7 to windows 10 expected ?
It may not be always possible for a filter to know if any previous handles were opened with FILE_OPEN_REQUIRING_OPLOCK, so what is the best way to know if a file is already oplocked ?
Any help is much appreciated.
It looks like you're new here. If you want to get involved, click one of these buttons!
|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||30 Mar 2020||OSR Seminar Space|
|Developing Minifilters||15 Jun 2020||LIVE ONLINE|
|Writing WDF Drivers||22 June 2020||LIVE ONLINE|
|Internals & Software Drivers||28 Sept 2020||Dulles, VA|