This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Fix cygwin compilation failure due to nameless LOAD_DLL_DEBUG_EVENT causes ntdll.dll to be missing
- From: Eli Zaretskii <eliz at gnu dot org>
- To: gdb-patches at sourceware dot org
- Date: Wed, 18 Dec 2013 22:01:37 +0200
- Subject: Re: [RFA] Fix cygwin compilation failure due to nameless LOAD_DLL_DEBUG_EVENT causes ntdll.dll to be missing
- Authentication-results: sourceware.org; auth=none
- References: <52ab8d0e dot 8aa2420a dot 30ff dot ffffd8f1SMTPIN_ADDED_BROKEN at mx dot google dot com> <52AF3493 dot 9090708 at redhat dot com> <20131218112045 dot GQ30010 at calimero dot vinschen dot de> <83bo0ecgdw dot fsf at gnu dot org> <20131218160707 dot GV30010 at calimero dot vinschen dot de> <834n66ccs9 dot fsf at gnu dot org> <20131218171819 dot GY30010 at calimero dot vinschen dot de> <831u1acblu dot fsf at gnu dot org> <20131218173155 dot GA30010 at calimero dot vinschen dot de> <83zjnyaupt dot fsf at gnu dot org> <20131218191757 dot GC30010 at calimero dot vinschen dot de>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Wed, 18 Dec 2013 20:17:57 +0100
> From: Corinna Vinschen <vinschen@redhat.com>
>
> > > I don't know, but I doubt it. The filenames in case of calling the
> > > _wfopen functions are probably sent directly to the underlying WIn32
> > > functions.
> >
> > I don't think they can do that, because it would mean that relative
> > file names, "../foo", etc. are forbidden for _wfopen. The CRT
> > functions must go through file-name normalization, so unless they
> > detect \\?\ file names up front and refrain from any processing, the
> > long file names will not work, because the normalization routines are
> > where these limitations live, AFAIK.
>
> There's a lot of theory here. Did you actually *try* it?
No. Who can afford to try everything, unless they are paying you to
do that?
> I just did:
>
> ===========================================
> #include <stdio.h>
> #include <errno.h>
>
> int main(void)
> {
> FILE *fp;
>
> fp = _wfopen (L"\\\\?\\C:\\Windows\\System32\\ntdll.dll", L"r");
> if (!fp)
> printf ("_wfopen w/ long pathname fails, errno = %d\n", errno);
> else
> {
> printf ("_wfopen w/ long pathname works\n");
> fclose(fp);
> }
> return 0;
> }
> ===========================================
Thanks, that's good to know. But that's just one CRT function. There
are a gazillion of them, and I'm quite sure some use MAX_PATH of 260
internally. Just grep the sources of the CRT functions.