Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:docs:fapi:dosgethugeshift [2020/12/04 12:51] – prokushev | en:docs:fapi:dosgethugeshift [2021/12/05 09:59] (current) – prokushev | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | {{logos:os2.gif? | + | {{page>en:templates:fapiint}} |
====== DosGetHugeShift ====== | ====== DosGetHugeShift ====== | ||
- | |||
This call returns a shift count used to derive the selectors that address memory allocated with [[DosAllocHuge]]. | This call returns a shift count used to derive the selectors that address memory allocated with [[DosAllocHuge]]. | ||
- | ==Syntax== | + | ===== Syntax ===== |
- | | + | |
- | ==Parameters== | + | <code c> |
- | ;ShiftCount (PUSHORT) - output : Address of the shift count. | + | DosGetHugeShift (ShiftCount) |
+ | </ | ||
+ | |||
+ | ===== Parameters ===== | ||
+ | |||
+ | | ||
+ | |||
+ | ===== Return Code ===== | ||
+ | |||
+ | rc ([[USHORT]]) - return | ||
- | ==Return Code== | ||
- | rc (USHORT) - return | ||
Return code description is: | 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 " | + | |
- | * 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== | + | ===== Remarks ===== |
- | ===C Binding=== | + | |
- | <PRE> | + | 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 " | ||
+ | * 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 ==== | ||
+ | |||
+ | <code c> | ||
#define INCL_DOSMEMMGR | #define INCL_DOSMEMMGR | ||
Line 33: | Line 42: | ||
USHORT | USHORT | ||
- | </PRE> | + | </code> |
- | ===MASM Binding=== | + | ==== MASM Binding ==== |
- | <PRE> | + | |
+ | <code c> | ||
EXTRN DosGetHugeShift: | EXTRN DosGetHugeShift: | ||
INCL_DOSMEMMGR | INCL_DOSMEMMGR | ||
Line 44: | Line 54: | ||
Returns WORD | Returns WORD | ||
- | </PRE> | + | </code> |
- | ====== Note ====== | + | ===== Note ===== |
Text based on [[http:// | Text based on [[http:// |