| 102 | } |
| 103 | |
| 104 | EFI_STATUS |
| 105 | GetNextFile ( |
| 106 | IN EFI_FFS_FILE_HEADER *CurrentFile, |
| 107 | OUT EFI_FFS_FILE_HEADER **NextFile |
| 108 | ) |
| 109 | /*++ |
| 110 | |
| 111 | Routine 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 | |
| 117 | Arguments: |
| 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 | |
| 122 | Returns: |
| 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)) { |
no test coverage detected