This is the mail archive of the
mailing list for the Cygwin project.
Re: Why does cygwin1.dll use NtCreateFile() instead of CreateFile()
- From: Dan Ch <force296-cygwin at yahoo dot com>
- To: cygwin at cygwin dot com
- Date: Sun, 30 Jan 2005 19:47:22 -0800 (PST)
- Subject: Re: Why does cygwin1.dll use NtCreateFile() instead of CreateFile()
- Reply-to: force296-cygwin at yahoo dot com
On Sun, 30 Jan 2005, Reini Urban wrote:
> Dan Ch schrieb:
> > Thank you for providing some information. But I do not understand
> > what types of objects require read permission in order to successfully
> > open with SYNCHRONIZE access. On Windows XP Professional SP2, using
> > CreateFile(...,GENERIC_WRITE | SYNCHRONIZE, ...) to open an ordinary
> > file on a local drive that has write-only permissions does not seem
> > to be a problem. I am primarily interested in the "buggy behavior"
> > that a user would experience if CreateFile() was used instead
> > of NtCreateFile().
> Special filenames in subdirs like con,prn,aux,nul,lpt1 et al do not work
> with CreateFile(), but do work as plain files with NtCreateFile().
Thank you for your answer and sample program. I think being able to
use reserved names like con and prn for ordinary files is a negative
instead of a positive. Files with these names can not be deleted or
renamed with rm or Windows Explorer unless you know the "secret"
prefix that was mentioned on this list several months ago. Note that
the current version (1.5.12-1) of Cygwin checks for these names
before deciding whether to use NtCreateFile() or CreateFile() which
prevents these names from being used for ordinary files.
I am still interested if old (pre NtCreateFile()) versions of Cygwin
had "buggy" behavior other than not being able to use reserved file
names that required switching to NtCreateFile() to solve.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html