Article View: comp.windows.ms.programmer
Article #938Re: Windows 3 segment/selector problems (Tech. Quest.)
From: Bill Ferro
Date: Wed, 19 Dec 1990 19:46
Date: Wed, 19 Dec 1990 19:46
38 lines
1442 bytes
1442 bytes
nickel@cs.utexas.edu (Jody P. Nickel) writes:
>If you are only going to run in 386 enhanced mode the this will simplify
>your task immensely. After a GlobalAlloc, you can lock this memory and
>leave it locked until it is no longer needed. The far pointer you receive
>is a selector:0 pointer.
This is also true for standard mode. Malloc and Free code
examples follow:
char *malloc(nbytes)
WORD nbytes;
{
HANDLE h;
if ((h=GlobalAlloc(GMEM_MOVEABLE,DWORD(nbytes))) == NULL)
return ((char *)0);
else
return ((char *)GlobalLock(h));
}
void free(ptr)
char *ptr;
{
HANDLE h;
h = LOWORD(GlobalHandle(HIWORD(ptr)));
GlobalUnlock(h);
GlobalFree(h);
return;
}
-bf
--
Bill Ferro UUCP: mit-eddie!progress!billf
Progress Software Corp. Internet: billf@progress.com
5 Oak Park
Bedford, MA 01730
Technical Details
Message-ID:
<1990Dec19.194631.22880@progress.com>Path:
arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!agate!linus!progress!billfReferences:
<2564@wn1.sci.kun.nl> <588@rodan.cs.utexas.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!agate!linus!progress!billf From: billf@progress.COM (Bill Ferro) Newsgroups: comp.windows.ms.programmer Subject: Re: Windows 3 segment/selector problems (Tech. Quest.) Keywords: windows-3 selectors 80286 80386 Message-ID: <1990Dec19.194631.22880@progress.com> Date: 19 Dec 90 19:46:31 GMT References: <2564@wn1.sci.kun.nl> <588@rodan.cs.utexas.edu> Sender: news@progress.com (The News User) Distribution: comp Organization: Progress Software Corp., Bedford, MA Lines: 38 Nntp-Posting-Host: billf