| 1388 | } |
| 1389 | |
| 1390 | static DWORD FetchAndLoadConfigFile(TCascStorage * hs, PCASC_BLOB pFileKey, PARSE_TEXT_FILE PfnParseProc) |
| 1391 | { |
| 1392 | CASC_PATH<TCHAR> LocalPath; |
| 1393 | void * pvListFile = NULL; |
| 1394 | DWORD dwErrCode; |
| 1395 | |
| 1396 | // Make sure there is a local copy of the file |
| 1397 | dwErrCode = FetchCascFile(hs, PathTypeConfig, pFileKey->pbData, NULL, LocalPath); |
| 1398 | if(dwErrCode == ERROR_SUCCESS) |
| 1399 | { |
| 1400 | // Load and verify the external listfile |
| 1401 | pvListFile = ListFile_OpenExternal(LocalPath); |
| 1402 | if(pvListFile != NULL) |
| 1403 | { |
| 1404 | if(ListFile_VerifyMD5(pvListFile, pFileKey->pbData)) |
| 1405 | { |
| 1406 | dwErrCode = PfnParseProc(hs, pvListFile); |
| 1407 | } |
| 1408 | else |
| 1409 | { |
| 1410 | dwErrCode = ERROR_FILE_CORRUPT; |
| 1411 | } |
| 1412 | CASC_FREE(pvListFile); |
| 1413 | } |
| 1414 | else |
| 1415 | { |
| 1416 | dwErrCode = ERROR_FILE_NOT_FOUND; |
| 1417 | } |
| 1418 | } |
| 1419 | return dwErrCode; |
| 1420 | } |
| 1421 | |
| 1422 | static LPTSTR CheckForDirectory(LPCTSTR szParentFolder, LPCTSTR szSubFolder) |
| 1423 | { |
no test coverage detected