<div>Opening a bare console for read currently fails, because when a</div><div>key is pressed the kernel code needs to inject it into the keyboard</div><div>buffer which it does with WriteConsoleInput. Unfortunately this</div>
<div>fails as it assumes that the handle in use was opened for write.</div><div>Although reproducable with a standalone testcase, I noticed this</div><div>when trying to get cmd.exe 'copy CON filename' type support working.</div>
<div><br></div><div>This patch handles the failure only case, and retries having opened</div><div>a new handle to the console in read/write mode, hence having no</div><div>effect on the 'normal' scenario.</div><div>
<br></div><div>(Thanks to Eric for help with this one)</div><div><br></div><div>[Fixes 32183 and along with previous patch, fixes bug 16214]</div>