title: force a blue screen (from a simple driver bug?) in C code
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/667581/simulating-a-bluescreen">Simulating a BlueScreen</a>  </p>
  </blockquote>
  
  
  
  <p>Hello SO,</p>
  
  <p>I'm trying to induce a BSOD somehow inline in my C code. My main background is Java but have been fortunate to have been tutored by some coworkers and am helping out with a simple C utility.</p>
  
  <p>There's two sections:<br>
  1) write to a hard drive (I finished this, wasn't too bad)<br>
  2) Force a blue screen immediately after sending the last SCSI write command</p>
  
  <p>You can probably tell the intent of the program easily now.</p>
  
  <p>I've tried two things so far:<br>
  1) Externally calling pskill.exe (windows utility) to manually crash csrss.exe which forces a blue screen every time since csrss.exe is a required service of windows. This doesn't work because it's not fast enough. The call to the external utility takes too long so we need inline code to compile with the write to disk section in order to crash the computer fast enough.  </p>
  
  <p>2) Use the windows.h API to call TerminateProcess: <a href="http://msdn.microsoft.com/en-us/library/ms686714%28v=vs.85%29.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms686714%28v=vs.85%29.aspx</a>
  The problem is this function cannot end system related tasks so it can't close csrss.exe</p>
  
  <p>This has left me short on options. I need a clever way to kill csrss.exe in our own native code without an external call or a clever way to force a blue screen in internal code OR I need a very simple driver I can load and call which will blue screen the machine immediately. Could be as short as 1 line calling KeBugCheck <a href="http://msdn.microsoft.com/en-us/library/ff551948.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ff551948.aspx</a>  </p>
  
  <p>Thanks for your time and input.</p>