-#if defined(__WINDOWS__) && !defined(__WXMICROWIN__)
- // GetFileAttributes can copy with network paths
- DWORD ret = GetFileAttributes(filename);
- DWORD isDir = (ret & FILE_ATTRIBUTE_DIRECTORY);
- return ((ret != 0xffffffff) && (isDir == 0));
+#if defined(__WIN32__) && !defined(__WXMICROWIN__)
+ // GetFileAttributes can copy with network paths unlike stat()
+ DWORD ret = ::GetFileAttributes(filename);
+
+ return (ret != (DWORD)-1) && !(ret & FILE_ATTRIBUTE_DIRECTORY);