MCPcopy Create free account
hub / github.com/Scobalula/Greyhound / InsertWellKnownFile

Function InsertWellKnownFile

src/External/CascLib/src/CascOpenStorage.cpp:806–842  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

804}
805
806static bool InsertWellKnownFile(TCascStorage * hs, const char * szFileName, CASC_CKEY_ENTRY & FakeCKeyEntry, DWORD dwFlags = 0)
807{
808 PCASC_CKEY_ENTRY pCKeyEntry = NULL;
809
810 // We need to find the CKey entry in the central array
811 if(FakeCKeyEntry.Flags & CASC_CE_HAS_CKEY)
812 {
813 // Did we find anything?
814 pCKeyEntry = FindCKeyEntry_CKey(hs, FakeCKeyEntry.CKey);
815 if(pCKeyEntry != NULL)
816 {
817 // Insert the key to the root handler. Note that the file can already be referenced
818 // ("index" vs "vfs-root" in Warcraft III storages)
819 hs->pRootHandler->Insert(szFileName, pCKeyEntry);
820
821 // Copy some flags
822 pCKeyEntry->Flags |= (dwFlags | CASC_CE_IN_BUILD);
823 return true;
824 }
825 }
826
827 // Special case: the PATCH file is usually not in any indices.
828 // It's also never locally available
829 if((dwFlags & CASC_CE_FILE_PATCH) && (hs->dwFeatures & CASC_FEATURE_ONLINE))
830 {
831 // Get or insert the PATCH entry
832 pCKeyEntry = InsertCKeyEntry(hs, FakeCKeyEntry);
833 if(pCKeyEntry != NULL)
834 {
835 hs->pRootHandler->Insert(szFileName, pCKeyEntry);
836 pCKeyEntry->Flags |= (dwFlags | CASC_CE_IN_BUILD);
837 return true;
838 }
839 }
840
841 return false;
842}
843
844static int LoadBuildManifest(TCascStorage * hs, DWORD dwLocaleMask)
845{

Callers 1

LoadCascStorageFunction · 0.85

Calls 3

FindCKeyEntry_CKeyFunction · 0.85
InsertCKeyEntryFunction · 0.85
InsertMethod · 0.45

Tested by

no test coverage detected