Re: [RFA] Fix cygwin compilation failure due to nameless LOAD_DLL_DEBUG_EVENT causes ntdll.dll to be missing

Eli Zaretskii
2013-12-18T17:29:13Z

> Date: Wed, 18 Dec 2013 18:18:19 +0100
> From: Corinna Vinschen <vinschen@redhat.com>
>
> On Dec 18 19:03, Eli Zaretskii wrote:
> > > Date: Wed, 18 Dec 2013 17:07:07 +0100
> > > > Are you sure that 32K capability cannot be had with ANSI file names
> > > > using the \\?\ notation?
> > >
> > > Yes. The \\?\ notation only works in the UNICODE API[*]. The reason
> > > is that the ANSI API is just a thin layer over the actual UNICODE
> > > functionality, and the conversion from ANSI to UNICODE is done using a
> > > per-thread fixed-size buffer of 520 bytes.
> >
> > Does this mean that using \\?\ with ANSI-encoded file names buys us
> > 520-byte file names?
>
> 260 char ANSI -> 520 bytes UTF-16

Oh, I misunderstood then.

So lifting the 260-char limit means both go to Unicode _and_ use the
\\?\ format of file names, is that right? If so, it probably means
that CRT functions that accept wchar_t arrays as file names (_wfopen
etc.) cannot be used with such long file names, and one needs to call
the Win32 APIs directly. Correct?