Date: Mon, 3 Nov 1997 16:42:37 +0200 (IST) From: Eli Zaretskii To: Brett Porter cc: DJGPP Subject: Re: Question about __dpmi_allocate_dos_memory In-Reply-To: <199711031208.XAA05407@rabble.uow.edu.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Mon, 3 Nov 1997, Brett Porter wrote: > I've noticed that __dpmi_allocate_dos_memory has superseded (and much > simplified) calling this DPMI function, over the > _go32_dpmi_allocate_dos_memory equivalent. No, they are two different functions (but use the same underlying DPMI function). The older _go32 variety is also required if you want to write code that will compile with DJGPP v1.x. > But the routine gives you back just a selector and a segment. Because the allocated block is aligned so that the offset is zero. > So if I have a structure MyStruct, I want to call like this: > > movedata( _my_ds(), (int )&MyStruct, DosSelector, 0, sizeof( MyStruct)); > > Is this right? Yes. But beware of moving structs: gcc pads struct elements, unless you explicitly tell it not to. > Likewise when I pass the segment > returned from the allocate to __dpmi_int with an es:ebx combination: I > assume again that the allocation aligns it on a segment boundary? Yes. > (BTW, the code doesn't work... in case you haven't guessed :) Then debug it. Or post it.