Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
From: Chris Faylor <cgf@cygnus.com>
Date: Wed, 11 Oct 2000 17:23:58 -0400
To: cygwin@sources.redhat.com
Subject: Re: argv weirdness with latest snapshot
Message-ID: <20001011172358.A13743@cygnus.com>
Reply-To: cygwin@sources.redhat.com
Mail-Followup-To: cygwin@sources.redhat.com
References: <80256975.002D984F.00@d06mta06.portsmouth.uk.ibm.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.3.6i
In-Reply-To: <80256975.002D984F.00@d06mta06.portsmouth.uk.ibm.com>; from BHOLAM@uk.ibm.com on Tue, Oct 10, 2000 at 08:51:51PM +0100

On Tue, Oct 10, 2000 at 08:51:51PM +0100, BHOLAM@uk.ibm.com wrote:
>You wanted some testing of the latest snapshot for the upcoming 1.1.5 so
>here goes.
>
>I have a program that uses the Windows API CreateProcess to run another
>program. This is a very small program which I compile using -mno-cygwin.
>If the execed program is a non-cygwin program then the argument list is as
>expected.
>If the execed program is a cygwin program then the argument list also
>includes the parent program.
>I only see this behaviour with the latest snapshot, 1.1.4 was OK.
>
>Attached should be a small testcase exec.tar. Just extract and 'sh runme'.
>The child program just prints the number of arguments and the argument
>list. With 1.1.4 you should see:
>
>$ sh runme
>Run no-cygwin child
>1
>C:\home\mike\db2\ntclp\winchild.exe
>Run cygwin child
>1
>/home/mike/db2/ntclp/cygchild.exe
>
>With the latest snapshot you see ( notice the difference in the argument
>list when running the cygwin child):

You're passing all of the argv information from the parent cygwin process
to a child cygwin process so cygchild is going to use the argv list set up
by sh when it execed exec1.

If you don't want this behavior, zero out startInfo.lpReserved2 and
startInfo.cbReserved2.

cgf

>$ sh runme
>Run no-cygwin child
>1
>C:\home\mike\db2\ntclp\winchild.exe
>Run cygwin child
>2
>./exec1
>cygchild.exe
>
>I am willing to entertain the possibility that I may not be using
>CreateProcess correctly as my Windows programming is not that strong but
>there is certainly a
>difference in behaviour between 1.1.4 and the latest snapshot.
>
>(See attached file: exec.tar)
>
>Regards, Mike
>
>Michael J. Bhola / DB2 Technical Specialist
>Managed SAP Services / Mailpoint: DGC North Harbour
>DDI: +44 (0)2392 564752 / Internal: 7-254752
>Internet: bholam@uk.ibm.com / Notes: bholam@ibmgb


>--
>Want to unsubscribe from this list?
>Send a message to cygwin-unsubscribe@sourceware.cygnus.com

-- 
cgf@cygnus.com                        Cygnus Solutions, a Red Hat company
http://sourceware.cygnus.com/         http://www.redhat.com/

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

