Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-35357

QProcess pipe creation on Windows uses wrong modes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.2.1
    • 5.1.1
    • Core: I/O
    • None
    • Windows 8
    • 7009843ae3b12fe86d21040ad96add335c7df5a5

    Description

      In qprocess_win.cpp, in qt_create_pipe the pipes are only created as output channels.
      I had to change the windows system calls from this:

      hRead = CreateNamedPipe(
                pipeName,
                PIPE_ACCESS_INBOUND | FILE_FLAG_OVERLAPPED,
                dwPipeFlags,
                1,                      // only one pipe instance
                0,                      // output buffer size
                dwPipeBufferSize,       // input buffer size
                0,
                &secAtt);
      
      hWrite = CreateFile(
                pipeName,
                GENERIC_WRITE,
                0,
                &secAtt,
                OPEN_EXISTING,
                FILE_FLAG_OVERLAPPED,
                NULL);
      

      to this:

      hRead = CreateNamedPipe(
                pipeName,
                ( isInputPipe ? PIPE_ACCESS_OUTBOUND : PIPE_ACCESS_INBOUND ) | 
                  FILE_FLAG_OVERLAPPED,
                dwPipeFlags,
                1,                      // only one pipe instance
                dwPipeBufferSize,                      // output buffer size
                dwPipeBufferSize,       // input buffer size
                0,
                &secAtt);
      
      hWrite = CreateFile(
                pipeName,
                isInputPipe ? GENERIC_READ | FILE_WRITE_ATTRIBUTES :
                  GENERIC_WRITE,
                0,
                &secAtt,
                OPEN_EXISTING,
                FILE_FLAG_OVERLAPPED,
                NULL);
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              jbornema Joerg Bornemann
              keesvp Kees van Prooijen
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes