+
+ if (!success)
+ {
+ // The OS didn't support GetLongPathName, or some other error.
+ // We need to call FindFirstFile on each component in turn.
+
+ WIN32_FIND_DATA findFileData;
+ HANDLE hFind;
+ pathOut = wxEmptyString;
+
+ size_t count = m_dirs.GetCount();
+ size_t i;
+ wxString tmpPath;
+ for ( i = 0; i < count; i++ )
+ {
+ // We're using pathOut to collect the long-name path,
+ // but using a temporary for appending the last path component which may be short-name
+ tmpPath = pathOut + m_dirs[i];
+
+ if (tmpPath.Last() == wxT(':'))
+ tmpPath += wxFILE_SEP_PATH;
+
+ hFind = ::FindFirstFile(tmpPath, &findFileData);
+ if (hFind == INVALID_HANDLE_VALUE)
+ {
+ // Error: return immediately with the original path
+ return path;
+ }
+ else
+ {
+ pathOut += findFileData.cFileName;
+ if ( (i < count) )
+ pathOut += wxFILE_SEP_PATH;
+
+ ::FindClose(hFind);
+ }
+ }
+ }
+ return pathOut;