delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/09/06:51:05

Date: Mon, 9 Jun 1997 13:50:05 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Michael Goffioul <goffioul AT emic DOT ucl DOT ac DOT be>
cc: djgpp AT delorie DOT com
Subject: Re: Sharing global variable
In-Reply-To: <339BB7B0.2EAD@emic.ucl.ac.be>
Message-ID: <Pine.SUN.3.91.970609134704.618H-100000@is>
MIME-Version: 1.0

On Mon, 9 Jun 1997, Michael Goffioul wrote:

> For example, if a static variable "a" is declared in a header file
> included in 2 differents programs "prog1.exe" and "prog2.exe". If 
> "prog1.exe" calls "prog2.exe", is it possible that prog2 uses the same
> global variable than prog1 ?

It's possible, but highly non-portable.  Since most DPMI servers implement
DPMI 0.9, all the selectors are global.  This means that a parent program
can advertise its DS selector and the address (offset) of any variable to
its children programs (e.g., via the command line used to invoke the child
program) and the child programs can access those variables using `farptr'
functions. 

- Raw text -


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