DosGetHugeShift

This call returns a shift count used to derive the selectors that address memory allocated with DosAllocHuge.

Syntax

DosGetHugeShift (ShiftCount)

Parameters

;ShiftCount (PUSHORT) - output : Address of the shift count.

Return Code

rc (USHORT) - return Return code description is: * 0 NO_ERROR

Remarks

Each segment of a huge memory allocation has a unique selector. To compute the next sequential selector in a huge memory area, take the value 1, shift it left by the number of bits specified in shift count. Use the resulting value as an increment to add to the previous selector (using the selector returned by DosAllocHuge as the first selector). For example: * Assume DosAllocHuge is issued with NumSeg equal to 3, and that the number 63 is returned for the selector of the first segment. * If DosGetHugeShift returns a shift count of 4, shifting the value “1” by this amount results in an increment of 16. * Adding this increment to selector number 63 produces 79 for the second selector. Adding the same increment to selector number 79 yields 95 for the third selector.

Example Code

C Binding

<PRE> #define INCL_DOSMEMMGR

USHORT rc = DosGetHugeShift(ShiftCount);

PUSHORT ShiftCount; /* Shift Count (returned) */

USHORT rc; /* return code */ </PRE>

MASM Binding

<PRE> EXTRN DosGetHugeShift:FAR INCL_DOSMEMMGR EQU 1

PUSH@ WORD ShiftCount ;Shift Count (returned) CALL DosGetHugeShift

Returns WORD </PRE>

Note

Text based on http://www.edm2.com/index.php/DosGetHugeShift

Family API
DOS	Process Manager	DosBeep DosExit DosSleep DosExecPgm
File Manager	DosChDir DosChgFilePtr DosClose DosDelete DosDupHandle DosMkDir DosMove DosQCurDir DosQCurDisk DosSetFileMode DosOpen DosQFileInfo DosRead DosQFileMode DosQFSInfo DosQVerify DosRmDir DosSelectDisk DosFindClose DosFindFirst DosFindNext DosSetFileInfo DosSetVerify DosWrite DosFileLocks DosSetFHandState DosNewSize DosBufReset DosQFHandState DosSetFSinfo DosShutdown
Memory Manager	DosFreeSeg DosSubAlloc DosSubFree DosSubSet DosAllocHuge DosAllocSeg DosReallocHuge DosReallocSeg DosGetHugeShift DosCreateCSAlias
NLS	DosCaseMap DosGetCtryInfo DosGetDBCSEv DosSetCtryCode DosGetCollate DosGetMessage DosInsMessage DosPutMessage
Date and Time	DosSetDateTime DosGetDateTime
Devices	DosDevConfig DosDevIOCtl DosDevIOCtl2
Signals	DosHoldSignal DosSetSigHandler
Misc	BadDynLink DosGetEnv DosGetMachineMode DosGetVersion DosError DosErrClass DosSetVec
KBD	KbdCharIn KbdFlushBuffer KbdGetStatus KbdSetStatus KbdStringIn KbdPeek
VIO	VioGetBuf VioGetConfig VioGetCurPos VioGetCurType VioGetPhysBuf VioReadCellStr VioReadCharStr VioScrollUp VioScrollDn VioScrollLf VioScrollRt VioScrUnLock VioSetCurPos VioSetCurType VioSetMode VioGetMode VioShowBuf VioWrtCellStr VioWrtCharStr VioWrtCharStrAtt VioWrtNAttr VioWrtNCell VioWrtNChar VioWrtTTY VioScrLock VioPopUp
Tools	BIND
Modules	DOSCALLS.DLL VIOCALLS.DLL KBDCALLS.DLL MSG.DLL
Libraries	API.LIB OS2386.LIB FAPI.LIB DOSCALLS.LIB SUBCALLS.LIB