[Bug] setup.exe

Corinna Vinschen corinna-cygwin@cygwin.com
Mon Nov 18 10:06:00 GMT 2013


On Nov 17 19:07, Achim Gratz wrote:
> 
> No good deed goes unpunished… the latest changes to setup.exe to use the
> UNC path interfaces break set_cout.  This function is only used in
> unattended mode and when the help option is used and setup.exe works
> correctly when this function does not get called.
> 
> The reason for the breakage is the special filename "conout$" that is
> used to attach to the console output handle and the override to fopen
> that then treats it like any other file name and makes a UNC path
> "\\?\conout$" from it.

Thanks for tracking this down.

> If I remove the override for fopen, things are
> working again, but I can't find how to specify "conout$" via a UNC path
> and simply setting the string back to "conout$" in the attr structure in
> gdb didn't work, either.

It's impossible prior to Windows 8.  In the days before Windows 8, the
console handle was always a fake handle, entirely handled within the
Win32 kernel32.dll.  Each access to a console handle got redirected
to calling a CrsXXX functions which calls CSRSS via LPC.  Windows 8
finally introduced a native Console device called \Device\ConDrv so
consoles became real OS objects.

Having said that, this set_cout function is a real bummer.  The easiest
way to fix this problem is to rename fopen to nt_fopen (analoge to
nt_wfopen) and to change all explicit fopen calls to nt_fopen calls.
I'll do that in a minute.


Thanks again,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-apps/attachments/20131118/7a60a885/attachment.sig>


More information about the Cygwin-apps mailing list