🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Windows 3 segment/selector problems (Tech. Quest.)

#945
From: Morris Jones
Date: Thu, 20 Dec 1990 22:51
26 lines
1805 bytes
jason@media-lab.media.mit.edu (Jason A. Kinchen) writes:
>                                        Has anyone solved the problem
>of dynamically, globally alloc'ing an arbitrarily long block of memory
>when you don't know in advance if it's longer than 64K?  Do you have
>to compile huge model or something nasty like that?

Here's one option if you're on a 386:  See Appendix E of the SDK manual.
Use the function Global32Alloc.  The selector you get back well be a USE32
selector, thus requiring a 32-bit offset.

Now the problem comes in referencing all that memory from a 16-bit program.
You can get 16-bit pointers into the memory using Global16PointerAlloc, but
each pointer will be limited to a 64K segment of space.

If you write some assembler, you can reference the memory using the 32-bit
registers, or other bits of 386-specific code.

Just some food for thought ...

Mojo

-- 
mojo@netcom.UUCP          Site Coordinating Instructor, San Jose South
Morris "Mojo" Jones       Skilled Motorcycling And Rider Training (S.M.A.R.T.)
Campbell, CA              800-675-5559 ... 800-CC-RIDER ...  408-423-2212
AA4KB @ N6LDL.#NOCAL.CA.USA.NA / aa4kb.ampr.org / netcom!mojo@apple.com
Technical Details
Message-ID: <19201@netcom.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!apple!netcom!mojo
References: <588@rodan.cs.utexas.edu> <1990Dec19.194631.22880@progress.com> <4563@media-lab.MEDIA.MIT.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!apple!netcom!mojo
From: mojo@netcom.UUCP (Morris Jones)
Newsgroups: comp.windows.ms.programmer
Subject: Re: Windows 3 segment/selector problems (Tech. Quest.)
Keywords: windows-3 selectors 80286 80386
Message-ID: <19201@netcom.UUCP>
Date: 20 Dec 90 22:51:10 GMT
References: <588@rodan.cs.utexas.edu> <1990Dec19.194631.22880@progress.com> <4563@media-lab.MEDIA.MIT.EDU>
Distribution: comp
Organization: Netcom- The Bay Area's Public Access Unix System {408 241-9760 guest}
Lines: 26