Re: Mandatory locking
- From: "Don Burn" <burn@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 12 Mar 2008 13:56:03 -0400
Well LockFile and LockFileEx are the Win32 wrappers for ZwLockFile and
UnlockFIle and UnlockFileEx are the ZwUnlockFile equivalents. In the kernel
you need to send an IRP_MJ_LOCK_CONTROL to the file system to do things.
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
"Corinna Vinschen" <corinna@xxxxxxxxxxxxxxxx> wrote in message
news:fr94ml$bqe$1@xxxxxxxxxxxxxxxxxx
Hi,
Is there any support for mandatory locking in the NT kernel, which would
be accessible from Win32 user space processes?
I'd like to implement mandatory locking in Cygwin. It doesn't matter if
non-Cygwin processes know about these mandatory locks or not, as long as
I can control the behaviour for Cygwin processes from within the Cygwin
DLL.
So far it looks like I'd have to handle all lock bookkeeping in the DLL
itself. I tried to utilize the "key" parameter in calls to ZwLockFile/
ZwUnlockFile(*), but either they don't work as suggested, or I used them
wrongly.
Thanks for any hint in advance,
Corinna
(*) I know, these calls are undocumented. Sigh.
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat
.
- Follow-Ups:
- Re: Mandatory locking
- From: Corinna Vinschen
- Re: Mandatory locking
- References:
- Mandatory locking
- From: Corinna Vinschen
- Mandatory locking
- Prev by Date: Mandatory locking
- Next by Date: Re: Stack overflow
- Previous by thread: Mandatory locking
- Next by thread: Re: Mandatory locking
- Index(es):
Relevant Pages
|