Okay, this is a really odd request, and frankly I can hear some of you saying "Are you retarded?? Why in the world would you want to do that?" Well, it's a first for me, but I have a job interview with the Surface team on Monday, and part of my prep is to write some automation code. Fortunately, I was given the exact interview questions and what not ahead of time, so I have a few days to get prepped and ready. I already have a basic plan of a few basic C# test cases I want to write, and I want the very last test case to cause a surprise BSOD where I fire up WinDBG and trace it back to what caused it. Since I have to be able to demonstrate my kernel debugging skills here, I really need to get him convinced on the spot that I know what I'm doing. Part of this is responding to BSODs.
So, what's the most ethical way to do it? I did some searching, and came up with a few quick ideas.
- Call KeBugCheck[Ex]() and be done with it. That's what I would have done already, but I heard that you can't call this in usermode (even if you do a call to ::LoadLibrary() and get a function pointer to it. So far I haven't tried that (I just know that I've done it several times with driver level stuff before) but I'm going to try it anyway later on.
- Write a basic driver that calls KeBugCheck[Ex]() instead. I haven't touched the basics of driver programming since the Win2k/XP days when I was attempting to write a Riva128 driver as a learning experience. A basic driver IIRC can be called from user mode code, so that seems like a way to do it.
- Call TerminateProcess() on some really critical process. I could imagine that a simple call to this may require certain privileges that a user mode program might not have. Someone tried this with "WinLogon" 12 years ago, but dunno if that would work today.
Personally, I'd like to go with #2, but it's been a while since I've touched any driver dev stuff. Plus since I don't have internet at home, I can't download the WDK for quite some time. Saturday and Sunday will be "busy all day" days for me, so if I could find the shortest distance between two points, that would be immensely helpful.
Any ideas? Thanks.
Shogun