On Mon, May 27, 2002 at 02:44:52PM -0400, Christopher Faylor wrote: >On Mon, May 27, 2002 at 08:38:32PM +0200, Corinna Vinschen wrote: >>On Mon, May 27, 2002 at 01:43:54PM -0400, Chris Faylor wrote: >>> In the process of researching this, I discovered that NT has a mechanism >>> for determining a filename from an open handle so I'm trying to work >>> that into dtable.cc. >> >>Interesting. Could you provide some link? MSDN or so? > >It's in the Native API reference. NtQueryObject or NtQueryInformationFile. >I had something working nicely with NtQueryInformationFile but then found out >that it wasn't actually returning drive info. So, the common google wisdom >was that NtQueryObject should be used instead. I assume that will probably >return something like \device\whatever\dir\foo, though. > >The Windows 9x stuff mentions the use of VXDs although there is a hint that >maybe that's not necessary.
I've just checked in a cleanup of fhandler_disk_file::fstat which attempts to avoid opening the file, where possible. Instead, it uses the already existing FindFirstFile logic. When it is necessary for the file to be opened, in theory, it attempts to do so in query_open mode if it already knows the file's executable state. So, given the original reason for the patch that started this thread, the -X and -E options should have a much greater impact on performance. I also added an NT-specific routine to determine the file name from it's handle. That means the binmode/textmode mounts should work correctly when redirecting files on the console in Windows NT. My quest to find functions for doing this on Windows 9x continues. A snapshot is building now. FYI, cgf
