Fast $MFT parsing - library
<p>I'm need to read(simple and already done) and psrse the $MFT - gather files $DATA runs and file names, time stamps and so on..
I have started with <a href="http://www.codeproject.com/KB/files/NTFSParseLib.aspx" rel="nofollow">this</a> ntfs library, but it is too slow to scan the entire mft.</p>

<h2>How can I speed it up or is there another - more faster library?</h2>

<p>Thanks, but could you please explain to me why the following code is very slow:</p>

<pre><code>for (ULONG64 i = 0;i &lt; kz;i++)
{
    FileRecordHeader = (FILE_RECORD_HEADER*) &amp;buf[bzp];
    if (FileRecordHeader-&gt;Magic != FILE_RECORD_MAGIC)
    {
        goto pd;
    }
    usnaddr = (WORD*)((BYTE*)FileRecordHeader + FileRecordHeader-&gt;OffsetOfUS);
    usn = *usnaddr;
    usarray = usnaddr + 1;
    if (!PatchUS((WORD*)FileRecordHeader, rzf / vl-&gt;SectorSize, usn, usarray))
    {
        goto pd;
    }
    //ParseAttrs(FileRecordHeader,MASK_FILE_NAME,Attrs,&amp;file);
    Application::DoEvents();
    progressBar1-&gt;Value = i;pd:
    bzp = bzp + rzf;
}
</code></pre>

<p>or just enumerating through file references isn't faster.
I'm just need enumerate mft, but with this code that takes minutes, when this could be done in around 20 seconds(on 22 gb prtition - more size - more slowdown)</p>
