MCPcopy Create free account
hub / github.com/Scobalula/Greyhound / FetchAndLoadConfigFile

Function FetchAndLoadConfigFile

src/External/CascLib/src/CascFiles.cpp:1390–1420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1388}
1389
1390static 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
1422static LPTSTR CheckForDirectory(LPCTSTR szParentFolder, LPCTSTR szSubFolder)
1423{

Callers 2

LoadCdnConfigFileFunction · 0.85
LoadCdnBuildFileFunction · 0.85

Calls 4

FetchCascFileFunction · 0.85
ListFile_OpenExternalFunction · 0.85
ListFile_VerifyMD5Function · 0.85
CASC_FREEFunction · 0.85

Tested by

no test coverage detected