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

QProcess pipe creation on Windows uses wrong modes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.1.1
    • Fix Version/s: 5.2.1
    • Component/s: Core: I/O
    • Labels:
      None
    • Environment:
      Windows 8
    • Commits:
      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

              Assignee:
              jbornema Joerg Bornemann
              Reporter:
              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