title: c++ elevating privileges on an .exe using OpenProcess()
body: <p>I have been reading some of the books by Hoglund and I thought I would have a 'go' at his 'simple debugger'...</p>
  
  <p>Anyway, I have been trying to use the line</p>
  
  <pre><code>hProcess = OpenProcess(PROCESS_ALL_ACCESS | PROCESS_VM_OPERATION, 0, aPID);
  </code></pre>
  
  <p>Every time I use it on a running process hProcess is being returned as NULL, why is this - the target I was using was an instance of notepad.exe.</p>
  
  <p>I can terminate a process no problem using:</p>
  
  <pre><code>hProcess = OpenProcess( PROCESS_QUERY_INFORMATION |
             PROCESS_VM_READ | PROCESS_TERMINATE, FALSE, aPID );
  </code></pre>
  
  <p>I am wondering how to elevate privileges, and why it doesn't work.</p>
  
  <p>Thanks, R.</p>