;**************************************************************
;***    EMS4E3.ASM                                          ***
;***                                                        ***
;***    function        EMS_Ems.getMapInfoSize32(           ***
;***                        var size:       Word)           ***
;***                        : Boolean;                      ***
;***                                                        ***
;***    Returns 0 for OK status or an error                 ***
;***    code.                                               ***
;***                                                        ***
;***    (Ems Version 3.2)                                   ***
;**************************************************************

        .model  large,pascal   

        include emsdefs.asm 

        extrn   errno:WORD  

;
;   Define entry point
;
        public  EMS_Ems@getMapInfoSize32

        .code

EMS_Ems@getMapInfoSize32  proc map_size:Far Ptr Word, self:DWord

        mov     ax,GetMapInfoSize32     ; Make the call to get the size
        int     Ems             

        or      ah,ah                   ; Check for an error
        jnz     error

;
;   Return the info. Size is in AL. We zero extend it to
;   16 bits and return it.
;
        les     bx,map_size             ; Get address of return spot
        xor     ah,ah                   ; Zero extend to 16 bits
        mov     es:[bx],ax              ; Return the size

        xor     ax,ax                   ; Return a zero meaning no error
        ret                             ; Return to caller

error:
        pop     di                      ; Restore di
        pop     es                      ; Restore es

        mov     al,ah
        xor     ah,ah                   ; Zero high byte
        mov     errno,ax                ; Save in errno too
        ret                             ; Return to caller

EMS_Ems@getMapInfoSize32   endp         ; End of procedure

        end                             ; End of source file
