During process termination, if you try to enter a critical section that is owned by another thread that has already been terminated, the gates are now electrified, and the kernel simply terminates your process.
as noted in a comment on the last linked article,
there is an option (enabled by default for Store apps)
to electrify the fences and raise a exception if
an application tries to use an invalid handle or an invalid
type of handle (for example,
SetEvent on a semaphore).
Classic Win32 applications can opt into this behavior
and asking for the
to be turned on.