Re: Mandatory locking

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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


.



Relevant Pages

  • RE: Linux GPL and binary module exception clause?
    ... the COPYING file for the kernel. ... the suggestion has been to have a separate copy of the header ... > with the Cygwin toolkit for Windows. ... > using the Cygwin libraries is a derived work and must be GPL. ...
    (Linux-Kernel)
  • Re: Building the kernel with Cygwin
    ... >> After untaring the kernel, ... >> with cygwin? ... >this information by persons or entities other than the intended recipient ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: case-sensitive file names during build
    ... I maintain patches that allow building glibc on Cygwin and MacOSX. ... The main patch deals with exactly this issue ... to help install the kernel headers, ...
    (Linux-Kernel)
  • Re: Building the kernel with Cygwin
    ... Building the kernel with Cygwin ... You could try giving windows absolute path. ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Building the kernel with Cygwin
    ... I am trying to build a kernel for a powerpc target using cygwin on ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)