title: Why the FindFirstFile/FindNextFile does not list the entire content of the system directory on Windows 7?
body: <p>I have a little question. The API <code>FindNextFile</code> does not list the entire contents of the directory <code>C:\Windows\System32</code> (Windows 7 only). Anyone have any solution? </p>
  
  <p>Code [Delphi]:</p>
  
  <pre><code>Var
    sAtr:       String;
    sPathName:  String;
    I:          Integer;
    iCont:      Integer;
    tHnd:       THandle;
    tArrAtr:    TStringList;
    tWDF:       WIN32_FIND_DATA;
  Begin
    iCont := 0;
    sAtr := '';
    Result := TStringList.Create;
    tArrAtr := TStringList.Create;
    tHnd := FindFirstFile(PChar(sPath + '*.*'), tWDF);
  
    If RightStr(sPath, 1) &lt;&gt; '\' Then
      sPath := sPath + '\';
  
    If tHnd = INVALID_HANDLE_VALUE Then
      Exit;
  
    Repeat
      If (tWDF.dwFileAttributes And FILE_ATTRIBUTE_ARCHIVE) &gt; 0 Then
        If (String(tWDF.cFileName[0]) &lt;&gt; '.') Then
        Begin
          sPathName := sPath + String(tWDF.cFileName);
  
          Result.Add(String(tWDF.cFileName) + sDel +
                     GetFileSizeAPI(sPathName));
          sAtr := '';
          Inc(iCont);
        End;
    Until (FindNextFile(tHnd, tWDF) &lt;&gt; True);
  
    //CloseHandle(tHnd);
  </code></pre>