From: luisllo AT alumni DOT uv DOT es (Luis) Newsgroups: comp.os.msdos.djgpp Subject: Re: Urgent help, please Date: 27 Aug 2002 03:17:57 -0700 Organization: http://groups.google.com/ Lines: 40 Message-ID: <6124b64f.0208270217.5eb4a2e2@posting.google.com> References: <6124b64f DOT 0208261541 DOT 4592f51c AT posting DOT google DOT com> <3d6b06cd DOT sandmann AT clio DOT rice DOT edu> NNTP-Posting-Host: 80.25.146.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1030443477 7896 127.0.0.1 (27 Aug 2002 10:17:57 GMT) X-Complaints-To: groups-abuse AT google DOT com NNTP-Posting-Date: 27 Aug 2002 10:17:57 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Charles Sandmann 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