🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#962
From: Jody P. Nickel
Date: Fri, 21 Dec 1990 16:36
23 lines
1529 bytes
This isn't pretty but... And I'm sure Microsoft won't condone it. The pointer
returned will always be an XXXX:0000, where XXXX is the selector for the
first 64K of the memory. To get to the next 64K you need to increment the
selector by (I'm not %100 of the value) 8. The easiest way to do this is
using the _based keyword and a far *; Something like the following.

_segment BigSeg;
char _based(BigSeg) *pBigSeg;

void far *x;
x=GlobalLock(...);
BigSeg=FP_SEG(x);
pBigSeg = NULL;

Now pBigSeg is pointing at the first 64 K and can move through it with ease. To
get at the next 64K, increment BigSeg by 8, reset pBigSeg to 0 and now you
have the next 64K. This by no means is any easier than using a huge model pointer
but if you don't want to use the huge memory model this, or something like it
is the only alternative.

Disclaimer..
Use at your own risk, if Microsoft choses to change the way these huge blocks
are mapped into the LDT this code won't work. (But neither will the programs
Technical Details
Message-ID: <600@rodan.cs.utexas.edu>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!nickel
References: <2564@wn1.sci.kun.nl> <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!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!nickel
From: nickel@cs.utexas.edu (Jody P. Nickel)
Newsgroups: comp.windows.ms.programmer
Subject: Re: Windows 3 segment/selector problems (Tech. Quest.)
Message-ID: <600@rodan.cs.utexas.edu>
Date: 21 Dec 90 16:36:02 GMT
References: <2564@wn1.sci.kun.nl> <588@rodan.cs.utexas.edu> <1990Dec19.194631.22880@progress.com> <4563@media-lab.MEDIA.MIT.EDU>
Distribution: comp
Organization: U. Texas CS Dept., Austin, Texas
Lines: 23