* :--------------------------------------- * ------------------------: Copybook for GetWindowsDirectory. * : * : See the documentation for details. * :--------------------------------------- * * To use: * * COPY WIN32API. * COPY GWINDIR. * . * . * ------------------------: Set the size of the buffer that * : will receive the Windows directory. * * MOVE LENGTH OF GWD-DIRECTORY TO GWD-BUFFER-LENGTH. * * ------------------------: Call the API to get the directory. * * SET API-GETWINDOWSDIRECTORY TO TRUE. * CALL 'GSWINAPI' USING WIN32API-PARMS * GWD-DIRECTORY * GWD-BUFFER-LENGTH * GWD-BYTES-RETURNED * WIN32API-D * WIN32API-E * WIN32API-F. * * ------------------------: If function failed, * : display a textual error message. * * IF WIN32API-FAILED * MOVE WIN32API-ERROR-TEXT TO my-error-message * do whatever to display my-error-message. * * ------------------------: NOTE: * : * : If your buffer wasn't large enough, * : the LENGTH-RETURNED is the size of the * : buffer needed to hold the directory. * * ---------------------------------------------------------------- * * : Buffer where the directory will * : be placed; you can make this as * : large as you need. 01 GWD-DIRECTORY PIC X(1024). * : Size of the buffer 01 GWD-BUFFER-LENGTH PIC S9(9) COMP-5. * : Number of bytes returned, not * : including the trailing low-value. 01 GWD-BYTES-RETURNED PIC S9(9) COMP-5.