| 288 | } |
| 289 | |
| 290 | static int DoMPQSearch_HashTable(TMPQSearch * hs, SFILE_FIND_DATA * lpFindFileData, TMPQArchive * ha) |
| 291 | { |
| 292 | TMPQHash * pHashTableEnd = ha->pHashTable + ha->pHeader->dwHashTableSize; |
| 293 | TMPQHash * pHash; |
| 294 | |
| 295 | // Parse the file table |
| 296 | for(pHash = ha->pHashTable + hs->dwNextIndex; pHash < pHashTableEnd; pHash++) |
| 297 | { |
| 298 | // Increment the next index for subsequent search |
| 299 | hs->dwNextIndex++; |
| 300 | |
| 301 | // Does this hash table entry point to a proper block table entry? |
| 302 | if(IsValidHashEntry(ha, pHash)) |
| 303 | { |
| 304 | // Check if this file entry should be included in the search result |
| 305 | if(DoMPQSearch_FileEntry(hs, lpFindFileData, ha, pHash, ha->pFileTable + MPQ_BLOCK_INDEX(pHash))) |
| 306 | return ERROR_SUCCESS; |
| 307 | } |
| 308 | } |
| 309 | |
| 310 | // No more files |
| 311 | return ERROR_NO_MORE_FILES; |
| 312 | } |
| 313 | |
| 314 | static int DoMPQSearch_FileTable(TMPQSearch * hs, SFILE_FIND_DATA * lpFindFileData, TMPQArchive * ha) |
| 315 | { |
no test coverage detected