DosFSAttach (OS/2 1.x)

DosFSAttach attaches or detaches drive to/from a remote FSD, or a pseudo-character device name to/from a local or remote FSD.

Syntax
DosFSAttach (DeviceName, FSDName, DataBuffer, DataBufferLen, OpFlag, Reserved)

Parameters

 * DeviceName (PSZ) - input : Points to either the drive letter followed by a colon, or points to a pseudo-character device name. If DeviceName is a drive, it is an ASCIIZ string having the form of drive letter followed by a colon. If an attach is successful, all requests to that drive are routed to the specified FSD. If a detach is successful, the drive disappears from the system's name space.
 * If DeviceName is a pseudo-character device name (single file device), its format is that of an ASCIIZ string in the format of an OS/2 filename in a subdirectory called \DEV\. All requests to that name are routed to the specified FSD after a successful attach. A successful detach removes the name from the system's name space.


 * FSDName (PSZ) - input : Address of the ASCIIZ name of the remote FSD to attach to or detach from DeviceName.
 * DataBuffer (PBYTE) - input : Points to the user-supplied FSD argument data area. The meaning of the data is specific to the FSD. The DataBuffer contains contiguous ASCIIZ strings, with the first word of the buffer containing the number of ASCIIZ strings.
 * DataBufferLen (USHORT) - input : The byte length of the data buffer.
 * OpFlag (USHORT) - input : Defines the type of operation to be performed. Attach = 0 and Detach = 1.
 * Reserved (ULONG) - input : Reserved, must be set to zero.

Return Code

 * rc (USHORT) - return:Return code descriptions are:
 * 0 NO_ERROR
 * 8 ERROR_NOT_ENOUGH_MEMORY
 * 15 ERROR_INVALID_DRIVE
 * 124 ERROR_INVALID_LEVEL
 * 252 ERROR_INVALID_FSD_NAME
 * 253 ERROR_INVALID_PATH

Remarks
The redirection of drive letters representing local drives is not supported.

FSDs that wish to establish open connections that are not attached to a name in the system's name space, for such purposes as optimizing UNC connections or establishing access rights, must use an DosFSCtl function to do so. DosFSAttach only creates attachments to drives or devices in the system's name space.

See description of pseudo-character devices.

C

 * 1) define INCL_DOSFILEMGR

USHORT rc = DosFSAttach(DeviceName, FSDName, DataBuffer, DataBufferLen, OpFlag, 0);

PSZ    DeviceName;    /* Device name or drive letter string */ PSZ    FSDName;       /* FSD name */ PBYTE  DataBuffer;    /* Attach argument data */ USHORT DataBufferLen; /* Buffer length  */ USHORT OpFlag;        /* Attach or detach */ ULONG  0;             /* Reserved (must be zero)  */

USHORT rc;            /* return code */ 

MASM
 EXTRN DosFSAttach:FAR INCL_DOSFILEMGR    EQU 1

PUSH@ ASCIIZ DeviceName     ;Device name or drive letter string PUSH@ ASCIIZ FSDName        ;FSD name PUSH@ OTHER  DataBuffer     ;Attach argument data PUSH  WORD   DataBufferLen  ;Buffer length PUSH  WORD   OpFlag         ;Attach or detach PUSH  DWORD  0              ;Reserved (must be zero) CALL  DosFSAttach

Returns WORD 