Adds a listfile into the MPQ archive.
| 638 | |
| 639 | // Adds a listfile into the MPQ archive. |
| 640 | DWORD 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 |