Microsoft KB Archive/38940

From BetaArchive Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

HIMEM.SYS Version 2.04 Reports 64K Too Much Free Memory PSS ID Number: Q38940 Article last modified on 05-07-1991

2.04

MS-DOS

Summary:

When using HIMEM.SYS version 2.04 (and earlier releases of HIMEM.SYS), if a program makes a call to HIMEM querying for the amount of free extended memory, HIMEM returns a value that is 64K too large. This value includes the 64K high memory area (HMA), which is not supposed to be included in this calculation. Microsoft has confirmed this to be a problem in HIMEM.SYS version 2.04. This problem was corrected in version 2.05.

This new release of HIMEM.SYS is available in the OnLine Software/Data Library in the file named HIMEM205. HIMEM205 can be found in the Software/Data Library by searching on the keyword HIMEM205, the Q number of this article, or S12137. HIMEM205 was archived using the PKware file-compression utility.

HIMEM.SYS version 2.05 is also available as an application note. This application note can be obtained from Microsoft Product Support Services by calling (206) 454-2030. The XMS distribution disk will also be updated to include this change.

More Information:

For source-code changes to HIMEM.SYS, refer to the file HIMEM.ASM in the subdirectory on the XMS distribution disk. The source-code modification to correct this problem is located in the routine HookInt15. It now reports the true amount of free extended memory. Below are portions of this code from versions 2.04 and 2.05.

The code fragment from HIMEM.SYS 2.04 is as follows:

—————– cmp [fHMAExists],0 je short HICont add [bx.Base],64 ; —————–

The code fragment from HIMEM.SYS 2.05 is as follows:

—————– cmp [fHMAExists],0 je short HICont add [bx.Base],64 sub [bx.Len],64 ; —————–
=================================================================

Copyright Microsoft Corporation 1991.