I use this go get the content of directory foo: FindFirstFile(L"foo\\*", &findData). It works great when foo is a regular directory. However when foo is a junction pointing to another directory (created with mklink /j foo C:\gah) FindFirstFile fails.
The docs have this to say: “If the path points to a symbolic link, the WIN32_FIND_DATA buffer contains information about the symbolic link, not the target.” But when I run it the debugger I just get an INVALID_HANDLE_VALUE and findData remains untouched.
So, how do I work around this?
Raymond Chen has an answer for you.