|GUI ScreenIO for Windows|
This API will convert a Driver Letter based file or directory name to the Universal Naming Convention name of the file or directory.
Assume the input to this API is file specification in the form
Drive:\directory\...\file.extension such as H:\data\cust.db
Further assume Drive H is mapped to a share named "production" on a server named Sales.
In this case calling the DriveToUNC with H:\data\cust.db would return \\Sales\production\data\cust.db as the UNC name.
If all you want to know is whether or not a drive is mapped simply call this API with the drive letter, Colon, and Backslash. "Y:\".
Calling DriveToUNC with a local drive letter such as C:\ wield yield an error code DTU-NOT-A-MAPPED-DRIVE (2250).
In this way you can tell if a file is on a local hard disk or remote share.
This API does not work on Windows 95, and will always return DTU-INVALID-Drive.
The API may be used to obtain information about a drive on either the client or the server. To interrogate drives on the server:
SET WIN32API-EXECUTE-API-ON-SERVER TO TRUE
Files available to copy to your system:
MOVE 'F:\MYFILE.COB' TO DTU-DRIVE-LETTER-PATH
This is the Drive Letter based specification for a Drive, or a Directory, or a File. It must be in valid format, but the actual file or directory need not actually exist. (You can get a UNC name for a file that you might plan to create later for instance).
Upon return from the call, this will contain the Universal Naming Convention for the location you specified.
This will contain the Server name and Share name portion of the UNC.
This field will contain the remaining part (beyond the Server and Share) of the path to the file or directory. If you specify only a drive letter, this portion will be empty.
If the call to this API is not successful (win32api-rc = zero) this field will be set to one of the values listed in the copybook. These error codes have 88 names that are reasonably descriptive. Of special Interest are the following:
DTU-NOT-A-MAPPED-DRIVE (2250): This means the Drive-letter-path is a local disk, and not mapped to a server share.
DTU-INVALID-DRIVE (1200): This means you specified a drive letter that does not exist, or you are running on Windows 95.
DTU-INTERNAL-ERROR (234): Notify Norcom. Internal buffer space is not sufficient. As a short term work around consider adding a share name on the server to the specific directory you need.
This argument is standard for all CALLs to GSWINAPI. It is used to select the desired API or function, and to return the status of the operation.
Used to return the status of a call to GSWINAPI. A value of zero is a failure, any other value indicates success.
Recommended usage is to test the 88-level value WIN32API to see if it worked, then to use the text error message to see why it failed.
* ------------------------: If function failed,
Error code that was returned by Windows. This is not generally useful unless you have the Windows Platform SDK documentation available to you.
Plain-text error message that describes why the operation failed.
The number of these present varies depending on how many arguments are used by the desired function. These are not used, but must be present because this CALL requires seven arguments.
|© 2000-2019 Norcom, all rights reserved|