delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/13/10:02:23

Date: Sun, 13 Dec 1998 17:02:23 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Simone Zanella <zanella AT prometeo DOT it>
cc: djgpp AT delorie DOT com
Subject: Re: DJGPP: finding command line in spawned programs
In-Reply-To: <199812131425.PAA06520@mail.prometeo.it>
Message-ID: <Pine.SUN.3.91.981213165912.28640E-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Sun, 13 Dec 1998, Simone Zanella wrote:

> I need to find the command line with which a program is spawned; with
> typical Dos executables, it is located from offset 0x80 of the PSP; but if
> a DJGPP compiled executable spawns another DJGPP executable, at this
> address there's a "!proxy" string followed by 3 four digits hex numbers.
> How can I use them to find the command line?

The command line is in the argv[] variable, as usual in C.  The DJGPP 
startup code already does all the work for you: it finds the command line 
and puts it into the argv[] array.  Isn't that what you want?  If not, 
please explain why.

It is not clear from your message why did you need to look in the PSP at 
all, even in the simple case of a program invoked from a DOS prompt.  
argv[] holds the command line in that case as well.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019