title: determining if a regime of virtual memory is readable
body: <p>let's say I want to examine the entire 4GB address space of my <code>win32</code> user-mode app.
  since trying to read directly from random places throws an <code>access violation</code> , I was thinking to check first for readability of each page:</p>
  
  <pre><code>char* p = 0x00000000;
  while (p &lt; 0xf0000000 ) 
  {
      MEMORY_BASIC_INFORMATION mbi;
      VirtualQuery ( p , &amp; mbi , 100) ;
      if (!(  mbi.Protect | PAGE_NOACCESS ) )        
           char tmp = *p;
      p = p + PAGE_SIZE;
  
  
  }
  </code></pre>
  
  <p>is there any other way, more efficient to just that?</p>