title: Why accessing ReadFileEx's input buffer prematurely can cause data corruption?
body: <p><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa365468.aspx" rel="nofollow noreferrer"><code>ReadFileEx</code>'s documentation</a> says:</p>
  <blockquote>
  <p>Accessing the input buffer while a read operation is using the buffer may lead to corruption of the data read into that buffer. Applications must not read from, write to, reallocate, or free the input buffer that a read operation is using until the read operation completes.</p>
  </blockquote>
  <p>This is the first time I've ever heard of reading data causing corruption.<br />
  So my question is, <em>why</em> does that happen? How can a <em>read</em> operation possibly cause data corruption?<br />
  What's going on underneath that causes this?</p>
  <h3>Update:</h3>
  <p>I noticed an interesting sentence on <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa365467.aspx" rel="nofollow noreferrer"><code>ReadFile</code>'s page</a>:</p>
  <blockquote>
  <p>The <code>ReadFile</code> function may fail with <code>ERROR_NOT_ENOUGH_QUOTA</code>, which means the calling process's buffer could not be page-locked.</p>
  </blockquote>
  <p>Maybe this is related to the answer?</p>