GUI ScreenIO for Windows

 ScreenIO.com


GetLogicalDrives

This API retrieves a list of Drive Letters on the current system.  It simply returns a list of disk drives, local drives as well as mapped drives, as a low-value separate list of drive letters of the form A:\ low-value B:\ low-value C:\ low-value low-value.  Note that the end of the list is delineated by consecutive low-values.  You can use the UNSTRING verb to get drive letters into individual variables.

Client/Server issues

The API may be used to obtain a list of Drive Letters on either the client or the server.  To interrogate a drives on the server:

     SET WIN32API-EXECUTE-API-ON-SERVER TO TRUE

Files

Files available to copy to your system:

Usage

     COPY WIN32API.
     COPY GETFTIME.

* ------------------------: Call the API.

     SET API-GETLOGICALDRIVES TO TRUE.
     MOVE LENGTH OF GLD-DRIVE-STRINGS TO GLD-DRIVE-BUFFER-LENGTH
     CALL 'GSWINAPI' USING WIN32API-PARMS
                           GLD-DRIVE-BUFFER-LENGHT
                           GLD-DRIVE-STRINGS
                           WIN32API-C
                           WIN32API-D
                           WIN32API-E
                           WIN32API-F.
                        

Parameters specific to this function

GLD-DRIVE-BUFFER-LENGTH

This must be set to the length of the GLD-DRIVE-STRINGS.  The copybook contains enough room for 40 drives, but in the unlikely event you have more drives you can use a larger area.

GLD-DRIVE-STRINGS

Your list of drives will be returned here as Low-Value separated list of drive letters, each with a trailing colon and backslash.

WIN32API-PARMS - Used in all GSWINAPI calls

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.

WIN32API-RC

Used to return the status of a call to GSWINAPI.  A value of zero is a failure, any other value indicates success.

NOTE: If the API succeeds, WIN32API-RC will contain the number of bytes returned in GLD-DRIVE-STRINGS, excluding the final low-value.

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,
*                         :   display the error in a message box.
*
     IF WIN32API-FAILED
       MOVE WIN32API-ERROR-TEXT TO panel-MESSAGE-TEXT
       SET panel-MESSAGE-IN-MESSAGEBOX TO TRUE.

WIN32API-ERROR-CODE

Error code that was returned by Windows.  This is not generally useful unless you have the Windows Platform SDK documentation available to you.

WIN32API-ERROR-TEXT

Plain-text error message that describes why the operation failed.

WIN32API-A through WIN32API-F

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 

TOC

Send feedback to Norcom