This is the mail archive of the cygwin-developers mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cygwin's spawn/exec, mintty and the "Program Compatibility Assistant"


On Feb 17 15:26, Charles Wilson wrote:
> On 2/17/2012 7:18 AM, Corinna Vinschen wrote:
> > Bottom line:
> > 
> > - From observation I assume that it's all about having a runlevel manifest
> >   or not.  On W7 the binary additionally needs a special W7 compatible
> >   manifest.
> > 
> > - Console applications are only affected when started directly from the
> >   GUI.  If they are started from a correctly-manifested console app (CMD),
> >   they and their children are not affected anymore.
> > 
> > - So we would have to create all executables with a W7-compatible
> >   manifest.  That is quite certainly not an option.
> > 
> > - So we have to keep the CREATE_BREAKAWAY_FROM_JOB stuff in Cygwin
> >   for the time being.
> 
> So, should run.exe (and run2.exe) be modified to do something similar to
> what Cygwin does, since they both use CreateProcess directly?

Just tested.  Yes, that should be helpful.  For run and run2 it should be
sufficient to do what the former code in Cygwin did:

  JOBOBJECT_BASIC_LIMIT_INFORMATION jobinfo;
  if (QueryInformationJobObject (NULL, JobObjectBasicLimitInformation,
  				 &jobinfo, sizeof jobinfo, NULL)
      & (jobinfo.LimitFlags & (JOB_OBJECT_LIMIT_BREAKAWAY_OK
			       | JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK)))
    create_flags |= CREATE_BREAKAWAY_FROM_JOB;

Btw., there's an easy way to test if it worked:  Start Process Explorer
from Sysinternals.  All processes running in a PCA job object have a
brown background.  If `run foo' successfully broke away from the job,
the line for the foo process should not have a brown background.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]