Microsoft KB Archive/40400

Increasing Available File Handles in MS-DOS Version 3.30 ID Number: Q40400

3.30 3.30a 4.00 4.01 MS-DOS buglist3.30 fixlist3.30a

Summary:

When a program needs to allocate more file handles, the Set Handle Count (Interrupt 21H, Function 67H) function needs to be called. The Set Handle Count function in turn must call the Allocate Memory (Interrupt 21H, Function 48H) function to allocate enough memory for the number of handles requested.

With MS-DOS Version 3.30, the amount of memory requested by the Set Handle Count function will be off by 1000H paragraphs if an even value of file handles is requested. The correct amount of memory will be requested if the number of file handles requested is an odd value.

Microsoft has confirmed this to be a problem in Version 3.30. This problem was corrected in Version 3.30a.

More Information:

There are two solutions for this problem. They are as follows:


 * 1) Upgrade MS-DOS to either Version 3.30a or Version 4.x.
 * 2) Always request an odd number of file handles.

If you choose to always request an odd number of file handles, the number requested should always be one less than a multiple of 16. This is because MS-DOS always rounds the request up to the next multiple of 16 to determine the amount of memory to request. The file handle limit is set to the requested amount, not the rounded up number. Therefore, there is no difference in the amount of memory used between 1 and 15 handles.