Jump to content

DosSizeSeg: Difference between revisions

From EDM2
Created page with "==Description== This call returns the size of a segment. ==Syntax== <PRE> DosSizeSeg (Selector, Size) </PRE> ==Parameters== ; Selector (SEL) - input : Selector/segmen..."
 
Ak120 (talk | contribs)
mNo edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Description==
This call returns the size of a segment.
This call returns the size of a segment.


==Syntax==
==Syntax==
<PRE>
  DosSizeSeg (Selector, Size)
  DosSizeSeg
 
    (Selector, Size)
</PRE>


==Parameters==
==Parameters==
; Selector (SEL) - input : Selector/segment of the segment for which size is to be determined. This must be the base selector in the case of a huge segment.  
;Selector (SEL) - input : Selector/segment of the segment for which size is to be determined. This must be the base selector in the case of a huge segment.
 
;Size (PULONG) - output : Address of the returned segment size. For non-huge segments, size is in the range 0 through 64KB. For huge segments, size equals (NUMSEG << 16) + ASIZE where NUMSEG and ASIZE are the last values passed successfully to DosAllocHuge or DosReallocHuge for this huge segment.
; Size (PULONG) - output : Address of the returned segment size. For non-huge segments, size is in the range 0 through 64KB. For huge segments, size equals (NUMSEG << 16) + ASIZE where NUMSEG and ASIZE are the last values passed successfully to DosAllocHuge or DosReallocHuge for this huge segment.


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


Return code description is:
==Remarks==
This function provides compatibility for family applications that must run in DOS or OS/2 mode. DosSizeSeg returns the actual size of memory allocated by a [[DosAllocSeg]] or [[DosAllocHuge]] request and is intended for use when the application is running in DOS mode, where allocations are rounded up to the next paragraph.


* 0    NO_ERROR
==Bindings==
==Remarks==
=== C ===
This function provides compatibility for family applications that must run in DOS or OS/2 mode. DosSizeSeg returns the actual size of memory allocated by a DosAllocSeg or DosAllocHuge request and is intended for use when the application is running in DOS mode, where allocations are rounded up to the next paragraph.
==Example Code==
=== C Binding===
<PRE>
<PRE>
#define INCL_DOSMEMMGR
#define INCL_DOSMEMMGR
Line 29: Line 22:
USHORT  rc = DosSizeSeg(Selector, Size);
USHORT  rc = DosSizeSeg(Selector, Size);


SEL             Selector;      /* Selector/Segment */
SEL     Selector;      /* Selector/Segment */
PULONG           Size;          /* Size of segment (returned) */
PULONG Size;          /* Size of segment (returned) */


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


===MASM Binding===
===MASM===
<PRE>
<PRE>
EXTRN  DosSizeSeg:FAR
EXTRN  DosSizeSeg:FAR
Line 47: Line 40:
</PRE>
</PRE>


==Related Functions==
[[Category:Dos16]]
*
 
[[Category:The OS/2 API Project]]

Latest revision as of 08:05, 26 January 2020

This call returns the size of a segment.

Syntax

DosSizeSeg (Selector, Size)

Parameters

Selector (SEL) - input
Selector/segment of the segment for which size is to be determined. This must be the base selector in the case of a huge segment.
Size (PULONG) - output
Address of the returned segment size. For non-huge segments, size is in the range 0 through 64KB. For huge segments, size equals (NUMSEG << 16) + ASIZE where NUMSEG and ASIZE are the last values passed successfully to DosAllocHuge or DosReallocHuge for this huge segment.

Return Code

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

Remarks

This function provides compatibility for family applications that must run in DOS or OS/2 mode. DosSizeSeg returns the actual size of memory allocated by a DosAllocSeg or DosAllocHuge request and is intended for use when the application is running in DOS mode, where allocations are rounded up to the next paragraph.

Bindings

C

#define INCL_DOSMEMMGR

USHORT  rc = DosSizeSeg(Selector, Size);

SEL     Selector;      /* Selector/Segment */
PULONG  Size;          /* Size of segment (returned) */

USHORT  rc;            /* return code */

MASM

EXTRN  DosSizeSeg:FAR
INCL_DOSMEMMGR      EQU 1

PUSH   WORD    Selector      ;Selector/Segment
PUSH@  DWORD   Size          ;Size of segment (returned)
CALL   DosSizeSeg

Returns WORD