Date: Thu, 07 Nov 1996 08:45:28 +0000 From: Bill Currie Subject: Re: Question To: Draximus AT fab DOT net Cc: djgpp AT delorie DOT com Reply-to: billc AT blackmagic DOT tait DOT co DOT nz Message-id: <3281A1A8.A11@blackmagic.tait.co.nz> Organization: Tait Electronics NZ MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit References: <327FF0BE DOT 27B8 AT fab DOT net> Eric Christopherson wrote: > > There is a program, called A. > Program A has a variable V. > Program A shells out and runs Program B, passing a pointer to V (in > hex). > Is it at all possible for B to read V (if A and B are compiled with > DJGPP)? > I don't know much about MSDOS memory management, and this is something > that has bugged me for awhile. > -- > +-- - - . .x > | Eric Christopherson | > x. . - - --+ If your not running under dpmi 1.0 (very rare) this can be done easily. What ou want to do is also pass the selector of the variable (_my_ds() in go32.h I beleive) and use the _far* functions in sys/farptr.h to access it. dpmi 1.0 is supposed to give each program it's own address space (as I understand it) and so B could not access anything in A unless you used shared memory (see the dpmi 1.0 spec) Bill -- Leave others their otherness.