title: win32 process termination detection: WMI vs. WaitForSingleObject
body: <p>I am writing a windows service (c++) that need to detect specific windows process termination.</p>
  
  <p>I thought about two different approaches to detect the termination:</p>
  
  <ol>
  <li>Using <strong>WMI</strong> as described <a href="https://stackoverflow.com/questions/3556048/how-to-detect-win32-process-creation-termination-in-c#new-answer?newreg=3f09734c0c3b4b739b0534998db7a9ff" title="here">here</a>.</li>
  <li>Using winapi <strong><code>WaitForSingleObject(hHandle, INFINITE)</code></strong> function on the process' handle.</li>
  </ol>
  
  <p>The obvious difference is that WMI uses a <code>CALLBACK</code> function.</p>
  
  <p>What are the other major differences, advantages and disadvantages, between the two approaches?</p>
  
  <p>Thanks!</p>