This commit is contained in:
Igor Pavlov
2022-01-22 18:43:09 +00:00
committed by Kornel
parent 52eeaf1ad6
commit c3529a41f5
88 changed files with 3474 additions and 435 deletions

View File

@@ -48,7 +48,7 @@ STDMETHODIMP COpenCallbackImp::GetProperty(PROPID propID, PROPVARIANT *value)
else
switch (propID)
{
case kpidName: prop = _fileInfo.Name; break;
case kpidName: prop = fs2us(_fileInfo.Name); break;
case kpidIsDir: prop = _fileInfo.IsDir(); break;
case kpidSize: prop = _fileInfo.Size; break;
case kpidAttrib: prop = (UInt32)_fileInfo.Attrib; break;
@@ -103,12 +103,20 @@ STDMETHODIMP COpenCallbackImp::GetStream(const wchar_t *name, IInStream **inStre
if (!IsSafePath(name2))
return S_FALSE;
// #ifdef _WIN32
// we don't want to support wildcards in names here here
if (name2.Find(L'?') >= 0 ||
name2.Find(L'*') >= 0)
#ifdef _WIN32
/* WIN32 allows wildcards in Find() function
and doesn't allow wildcard in File.Open()
so we can work without the following wildcard check here */
if (name2.Find(L'*') >= 0)
return S_FALSE;
// #endif
{
int startPos = 0;
if (name2.IsPrefixedBy_Ascii_NoCase("\\\\?\\"))
startPos = 3;
if (name2.Find(L'?', startPos) >= 0)
return S_FALSE;
}
#endif
#endif