Newsgroups: bit.listserv.novell
Date:         Fri, 8 Jan 1993 09:33:18 EST
Reply-To:     Novell LAN Interest Group <NOVELL@SUVM.BITNET>
From:         Brett Warthen <BRETT@INFINITE.MHS.COMPUSERVE.COM>
Subject:      RE: NetWare C Interface 1.2 and MAP ROOT

FORWARDED MESSAGE from Andreas Tranquillini (MAIL@CSERVE
AT> {INTERNET:Andreas.Tranquillini@UIBK.AC.AT}) at 1/08/93 5:26 AM
AT> From: Andreas Tranquillini <Andreas.Tranquillini@UIBK.AC.AT>
AT> Subject:      NetWare C Interface 1.2 and MAP ROOT
AT>
AT> A question to those who are familiar with the NetWare C Interface
AT> library V1.2:
AT>
AT> I want to convert a DOS pathname to a NetWare-style path. This should
AT> be accomplished by ConvertNameToFullPath(), but this function will
AT> return wrong results if the DOS pathname includes a root-mapped drive.
AT>
AT> In the meantime I found a workaround by merging the output of several
AT> other functions (_fullpath(), GetDriveInformation(),
AT> GetCurrentDirectory(), ConvertNameToVolumePath(), ...) but this is far
AT> from being elegant.
AT>
AT> In FORUM.ZIP I found a reference saying that this is a well-known
AT> problem and a fix is included in the file PRSPTH.ZIP but I cannot find
AT> this file anywhere (it is not on ftp.novell.com; archie reports that it
AT> should be on ftp.uni-kl.de but this host is now denying access to user
AT> anonymous).
AT>
AT> Any help will be welcome.
***** NOTES from Brett Warthen (BRETT @ INFINITE) at 1/08/93 9:03 AM
Here's API information that was published in Novell's PDS Bullets (June
1990, I believe), which details the APIs relevant to map root.

For getting the full path to a file...you might find the undocumented DOS
"truename" function helpful.  Int 21h, AH=60h, DS:SI->unqualified path,
ES:DI->buffer for qualified path.  Note that while in some DOS versions you
can get away with DS:SI = ES:DI, under others (especially DR-DOS 6) it can
get you into trouble.

Now the map root stuff from PDS Bullets...

        Interrupt 21h function E9h subfunctions 5-7
        New functions have been added for fake roots.  These
functions have been added as sub-functions of interrupt 21h function E9h.


        Map a Fake Root (if the drive is not currently mapped, a drive
mapping will be created, and the fake root set)

        Parameters:
                AX = E905h (Map a fake root)
                BL = Drive number (0 = current, 1 = A,..26 = Z)
                DS:DX = Pointer to ASCIIZ path.  This path may include
                [server/][volume:][path], and may be NULL length
        Returns:
                Carry flag set on error, Cleared on no error
                AL = error code
                        03h = Invalid path
                        0Fh = Invalid drive
                        11h = Not same device

       Delete a Fake Root (drive remains mapped, just removes the fake
root)
                Parameters:
                AX = E906h (Delete a fake root)
                BL = Drive number (0 = current, 1 = A,..26 = Z)
        Returns:
                Nothing

        Get Relative Drive Depth (returns the number of directories below
the fake root for the drive mapping of the specified drive)
        Parameters:
                AX = E907h (Get relative drive depth)
                BL = Drive number (0 = current, 1 = A,..26 = Z)
        Returns:
                AL = Number of directories below the +fake root+.  0FFh
                indicates no fake root assigned
        For example:
                A drive is mapped to server/sys:users/name.  The +fake
root+ is
                set to server/sys:users.  The prompt would show F:\NAME>.
                This function would return 1 as the relative depth

------------------------+-------------------------------------------------
 Brett Warthen          |        MHS:  Brett @ Infinite (via NHUB/CSERVE)
 Infinite Technologies  | CompuServe:  >MHS:Brett@Infinite
 11433 Cronridge Drive  |   Internet:  Brett@Infinite.mhs.compuserve.com
 Suite H                |       Phax:  +1-410-363-3779
 Owings Mills, MD 21117 |      Phone:  +1-410-363-1097
------------------------+-------------------------------------------------
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU