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

QProcess: Make it possible to set native process creating flags

    XMLWordPrintable

Details

    • 068baa9bb6d526cccc0c8bc7cdbb84bbdf137f95

    Description

      Please make it possible to pass native process creating flags when creating a process with the QProcess class.

      Something like QProcess::setNativeCreationFlags(), which of course would be platform-specific, would be extremely helpful.

      In particular, in our project we need to pass the CREATE_BREAKAWAY_FROM_JOB creating flag on the Win32 platform.

      This flags is required, because Windows (Vista and later) automatically adds the child process to a PCA (Program Compatibility Assistant) job object.

      As a consequence, the process can NOT be added to our own job object anymore - on Win32 processes can be assigned to exactly one job object.

      And once it has been assigned to a job object (e.g. the PCA job object), a process can NOT be assigend to another job object anymore. AssignProcessToJobObject() will simply fail

      Only by using the CREATE_BREAKAWAY_FROM_JOB flag in CreateProcess(), we can avoid getting added to the PCA job object and correct functionality of AssignProcessToJobObject() is restored.

      For details please read here:
      http://blogs.msdn.com/b/cjacks/archive/2009/07/10/how-to-work-around-program-compatibility-assistant-pca-jobobjects-interfering-with-your-jobobjects.aspx

      In addition to being able to set the CREATE_BREAKAWAY_FROM_JOB flag, it would also be great to be able to set CREATE_SUSPENDED when needed.

      Normally, on Win32, we would create a process with CREATE_SUSPENDED, add the new (but suspended) process to our job object and then resume the process.

      QProcess does not currently allow us to create a process in suspended state at all

      So please consider adding QProcess::setNativeCreationFlags() in a future version. Until then, we have to patch Qt for our requirements.

      We are pretty sure that this will be very helpful for other developers too...

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-24619
          # Subject Branch Project Status CR V

          Activity

            People

              jbornema Joerg Bornemann
              mulder LoRd MuldeR
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes