title: Is it possible to dynamically change from FILE_FLAG_SEQUENTIAL_SCAN to FILE_FLAG_RANDOM_ACCESS?
body: <p>Good afternoon, We are building a prototype of a Windows/LINUX deduper using the memory mapped file API of Windows and Linux. Our deduper starts out by doing a sequential scan of all the database records to be deduped. Therefore , we pass the flag FILE_FLAG_SEQUENTIAL_SCAN to the Windows API CreateFile during our intial sequential scan of the database records to be deduped.
     Once we finish the first part of our deduping process, we try to use the Windows memory mapping API to randomly access the data. At this point, using the Windows C++ API, is it possible to dynamically change to the FILE_FLAG_RANDOM_ACCESS mode? </p>
  
  <pre><code>In Linux, we are are able to do this with the following excerpt of code, 
    MapPtr = (char*)mmap((void *)BaseMapPtr ,mappedlength,PROT_READ, 
              MAP_PRIVATE,  hFile,baseoff );
                      if (MapPtr == MAP_FAILED){
                          perror("mmap");
                          throw cException(ERR_MEMORYMAPPING,TempFileName);
                      }
   madvise(MapPtr,mappedlength,MADV_RANDOM);
  </code></pre>
  
  <p>Are we paying a penalty in Windows by using FILE_FLAG_SEQUENTIAL_SCAN  during the random access phase of our deduping process. Thank you.</p>