title: HANDLE_TYPE_PROCESS across Windows versions
body: <p>I can't find any documentation about this. I'm enumerating process handles in another process.</p>
  
  <p>I check the value of <code>SYSTEM_HANDLE::ObjectTypeNumber</code> and apparently it's different between versions of Windows. I found this piece of code in a project on GitHub</p>
  
  <pre class="lang-cpp prettyprint-override"><code>// For XP &amp; 2K3 : HANDLE_TYPE_PROCESS = 0x5
  // For Vista &amp; Longhorn : HANDLE_TYPE_PROCESS = 0x6
  // Windows 8: HANDLE_TYPE_PROCESS = 0x7
  #define HANDLE_TYPE_PROCESS 7
  </code></pre>
  
  <p>Strangely, it skips Windows 7. I've been checking various kernel related books (such as Windows Internals) and wasn't able to find the correct value for Windows 7. I don't own a Windows 7 machine to test on either.</p>
  
  <p>Therefore, my code looks like this at the moment:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>BYTE HANDLE_TYPE_PROCESS;
  if(IsWindows8OrGreater()) HANDLE_TYPE_PROCESS = 7;
  else if(IsWindowsVistaOrGreater()) HANDLE_TYPE_PROCESS = 6;
  else HANDLE_TYPE_PROCESS = 5;
  </code></pre>
  
  <p>What's the object type number for process handles in Windows 7?</p>