Subject: Re: Implementing stat() with FindFirstFile()

From: Heiko Voigt <[email-masked]>
Date: Tue, 31 Mar 2009 00:07:10 +0200

On Mon, Mar 30, 2009 at 07:11:18AM +0200, Björn Steinbrink wrote:
> On 2009.03.30 02:52:47 +0200, Johannes Schindelin wrote:
> > On Mon, 30 Mar 2009, Magnus Bäck wrote:
> > > On Friday, March 27, 2009 at 03:25 CET,
> > > Johannes Schindelin <[email-masked]> wrote:
> > > > On Thu, 26 Mar 2009, Magnus Bäck wrote:
> > > > > I'd be very surprised if ZwQueryDirectoryFile() hasn't always been
> > > > > around (I just verified ntdll.dll from NT 4.0), so that's not a
> > > > > worry. Don't know why MSDN reports it as introduced in XP.
> > > >
> > > > As the current maintainer of msysGit, I refuse to have something in
> > > > the installer I ship that relies on not-at-all guaranteed interfaces.
> > > 
> > > Although I do appreciate the importance of guaranteed interfaces,
> > > I am also pragmatic. An incompatible change in ntdll.dll would break
> > > vast amounts of programs, including cygwin. There is a lot to be said
> > > about Microsoft and their APIs, but I don't think they have a habit of
> > > changing ABIs or function semantics for userland libraries that have
> > > been around for 15 years.
> > 
> > Had you pointed to some document that states that the function has been in 
> > all NT-based versions, that would have done the trick.
> 
> Not official documentation, but at least from some MS guy it seems:
> http://www.osronline.com/showThread.cfm?link=73086 (last message).
> 
> Apparently, it was in NT3.x, but they document only what's actually
> defined in the header.

How about runtime checking? You could do GetProcAddress(...) and if you
don't get it use the old behaviour. I mean if it really is faster why
not let Users of recent systems benefit from it.

cheers Heiko