Re: PR_CreateProcess() without Windows console window?

Rob Arnold <[email protected]> Fri, 30 Jul 2010 15:56:12 -0400
Newsgroups gmane.comp.mozilla.devel.nspr
Message-ID <[email protected]>
On Fri, Jul 30, 2010 at 2:08 PM, Wan-Teh Chang <[email protected]> wrote:

> On Fri, Jul 30, 2010 at 6:25 AM, Fredrik Roubert <[email protected]>
> wrote:
> > On Jul 12, 9:44 pm, Fredrik Roubert <[email protected]> wrote:
> >
> >> I'll write some example code to see what can be done with the right
> >> flags to CreateProcess().
> >
> > This turned out to be very well documented and the flag that should be
> > passed to the CreateProcess() system call is named CREATE_NO_WINDOW:
> >
> > http://msdn.microsoft.com/en-us/library/ms684863(VS.85).aspx<http://msdn.microsoft.com/en-us/library/ms684863%28VS.85%29.aspx>
> >
> > I've written a piece of sample code to verify that I understood the
> > MSDN text correctly and that this indeed does what I want. Phil has
> > filed a bug report and I've attached to possible patches to it now:
> >
> > https://bugzilla.mozilla.org/show_bug.cgi?id=583223
>
> Good find!  Thanks for doing the research and writing the patches.
>
> Rob Arnold, you posted an intelligent answer to Fredrik question
> on this thread before.  I'd appreciate your comment on using the
> CREATE_NO_WINDOW.  (Feel free to comment here or in the
> bug report.)  In particular, if "the console handle for the application
> is not set", could that be problematic?  I am not familair with this
> area.
>

I am not familiar with this flag nor do I have a deep understanding of
console IO on Windows. I'm not sure what exactly they mean by "the console
handle" but if I had to guess, it's the handle to the console screen buffer
which is used for stdout/stdin. My concern then is that the lack of a
console handle would mean that any IO or API calls to the console would
fail. This is probably OK if no one checks that their stdout IO functions
actually succeeded (quite common practice I think) or if stdout/stdin are
redirected.

-Rob