Function 67h Set Maximum Handle Count

mov bx, Handles ;new maximum handle count

mov ah, 67h ;Set Maximum Handle Count

int 21h

jc error_handler

Set Maximum Handle Count (Function 67h) sets the maximum number of handles a program can use at any one time.

Parameter

Handles

Identifies the new maximum number of handles.

Return Value

If the function is successful, the carry flag is clear. Otherwise, the carry flag is set and the AX register contains an error value.

Comments

This function sets the maximum number of handles for the program but does not change the number of handles available in the system. The total number of system handles is set by the files command in the CONFIG.SYS file.

The maximum handle count specified in the Handles parameter is a property of the given program and is not inherited by child programs. This count must be in the range 20 to 65,535. If a number less than 20 is specified, the function uses 20 by default.

If Set Maximum Handle Count is used to reduce the number of “allowed” handles, the new limit does not take effect until any handles above the new limit are closed.

See Also

Function 46h Force Duplicate File Handle