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.
|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||7 Dec 2020||LIVE ONLINE|
|Internals & Software Drivers||25 Jan 2021||LIVE ONLINE|
|Developing Minifilters||8 March 2021||LIVE ONLINE|