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

Function LoadEKeyEntry

src/External/CascLib/src/CascFiles.cpp:433–453  ·  view source on GitHub ↗

For files like PATCH, which only contain EKey in the build file

Source from the content-addressed store, hash-verified

431
432// For files like PATCH, which only contain EKey in the build file
433static DWORD LoadEKeyEntry(TCascStorage * hs, const char * szVariableName, const char * szDataPtr, const char * szDataEnd, void * pvParam)
434{
435 PCASC_CKEY_ENTRY pCKeyEntry = (PCASC_CKEY_ENTRY)pvParam;
436 DWORD dwErrCode;
437
438 // Load the entry as if it was a CKey. Then move CKey into EKey and adjust flags
439 if((dwErrCode = LoadCKeyEntry(hs, szVariableName, szDataPtr, szDataEnd, pvParam)) == ERROR_SUCCESS)
440 {
441 if((pCKeyEntry->Flags & (CASC_CE_HAS_CKEY | CASC_CE_HAS_EKEY | CASC_CE_HAS_EKEY_PARTIAL)) == CASC_CE_HAS_CKEY)
442 {
443 // Move the CKey into EKey
444 CopyMemory16(pCKeyEntry->EKey, pCKeyEntry->CKey);
445 ZeroMemory16(pCKeyEntry->CKey);
446
447 // Adjust flags
448 pCKeyEntry->Flags = (pCKeyEntry->Flags & ~CASC_CE_HAS_CKEY) | CASC_CE_HAS_EKEY;
449 }
450 }
451
452 return dwErrCode;
453}
454
455static DWORD LoadVfsRootEntry(TCascStorage * hs, const char * szVariableName, const char * szDataPtr, const char * szDataEnd, void * pvParam)
456{

Callers

nothing calls this directly

Calls 3

LoadCKeyEntryFunction · 0.85
CopyMemory16Function · 0.85
ZeroMemory16Function · 0.85

Tested by

no test coverage detected