delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/01/30/13:50:27

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Sun, 30 Jan 2005 13:50:04 -0500 (EST)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Dan Ch <force296-cygwin AT yahoo DOT com>
cc: cygwin AT cygwin DOT com
Subject: Re: Why does cygwin1.dll use NtCreateFile() instead of CreateFile()
In-Reply-To: <20050130182916.55154.qmail@web80109.mail.yahoo.com>
Message-ID: <Pine.GSO.4.61.0501301341580.23053@slinky.cs.nyu.edu>
References: <20050130182916 DOT 55154 DOT qmail AT web80109 DOT mail DOT yahoo DOT com>
MIME-Version: 1.0

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
answer here:

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.
	Igor
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.
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,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
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019