MCPcopy Create free account
hub / github.com/LongSoft/UEFITool / patchFile

Method patchFile

UEFIPatch/uefipatch.cpp:204–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202}
203
204UINT8 UEFIPatch::patchFile(const QModelIndex & index, const QByteArray & fileGuid, const UINT8 sectionType, const QVector<PatchData> & patches)
205{
206
207 if (!model || !index.isValid())
208 return ERR_INVALID_PARAMETER;
209 if (model->type(index) == Types::Section && model->subtype(index) == sectionType) {
210 QModelIndex fileIndex = model->findParentOfType(index, Types::File);
211 if (model->type(fileIndex) == Types::File &&
212 model->header(fileIndex).left(sizeof(EFI_GUID)) == fileGuid)
213 {
214 return ffsEngine->patch(index, patches);
215 }
216 }
217
218 if (model->rowCount(index) > 0) {
219 for (int i = 0; i < model->rowCount(index); i++) {
220 UINT8 result = patchFile(index.child(i, 0), fileGuid, sectionType, patches);
221 if (!result)
222 break;
223 else if (result != ERR_NOTHING_TO_PATCH)
224 return result;
225 }
226 }
227
228 return ERR_NOTHING_TO_PATCH;
229}

Callers

nothing calls this directly

Calls 7

findParentOfTypeMethod · 0.80
patchMethod · 0.80
rowCountMethod · 0.80
childMethod · 0.80
typeMethod · 0.45
subtypeMethod · 0.45
headerMethod · 0.45

Tested by

no test coverage detected