ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2011/12/08/16:30:23

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Georg <dosusb AT googlemail DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: argv[0]
Date: Thu, 8 Dec 2011 13:04:04 -0800 (PST)
Organization: http://groups.google.com
Lines: 35
Message-ID: <e2fd5f2a-d8e5-439b-9b95-68898e7cf4fa@l24g2000yqm.googlegroups.com>
References: <16b04d29-8317-4c7f-929c-1a22a328fa32 AT p9g2000vbb DOT googlegroups DOT com>
<jaueod$2t8$1 AT speranza DOT aioe DOT org> <9bf257a7-a0f8-43ba-a65f-36c6027f68cb AT r28g2000yqj DOT googlegroups DOT com>
<jb1ejh$hm8$1 AT speranza DOT aioe DOT org> <cc43d375-8e59-425d-a32e-b4ca200ae5cc AT 4g2000yqu DOT googlegroups DOT com>
<jbeegg$qp2$1 AT speranza DOT aioe DOT org> <dca06357-dc1d-4ede-aa9e-510e15e499b5 AT z17g2000vbe DOT googlegroups DOT com>
<dca6ea34-7cf2-4abe-afc3-8a1122602ed9 AT y12g2000vba DOT googlegroups DOT com> <jbngu9$b4$1 AT speranza DOT aioe DOT org>
NNTP-Posting-Host: 92.250.191.164
Mime-Version: 1.0
X-Trace: posting.google.com 1323379154 20623 127.0.0.1 (8 Dec 2011 21:19:14 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: Thu, 8 Dec 2011 21:19:14 +0000 (UTC)
Complaints-To: groups-abuse AT google DOT com
Injection-Info: l24g2000yqm.googlegroups.com; posting-host=92.250.191.164; posting-account=v5xbdQoAAAAOGc9Ccc-kLZyobvPlN3Qr
User-Agent: G2/1.0
X-HTTP-Via: 1.1 TAS-4-3.man-a
X-Google-Web-Client: true
X-Google-Header-Order: UALSERCVNKH
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.4)
Gecko/20091016 Firefox/3.5.4,gzip(gfe)
Bytes: 2950
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi Rod,

thank you for looking into this. I was so happy that I got it working
(on my PC at least) that I did not follow your suggestion.

When I run your code I see that it finds and prints the master
environment block, i.e. the environment of command.com and that does
not contain the absolute path to the running program I am looking for.

>dosmemget(the_psp+0x16, 2, &the_psp);

reads the psp of the parent process and that is command.com. I do not
fully understand the loop but it exits with the psp of command.com and
then reads the environment from there. I can check that with the "mem /
d |more" command.

Georg

By the way this is the output of my program on my PC:

E:\myprogs\djtest>mcb4

MCB:21B0        M PSP:8         Blocksize:1ED
MCB:4090        M PSP:40A       Blocksize:BA    ENV:4CD
Program:COMMAND
MCB:4C40        M PSP:0         Blocksize:7
MCB:4CC0        M PSP:40A       Blocksize:7D
MCB:54A0        M PSP:54B       Blocksize:87A   ENV:D312  Program:DOSX
MCB:DC50        M PSP:FB5       Blocksize:70    Path:E:\MYPROGS\DJTEST
\MCB4.EXE
MCB:E360        M PSP:E37       Blocksize:17D   ENV:DC6  Program:KB16
MCB:FB40        M PSP:FB5       Blocksize:410   ENV:187  Program:MCB4
MCB:13C50       M PSP:0         Blocksize:F00
MCB:22C60       Z PSP:0         Blocksize:7D38
E:\myprogs\djtest>

- Raw text -


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