home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!mcsun!fuug!kiae!csoft!news-server
- From: dema@metal.dnepropetrovsk.ua (D.V.Uzhakov)
- Subject: Re:[HELP] documentation __AnIncr
- Reply-To: dema%metal.dnepropetrovsk.ua@ussr.eu.net
- Organization: Dneprometal
- Date: Tue, 28 Jul 92 16:09:57 -0500
- Message-ID: <AALcQTg4h4@metal.dnepropetrovsk.ua>
- Lines: 47
- Keywords: __AnIncr, __AhShift
- Sender: news-server@cs.kiev.ua
-
- > Also, from reading Petzold, I understand that if I have allocated a
- > very large block using GlobalAlloc() (>64K bytes), then I cannot use a
- > huge pointer and step from byte 0xffff to 0x10000 by simply adding 1.
- > There is some magic about protected mode and adding 8 to the segment
- > register that is not clear. Any ideas?
-
- ???????????????????????????????????????????????????????????????????????????
- __ahIncr = 8 ? These constants are defined in kernel. You can use
- __ahShift = 3 = log 8 ? them to address next selectors in a large block of
- 2 ? memory ( > 64 KB ) .They are added to the current
- ? selector.
- ???????????????????????????????????????????????????????????????????????????
- Example for TPW :
- uses WinCrt ,
- WinTypes ,
- WinProcs ;
- const LONGBLOCK = 100000 ;
- type buf = array [ 0 .. 0 ] of BYTE ;
- pbuf = ^ buf ;
- var hMem ,
- wCount : WORD ;
- pMem : pbuf ;
- begin
- hMem := GlobalAlloc ( GMEM_FIXED , LONGBLOCK) ;
- pMem := GlobalLock ( hMem ) ;
-
- for wCount := 0 to $FFFF
- do pMem ^ [ wCount ] := wCount mod $FF ;
-
- hMem := hMem + 8 ; (* __AHINCR *)
- pMem := GlobalLock ( hMem ) ;
-
- for wCount := 0 to LONGBLOCK-$FFFF
- do pMem ^ [ wCount ] := wCount mod $FF ;
-
- GlobalUnLock ( hMem ) ;
- GlobalFree ( hMem ) ;
- hMem := hMem - 8 ; (* __AHINCR *)
- GlobalUnLock ( hMem ) ;
- GlobalFree ( hMem ) ;
- end .
-
- Cygankov Sergey Dnepropetrovsk State University
- Uzhakov Dementiy UKRAINE ( 7-0562 ) -39-12-85
- -26-17-51
-
-
-