Driver Problems? Questions? Issues?
Put OSR's experience to work for you! Contact us for assistance with:
  • Creating the right design for your requirements
  • Reviewing your existing driver code
  • Analyzing driver reliability/performance issues
  • Custom training mixed with consulting and focused directly on your specific areas of interest/concern.
Check us out. OSR, the Windows driver experts.

OSR Seminars

Go Back   OSR Online Lists > ntfsd
Welcome, Guest
You must login to post to this list
  Message 1 of 3  
12 Apr 18 11:10
Alnoor Allidina
Join Date: 27 Jun 2013
Posts To This List: 8
IO_IGNORE_SHARE_ACCESS_CHECK and file sharing (redux)

Hi all, On a couple of occasions, we?ve been surprised at the outcome of the following test: Open an existing file via FltCreateFileEx2 (or similar) with: DesiredAccess = FILE_READ_DATA ShareAccess = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE Flags = IO_IGNORE_SHARE_ACCESS_CHECK While the file handle is still open, open the same file with: DesiredAccess = FILE_WRITE_DATA ShareAccess = 0 Flags = 0 We expect the second open to fail with STATUS_SHARING_VIOLATION, since the file is already open for READ and the sharing flags are incompatible. However, the second open succeeds. We find the same regardless of the desired access of the second open ? FILE_READ_DATA and DELETE also work. We?ve reproduced this on Windows 7 SP1 as well as Windows 10 SP3. When I finally decided to post my puzzlement to NTFSD, the site was down due to the OSR office move. Later I found a similar observation, without explanation: As it turns out, if IO_IGNORE_SHARE_ACCESS_CHECK is passed in, IoCheckShareAccess does not update the counts in the SHARE_ACCESS struct of the FCB. So, subsequent opens are not affected by the access permissions or share access. Given this undocumented behavior, I wrote a blog post. I recently came across quite a complicated approach to avoid sharing violations -- this way is much easier and should be made more obvious. k Feedback is most welcome. Thanks, Alnoor
  Message 2 of 3  
13 Apr 18 19:43
Scott Noone
Join Date: 10 Jul 2002
Posts To This List: 1026
List Moderator
IO_IGNORE_SHARE_ACCESS_CHECK and file sharing (redux)

It's funny because I have always assumed IO_IGNORE_SHARE_ACCESS_CHECK "sneaks in" and thus does not affect current or future sharing requests. However, this wasn't based on any documentation or testing, just an assumption that that must be the way it works. Clearly you assumed it worked a different way and were burned by it. In the end, we all end up paying for assuming at some point :) Nice thing to point out in a blog post and the documentation could certainly use an update. -scott OSR @OSRDrivers
  Message 3 of 3  
15 Apr 18 20:43
Alnoor Allidina
Join Date: 27 Jun 2013
Posts To This List: 8
IO_IGNORE_SHARE_ACCESS_CHECK and file sharing (redux)

Thanks. We're quite happy about this behavior, as it exonerates our component in a customer issue. The lack of documentation does hurt though -- we wasted many hours exploring theories that had no basis in reality. Alnoor
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntfsd list to be able to post.

All times are GMT -5. The time now is 17:21.

Copyright ©2015, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license