This is an archive of the discontinued LLVM Phabricator instance.

Fix inferior's i/o connections to its console window on Windows 7
ClosedPublic

Authored by amccarth on May 28 2015, 1:53 PM.

Details

Reviewers
zturner
Summary

Passing NULL for the standard handles is documented to do the right thing, but it doesn't work on Windows 7. However, passing the result of GetStdHandle does seem to work, and is recommended in this MSDN article, which specifically talks about overriding just some of the i/o handles in a new process with its own console window: https://support.microsoft.com/en-us/kb/190351 .

Can you patch this in and confirm that it still works on newer versions of Windows?

Diff Detail

Event Timeline

amccarth updated this revision to Diff 26732.May 28 2015, 1:53 PM
amccarth retitled this revision from to Fix inferior's i/o connections to its console window on Windows 7.
amccarth updated this object.
amccarth edited the test plan for this revision. (Show Details)
amccarth added a reviewer: zturner.
amccarth added a subscriber: Unknown Object (MLST).
zturner added inline comments.May 28 2015, 2:16 PM
source/Host/windows/ProcessLauncherWindows.cpp
37–39

I think this would be a little better if we change the implementation of GetStdioHandle() to just return the right thing.

amccarth added inline comments.May 28 2015, 3:11 PM
source/Host/windows/ProcessLauncherWindows.cpp
37–39

I had started down that path, but ended up here because the caller doesn't otherwise know if it should close the handle.

zturner accepted this revision.Oct 15 2015, 1:47 PM
zturner edited edge metadata.
This revision is now accepted and ready to land.Oct 15 2015, 1:47 PM
Eugene.Zelenko added a subscriber: Eugene.Zelenko.

Committed in r238629.