MCPcopy Create free account
hub / github.com/Kenix3/libultraship / SFileAddListFile

Function SFileAddListFile

extern/StormLib/src/SFileListFile.cpp:640–664  ·  view source on GitHub ↗

Adds a listfile into the MPQ archive.

Source from the content-addressed store, hash-verified

638
639// Adds a listfile into the MPQ archive.
640DWORD WINAPI SFileAddListFile(HANDLE hMpq, const TCHAR * szListFile)
641{
642 TMPQArchive * ha = (TMPQArchive *)hMpq;
643 DWORD dwErrCode = ERROR_SUCCESS;
644
645 // Add the listfile for each MPQ in the patch chain
646 while(ha != NULL)
647 {
648 if(szListFile != NULL)
649 dwErrCode = SFileAddArbitraryListFile(ha, NULL, szListFile, MAX_LISTFILE_SIZE);
650 else
651 dwErrCode = SFileAddInternalListFile(ha, hMpq);
652
653 // Also, add three special files to the listfile:
654 // (listfile) itself, (attributes) and (signature)
655 SListFileCreateNodeForAllLocales(ha, LISTFILE_NAME);
656 SListFileCreateNodeForAllLocales(ha, SIGNATURE_NAME);
657 SListFileCreateNodeForAllLocales(ha, ATTRIBUTES_NAME);
658
659 // Move to the next archive in the chain
660 ha = ha->haPatch;
661 }
662
663 return dwErrCode;
664}
665
666//-----------------------------------------------------------------------------
667// Enumerating files in listfile

Callers 4

TestArchiveFunction · 0.85
CheckIfAllKeysKnownFunction · 0.85
SFileOpenArchiveFunction · 0.85
SFileFindFirstFileFunction · 0.85

Calls 3

SFileAddInternalListFileFunction · 0.85

Tested by 1

TestArchiveFunction · 0.68