GetCurrentDirectory
3.5.3 Windows 32-Bit API Replacements for Int 21
Direct INT21 calls or the use of the Windows 3.x DOS3Call API to request MS-DOS to perform file I/O operations must be replaced by the appropriate Windows 32-Bit file I/O calls. Windows 32-Bit offers a complete set of named APIs to replace nonportable INT21 calls including:
INT 21H FunctionDOS OperationWindows 32-Bit API Equivalent
0EHSelect DiskSetCurrentDirectory
19HGet Current DiskGetCurrentDirectory
2AHGet DateGetDateAndTime
2BHSet DateSetDateAndTime
2CHGet TimeGetDateAndTime
2DHSet TimeSetDateAndTime
36HGet Disk Free SpaceGetDiskFreeSpace
39HCreate DirectoryCreateDirectory
3AHRemove DirectoryRemoveDirectory
3BHSet Current DirectorySetCurrentDirectory
3CHCreate HandleCreateFile
3DHOpen HandleOpenFile
3EHClose HandleCloseHandle
3FHRead HandleReadFile
40HWrite HandleWriteFile
41HDelete FileDeleteFile
42HMove File PointerSetFilePointer
43HGet File AttributesGetAttributesFile
43HSet File AttributesSetAttributesFile
47HGet Current DirectoryGetCurrentDirectory
4EHFind First FileFindFirstFile
4FHFind Next FileFindNextFile
56HChange Directory EntryMoveFile
57HGet Date/Time of FileGetDateAndTimeFile
57HSet Date/Time of FileSetDataAndTimeFile
59HGet Extended ErrorGetLastError
5AHCreate Unique FileGetTempFileName
5BHCreate New FileCreateFile
5CHLockLockFile
5CHUnlockUnlockFile
67HSet Handle CountSetHandleCount
In most situations, the standard C runtime libraries are sufficient for normal file I/O. The C runtime has the advantage of being portable across many platforms.