delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/02/01/01:00:12

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
Message-ID: <20050201055938.66024.qmail@web80110.mail.yahoo.com>
Date: Mon, 31 Jan 2005 21:59:38 -0800 (PST)
From: Dan Ch <force296-cygwin AT yahoo DOT com>
Reply-To: force296-cygwin AT yahoo DOT com
Subject: Re: Why does cygwin1.dll use NtCreateFile() instead of CreateFile()
To: Brian Ford <ford AT vss DOT fsi DOT com>
Cc: cygwin AT cygwin DOT com
In-Reply-To: <Pine.CYG.4.58.0501310901040.2732@fordpc.vss.fsi.com>
MIME-Version: 1.0
X-IsSubscribed: yes

On Mon, 31 Jan 2005, Brian Ford wrote:
> 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().
>
> IIRC, NtCreateFile is significantly cheaper if you already have a file
> handle, especially on network drives where the name to handle
> translation and open are fairly expensive.  The original reason was
> purely performance (since I believe my company paid for some of this
> optimization).

Thank you for answering my question.  Now I understand why
CreateFile() instead of NtCreateFile() probably did not cause
any major bugs.

Dan Ch.


--
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