Mail Archives: djgpp/2002/08/27/06:30:08
Charles Sandmann <sandmann AT clio DOT rice DOT edu> wrote in message news:<3d6b06cd DOT sandmann AT clio DOT rice DOT edu>...
> > I'm using DJGPP and dpmi libray in a machine with Win2000. I
> > previously had it running under win98 Second Edition. When running
> > under win98 everytime I called the dpmi function:
>
> > __dpmi_meminfo mem;
> > __dpmi_allocate_memory(&mem)
>
> > It always gave as a result same value for mem.handle and mem.address.
> > I wrote a multi-threaded executive with a different data segment for
> > executive structures, being confident about this being the normal
> > behaviour of the function.
>
> This was a bad assumption - different DPMI providers behave
> differently. Windows 2000 and Windows XP behave like Windows NT,
> not like Win 9x. (And Win 9x is dead as far as MS is concerned).
> Even under Win9x if you do some heavy multi-tasking in different
> windows you can see different behavior.
>
> > And now under Win2000 everytime I call the function I get different
> > values for mem.handle and mem.address, and this implies making a lot
> > of changes in my code.
>
> You need to make those changes and not make assumptions like this in
> the future, unless it's specifically stated to be that way in the
> DPMI specification.
>
> Sorry, maybe there is an easy way to fix this in your code if you look
> hard enough.
Thank's for your help. Just another question, is there anyway to
obtain the handle of a memory block when you only have the selector
that points to the ldt table?. I mean:
I can obtain the segment base address by using
__dpmi_get_segment_base_address(selector, &base_addr)
But I need to obtain the handle of memory allocated for that segment,
in order to call __dpmi_free_memory(handle). And I don't have that
info available (I know it's given to you when you call
__dpmi_allocate_memory(&mem)).
Thank's a lot for you help
- Raw text -