| 448 | |
| 449 | |
| 450 | void ScanTree::ScanError(bool &Error) |
| 451 | { |
| 452 | #ifdef _WIN_ALL |
| 453 | if (Error) |
| 454 | { |
| 455 | // Get attributes of parent folder and do not display an error |
| 456 | // if it is reparse point. We cannot scan contents of standard |
| 457 | // Windows reparse points like "C:\Documents and Settings" |
| 458 | // and we do not want to issue numerous useless errors for them. |
| 459 | // We cannot just check FD->FileAttr here, it can be undefined |
| 460 | // if we process "folder\*" mask or if we process "folder" mask, |
| 461 | // but "folder" is inaccessible. |
| 462 | wchar *Slash=PointToName(CurMask); |
| 463 | if (Slash>CurMask) |
| 464 | { |
| 465 | *(Slash-1)=0; |
| 466 | DWORD Attr=GetFileAttributes(CurMask); |
| 467 | *(Slash-1)=CPATHDIVIDER; |
| 468 | if (Attr!=0xffffffff && (Attr & FILE_ATTRIBUTE_REPARSE_POINT)!=0) |
| 469 | Error=false; |
| 470 | } |
| 471 | |
| 472 | // Do not display an error if we cannot scan contents of |
| 473 | // "System Volume Information" folder. Normally it is not accessible. |
| 474 | if (wcsstr(CurMask,L"System Volume Information\\")!=NULL) |
| 475 | Error=false; |
| 476 | } |
| 477 | #endif |
| 478 | |
| 479 | if (Error && Cmd!=NULL && Cmd->ExclCheck(CurMask,false,true,true)) |
| 480 | Error=false; |
| 481 | |
| 482 | if (Error) |
| 483 | { |
| 484 | if (ErrDirList!=NULL) |
| 485 | ErrDirList->AddString(CurMask); |
| 486 | if (ErrDirSpecPathLength!=NULL) |
| 487 | ErrDirSpecPathLength->Push((uint)SpecPathLength); |
| 488 | wchar FullName[NM]; |
| 489 | // This conversion works for wildcard masks too. |
| 490 | ConvertNameToFull(CurMask,FullName,ASIZE(FullName)); |
| 491 | uiMsg(UIERROR_DIRSCAN,FullName); |
| 492 | ErrHandler.SysErrMsg(); |
| 493 | } |
| 494 | } |
nothing calls this directly
no test coverage detected