* :--------------------------------------- * ------------------------: CopyBook for QueryDosDevice API * : Uset to obtain the current mapping of * : a dos Device (Drive) * : If WIN32API-RC returns a value larger * : than DOS-MAPPING-SIZE it is * : necessary to increase the size of * : DOS-DRIVE-MAPPING. * :--------------------------------------- * : This API returns nothing for windows * : 98, and less than usefull in win2k. * :--------------------------------------- * : In some versions of Windows the * : drive mapping may be followed by prior * : drive mappings for that same drive * : letter, each separated by a low-value. * * To use: * * COPY WIN32API. * COPY QUERYDOS. * . * . * ------------------------: Clear any previous data in * : preparation to making our request * MOVE LOW-VALUES TO DOS-DRIVE-MAPPING * MOVE LENGTH OF DOS-DRIVE-MAPPING TO DOS-MAPPING-SIZE * * ------------------------: Call the GUI ScreenIO API routine: * MOVE 'F:' TO DOS-DEVICE-NAME * SET API-QUERYDOSDEVICE TO TRUE * CALL 'GSWINAPI' USING WIN32API-PARMS * DOS-DEVICE-NAME * DOS-MAPPING-SIZE * DOS-DEVICE-MAPPING * DUMMY * DUMMY * DUMMY * * IF WIN32API-FAILED * do error-routine * ELSE * IF WIN32API-RC < DOS-MAPPING-SIZE * UNSTRING DOS-DEVICE-MAPPING DELIMITED LOW-VALUES INTO * WS-DRIVE-MAPPED-TO * ... * END-IF * END-IF * * ---------------------------------------------------------------- * 01 DOS-DEVICE-NAME PIC X(10). 01 DOS-MAPPING-SIZE PIC 9(9) COMP-5. 01 DOS-DEVICE-MAPPING PIC X(2048).