Date: Wed, 10 May 2000 08:16:19 -0400 (EDT) Message-Id: <200005101216.IAA11780@indy.delorie.com> From: Eli Zaretskii To: LittleHelpNeeded CC: djgpp AT delorie DOT com In-reply-to: <1f1200dc.77e75303@usw-ex0108-062.remarq.com> (message from LittleHelpNeeded on Tue, 09 May 2000 11:59:31 -0700) Subject: Re: DJGPP pointers and __dpmi_paddr References: <1f1200dc DOT 77e75303 AT usw-ex0108-062 DOT remarq DOT com> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: LittleHelpNeeded > Newsgroups: comp.os.msdos.djgpp > Date: Tue, 09 May 2000 11:59:31 -0700 > > How do you change a __dpmi_paddr struct to a pointer like > void* ??? > > ie. If you have > > short selector; > int offset; > > How do you make it to > > void *Pointer?? You cannot do that, unless the selector is identical to what _my_ds() returns. A pointer such as "void *Pointer" is actually an offset relative to the base address of the selector loaded into the DS register. If you need to use an offset relative to another selector, you need to use the farptr functions (_farpeekb, _farpokew, etc.). Alternatively, you could enable nearptr method by calling __djgpp_nearptr_enable, and adjust the offset accordingly. But I don't recommend that, since it disables part of the memory protection. If your selector is the same as _my_ds(), simply do this: void *Pointer = (void *)offset;