This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: From Microsoft: Windows 10 Console and Cygwin

Hi Rich,

thanks for your help.

On May  1 18:51, Rich Eizenhoefer wrote:
> Hi Corinna,
> I spent most of the day yesterday and part of this AM talking with
> console devs and going through the windows codebase to  understand the
> changes between Vista and W7 (and now). The regression in
> functionality wasn't inadvertent, but related to security.

Oh, ok.  W7 introduced the conhost.exe process as well.  Was that part
of the security consideration or was the windowstation change a result
of changing to a process-based model?

> The result
> is that the console is no longer able to get the windowstation id and
> object information (oi.dwFlags) to test whether the console window
> should be visible, all things it used to do. You are right that during
> console init, our process has  already been assigned to the default
> Windows station.  I took your code and spent several hours
> experimenting as well, looking for another way to do this (simply)
> with no luck.


> I have added an item in our backlog to see how we can
> provide a secure way to allow allocating an invisible console. We have
> some ideas, just have to work with other teams in windows core to
> provide the functionality. You'd think this would be pretty easy, but
> the console driver is a little nutty and by the time we get to the
> visible or not decision point, no meaningful context is currently
> available to check against.

No worries.  I never thought that's easy stuff.  I'm looking forward to
trying out the ideas you're coming up with.

Two points:

- I'm on vacation for a while now so my replies will be a bit sluggish
  and testing anything will have to wait, too.  I hope that's ok.

- Tonight it occured to me to ask you another question:

  For a long time Cygwin is emulating pseudo ttys using named pipes.
  This works fine for Cygwin applications, but it has some downside
  when using non-Cygwin executables.  MSVCRT's isatty() function
  returns 0 for named pipes, because it's (obviously) not aware of
  Cygwin's pseudo tty functionality.  As a result, many non-Cygwin
  console applications misbehave in Cygwin terminals or remote ssh
  sessions as soon as it comes to user input or paging.

  Two possible solutions for this problem come to mind:

  - Either MSVCRT's isatty function recognizes named pipes used as
    Cygwin PTYs.  That's not tricky because the name of the pipe is a
    simple indicator.  But I could understand a certain reluctance,
    because that would require the MSVCRT guys to support this solution.

  - Or the console API could be extended (or even just documented as far
    as it exists) so that the Cygwin PTY implementation could use
    console handles under the hood, rather than named pipes.  For that
    to work, the PTY master side would have to have been able to create
    console handles and connect to the master side of them, basically
    the side which right now conhost.exe is attached to.

    Do you see a chance to open this API up to allow other processes
    than conhost to create the master side of a console, aka a PTY
    in POSIX speak?  Or is there already an existing solution I just
    don't see?

Thanks a lot,

Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: pgp5HPWCZA7So.pgp
Description: PGP signature

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]