title: Prevent C# app from process kill
body: <p>How can I protect my C# app from someone killing its process via taskman or programmatically?</p>
  
  <p>Here is my scenario:</p>
  
  <p>App A is an MFC app developed by another team. It has an unpublished text-based remote interface that is enabled via a backdoor.</p>
  
  <p>I'm developing app B, a C# WinForms app which interacts with A. B enables A's backdoor when it needs remote access closes it when finished (or on failure).</p>
  
  <p>I'm exploring ways users could abuse B in order to gain access to A's hidden functionality, such as killing B's process after it has enabled A's remote interface. I'd like have one last chance for B to close A's backdoor when that happens.</p>
  
  <p>B uses localhost to interact with A, so I'm not worried about the power-down scenario.</p>
  
  <p>I'm looking for a solution that doesn't involve changing A.</p>
  
  <p>I'm not expecting to be able to stop Dark Tangent (though that would be a bonus), but right now a script kiddie could have his way with this design :)</p>
  
  <p>These apps run on Windows XP, but will also soon support Vista &amp; 7.</p>
  
  <p>Thanks in advance,
  Jim</p>