HWman

Information
hwman is a WPS class replacement for HWManager (the OS/2 Hardware Manager).

This is an update to the OS/2 "Hardware-Manager".

It does 2 things: 1) It removes "WPDevice" nodes from the HW manager device tree if the corresponding RMNode does not exist anymore. This finally fixes the problem that if you remove USB devices they would never be removed from the HWManager device tree. This is not limited to USB devices. Any non existing RM node will lead to removal of the corresponding WPDevice.

2) As a cosmetic measure, I changed the icon for any "bus devices" to show the WPBusDev icon (that's the "3 squares icon" colored in yellow,red and blue). For example, a "bus device" would be an AGP bus connected to the PCI bus via a bridge (the AGP "bus device" is an addition that Veit Kannegiesser had added to PCIBUS.SNP if it finds an AGP bus).



More Information
WPHwManagerEx class depends on WPHwManager, it is not a 100% replacement of the original class, that's why it is so small. It changes the behavior of WPHwManager while letting WPHwManager do all the rest it has been doing already.

It still replaces WPHwManager in the way that WPHwManagerEx is invoked before WPHwManager is. Per default WPHwManagerEx will just delegate the call to WPHwManager. With the little exception for when it overrides any WPHwManager methods. In that case, WPHwManagerEx is invoked first. Then it can decide what it wants to do: completely replace a method, do something and then call the WPHwManager method or call the WPHwManager method and then do something. The latter is normally done to setup some desired default "state" and then do a modification. Exactly what WPHwManagerEx does for the "WPPopulate" method.

WarpIn Installation
On the latest version of HWman there is WarpIn installer that will register the class automatically.

Manual Installation
Use this instructions only if you don't want to use the WarpIn installer. This is the manual way to register a class on WPS.

Instructions:
 * 1) copy the DLL (hwman.dll) to a convenient place
 * 2) open XWorkplace "WPS class list" object
 * 3) Do right click in class tree and select "register new class", select the DLL (hwman.dll) and specify "WPHwManagerEx" as the class to register
 * 4) refresh the "WPS class list" view by hitting F5 or do a WPS restart until "WPHwManagerEx" shows up in the "WPS class list" class tree
 * 5) open XWorkplace "WPS class list" object
 * 6) right click on "WPHwManager" and select "replace by subclass" (or whatever it's called in english)
 * 7) in the dialog select "WPHwManagerEx" which is a subelement of "WPHwManager"
 * 8) hit "OK
 * 9) restart WPS

If you attach and detach USB devices, you will need to hit F5 in the HWManager view to trigger an update of the view(s) (as always). I could implement a secondary thread to trigger the update on a regular basis but I didn't (save CPU for more important things).

Using WPS Class List Utility
















Once hwman class is installed you can see that WPHwManagerEX overrides WPHwManager.



Download

 * Hobbes Download

Build Source Code
See enclosed sources.zip. You will need the OS/2 DDK as well as the OS/2 toolkit. It uses VAC to create the DLL. If you want to use Watcom you might need to modify the calling conventions etc.

Author
Lars Erdmann