| 63 | } |
| 64 | |
| 65 | static bool CopyCKeyEntryToFindData(PCASC_FIND_DATA pFindData, PCASC_CKEY_ENTRY pCKeyEntry) |
| 66 | { |
| 67 | ULONGLONG ContentSize = 0; |
| 68 | ULONGLONG EncodedSize = 0; |
| 69 | |
| 70 | // Supply both keys |
| 71 | CopyMemory16(pFindData->CKey, pCKeyEntry->CKey); |
| 72 | CopyMemory16(pFindData->EKey, pCKeyEntry->EKey); |
| 73 | |
| 74 | // Supply the tag mask |
| 75 | pFindData->TagBitMask = pCKeyEntry->TagBitMask; |
| 76 | |
| 77 | // Supply the plain name. Only do that if the found name is not a CKey/EKey |
| 78 | if(pFindData->szFileName[0] != 0) |
| 79 | pFindData->szPlainName = (char *)GetPlainFileName(pFindData->szFileName); |
| 80 | |
| 81 | // If we retrieved the file size directly from the root provider, use it |
| 82 | // Otherwise, supply EncodedSize or ContentSize, whichever is available (but ContentSize > EncodedSize) |
| 83 | pFindData->dwSpanCount = GetFileSpanInfo(pCKeyEntry, &ContentSize, &EncodedSize); |
| 84 | if(pFindData->FileSize == CASC_INVALID_SIZE64) |
| 85 | { |
| 86 | if(ContentSize != CASC_INVALID_SIZE64) |
| 87 | pFindData->FileSize = ContentSize; |
| 88 | else |
| 89 | pFindData->FileSize = EncodedSize; |
| 90 | } |
| 91 | |
| 92 | // Set flag indicating that the file is locally available |
| 93 | pFindData->bFileAvailable = (pCKeyEntry->Flags & CASC_CE_FILE_IS_LOCAL); |
| 94 | |
| 95 | // Supply a fake file name, if there is none supplied by the root handler |
| 96 | if(pFindData->szFileName[0] == 0) |
| 97 | SupplyFakeFileName(pFindData, pCKeyEntry); |
| 98 | return true; |
| 99 | } |
| 100 | |
| 101 | // Perform searching using root-specific provider. |
| 102 | // The provider may need the listfile |
no test coverage detected