This is part of Family API which allow to create dual-os version of program runs under OS/2 and DOS

Note: This is legacy API call. It is recommended to use 32-bit equivalent

DosFindClose

This call closes the association between a directory handle and a DosFindFirst or DosFindNext directory search function.

Syntax

DosFindClose (DirHandle)

Parameters

;DirHandle (HDIR) - input : bHandle previously associated with a DosFindFirst by the system, or used with a DosFindNext directory search function.

Return Code

rc (USHORT) - return Return code descriptions are: * 0 NO_ERROR * 6 ERROR_INVALID_HANDLE Remarks

Remarks

When DosFindClose is issued, a subsequent DosFindNext for the closed DirHandle fails unless an intervening DosFindFirst has been issued specifying DirHandle.

Bindings

C Binding

<PRE> #define INCL_DOSFILEMGR

USHORT rc = DosFindClose(DirHandle);

HDIR DirHandle; /* Directory search handle */ USHORT rc; /* return code */ </PRE>

MASM Binding

<PRE> EXTRN DosFindClose:FAR INCL_DOSFILEMGR EQU 1

PUSH WORD DirHandle ;Directory search handle CALL DosFindClose

Returns WORD </PRE>

Example

This example searches for a file, then closes the search. <PRE> #define INCL_DOSFILEMGR #define SEARCH_PATTERN “*.*” #define FILE_ATTRIBUTE 0 #define RESERVED 0L

HDIR FindHandle;

FindHandle = 0x0001;
FindCount = 1;

rc = DosFindFirst(SEARCH_PATTERN, /* File pattern */
&FindHandle, /* Directory search handle */
FILE_ATTRIBUTE, /* Search attribute */
&FindBuffer, /* Result buffer */
sizeof(FindBuffer), /* Result buffer length */
&FindCount, /* # of entries to find */
RESERVED); /* Reserved (must be zero) */
rc = DosFindClose(FindHandle); /* Directory search handle */

</PRE>

Note

Text based on http://www.edm2.com/index.php/DosFindClose_(OS/2_1.x)

Family API
DOS	Process Manager	DosBeep DosExit DosSleep DosExecPgm
File Manager	DosChDir DosChgFilePtr DosClose DosDelete DosDupHandle DosMkDir DosMove DosQCurDir DosQCurDisk DosSetFileMode DosOpen DosQFileInfo DosRead DosQFileMode DosQFSInfo DosQVerify DosRmDir DosSelectDisk DosFindClose DosFindFirst DosFindNext DosSetFileInfo DosSetVerify DosWrite DosFileLocks DosSetFHandState DosNewSize DosBufReset DosQFHandState DosSetFSinfo DosShutdown
Memory Manager	DosFreeSeg DosSubAlloc DosSubFree DosSubSet DosAllocHuge DosAllocSeg DosReallocHuge DosReallocSeg DosGetHugeShift DosCreateCSAlias
NLS	DosCaseMap DosGetCtryInfo DosGetDBCSEv DosSetCtryCode DosGetCollate DosGetMessage DosInsMessage DosPutMessage
Date and Time	DosSetDateTime DosGetDateTime
Devices	DosDevConfig DosDevIOCtl DosDevIOCtl2
Signals	DosHoldSignal DosSetSigHandler
Misc	BadDynLink DosGetEnv DosGetMachineMode DosGetVersion DosError DosErrClass DosSetVec
KBD	KbdCharIn KbdFlushBuffer KbdGetStatus KbdSetStatus KbdStringIn KbdPeek
VIO	VioGetBuf VioGetConfig VioGetCurPos VioGetCurType VioGetPhysBuf VioReadCellStr VioReadCharStr VioScrollUp VioScrollDn VioScrollLf VioScrollRt VioScrUnLock VioSetCurPos VioSetCurType VioSetMode VioGetMode VioShowBuf VioWrtCellStr VioWrtCharStr VioWrtCharStrAtt VioWrtNAttr VioWrtNCell VioWrtNChar VioWrtTTY VioScrLock VioPopUp
Tools	BIND
Modules	DOSCALLS.DLL VIOCALLS.DLL KBDCALLS.DLL MSG.DLL
Libraries	API.LIB OS2386.LIB FAPI.LIB DOSCALLS.LIB SUBCALLS.LIB