Author Segev Finer
Recipients Bernt.Røskar.Brenna, Segev Finer, eryksun, paul.moore, sbt, steve.dower, tim.golden, vstinner, zach.ware
Date 2017-01-13.17:22:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1484328151.17.0.58765112017.issue19764@psf.upfronthosting.co.za>
In-reply-to
Content
I have read some of https://github.com/rprichard/win32-console-docs and it documents quite a bunch of nastiness with PROC_THREAD_ATTRIBUTE_HANDLE_LIST in Windows Vista/7. Windows is so much fun sometimes :P

Essentially console handles in Windows before Windows 8 are user mode handles and not real kernel handles. Those user mode handles are inherited by a different mechanism than kernel handles and regardless of PROC_THREAD_ATTRIBUTE_HANDLE_LIST, and if passed in PROC_THREAD_ATTRIBUTE_HANDLE_LIST will cause it to fail in weird ways. Those user mode console handles have the lower two bits set. The lower two bits in Windows are reserved for tagging such special handles.

Also in all versions you can't pass in an empty handle list, but a list with just a NULL handle works fine.

See: https://github.com/rprichard/win32-console-docs/blob/master/src/HandleTests/CreateProcess_InheritList.cc

I attached a version of the patch with a hack around those issues based on what I read, but I can't test that it actually fixes the issues since I don't have a Windows Vista or 7 system around.
History
Date User Action Args
2017-01-13 17:22:31Segev Finersetrecipients: + Segev Finer, paul.moore, vstinner, tim.golden, Bernt.Røskar.Brenna, sbt, zach.ware, eryksun, steve.dower
2017-01-13 17:22:31Segev Finersetmessageid: <1484328151.17.0.58765112017.issue19764@psf.upfronthosting.co.za>
2017-01-13 17:22:31Segev Finerlinkissue19764 messages
2017-01-13 17:22:30Segev Finercreate