This is the mail archive of the
mailing list for the Cygwin project.
Re: Why does cygwin1.dll use NtCreateFile() instead of CreateFile()
- From: Igor Pechtchanski <pechtcha at cs dot nyu dot edu>
- To: Dan Ch <force296-cygwin at yahoo dot com>
- Cc: cygwin at cygwin dot com
- Date: Sun, 30 Jan 2005 13:50:04 -0500 (EST)
- Subject: Re: Why does cygwin1.dll use NtCreateFile() instead of CreateFile()
- References: <firstname.lastname@example.org>
- Reply-to: cygwin at cygwin dot com
On Sun, 30 Jan 2005, Dan Ch wrote:
> I noticed that cygwin-1.5.12-1/winsup/cygwin/fhandler.cc
> uses NtCreateFile() instead of CreateFile() on Windows NT based
> operating systems (NT, 2000, 2003, XP) for opening files. Why? I
> checked the archives for this mailing list and noted some activity
> that discuses some side affects caused by using NtCreateFile()
> instead of CreateFile() such as being able to use file names that are
> off limits to normal Windows applications. But I could not find
> anything that explains the benefits of using NtCreateFile() instead
> of CreateFile().
This is a reasonable question, with the answer buried in the (private)
archives of cygwin-developers. I'm taking the liberty of quoting the
On Fri, 16 Apr 2004, Corinna Vinschen wrote on cygwin-developers:
> I've changed fhandler_base::open to use NtCreateFile now. After some
> head scratching and searching with google, I read that the Win32
> CreateFile call adds some access bits at its own will, namely the
> FILE_READ_ATTRIBUTES and SYNCHRONIZE bits. The latter is a problem when
> a user has no FILE_READ_DATA permission on a file since that apparently
> seem to disallow requesting SYNCHRONIZE.
An aside to CGF and Corinna: I have seen (and mostly agree) with the
reasons for keeping the cygwin-developers archives private, but questions
like this may, IMO, occasionally require us to quote messages from there.
I feel that this particular quote was justified, but please let me know if
you don't think it was.
P.S. When someone's subscription request to cygwin-developers is approved,
does the welcome message contain the instructions for accessing the
archives? If it does -- great. If not, it should.
|\ _,,,---,,_ email@example.com
ZZZzz /,`.-'`' -. ;-;;,_ firstname.lastname@example.org
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html