Filesystem.GetFullFileSystemEntries() always returns folders and files

Sep 30, 2011 at 12:17 AM

Bad news crew :)

Microsoft has indeed changed something with latest Windows 7 updates.

Before that the flag FindExSearchLimitToDirectories worked without problems.

I double checked it with straight C++ mini app. And confirmed it does not work anymore.

The better solution for now would be to change our main Enumerator class and manually filter items. Will do it tonight.

Here is a c app to test with.

#include "stdafx.h"
#include <windows.h>
#include <stdio.h>

int _tmain(int argc, _TCHAR* argv[])
{
    WIN32_FIND_DATA FFD;
    HANDLE hFind;
    hFind = FindFirstFileExW(argv[1], FindExInfoStandard, &FFD, FindExSearchLimitToDirectories, NULL, 0);

    if (hFind == INVALID_HANDLE_VALUE)
    {
        _tprintf (L"Invalid File Handle. GetLastError reports %d\n", GetLastError ());
        return (0);
    }
    else
    {
        do{
            _tprintf (L"%s\n", FFD.cFileName);
        } while((BOOL) FindNextFileW(hFind, &FFD));

        FindClose(hFind);
    }

    return 0;
}

 

Thank you for reporting it.

Sep 30, 2011 at 12:18 AM

forgot to mention to use it as something like that

test.exe "C:\*"

Oct 2, 2011 at 2:46 AM

jjangli,

can you please test the latest commit I recently made? before compiling it please uncheck the sign code check box in the project's settings, otherwise it won't run.