title: Are MapViewOfFile memory mappings reused?
body: <p>If I create 2 separate mappings of the same file in the same process will the pointers be shared?</p>
  
  <p>in other words: </p>
  
  <pre><code>LPCTSTR filename = //...
  
  HANDLE file1 = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0);
  HANDLE fileMapping1 = CreateFileMapping(file1, NULL, PAGE_READONLY, 0, 0, 0);
  void* pointer1 = MapViewOfFile(fileMapping1, FILE_MAP_READ, 0, 0, 0);
  
  CloseHandle(fileMapping1);
  CloseHandle(file1);
  
  HANDLE file2 = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0);
  HANDLE fileMapping2 = CreateFileMapping(file2, NULL, PAGE_READONLY, 0, 0, 0);
  void* pointer2 = MapViewOfFile(fileMapping2, FILE_MAP_READ, 0, 0, 0);
  
  CloseHandle(fileMapping2);
  CloseHandle(file2);
  </code></pre>
  
  <p>Will <code>pointer1</code> ever be equal to <code>pointer2</code>?</p>
  
  <p>The reason I am asking is that I have several threads that need to search in a large (300+MB) file and I want to use memory mapping for that. However the process needs to be able to run on an old 32bit xp machine, so if each thread allocated their own copy in virtual memory then I could run out of memory.</p>