On Thu, Sep 9, 2010 at 11:12 PM, Axel Holzinger <aholzinger@gmx.de> wrote:
Hi Martin et al,

On Thu, Sep 9, 2010 at 7:12 PM, Martin Mocko wrote:
> On Thu, Sep 9, 2010 at 3:53 PM, Axel Holzinger
> <aholzinger@gmx.de> wrote:
 > I doubt console application have something to do with cmd.exe
> shell. I'd say OS just creates console (as in
> http://msdn.microsoft.com/en-us/library/ms682073(VS.85).aspx)
> for std handles when process can't inherit one from parent.
I don't want to insist on cmd.exe being involved. Fact is that there
is code involved that doesn't come from bash sourcecode and makes all
the window drawing and - and this is just my opinion, no proove yet -
is responsible for the 8K commandline limit.

but does the console code have anything to do with passing parameters? I don't say it is impossible, but I can't really imagine how. How would fact that program's output goes to console (and not file, pipe, or whatever) affect passing command line argument (eg. in CreateProcess(), which is called outside console code)? I can't really imagine.

BTW, I haven't heard about windows console using bash code, can you point me to somewhere where I learn more on this?

>       To gain the 32768 characters commandline that
>     NT/XP/Vista/7 offers via its CreateProcess function
>     MinGW/MSys bash would need to be a native
>       Win32 application instead of a console application.
> Nitpick warning: "native win32 application" is not correct
> term here. It is obvious what you mean ("GUI win32
> application", the subsystem is called "GUI"). "Native"
> subsystem exists too and it is something different.

Also nitpicking: What you mean is native NT. Win32 is already a
subsystem, like POSIX.

Heh-heh, right, good one ;)
I just meant a Win32 process without the
/console parameter that does all the windowing and keyboard input on
ist own. If you like, which does the GUI part on ist own. A Win32
process running in the Win32 subsystem can be a process without any
window/GUI at all.

Well, it's not really extra flag in Win32-subsystem NT executables. There is field "Subsystem" in IMAGE_OPTIONAL_HEADER, which can be IMAGE_SUBSYSTEM_NATIVE, IMAGE_SUBSYSTEM_WINDOWS_GUI, IMAGE_SUBSYSTEM_WINDOWS_CUI (or some other). It was in this context I called console a "subsystem" on par with native. But of course I agree from programmer's point of view, it appears more like a extra flag than a separate subsystem.