Microsoft KB Archive/87284

= DOSKEY Maximum Buffer Size is 61900 Bytes =

Article ID: 87284

Article Last Modified on 10/12/2003

-

APPLIES TO


 * Microsoft MS-DOS 5.0 Standard Edition
 * Microsoft MS-DOS 5.0a
 * Microsoft MS-DOS 6.0 Standard Edition

-



This article was previously published under Q87284



SYMPTOMS
Specifying a buffer size larger than 61900 for DOSKEY causes your computer to stop responding (hang).



CAUSE
The maximum size of the DOSKEY command history and macro buffer is equal to 64K minus the size of the DOSKEY program itself. This works out to approximately 61900 bytes. Due to an error in the DOSKEY program, specifying a buffer size larger than this will cause your computer to hang. To avoid this problem, specify a buffer of 61900 bytes or less.



STATUS
Microsoft has confirmed this to be a problem in MS-DOS versions 5.0, 5.00a, and 6.00. This problem was corrected in later versions.



MORE INFORMATION
Because DOSKEY is a .COM program, it is limited to 64K of memory for both its code and data. For this reason, the maximum command history and macro buffer size is equal to 64K minus the DOSKEY code, or approximately 61900 bytes.

If you specify a buffer size larger than can fit within the DOSKEY 64K memory segment, DOSKEY will detect it and automatically truncate the buffer. While DOSKEY correctly limits the size of the buffer, an error in the code used when DOSKEY terminates and stays resident causes DOSKEY to miscalculate the amount of memory to free on termination.

As a result, the memory where DOSKEY is loaded is marked as unused. The next program that runs will be placed where DOSKEY is already located, which causes the computer to hang. Reference(s):

&quot;Microsoft MS-DOS User's Guide and Reference,&quot; versions 5.0 and 5.0a

Additional query words: 5.00 5.00a 6.00 lock /bufsize large MS DOS KEY

Keywords: KB87284

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.