[Patch]: NUL and other special names

Christopher Faylor cgf-no-personal-reply-please@cygwin.com
Thu Jun 3 22:29:00 GMT 2004

On Thu, Jun 03, 2004 at 06:14:58PM -0400, Christopher Faylor wrote:
>On Thu, Jun 03, 2004 at 04:35:00PM -0400, Christopher Faylor wrote:
>>On Thu, Jun 03, 2004 at 03:53:40PM -0400, David Fritz wrote:
>>>I don't how much you want to rely on undocumented features, but ntdll.dll 
>>>exports a function called RtlIsDosDeviceName_U().  The WINE implementation 
>>>has the following to say about it:
>>> *             RtlIsDosDeviceName_U   (NTDLL.@)
>>> *
>>> * Check if the given DOS path contains a DOS device name.
>>> *
>>> * Returns the length of the device name in the low word and its
>>> * position in the high word (both in bytes, not WCHARs), or 0 if no
>>> * device name is found.
>>> */
>>>ULONG WINAPI RtlIsDosDeviceName_U( PCWSTR dos_name )
>>THANK YOU!  This is what I was vaguely remembering.
>Interestingly enough, I just added some checking to fhandler_base::open which
>used RtlIsDosDeviceName_U.  It caused a reboot of my XP system every time
>I tried it.  That's a first for XP.

Oops.  No, that was the result of passing garbage to
InitializeObjectAttributes apparently.  Seems like a pretty serious XP
bug regardless.

I've checked in a minimal change which protects against calling NtCreateFile
on a dos device.  Now what was the method that was used to get rid of those
pesky NULs and COM1s on my disk again?


More information about the Cygwin-patches mailing list