[comp.windows.ms.programmer] Global Memory

dlp@zule.EBay.Sun.COM (Dan Pritchett) (12/15/90)

I am writing a DLL that will be used by Toolbook to manipulate a small
database. I am trying to understand the rules for using global memory,
but finding some of the documentation a bit confusing. Toolbook will
only run in protected mode (either 286 or 386). The documentation
seems to indicate that in protected mode that GlobalLock is a noop on
memory blocks that are allocated non-discardable (other than returning
the pointer).

Knowing what I know about the capabilities of an MMU I can see how
Windows could move my block around in memory and keep my pointer
address fixed. Does this mean that I can do a GlobalAlloc, followed
immediately by a GlobalLock without impacting the performance of
Windows? This is highly desirable as keeping track of memory leaks is
hard enough without worrying about locking locked blocks and other
such silliness.

Note that I have no problems with restricting the configuration to
protected mode with extended memory. The current target platforms for
this application meets this restriction. I just don't want to stop
other applications like CorelDraw or Excel from working with my
application.
--

Dan Pritchett                      | ARPA/Internet: dlp@zule.EBay.Sun.COM
Sun Federal System Engineer        | UUCP:          ...!sun!dlp
--------------------------------------------------------------------------
I've read plenty of books, about heros and crooks.
And I've learned much from both of their styles...
                      --Jimmy Buffet