I'm attempting to develop a hack using HackMaster to control the installation
process (the hack patches the SysGetEvent trap entry).

The trap routine that is installed makes some changes to the OS environment that
need to be undone when the hack is un-installed:

  1. It needs to maintain some global state between events. Rather than allocate
     memory for the global state on each event, it allocates some memory (using
     MemHandleNew) the first time the memory is needed, initialises the memory
     from preference memory, and saves the handle away in a feature.

     On subsequent events, the routine just locks the memory handle to get
     access to its global state.

     When it detects an appStopEvent event, it saves a small part of this global
     state to the preference memory, releases the memory chunk, and then
     unregisters the feature.

  2. It changes the display settings. These are normally restored to their
     original values when the appStopEvent is detected.

My problem occurs when the hack is un-installed. HackMaster seems to just remove
the trap routine from the trap chain, and doesn't give it a chance to tidy up
after itself.

The HackMaster documentation mentions a custom extension routine, but gives no
further details on the interface. I'm assuming that I could do the resource
cleanup there.

Does anyone know whether this has actually been implemented within HackMaster
and if so what the API looks like?

Any other suggestions as to how to get around this problem would also be greatly
appreciated.  


Thanks - David

-----------------------------------------------------------------------------
David A. Buckle                                              [EMAIL PROTECTED]
-----------------------------------------------------------------------------


Reply via email to