no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Next revision | |||
— | en:docs:fapi:dosreallochuge [2018/08/30 17:20] – created prokushev | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | This call changes the size of memory originally allocated by DosAllocHuge. | ||
+ | |||
+ | ==Syntax== | ||
+ | | ||
+ | |||
+ | ==Parameters== | ||
+ | ;NumSeg (USHORT) - input : Number of 65536 byte segments requested. | ||
+ | ;Size (USHORT) - input : Number of bytes requested in the last non-65536 byte segment. A value of 0 indicates none. | ||
+ | ;Selector (SEL) - input : Selector returned on a previous DosAllocHuge. | ||
+ | |||
+ | ==Return Code== | ||
+ | rc (USHORT) - return | ||
+ | Return code descriptions are: | ||
+ | * 0 | ||
+ | * 8 | ||
+ | * 87 ERROR_INVALID_PARAMETER | ||
+ | |||
+ | ==Remarks== | ||
+ | DosReallocHuge is called to change the size of unshared or shared huge memory allocated by DosAllocHuge. The selector used for this call must be the one returned by the DosAllocHuge request. | ||
+ | |||
+ | Normally, segments allocated as shared (AllocFlags bits 0 and 1 were set) cannot be decreased in size. However, if AllocFlags bit 3 was also set, the shared segment' | ||
+ | |||
+ | DosReallocHuge is also called to reallocate a segment allocated as discardable (AllocFlags bit 2 set) after the segment is discarded by the system. The call to DosReallocHuge automatically locks the segment for access by the caller, the same as if a DosLockSeg had been issued. | ||
+ | |||
+ | ''' | ||
+ | |||
+ | ===Family API Considerations=== | ||
+ | Some options operate differently in the DOS mode than in the OS/2 mode. Therefore, the following restriction applies to DosReallocHuge when coding for the DOS mode: | ||
+ | |||
+ | The requested Size value is rounded up to the next paragraph (16-byte). | ||
+ | |||
+ | ==Example Code== | ||
+ | === C Binding=== | ||
+ | <PRE> | ||
+ | #define INCL_DOSMEMMGR | ||
+ | |||
+ | USHORT | ||
+ | |||
+ | USHORT | ||
+ | requested */ | ||
+ | USHORT | ||
+ | SEL Selector; | ||
+ | |||
+ | USHORT | ||
+ | </ | ||
+ | |||
+ | ===MASM Binding=== | ||
+ | <PRE> | ||
+ | EXTRN DosReallocHuge: | ||
+ | INCL_DOSMEMMGR | ||
+ | |||
+ | PUSH | ||
+ | PUSH | ||
+ | PUSH | ||
+ | CALL | ||
+ | |||
+ | Returns WORD | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ====== Note ====== | ||
+ | |||
+ | Text based on [[http:// | ||
+ | |||
+ | {{page> | ||
+ | |||