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

QProcess pipe creation on Windows uses wrong modes

XMLWordPrintable

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

      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);
      

        1. QtProcessTest.zip
          15 kB
          Kees van Prooijen
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes