In the case of an exception in user mode code, the operating system parses the thread's  list and calls each exception handler in sequence until a handler signals it has handled the exception (by return value) or the list is exhausted. The last one in the list is always the kernel32!UnhandledExceptionFilter which displays the General protection fault error message.
When an exception occurs in user mode code, the operating system goes through each handler listed for that exception and calls it until a handler signals it has handled the exception or the list is empty. The last handler on the list is always kernel32!UnhandledExceptionFilter which displays the General protection fault error message.