MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / GetNextFile

Function GetNextFile

BaseTools/Source/C/Common/FvLib.c:104–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104EFI_STATUS
105GetNextFile (
106 IN EFI_FFS_FILE_HEADER *CurrentFile,
107 OUT EFI_FFS_FILE_HEADER **NextFile
108 )
109/*++
110
111Routine Description:
112
113 This function returns the next file. If the current file is NULL, it returns
114 the first file in the FV. If the function returns EFI_SUCCESS and the file
115 pointer is NULL, then there are no more files in the FV.
116
117Arguments:
118
119 CurrentFile Pointer to the current file, must be within the current FV.
120 NextFile Pointer to the next file in the FV.
121
122Returns:
123
124 EFI_SUCCESS Function completed successfully.
125 EFI_INVALID_PARAMETER A required parameter was NULL or is out of range.
126 EFI_ABORTED The library needs to be initialized.
127
128--*/
129{
130 EFI_STATUS Status;
131
132 //
133 // Verify library has been initialized.
134 //
135 if (mFvHeader == NULL || mFvLength == 0) {
136 return EFI_ABORTED;
137 }
138 //
139 // Verify input arguments
140 //
141 if (NextFile == NULL) {
142 return EFI_INVALID_PARAMETER;
143 }
144 //
145 // Verify FV header
146 //
147 Status = VerifyFv (mFvHeader);
148 if (EFI_ERROR (Status)) {
149 return EFI_ABORTED;
150 }
151 //
152 // Get first file
153 //
154 if (CurrentFile == NULL) {
155 CurrentFile = (EFI_FFS_FILE_HEADER *) ((UINTN) mFvHeader + mFvHeader->HeaderLength);
156
157 //
158 // Verify file is valid
159 //
160 Status = VerifyFfsFile (CurrentFile);
161 if (EFI_ERROR (Status)) {

Callers 2

GetFileByNameFunction · 0.85
GetFileByTypeFunction · 0.85

Calls 4

VerifyFfsFileFunction · 0.85
GetFfsFileLengthFunction · 0.85
GetFfsHeaderLengthFunction · 0.85
VerifyFvFunction · 0.70

Tested by

no test coverage detected