| 660 | } |
| 661 | |
| 662 | static bool GetFileFullInfo(TCascFile * hf, void * pvFileInfo, size_t cbFileInfo, size_t * pcbLengthNeeded) |
| 663 | { |
| 664 | PCASC_FILE_FULL_INFO pFileInfo; |
| 665 | PCASC_CKEY_ENTRY pCKeyEntry = hf->pCKeyEntry; |
| 666 | TCascStorage * hs = hf->hs; |
| 667 | DWORD dwErrCode; |
| 668 | |
| 669 | // Make sure that the file spans are loaded |
| 670 | dwErrCode = EnsureFileSpanFramesLoaded(hf); |
| 671 | if(dwErrCode != ERROR_SUCCESS) |
| 672 | { |
| 673 | SetCascError(dwErrCode); |
| 674 | return false; |
| 675 | } |
| 676 | |
| 677 | // Verify whether we have enough space in the buffer |
| 678 | pFileInfo = (PCASC_FILE_FULL_INFO)ProbeOutputBuffer(pvFileInfo, cbFileInfo, sizeof(CASC_FILE_FULL_INFO), pcbLengthNeeded); |
| 679 | if(pFileInfo != NULL) |
| 680 | { |
| 681 | // Reset the entire structure |
| 682 | CopyMemory16(pFileInfo->CKey, pCKeyEntry->CKey); |
| 683 | CopyMemory16(pFileInfo->EKey, pCKeyEntry->EKey); |
| 684 | pFileInfo->FileDataId = CASC_INVALID_ID; |
| 685 | pFileInfo->LocaleFlags = CASC_INVALID_ID; |
| 686 | pFileInfo->ContentFlags = CASC_INVALID_ID; |
| 687 | |
| 688 | // Supply information not depending on root |
| 689 | CascStrPrintf(pFileInfo->DataFileName, _countof(pFileInfo->DataFileName), "data.%03u", hf->pFileSpan->ArchiveIndex); |
| 690 | pFileInfo->StorageOffset = pCKeyEntry->StorageOffset; |
| 691 | pFileInfo->SegmentOffset = hf->pFileSpan->ArchiveOffs; |
| 692 | pFileInfo->FileNameHash = 0; |
| 693 | pFileInfo->TagBitMask = pCKeyEntry->TagBitMask; |
| 694 | pFileInfo->ContentSize = hf->ContentSize; |
| 695 | pFileInfo->EncodedSize = hf->EncodedSize; |
| 696 | pFileInfo->SegmentIndex = hf->pFileSpan->ArchiveIndex; |
| 697 | pFileInfo->SpanCount = hf->SpanCount; |
| 698 | |
| 699 | // Supply the root-specific information |
| 700 | hs->pRootHandler->GetInfo(pCKeyEntry, pFileInfo); |
| 701 | } |
| 702 | |
| 703 | return (pFileInfo != NULL); |
| 704 | } |
| 705 | |
| 706 | static bool GetFileSpanInfo(TCascFile * hf, void * pvFileInfo, size_t cbFileInfo, size_t * pcbLengthNeeded) |
| 707 | { |
no test coverage detected