* :--------------------------------------- * ------------------------: CopyBook for DriveToUNC API * : Uset to obtain the UNC name of a file * : or directory located on a mapped drive * : This is useful for applications which * : need know if a file is located on the * : local machine or on a remote machine. * : * : If WIN32API-FAILED specific reason * : code found in DTU-ERROR-CODE. * : * : This API does not work on Win95. * :--------------------------------------- * * To use: * * COPY WIN32API. * COPY DRIVEUNC. * . * . * * STRING 'F:\MYDIRECTORY\MYFILE.TXT' LOW-VALUE * DELIMITED SIZE INTO DTU-DRIVE-LETTER-PATH * * ------------------------: Call the GUI ScreenIO API routine: * SET API-DRIVETOUNC TO TRUE * CALL 'GSWINAPI' USING WIN32API-PARMS * DTU-DRIVE-LETTER-PATH * DTU-UNIVERSAL-NAME * DTU-CONNECTION-NAME * DTU-REMAINING-PATH * DTU-ERROR-CODE * DUMMY * * IF NOT WIN32API-FAILED * SET ws-drive-is-mapped-switch TO TRUE * ELSE * IF DTU-NOT-A-MAPPED-DRIVE * SET ws-drive-is-local-switch TO TRUE * ELSE * SET ws-other-error TO TRUE * END-IF * END-IF * * ---------------------------------------------------------------- * * : This is the drive letter based name * : of a file or directory 01 DTU-DRIVE-LETTER-PATH PIC X(120). * : This is the returned UNC equivelent 01 DTU-UNIVERSAL-NAME PIC X(400). * : This is the network portion 01 DTU-CONNECTION-NAME PIC X(250). * : This is the directory/file portion 01 DTU-REMAINING-PATH PIC X(120). 01 DTU-ERROR-CODE PIC 9(9) COMP-5. 88 DTU-NO-ERROR VALUE ZERO. * : Drive-letter-path is not valid. * : Win95 always returns this value. 88 DTU-INVALID-DRIVE VALUE 1200. * : Was mapped, but not currently mapped 88 DTU-NO-CURRENT-CONNECTION VALUE 1201. 88 DTU-NETWORK-ERROR VALUE 1208. * : Notify Norcom - need larger work space 88 DTU-INTERNAL-ERROR VALUE 234. * : Network type not compatible with UNC. 88 DTU-NOT-SUPPORTED VALUE 1254. * : one or more network links id down 88 DTU-NOT-MAPPED-OR-NET-DOWN VALUE 1203. * : no network is available 88 DTU-NO-NETWORK VALUE 1222. * : * >>>-------------> : The Drive-letter-path is not a mapped * : Drive. It is a local drive. 88 DTU-NOT-A-MAPPED-DRIVE VALUE 2250.