🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #1127

Re: GlobalDosAlloc

#1127
From: Risto Lankinen
Date: Thu, 24 Jan 1991 12:08
36 lines
2263 bytes
elhadad@cs.columbia.edu (Michael Elhadad) writes:

>I'm trying to understand when and why to use GlobalDosAlloc as opposed to
>GlobalAlloc.  Assume I am running in enhanced mode.  The only difference I 
>have read in the doc is GloabalDosAlloc will allocate the memory under the 
>1M line.  Why should that make a difference to an application?

Hi!

There are two cases I can think of, where GlobalDosAlloc() would be prefer-
able to GlobalAlloc() :
   - For data items, pointer to which is passed to certain INT calls, some of
     which run in real mode, and can therefore use the bottom 1M only
   - For co-operationg DOS/Windows apps, which would communicate thru common
     memory, that's addressable by both

Related Q:
There's also function GlobalWire() , which is somewhat 'stronger' way to lock
a memory block.  Its documentation says, that the block is first moved to a
lower address before locking.  The handle received seems to be usable in an
interrupt server running in a 286 system (standard mode).  I'm in doubt of
whether this implies, that the block is *always* moved all the way down to
the first 1 meg, failing in case of no free space there (as opposed to using
a higher address instead). Any way to check, ie. to allocate all of the *DOS*
memory, but none other (a'la GlobalAlloc(-1) or GlobalCompact() )?

Today's slogan:
"There are three kinds of memory in an XT: Extended, Expanded and Exhausted."
   - R.L.

Terveisin: Risto Lankinen
-- 
Risto Lankinen / product specialist ***************************************
Nokia Data Systems, Technology Dept *  2                              2   *
THIS SPACE INTENTIONALLY LEFT BLANK * 2 -1 is PRIME!  Now working on 2 +1 *
replies: risto@yj.data.nokia.fi     ***************************************
Technical Details
Message-ID: <955@tuura.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!wuarchive!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!news.funet.fi!fuug!tuura!risto
References: <ELHADAD.91Jan23121418@mermaid.cs.columbia.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!wuarchive!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!news.funet.fi!fuug!tuura!risto
From: risto@tuura.UUCP (Risto Lankinen)
Newsgroups: comp.windows.ms.programmer
Subject: Re: GlobalDosAlloc
Message-ID: <955@tuura.UUCP>
Date: 24 Jan 91 12:08:19 GMT
References: <ELHADAD.91Jan23121418@mermaid.cs.columbia.edu>
Distribution: comp
Organization: Nokia Data Systems Oy
Lines: 36