Article View: comp.sys.ibm.pc
Article #26646where's my parent?
From: david
Date: Fri, 22 Apr 1988 21:27
Date: Fri, 22 Apr 1988 21:27
37 lines
1686 bytes
1686 bytes
From squid!david Fri Apr 22 05:14 CST 1983 remote from occrsh
From: ihnp4!occrsh!squid!david (Safe from sanity)
Date: Fri, 22 Apr 83 5:14:21 CST
Message-Id: <831110558D@squid.UUCP>
Subject: where's my parent?
/**
** Address in header may be incorrect. Please reply to:
** { ihnp4 | moss | cbosgd | uokmax }!occrsh!squid!david
**
**/
>I have a program which invokes another program via an exec-type call
>("system()" in C). In mess-dos so far, this means your calling program
>goes away until the new program has done its stuff. My calling program
>needs to know where the called program got loaded in memory. Does
>anyone have any hints on how to do this?
You don't say what you're after, so I'm assuming that you want to use data
in the calling program.
Some compilers will allow you to find out what the current data seg is. In
Turbo C, it is the '_DS' global variable. Create a far pointer to your
data like this:
far_pointer = MK_FP( _DS, &data ) ;
and pass it to the called program in an environment variable. The MK_FP() is
really a macro, which says:
(void far *)( (arg1 << 16) | arg2 )
If your compiler has spawn(), you might look into using it instead of
system(). It allows you more control over the environment.
David Drexler {at&t sites}!occrsh!squid!david
Technical Details
Message-ID:
<141900029@occrsh.ATT.COM>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!lll-winken!lll-tis!ames!pacbell!att-ih!occrsh!occrsh.ATT.COM!davidShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!lll-winken!lll-tis!ames!pacbell!att-ih!occrsh!occrsh.ATT.COM!david From: david@squid.UUCP Newsgroups: comp.sys.ibm.pc Subject: where's my parent? Message-ID: <141900029@occrsh.ATT.COM> Date: 22 Apr 88 21:27:00 GMT Lines: 36 Nf-ID: #N:occrsh.ATT.COM:141900029:000:1295 Nf-From: squid.UUCP!david Apr 22 15:27:00 1988