valid content for ptys. Remove setting FILE_CREATE_PIPE_INSTANCE in access flags since it's not needed. Set the access mask for kernel objects according to what's returned by NtQueryInformationFile, info class FileAccessInformation.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cygwin documentation is available on the net at http://cygwin.com You might especially be interested in http://cygwin.com/faq/faq.programming.html#faq.programming.building-cygwin