Mail Archives: djgpp/1997/06/09/06:51:05
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 -