| 453 | } |
| 454 | |
| 455 | static DWORD LoadVfsRootEntry(TCascStorage * hs, const char * szVariableName, const char * szDataPtr, const char * szDataEnd, void * pvParam) |
| 456 | { |
| 457 | PCASC_CKEY_ENTRY pCKeyEntry; |
| 458 | CASC_ARRAY * pArray = (CASC_ARRAY *)pvParam; |
| 459 | const char * szVarPtr = szVariableName; |
| 460 | const char * szVarEnd = szVarPtr + strlen(szVarPtr); |
| 461 | DWORD VfsRootIndex = CASC_INVALID_INDEX; |
| 462 | |
| 463 | // Skip the "vfs-" part |
| 464 | if(!strncmp(szVariableName, "vfs-", 4)) |
| 465 | { |
| 466 | // Then, there must be a decimal number as index |
| 467 | if((szVarPtr = CaptureDecimalInteger(szVarPtr + 4, szVarEnd, &VfsRootIndex)) != NULL) |
| 468 | { |
| 469 | // We expect the array to be initialized |
| 470 | assert(pArray->IsInitialized()); |
| 471 | |
| 472 | // The index of the key must not be NULL |
| 473 | if(VfsRootIndex != 0) |
| 474 | { |
| 475 | // Make sure that he entry is in the array |
| 476 | pCKeyEntry = (PCASC_CKEY_ENTRY)pArray->ItemAt(VfsRootIndex - 1); |
| 477 | if(pCKeyEntry == NULL) |
| 478 | { |
| 479 | // Insert a new entry |
| 480 | pCKeyEntry = (PCASC_CKEY_ENTRY)pArray->InsertAt(VfsRootIndex - 1); |
| 481 | if(pCKeyEntry == NULL) |
| 482 | return ERROR_NOT_ENOUGH_MEMORY; |
| 483 | |
| 484 | // Initialize the new entry |
| 485 | pCKeyEntry->Init(); |
| 486 | } |
| 487 | |
| 488 | // Call just a normal parse function |
| 489 | return LoadCKeyEntry(hs, szVariableName, szDataPtr, szDataEnd, pCKeyEntry); |
| 490 | } |
| 491 | } |
| 492 | } |
| 493 | |
| 494 | return ERROR_SUCCESS; |
| 495 | } |
| 496 | |
| 497 | static DWORD LoadBuildProductId(TCascStorage * hs, const char * /* szVariableName */, const char * szDataBegin, const char * szDataEnd, void * /* pvParam */) |
| 498 | { |
nothing calls this directly
no test coverage detected