Note:

Do not make Presentation Manager calls from exception handlers.

To preserve variables currently on the stack, pass them as arguments to DosUnwindException using the optional parameters.