Skip to content

Instantly share code, notes, and snippets.

@Lovesan
Created June 6, 2019 15:39
Show Gist options
  • Save Lovesan/fe8ecc5bed205e81f8505b35617bbbd6 to your computer and use it in GitHub Desktop.
Save Lovesan/fe8ecc5bed205e81f8505b35617bbbd6 to your computer and use it in GitHub Desktop.
SBCL test for SEH-utilizing C++ or .NET library
(sb-alien:load-shared-object "sehlib.dll")
(sb-alien:define-alien-routine
("catches_fn" catches-fn)
sb-alien:void)
(defun test-seh ()
(handler-case
(progn (catches-fn)
(format *error-output*
"Correct behavior. No exception."))
(sb-win32:exception
(ex)
(format *error-output*
"Invalid behavior. Got exception. Code #x~8,'0X"
(sb-win32:exception-code ex))))
(values))
(test-seh)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment