Reporting Uncaught Exceptions (SEH)

Started by
13 comments, last by tok_junior 19 years, 8 months ago
Quote:Original post by Anonymous Poster
I'd say you're on the wrong track. Step back, do some reading and try again :)


I'd say he's on the right track indeed.
The reason for having the logfile is probably so some user that has the game crash can send him the logfile.

Getting SEH to work with the intrinsics shouldn't be a problem at all, as long as you make sure you actually tear down your exceptionhandler when you're done with it.

Anyway, SetUnhandledExceptionFilter() is the way to go, as I and others already told you. It's not global, like someone said, it's per-process. UnhandledExceptionFilter() should work in all cases, no matter what the startup-code. If someone's written exceptionhandlers for every single exception, and isn't reporting them back to you (in their CRTStartup that is) they should have their hands cut off so they can't code any more.
And i don't think i know of a CRT that does this either...
Advertisement
Quote:Original post by tok_junior
It's not global, like someone said, it's per-process.

I wrote that. I meant it in the sense that it's global in the process (like a global variable) and not global to the system.

Quote:Original post by tok_junior
UnhandledExceptionFilter() should work in all cases, no matter what the startup-code. If someone's written exceptionhandlers for every single exception, and isn't reporting them back to you (in their CRTStartup that is) they should have their hands cut off so they can't code any more. And i don't think i know of a CRT that does this either...


Just because you don't know of it, doesn't mean it's the case. I know of an example where the UnhandledExceptionFilter does not work in all cases otherwise I wouldn't have wrote what I wrote. If it's something that you're truly interested in send me an email and I'll provide you with the details.
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
Actually, i've spent quite a lot of time reversing the entire exceptionhandling-system under Windows 2000/XP, and I think i've got most of the details figured out.
The only reason for UnhandledExceptionFilter() not to get called is if there exists a handler that handles every single exception. Or if it doesn't handle it, atleast claims it's handled it.
This is vile coding indeed, and what i wrote in the last post still stands: people who does this should have their hands cut off. Ignorant bastards shouldn't be allowed to release trash like that, and people who knows it for what it is, and still use it, well... They can suit themselves when things aren't working the way they're supposed to.
The KiUserException*-functions are still called, even if you don't have a single handler registered in the TIB, and it's the job of these to call UnhandledExceptionFilter() if it reaches the end of the handler-chain.

Sounds like someone knows how to use SoftIce. :)

The Robbins book is second-to-none and available very cheap on Amazon. I posted a link to get it for $5 in The Lounge awhile back but got like two responses, seems like everyone would rather BS about their CSingleton class...
--God has paid us the intolerable compliment of loving us, in the deepest, most tragic, most inexorable sense.- C.S. Lewis
Most of the stuff i do at work relies heavily on kernelmode code, and the only things im doing with the computer on my sparetime is coding and reversing. So yes, i'd say i know sice pretty well ;)
People here are usually not interested in anything that doesn't involve drawing cool things on the screen, preferably stuff that involves heightmaps and bumpmapping it seems. And they're not likely to go anywhere near systemlevel programming ;)

This topic is closed to new replies.

Advertisement