This is the mail archive of the cygwin@sources.redhat.com 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]

Re: argv weirdness with latest snapshot


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


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