X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/17a691c1efcf3ded480a877e5d788066882e286f..75f661bbc8f9d44f6899aca0fd3afa98224ecf4d:/src/msw/volume.cpp diff --git a/src/msw/volume.cpp b/src/msw/volume.cpp index fb471ddf5f..dbc6c61e55 100644 --- a/src/msw/volume.cpp +++ b/src/msw/volume.cpp @@ -33,6 +33,7 @@ #endif #include "wx/intl.h" #include "wx/hashmap.h" + #include "wx/filefn.h" #endif // WX_PRECOMP #include "wx/dir.h" @@ -264,6 +265,17 @@ static void BuildListFromNN(wxArrayString& list, NETRESOURCE* pResSrc, { wxString filename(pRes->lpRemoteName); + // if the drive is unavailable, FilteredAdd() can hang for + // a long time and, moreover, its failure appears to be not + // cached so this will happen every time we use it, so try + // a much quicker wxDirExists() test (which still hangs but + // for much shorter time) for locally mapped drives first + // to try to avoid this + if ( pRes->lpLocalName && + *pRes->lpLocalName && + !wxDirExists(pRes->lpLocalName) ) + continue; + if (!filename.empty()) { if (filename.Last() != '\\')