This blog article demonstraites a technique to access the LinearHash service Universal Driver Manager console through custom OpenInsight BASIC+ code. The example walks through applying a code wrapper around the Universal Driver manager and programatically accessing the contents of the active computers and locks. Extending this example will allow you to remotely control the Universal Driver Manager from another computer.
The Universal Driver Manager has no official API but it is written in OpenInsight and runs from a stripped down version of OpenInsight. By writing a wrapper form and changing the UD Manager to run the custom wrapper form it is possible to interact with the UD Manager controls. The proof of concept code below will:
- Starts the stock UD Manager form.
- Call the get_property function on the form controls containing the active computers and the table of active locks.
- Writes the control contents to OS files for accessing after after the wrapper form closes.
- Close the UD Manager form and exits.
The control contents can be read by a controling copy of OpenInsight as needed.
With additional work the wrapper form could be customized to receive custom commands and issue set_property and send_event functions to unlock files and manipulate the UD Manager as if controlled using the GUI.
Applying the Proof of Concept Code
- Download LH_MANAGER_INTERFACE.zip and extract to c:\temp\rdk.
- Copy the directory c:\Revsoft\Universal Driver\UD_Manager to C:\Revsoft\Universal Driver\UD_Manager_api.
- Copy your development oengine.dll into the UD_Manager_api directory and overwrite the existing oengine.dll.
- Launch C:\Revsoft\Universal Driver\UD_Manager_api\oinsight.exe in development mode and login to SYSPROG as the SYSPROG user (no password).
- Open the system monitor (press F12) and install the downloaded RDK. Use the command:
RUN RDKInstall "C:\temp\rdk"
This will install a new form named LH_MANAGER_INTERFACE.
- Change the application entry point from the form MANAGE_LH_SERVER to LH_MANAGER_INTERFACE.
- Close OpenInsight.
- Copy oengine.dll from UD_Manager into UD_Manager_api and overwrite the development engine.
The changes are now complete. Run the the the new UD Manager API with the following command line:
"C:\Revsoft\Universal Driver\UD_Manager_api\OINSIGHT.exe" /AP=SYSPROG /UN=SYSPROG /PW=""
The UD Manager API will write the contents of the active computers and locks to the files activecomputers.txt and activelocks.txt in the UD_Manager_api directory each time the UD manager API runs.
Extending the Proof of Concept
The RDK contains all of the source in the above example. Look at the stored proceedure LH_MANAGER_INTERFACE_EVENTS to see how the wrapper form starts the stock UD Manager and queries the contents of the control. With additional work the wrapper could be programs to read remote commands and interact with the UD Manager window to unlock files.
This article first appeared on the Congruity Service blog on September 9th, 2015.