X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/17a691c1efcf3ded480a877e5d788066882e286f..d8812c6e0e780fb2dae99bc352c5061f58793e14:/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() != '\\')