According to the MSDN documentation, transactional NTFS doesn't seem to allow one to block on opening a file for write - instead the open operation fails with ERROR_SHARING_VIOLATION. I'd like to block on writes instead - how can I do this?
Ideally I'd like the following properties for the solution:
- Works over a network share (so no local named mutex handles)
- Auto-releases if the owning process dies
- Doesn't require a separate file (named streams are OK)
- Allows the locking wait to have a timeout (or be cancellable from another thread or APC)
Does anyone have some experience with a locking method that works with transactional NTFS with these properties?