XWorkplace registers additional exception handlers in certain parts where I considered worth it.

With "worth it" I mean the following situations:

  1. Certain code parts crashed on my system and these parts seemed error-prone enough to me to outweigh the performance loss of registering and deregistering exception handlers.

  2. Exception handlers must be registered for all additional threads. If no exception handling was registered there, crashes would take the whole WPS down, because the default WPS exception handler only deals with the default WPS threads.

  3. Exception handlers must also be registered every time mutex semaphores are used. If a code part crashes while a mutex semaphore has been requested by a function, all other threads waiting for that semaphore to be released will be blocked forever. And I mean forever, because even DosKillProcess won't be able to terminate that thread. You'd have to reboot to get out of this. So the exception handler must always check for whether a mutex semaphore is currently owned by the thread and, if so, release it.
XWorkplace does not use the VAC++ library funcs for all this, but installs its own set of quite complex exception handlers (using DosSetExceptionHandler()). The code for exception handlers has been made independent of XWorkplace and moved to /helpers/except.c with V0.9.0.

Also, I have created a few handy macros which automatically register and deregister the XWorkplace exception handlers. This avoids the frequent problem that one forgets to deregister an exception handler, which leads to really awkward problems which are almost impossible to debug. Those macros are called TRY_xxx and CATCH to mimic at least some C++ syntax. See the top of src\helpers\except.c for detailed instructions how to use these.

The XWorkplace exception handlers are the following: