🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

GlobalAlloc by DLL

#2770
From: Kevin P. Kleinfelter
Date: Tue, 21 May 1991 12:59
31 lines
1955 bytes
I'd like to do a GlobalAlloc in a DLL, and have the memory owned by the
DLL (not the application that calls the DLL).  I don't mean I want to
allocate the memory in LibMain; my application calls a DLL routine, and
I want the DLL routine to GlobalAlloc.

What SEEMS to happen is that the GlobalAlloc allocates memory that is
"owned" by the application.  I have another application that makes other
calls to the DLL to update and retrieve data from this memory.

Is there some kind of a call I can make in the DLL routines that switches
Windows notion of the current instance to be the DLL's instance and not
the calling applications instance?

I need to share chunks of Read/Write memory. 
   * DLL isn't gonna cut it (DLL sends a copy of the memory according to
     page 16-39  of "Guide to Programming"
   * static storage in the DLL isn't gonna cut it (I cannot tell at
     compile-time how much memory is needed, and the more applications that
     call my DLL, the more memory I'll need.
   * ClassExtra bytes aren't gonna cut it because I'm going to need to share
     dozens and maybe hundreds of 2K blocks of memory.

I need it to be FAST because this memory will be accessed at least once for
EVERY message my application receives.

(Programming was easier back in the days when my program owned the whole
machine!)
-- 
Kevin Kleinfelter @ DBS, Inc (404) 239-2347   ...gatech!nanoVX!msa3b!kevin
This is only a test. If this were an actual .signature line, you would be
directed where to tune for official news and information.
Technical Details
Message-ID: <1652@msa3b.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!wa4mei!nanovx!msa3b!kevin

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!wa4mei!nanovx!msa3b!kevin
From: kevin@msa3b.UUCP (Kevin P. Kleinfelter)
Newsgroups: comp.windows.ms.programmer
Subject: GlobalAlloc by DLL
Message-ID: <1652@msa3b.UUCP>
Date: 21 May 91 12:59:22 GMT
Organization: Dun and Bradstreet Software, Inc., Atlanta, GA
Lines: 31