Mail Archives: djgpp-workers/2000/12/01/02:51:20
> Date: Thu, 30 Nov 2000 21:56:19 -0500
> From: "Peter J. Farley III" <pjfarley AT banet DOT net>
>
> At 09:27 AM 11/30/00 -0500, Mark E. wrote:
> >> Does the IOCTL subfunction or poking the SFT allow to set the
> >> SH_DENY* bits for files that are already open?
>
> >You can fiddle with those flags in the SFT, but I haven't
> experimented >with them.
>
> OK, you folk are beyond my level of knowledge here. Are you saying
> there is an alternate way to set up read locks?
Yes, you can implement a sort of shared locks on the entire file by
setting the sharing bits of the handle.
> Assuming that these bits can be set on an open file, how would it
> work?
The idea is to set the relevant bit(s) with either Int 21h/AX=4401h or
by directly poking the SFT. Then Windows' VSHARE will refuse other
processes/handles access to the file.
However, I don't think this is worth your hassle to implement this
now. Poking the SFT is not reliable enough, and doesn't allow to lock
parts of a file. So I think leaving a FIXME comment about this
possibility in the sources, and treating shared locks as write locks
would be enough at this time.
- Raw text -