🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.misc
Article #2483

GlobalAlloc questions ...

#2483
From: Brian Matusz
Date: Tue, 05 Jan 1993 17:10
33 lines
1747 bytes
Being posted for a friend; followup to center03@cps201.cps.cmich.edu
--------------------------------------------------------------------

I'm having some ... difficulties ... with global memory allocation.
The correct flag for memory that will be allocated by one task and freed
by another is GMEM_SHARE, right?  Do any other flags need to be present?
I'm having messages like:

GlobalUnlock: Object usage count underflow
GLOBALFREE+15: Invalid global memory object

I just perused the code, and every Lock has an Unlock, and the allocs are
with the GMEM_SHARE.  Comments?

Also, in another project, there's a possibility that a memory object
gets locked and then passed to another process, which then locks it,
uses it, unlocks it and frees it.  Is this legal (ie, 2x locking, with
only 1 unlock, and then attempt to free?)  Should there be an unlock
before it's passed?  It sounds bizarre, so I thought I'd ask ...

Last, seeing the message cracker for GlobalAllocPtr, it seems that MSoft
decided that it's all right to allocate and lock memory and leave it
locked (for 3.1, assumably).  If I'm writing a 3.0 app, should I not
use this?  Even if the application is pmode only?

Thanks for any help ...
Brad Wilson
center03@cps201.cps.cmich.edu
-- 

---
bcmatusz@vela.acs.oakland.edu
"Use DEVICE=EXXON to screw up your environment."
Technical Details
Message-ID: <1993Jan5.171037.26950@vela.acs.oakland.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!olivea!spool.mu.edu!sdd.hp.com!ux1.cso.uiuc.edu!cs.uiuc.edu!vela!bcmatusz

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!olivea!spool.mu.edu!sdd.hp.com!ux1.cso.uiuc.edu!cs.uiuc.edu!vela!bcmatusz
From: bcmatusz@vela.acs.oakland.edu (Brian Matusz)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: GlobalAlloc questions ...
Message-ID: <1993Jan5.171037.26950@vela.acs.oakland.edu>
Date: 5 Jan 93 17:10:37 GMT
Organization: Oakland University, Rochester MI.
Lines: 33