Table of Contents

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

2021/09/17 04:47 · prokushev · 0 Comments
2021/08/20 03:18 · prokushev · 0 Comments

DosQFSAttach

Query information about an attached file system (local or remote), or about a character device or pseudo-character device attached to the file system.

Syntax

 DosQFSAttach (DeviceName, Ordinal, FSAInfoLevel, DataBuffer, DataBufferLen, Reserved)

Parameters

Note: The szFSDName is the FSD name exported by the FSD, which is not necessarily the same as the FSD name in the boot sector.

For local character devices (iType = 1), cbFSDName = 0 and szFSDName contains only a terminating NULL byte, and cbFSAData = 0.

For local drives (iType = 3), szFSDName contains the name of the FSD attached to the drive at the time of the call. This information changes dynamically. If the drive is attached to the kernel's resident file system, szFSDName contains FAT or unknown. Since the resident file system gets attached to any disk that other FSDs refuse to mount, it is possible to have a disk that does not contain a recognizable file system, but yet gets attached to the resident file system. In this case, it is possible to detect the difference, and this information would help programs in not destroying data on a disk that was not properly recognized.

Return Code

rc (USHORT) - return:Return code descriptions are:

Remarks

Information about all block devices and all character and pseudo-character devices is returned by this call.

The information returned by this call is highly volatile. Calling programs should be aware that the returned information may have already changed by the time it's returned to them.

The information returned for disks that are attached to the kernel's resident file system can be used to determine if the kernel definitely recognized the disk as one with its file system on it, or if the kernel just attached its file system to it because no other FSDs mounted the disk. This can be important information for a program that needs to know what file system is attached to the drive. It is quite easy to get into a situation where the FSD that recognizes a certain disk has not been installed into the system. In such a case, there is a potential for the data on the disk to be destroyed since the wrong file system is attached to the disk by default.

Bindings

C

#define INCL_DOSFILEMGR
 
USHORT  rc = DosQFSAttach(DeviceName, Ordinal, FSAInfoLevel, DataBuffer,
                            DataBufferLen, 0);
 
PSZ     DeviceName;    /* Device name or drive letter string */
USHORT  Ordinal;       /* Ordinal of entry in name list  */
USHORT  FSAInfoLevel;  /* Type of attached FSD data required */
PBYTE   DataBuffer;    /* Returned data buffer */
PUSHORT DataBufferLen; /* Buffer length  */
ULONG   0;             /* Reserved (must be zero)  */
 
USHORT  rc;            /* return code */

MASM

EXTRN DosQFSAttach:FAR
INCL_DOSFILEMGR     EQU 1
 
PUSH@  ASCIIZ DeviceName     ;Device name or drive letter string
PUSH   WORD   Ordinal        ;Ordinal of entry in name list
PUSH   WORD   FSAInfoLevel   ;Type of attached FSD data required
PUSH@  OTHER  DataBuffer     ;Data buffer (returned)
PUSH@  WORD   DataBufferLen  ;Buffer length (returned)
PUSH   DWORD  0              ;Reserved (must be zero)
CALL   DosQFSAttach
 
Returns WORD