BOOL ShellCache::IsContextPathAllowed(LPCTSTR path) { Locker lock(m_critSec); ExcludeContextValid(); for (const auto& exPath : excontextvector) { if (exPath.empty()) continue; if (exPath[exPath.size() - 1] == '*') { tstring str = exPath.substr(0, exPath.size() - 1); if (_wcsnicmp(str.c_str(), path, str.size()) == 0) return FALSE; } else if (_wcsicmp(exPath.c_str(), path) == 0) return FALSE; } return TRUE; }
BOOL ShellCache::IsContextPathAllowed(LPCTSTR path) { Locker lock(m_critSec); ExcludeContextValid(); for (std::vector<tstring>::iterator I = excontextvector.begin(); I != excontextvector.end(); ++I) { if (I->empty()) continue; if (!I->empty() && I->at(I->size()-1)=='*') { tstring str = I->substr(0, I->size()-1); if (_wcsnicmp(str.c_str(), path, str.size())==0) return FALSE; } else if (_wcsicmp(I->c_str(), path)==0) return FALSE; } return TRUE; }