diff options
| author | Ladislav Zezula <ladislav.zezula@avg.com> | 2014-10-07 11:47:23 +0200 | 
|---|---|---|
| committer | Ladislav Zezula <ladislav.zezula@avg.com> | 2014-10-07 11:47:23 +0200 | 
| commit | eec75473b71cba0363dcb4c6985e92b266144ce5 (patch) | |
| tree | efe961bf0304307e39bc8b1897a014f3df4a3527 | |
| parent | 2d3b3e11c032728a74dbc65a4a3941714b870a0f (diff) | |
+ SFILE_FIND_DATA now contains base hash index, instead of patch hash index
| -rw-r--r-- | src/SFileFindFile.cpp | 9 | ||||
| -rw-r--r-- | test/StormTest.cpp | 6 | 
2 files changed, 10 insertions, 5 deletions
| diff --git a/src/SFileFindFile.cpp b/src/SFileFindFile.cpp index 2809b68..80a9e59 100644 --- a/src/SFileFindFile.cpp +++ b/src/SFileFindFile.cpp @@ -288,6 +288,9 @@ static int DoMPQSearch(TMPQSearch * hs, SFILE_FIND_DATA * lpFindFileData)                      // Now we have to check if this file was not enumerated before                      if(!FileWasFoundBefore(ha, hs, pFileEntry))                      { +//                      if(pFileEntry != NULL && !_stricmp(pFileEntry->szFileName, "TriggerLibs\\NativeLib.galaxy")) +//                          DebugBreak(); +                          // Find a patch to this file                          pPatchEntry = FindPatchEntry(ha, pFileEntry);                          if(pPatchEntry == NULL) @@ -310,14 +313,14 @@ static int DoMPQSearch(TMPQSearch * hs, SFILE_FIND_DATA * lpFindFileData)                              }                          } -                        // If the file name is still NULL, we cannot include the file to the search +                        // If the file name is still NULL, we cannot include the file to search results                          if(szFileName != NULL)                          {                              // Check the file name against the wildcard                              if(CheckWildCard(szFileName + nPrefixLength, hs->szSearchMask))                              { -                                // Fill the found entry -                                lpFindFileData->dwHashIndex  = pPatchEntry->dwHashIndex; +                                // Fill the found entry. hash entry and block index are taken from the base MPQ +                                lpFindFileData->dwHashIndex  = pFileEntry->dwHashIndex;                                  lpFindFileData->dwBlockIndex = dwBlockIndex;                                  lpFindFileData->dwFileSize   = pPatchEntry->dwFileSize;                                  lpFindFileData->dwFileFlags  = pPatchEntry->dwFlags; diff --git a/test/StormTest.cpp b/test/StormTest.cpp index 955a9d3..66adcf5 100644 --- a/test/StormTest.cpp +++ b/test/StormTest.cpp @@ -1583,6 +1583,8 @@ static int SearchArchive(  //      if(!_stricmp(sf.cFileName, "DBFilesClient\\Item-Sparse.db2"))  //          DebugBreak(); +//      if(!_stricmp(sf.cFileName, "TriggerLibs\\NativeLib.galaxy")) +//          DebugBreak();          if(dwTestFlags & TEST_FLAG_MOST_PATCHED)          { @@ -3837,7 +3839,7 @@ int main(int argc, char * argv[])      // Search all testing archives and verify their SHA1 hash  //  if(nError == ERROR_SUCCESS)  //      nError = FindFiles(ForEachFile_VerifyFileChecksum, szMpqSubDir); - +/*      // Test reading linear file without bitmap      if(nError == ERROR_SUCCESS)          nError = TestFileStreamOperations("MPQ_2013_v4_alternate-original.MPQ", 0); @@ -4003,7 +4005,7 @@ int main(int argc, char * argv[])      // Open a patched archive.      if(nError == ERROR_SUCCESS)          nError = TestOpenArchive_Patched(PatchList_WoW_16965, "DBFilesClient\\BattlePetNPCTeamMember.db2", 0); - +*/      // Open a patched archive.      if(nError == ERROR_SUCCESS)          nError = TestOpenArchive_Patched(PatchList_SC2_32283, "TriggerLibs\\natives.galaxy", 6); | 
