forgot to mention that stdlib.h is necessary to define errno in VC/C++ 4. |
If you want the most portable code, you should directly #include the header that the documentation says it's defined in, which is <cerrno> (or <errno.h> for C).
Well, while you wait for Microsoft...
What version of the Win10 SDK are you using, anyway?
And what happens when you run the same code but you use it with a different folder, such as a "normal" folder like C:\folder
Edit: I am able to reproduce the same issue in Visual Studio 2017.
Edit 2: "Normal" folders like the one above are handled successfully. So it is a special issue with "C:\System Volume Information", it appears.
I have found other GNU documents saying their version of stat also fails for special Windows folders like the one you're dealing with.
https://www.gnu.org/software/gnulib/manual/html_node/stat.html
_________________________________________________________
PS: What are you actually requiring these functions for?
If you are trying to get security attributes, you could use GetFileSecurity instead.