TianoCore EDK2 master
Loading...
Searching...
No Matches
FvSimpleFileSystem.c
Go to the documentation of this file.
1
22
23//
24// Template for EFI_FILE_SYSTEM_INFO data structure.
25//
26EFI_FILE_SYSTEM_INFO mFsInfoTemplate = {
27 0, // Populate at runtime
28 TRUE, // Read-only
29 0, // Don't know volume size
30 0, // No free space
31 0, // Don't know block size
32 L"" // Populate at runtime
33};
34
35//
36// Template for EFI_FILE_PROTOCOL data structure.
37//
38EFI_FILE_PROTOCOL mFileSystemTemplate = {
39 EFI_FILE_PROTOCOL_REVISION,
50};
51
72 IN FV_FILESYSTEM_FILE_INFO *FvFileInfo,
73 IN OUT UINTN *BufferSize,
74 IN OUT VOID **Buffer
75 )
76{
77 EFI_SECTION_TYPE SectionType;
78 UINT32 AuthenticationStatus;
79 EFI_STATUS Status;
80
81 for (SectionType = EFI_SECTION_PE32; SectionType <= EFI_SECTION_TE; SectionType++) {
82 Status = FvProtocol->ReadSection (
83 FvProtocol,
84 &FvFileInfo->NameGuid,
85 SectionType,
86 0,
87 Buffer,
88 BufferSize,
89 &AuthenticationStatus
90 );
91 if (Status != EFI_NOT_FOUND) {
92 return Status;
93 }
94 }
95
96 return EFI_NOT_FOUND;
97}
98
113 IN OUT FV_FILESYSTEM_FILE_INFO *FvFileInfo
114 )
115{
116 UINT32 AuthenticationStatus;
117 EFI_FV_FILETYPE FoundType;
118 EFI_FV_FILE_ATTRIBUTES Attributes;
119 EFI_STATUS Status;
120 UINT8 IgnoredByte;
121 VOID *IgnoredPtr;
122
123 //
124 // To get the size of a section, we pass 0 for BufferSize. But we can't pass
125 // NULL for Buffer, as that will cause a return of INVALID_PARAMETER, and we
126 // can't pass NULL for *Buffer, as that will cause the callee to allocate
127 // a buffer of the sections size.
128 //
129 IgnoredPtr = &IgnoredByte;
130 FvFileInfo->FileInfo.FileSize = 0;
131
132 if (FV_FILETYPE_IS_EXECUTABLE (FvFileInfo->Type)) {
133 //
134 // Get the size of the first executable section out of the file.
135 //
136 Status = FvFsFindExecutableSection (FvProtocol, FvFileInfo, (UINTN *)&FvFileInfo->FileInfo.FileSize, &IgnoredPtr);
137 if (Status == EFI_WARN_BUFFER_TOO_SMALL) {
138 return EFI_SUCCESS;
139 }
140 } else if (FvFileInfo->Type == EFI_FV_FILETYPE_FREEFORM) {
141 //
142 // Try to get the size of a raw section out of the file
143 //
144 Status = FvProtocol->ReadSection (
145 FvProtocol,
146 &FvFileInfo->NameGuid,
147 EFI_SECTION_RAW,
148 0,
149 &IgnoredPtr,
150 (UINTN *)&FvFileInfo->FileInfo.FileSize,
151 &AuthenticationStatus
152 );
153 if (Status == EFI_WARN_BUFFER_TOO_SMALL) {
154 return EFI_SUCCESS;
155 }
156
157 if (EFI_ERROR (Status)) {
158 //
159 // Didn't find a raw section, just return the whole file's size.
160 //
161 return FvProtocol->ReadFile (
162 FvProtocol,
163 &FvFileInfo->NameGuid,
164 NULL,
165 (UINTN *)&FvFileInfo->FileInfo.FileSize,
166 &FoundType,
167 &Attributes,
168 &AuthenticationStatus
169 );
170 }
171 } else {
172 //
173 // Get the size of the entire file
174 //
175 return FvProtocol->ReadFile (
176 FvProtocol,
177 &FvFileInfo->NameGuid,
178 NULL,
179 (UINTN *)&FvFileInfo->FileInfo.FileSize,
180 &FoundType,
181 &Attributes,
182 &AuthenticationStatus
183 );
184 }
185
186 return Status;
187}
188
216 IN FV_FILESYSTEM_FILE_INFO *FvFileInfo,
217 IN OUT UINTN *BufferSize,
218 IN OUT VOID **Buffer
219 )
220{
221 UINT32 AuthenticationStatus;
222 EFI_FV_FILETYPE FoundType;
223 EFI_FV_FILE_ATTRIBUTES Attributes;
224 EFI_STATUS Status;
225
226 if (FV_FILETYPE_IS_EXECUTABLE (FvFileInfo->Type)) {
227 //
228 // Read the first executable section out of the file.
229 //
230 Status = FvFsFindExecutableSection (FvProtocol, FvFileInfo, BufferSize, Buffer);
231 } else if (FvFileInfo->Type == EFI_FV_FILETYPE_FREEFORM) {
232 //
233 // Try to read a raw section out of the file
234 //
235 Status = FvProtocol->ReadSection (
236 FvProtocol,
237 &FvFileInfo->NameGuid,
238 EFI_SECTION_RAW,
239 0,
240 Buffer,
241 BufferSize,
242 &AuthenticationStatus
243 );
244 if (EFI_ERROR (Status)) {
245 //
246 // Didn't find a raw section, just return the whole file.
247 //
248 Status = FvProtocol->ReadFile (
249 FvProtocol,
250 &FvFileInfo->NameGuid,
251 Buffer,
252 BufferSize,
253 &FoundType,
254 &Attributes,
255 &AuthenticationStatus
256 );
257 }
258 } else {
259 //
260 // Read the entire file
261 //
262 Status = FvProtocol->ReadFile (
263 FvProtocol,
264 &FvFileInfo->NameGuid,
265 Buffer,
266 BufferSize,
267 &FoundType,
268 &Attributes,
269 &AuthenticationStatus
270 );
271 }
272
273 return Status;
274}
275
294 IN FV_FILESYSTEM_FILE_INFO *FvFileInfo,
295 IN OUT UINTN *BufferSize,
297 )
298{
299 UINTN InfoSize;
300
301 InfoSize = (UINTN)FvFileInfo->FileInfo.Size;
302 if (*BufferSize < InfoSize) {
303 *BufferSize = InfoSize;
304 return EFI_BUFFER_TOO_SMALL;
305 }
306
307 //
308 // Initialize FileInfo
309 //
310 CopyMem (FileInfo, &FvFileInfo->FileInfo, InfoSize);
311
312 *BufferSize = InfoSize;
313 return EFI_SUCCESS;
314}
315
326BOOLEAN
327EFIAPI
329 IN OUT CHAR16 *Path
330 )
331{
332 CHAR16 *Walker;
333 CHAR16 *LastSlash;
334
335 //
336 // get directory name from path... ('chop' off extra)
337 //
338 for ( Walker = Path, LastSlash = NULL
339 ; Walker != NULL && *Walker != CHAR_NULL
340 ; Walker++
341 )
342 {
343 if ((*Walker == L'\\') && (*(Walker + 1) != CHAR_NULL)) {
344 LastSlash = Walker + 1;
345 }
346 }
347
348 if (LastSlash != NULL) {
349 *LastSlash = CHAR_NULL;
350 return (TRUE);
351 }
352
353 return (FALSE);
354}
355
372CHAR16 *
373EFIAPI
375 IN CHAR16 *Path
376 )
377{
378 CHAR16 *TempString;
379 UINTN TempSize;
380
381 if (Path == NULL) {
382 return NULL;
383 }
384
385 //
386 // Fix up the '/' vs '\'
387 //
388 for (TempString = Path; (TempString != NULL) && (*TempString != CHAR_NULL); TempString++) {
389 if (*TempString == L'/') {
390 *TempString = L'\\';
391 }
392 }
393
394 //
395 // Fix up the ..
396 //
397 while ((TempString = StrStr (Path, L"\\..\\")) != NULL) {
398 *TempString = CHAR_NULL;
399 TempString += 4;
401 TempSize = StrSize (TempString);
402 CopyMem (Path + StrLen (Path), TempString, TempSize);
403 }
404
405 if (((TempString = StrStr (Path, L"\\..")) != NULL) && (*(TempString + 3) == CHAR_NULL)) {
406 *TempString = CHAR_NULL;
408 }
409
410 //
411 // Fix up the .
412 //
413 while ((TempString = StrStr (Path, L"\\.\\")) != NULL) {
414 *TempString = CHAR_NULL;
415 TempString += 2;
416 TempSize = StrSize (TempString);
417 CopyMem (Path + StrLen (Path), TempString, TempSize);
418 }
419
420 if (((TempString = StrStr (Path, L"\\.")) != NULL) && (*(TempString + 2) == CHAR_NULL)) {
421 *(TempString + 1) = CHAR_NULL;
422 }
423
424 while ((TempString = StrStr (Path, L"\\\\")) != NULL) {
425 *TempString = CHAR_NULL;
426 TempString += 1;
427 TempSize = StrSize (TempString);
428 CopyMem (Path + StrLen (Path), TempString, TempSize);
429 }
430
431 if (((TempString = StrStr (Path, L"\\\\")) != NULL) && (*(TempString + 1) == CHAR_NULL)) {
432 *(TempString) = CHAR_NULL;
433 }
434
435 return Path;
436}
437
469EFIAPI
471 IN EFI_FILE_PROTOCOL *This,
472 OUT EFI_FILE_PROTOCOL **NewHandle,
473 IN CHAR16 *FileName,
474 IN UINT64 OpenMode,
475 IN UINT64 Attributes
476 )
477{
478 FV_FILESYSTEM_INSTANCE *Instance;
479 FV_FILESYSTEM_FILE *File;
480 FV_FILESYSTEM_FILE *NewFile;
481 FV_FILESYSTEM_FILE_INFO *FvFileInfo;
482 LIST_ENTRY *FvFileInfoLink;
483 EFI_STATUS Status;
484 UINTN FileNameLength;
485 UINTN NewFileNameLength;
486 CHAR16 *FileNameWithExtension;
487
488 //
489 // Check for a valid mode
490 //
491 switch (OpenMode) {
492 case EFI_FILE_MODE_READ:
493 break;
494
495 default:
496 return EFI_WRITE_PROTECTED;
497 }
498
499 File = FVFS_FILE_FROM_FILE_THIS (This);
500 Instance = File->Instance;
501
502 FileName = TrimFilePathToAbsolutePath (FileName);
503 if (FileName == NULL) {
504 return EFI_INVALID_PARAMETER;
505 }
506
507 if (FileName[0] == L'\\') {
508 FileName++;
509 }
510
511 //
512 // Check for opening root
513 //
514 if ((StrCmp (FileName, L".") == 0) || (StrCmp (FileName, L"") == 0)) {
515 NewFile = AllocateZeroPool (sizeof (FV_FILESYSTEM_FILE));
516 if (NewFile == NULL) {
517 return EFI_OUT_OF_RESOURCES;
518 }
519
520 NewFile->Signature = FVFS_FILE_SIGNATURE;
521 NewFile->Instance = Instance;
522 NewFile->FvFileInfo = File->FvFileInfo;
523 CopyMem (&NewFile->FileProtocol, &mFileSystemTemplate, sizeof (mFileSystemTemplate));
524 InitializeListHead (&NewFile->Link);
525 InsertHeadList (&Instance->FileHead, &NewFile->Link);
526
527 NewFile->DirReadNext = NULL;
528 if (!IsListEmpty (&Instance->FileInfoHead)) {
529 NewFile->DirReadNext = FVFS_GET_FIRST_FILE_INFO (Instance);
530 }
531
532 *NewHandle = &NewFile->FileProtocol;
533 return EFI_SUCCESS;
534 }
535
536 //
537 // Do a linear search for a file in the FV with a matching filename
538 //
539 Status = EFI_NOT_FOUND;
540 FvFileInfo = NULL;
541 for (FvFileInfoLink = GetFirstNode (&Instance->FileInfoHead);
542 !IsNull (&Instance->FileInfoHead, FvFileInfoLink);
543 FvFileInfoLink = GetNextNode (&Instance->FileInfoHead, FvFileInfoLink))
544 {
545 FvFileInfo = FVFS_FILE_INFO_FROM_LINK (FvFileInfoLink);
546 if (mUnicodeCollation->StriColl (mUnicodeCollation, &FvFileInfo->FileInfo.FileName[0], FileName) == 0) {
547 Status = EFI_SUCCESS;
548 break;
549 }
550 }
551
552 // If the file has not been found check if the filename exists with an extension
553 // in case there was no extension present.
554 // FvFileSystem adds a 'virtual' extension '.EFI' to EFI applications and drivers
555 // present in the Firmware Volume
556 if (Status == EFI_NOT_FOUND) {
557 FileNameLength = StrLen (FileName);
558
559 // Does the filename already contain the '.EFI' extension?
560 if (mUnicodeCollation->StriColl (mUnicodeCollation, FileName + FileNameLength - 4, L".efi") != 0) {
561 // No, there was no extension. So add one and search again for the file
562 // NewFileNameLength = FileNameLength + 1 + 4 = (Number of non-null character) + (file extension) + (a null character)
563 NewFileNameLength = FileNameLength + 1 + 4;
564 FileNameWithExtension = AllocatePool (NewFileNameLength * 2);
565 StrCpyS (FileNameWithExtension, NewFileNameLength, FileName);
566 StrCatS (FileNameWithExtension, NewFileNameLength, L".EFI");
567
568 for (FvFileInfoLink = GetFirstNode (&Instance->FileInfoHead);
569 !IsNull (&Instance->FileInfoHead, FvFileInfoLink);
570 FvFileInfoLink = GetNextNode (&Instance->FileInfoHead, FvFileInfoLink))
571 {
572 FvFileInfo = FVFS_FILE_INFO_FROM_LINK (FvFileInfoLink);
573 if (mUnicodeCollation->StriColl (mUnicodeCollation, &FvFileInfo->FileInfo.FileName[0], FileNameWithExtension) == 0) {
574 Status = EFI_SUCCESS;
575 break;
576 }
577 }
578 }
579 }
580
581 if (!EFI_ERROR (Status)) {
582 NewFile = AllocateZeroPool (sizeof (FV_FILESYSTEM_FILE));
583 if (NewFile == NULL) {
584 return EFI_OUT_OF_RESOURCES;
585 }
586
587 NewFile->Signature = FVFS_FILE_SIGNATURE;
588 NewFile->Instance = Instance;
589 NewFile->FvFileInfo = FvFileInfo;
590 CopyMem (&NewFile->FileProtocol, &mFileSystemTemplate, sizeof (mFileSystemTemplate));
591 InitializeListHead (&NewFile->Link);
592 InsertHeadList (&Instance->FileHead, &NewFile->Link);
593
594 *NewHandle = &NewFile->FileProtocol;
595 return EFI_SUCCESS;
596 }
597
598 return EFI_NOT_FOUND;
599}
600
611EFIAPI
614 )
615{
616 FV_FILESYSTEM_INSTANCE *Instance;
617 FV_FILESYSTEM_FILE *File;
618
619 File = FVFS_FILE_FROM_FILE_THIS (This);
620 Instance = File->Instance;
621
622 if (File != Instance->Root) {
623 RemoveEntryList (&File->Link);
624 FreePool (File);
625 }
626
627 return EFI_SUCCESS;
628}
629
651EFIAPI
653 IN EFI_FILE_PROTOCOL *This,
654 IN OUT UINTN *BufferSize,
655 OUT VOID *Buffer
656 )
657{
658 FV_FILESYSTEM_INSTANCE *Instance;
659 FV_FILESYSTEM_FILE *File;
660 EFI_STATUS Status;
661 LIST_ENTRY *FvFileInfoLink;
662 VOID *FileBuffer;
663 UINTN FileSize;
664
665 File = FVFS_FILE_FROM_FILE_THIS (This);
666 Instance = File->Instance;
667
668 if (File->FvFileInfo == Instance->Root->FvFileInfo) {
669 if (File->DirReadNext) {
670 //
671 // Directory read: populate Buffer with an EFI_FILE_INFO
672 //
673 Status = FvFsGetFileInfo (File->DirReadNext, BufferSize, Buffer);
674 if (!EFI_ERROR (Status)) {
675 //
676 // Successfully read a directory entry, now update the pointer to the
677 // next file, which will be read on the next call to this function
678 //
679 FvFileInfoLink = GetNextNode (&Instance->FileInfoHead, &File->DirReadNext->Link);
680 if (IsNull (&Instance->FileInfoHead, FvFileInfoLink)) {
681 //
682 // No more files left
683 //
684 File->DirReadNext = NULL;
685 } else {
686 File->DirReadNext = FVFS_FILE_INFO_FROM_LINK (FvFileInfoLink);
687 }
688 }
689
690 return Status;
691 } else {
692 //
693 // Directory read. All entries have been read, so return a zero-size
694 // buffer.
695 //
696 *BufferSize = 0;
697 return EFI_SUCCESS;
698 }
699 } else {
700 FileSize = (UINTN)File->FvFileInfo->FileInfo.FileSize;
701
702 FileBuffer = AllocateZeroPool (FileSize);
703 if (FileBuffer == NULL) {
704 return EFI_DEVICE_ERROR;
705 }
706
707 Status = FvFsReadFile (File->Instance->FvProtocol, File->FvFileInfo, &FileSize, &FileBuffer);
708 if (EFI_ERROR (Status)) {
709 FreePool (FileBuffer);
710 return EFI_DEVICE_ERROR;
711 }
712
713 if (*BufferSize + File->Position > FileSize) {
714 *BufferSize = (UINTN)(FileSize - File->Position);
715 }
716
717 CopyMem (Buffer, (UINT8 *)FileBuffer + File->Position, *BufferSize);
718 File->Position += *BufferSize;
719
720 FreePool (FileBuffer);
721
722 return EFI_SUCCESS;
723 }
724}
725
747EFIAPI
749 IN EFI_FILE_PROTOCOL *This,
750 IN OUT UINTN *BufferSize,
751 IN VOID *Buffer
752 )
753{
754 FV_FILESYSTEM_INSTANCE *Instance;
755 FV_FILESYSTEM_FILE *File;
756
757 File = FVFS_FILE_FROM_FILE_THIS (This);
758 Instance = File->Instance;
759
760 if (File->FvFileInfo == Instance->Root->FvFileInfo) {
761 return EFI_UNSUPPORTED;
762 } else {
763 return EFI_WRITE_PROTECTED;
764 }
765}
766
780EFIAPI
782 IN EFI_FILE_PROTOCOL *This,
783 OUT UINT64 *Position
784 )
785{
786 FV_FILESYSTEM_INSTANCE *Instance;
787 FV_FILESYSTEM_FILE *File;
788
789 File = FVFS_FILE_FROM_FILE_THIS (This);
790 Instance = File->Instance;
791
792 if (File->FvFileInfo == Instance->Root->FvFileInfo) {
793 return EFI_UNSUPPORTED;
794 } else {
795 *Position = File->Position;
796 return EFI_SUCCESS;
797 }
798}
799
814EFIAPI
816 IN EFI_FILE_PROTOCOL *This,
817 IN UINT64 Position
818 )
819{
820 FV_FILESYSTEM_INSTANCE *Instance;
821 FV_FILESYSTEM_FILE *File;
822
823 File = FVFS_FILE_FROM_FILE_THIS (This);
824 Instance = File->Instance;
825
826 if (File->FvFileInfo == Instance->Root->FvFileInfo) {
827 if (Position != 0) {
828 return EFI_UNSUPPORTED;
829 }
830
831 //
832 // Reset directory position to first entry
833 //
834 if (File->DirReadNext) {
835 File->DirReadNext = FVFS_GET_FIRST_FILE_INFO (Instance);
836 }
837 } else if (Position == 0xFFFFFFFFFFFFFFFFull) {
838 File->Position = File->FvFileInfo->FileInfo.FileSize;
839 } else {
840 File->Position = Position;
841 }
842
843 return EFI_SUCCESS;
844}
845
862EFIAPI
865 )
866{
867 return EFI_WRITE_PROTECTED;
868}
869
881EFIAPI
884 )
885{
886 EFI_STATUS Status;
887
888 Status = FvSimpleFileSystemClose (This);
889 ASSERT_EFI_ERROR (Status);
890
891 return EFI_WARN_DELETE_FAILURE;
892}
893
915EFIAPI
917 IN EFI_FILE_PROTOCOL *This,
918 IN EFI_GUID *InformationType,
919 IN OUT UINTN *BufferSize,
920 OUT VOID *Buffer
921 )
922{
923 FV_FILESYSTEM_FILE *File;
924 EFI_FILE_SYSTEM_INFO *FsInfoOut;
925 EFI_FILE_SYSTEM_VOLUME_LABEL *FsVolumeLabel;
926 FV_FILESYSTEM_INSTANCE *Instance;
927 UINTN Size;
928 EFI_STATUS Status;
929
930 File = FVFS_FILE_FROM_FILE_THIS (This);
931
932 if (CompareGuid (InformationType, &gEfiFileSystemInfoGuid)) {
933 //
934 // Return filesystem info
935 //
936 Instance = File->Instance;
937
938 Size = sizeof (EFI_FILE_SYSTEM_INFO) + StrSize (Instance->VolumeLabel) - sizeof (CHAR16);
939
940 if (*BufferSize < Size) {
941 *BufferSize = Size;
942 return EFI_BUFFER_TOO_SMALL;
943 }
944
945 //
946 // Cast output buffer for convenience
947 //
948 FsInfoOut = (EFI_FILE_SYSTEM_INFO *)Buffer;
949
950 CopyMem (FsInfoOut, &mFsInfoTemplate, sizeof (EFI_FILE_SYSTEM_INFO));
951 Status = StrnCpyS (
952 FsInfoOut->VolumeLabel,
953 (*BufferSize - OFFSET_OF (EFI_FILE_SYSTEM_INFO, VolumeLabel)) / sizeof (CHAR16),
954 Instance->VolumeLabel,
955 StrLen (Instance->VolumeLabel)
956 );
957 ASSERT_EFI_ERROR (Status);
958 FsInfoOut->Size = Size;
959 return Status;
960 } else if (CompareGuid (InformationType, &gEfiFileInfoGuid)) {
961 //
962 // Return file info
963 //
964 return FvFsGetFileInfo (File->FvFileInfo, BufferSize, (EFI_FILE_INFO *)Buffer);
965 } else if (CompareGuid (InformationType, &gEfiFileSystemVolumeLabelInfoIdGuid)) {
966 //
967 // Return Volume Label
968 //
969 Instance = File->Instance;
970 Size = sizeof (EFI_FILE_SYSTEM_VOLUME_LABEL) + StrSize (Instance->VolumeLabel) - sizeof (CHAR16);
971 if (*BufferSize < Size) {
972 *BufferSize = Size;
973 return EFI_BUFFER_TOO_SMALL;
974 }
975
976 FsVolumeLabel = (EFI_FILE_SYSTEM_VOLUME_LABEL *)Buffer;
977 Status = StrnCpyS (
978 FsVolumeLabel->VolumeLabel,
979 (*BufferSize - OFFSET_OF (EFI_FILE_SYSTEM_VOLUME_LABEL, VolumeLabel)) / sizeof (CHAR16),
980 Instance->VolumeLabel,
981 StrLen (Instance->VolumeLabel)
982 );
983 ASSERT_EFI_ERROR (Status);
984 return Status;
985 } else {
986 return EFI_UNSUPPORTED;
987 }
988}
989
1025EFIAPI
1027 IN EFI_FILE_PROTOCOL *This,
1028 IN EFI_GUID *InformationType,
1029 IN UINTN BufferSize,
1030 IN VOID *Buffer
1031 )
1032{
1033 if (CompareGuid (InformationType, &gEfiFileSystemInfoGuid) ||
1034 CompareGuid (InformationType, &gEfiFileInfoGuid) ||
1035 CompareGuid (InformationType, &gEfiFileSystemVolumeLabelInfoIdGuid))
1036 {
1037 return EFI_WRITE_PROTECTED;
1038 }
1039
1040 return EFI_UNSUPPORTED;
1041}
UINT64 UINTN
BOOLEAN EFIAPI IsNull(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
Definition: LinkedList.c:443
UINTN EFIAPI StrSize(IN CONST CHAR16 *String)
Definition: String.c:72
BOOLEAN EFIAPI IsListEmpty(IN CONST LIST_ENTRY *ListHead)
Definition: LinkedList.c:403
RETURN_STATUS EFIAPI StrCpyS(OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source)
Definition: SafeString.c:226
LIST_ENTRY *EFIAPI GetNextNode(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
Definition: LinkedList.c:333
INTN EFIAPI StrCmp(IN CONST CHAR16 *FirstString, IN CONST CHAR16 *SecondString)
Definition: String.c:109
LIST_ENTRY *EFIAPI InsertHeadList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
Definition: LinkedList.c:218
LIST_ENTRY *EFIAPI GetFirstNode(IN CONST LIST_ENTRY *List)
Definition: LinkedList.c:298
RETURN_STATUS EFIAPI StrCatS(IN OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source)
Definition: SafeString.c:405
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
Definition: LinkedList.c:590
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
Definition: LinkedList.c:182
RETURN_STATUS EFIAPI StrnCpyS(OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source, IN UINTN Length)
Definition: SafeString.c:310
UINTN EFIAPI StrLen(IN CONST CHAR16 *String)
Definition: String.c:30
CHAR16 *EFIAPI StrStr(IN CONST CHAR16 *String, IN CONST CHAR16 *SearchString)
Definition: String.c:224
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
Definition: MemLibGuid.c:73
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
EFI_STATUS FvFsGetFileInfo(IN FV_FILESYSTEM_FILE_INFO *FvFileInfo, IN OUT UINTN *BufferSize, OUT EFI_FILE_INFO *FileInfo)
EFI_STATUS FvFsReadFile(IN EFI_FIRMWARE_VOLUME2_PROTOCOL *FvProtocol, IN FV_FILESYSTEM_FILE_INFO *FvFileInfo, IN OUT UINTN *BufferSize, IN OUT VOID **Buffer)
EFI_STATUS EFIAPI FvSimpleFileSystemSetPosition(IN EFI_FILE_PROTOCOL *This, IN UINT64 Position)
EFI_STATUS FvFsFindExecutableSection(IN EFI_FIRMWARE_VOLUME2_PROTOCOL *FvProtocol, IN FV_FILESYSTEM_FILE_INFO *FvFileInfo, IN OUT UINTN *BufferSize, IN OUT VOID **Buffer)
EFI_STATUS EFIAPI FvSimpleFileSystemGetInfo(IN EFI_FILE_PROTOCOL *This, IN EFI_GUID *InformationType, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
CHAR16 *EFIAPI TrimFilePathToAbsolutePath(IN CHAR16 *Path)
EFI_STATUS EFIAPI FvSimpleFileSystemDelete(IN EFI_FILE_PROTOCOL *This)
EFI_STATUS EFIAPI FvSimpleFileSystemOpen(IN EFI_FILE_PROTOCOL *This, OUT EFI_FILE_PROTOCOL **NewHandle, IN CHAR16 *FileName, IN UINT64 OpenMode, IN UINT64 Attributes)
EFI_STATUS EFIAPI FvSimpleFileSystemRead(IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
BOOLEAN EFIAPI RemoveLastItemFromPath(IN OUT CHAR16 *Path)
EFI_STATUS EFIAPI FvSimpleFileSystemSetInfo(IN EFI_FILE_PROTOCOL *This, IN EFI_GUID *InformationType, IN UINTN BufferSize, IN VOID *Buffer)
EFI_STATUS EFIAPI FvSimpleFileSystemGetPosition(IN EFI_FILE_PROTOCOL *This, OUT UINT64 *Position)
EFI_STATUS EFIAPI FvSimpleFileSystemWrite(IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, IN VOID *Buffer)
EFI_STATUS EFIAPI FvSimpleFileSystemFlush(IN EFI_FILE_PROTOCOL *This)
EFI_STATUS FvFsGetFileSize(IN EFI_FIRMWARE_VOLUME2_PROTOCOL *FvProtocol, IN OUT FV_FILESYSTEM_FILE_INFO *FvFileInfo)
EFI_STATUS EFIAPI FvSimpleFileSystemClose(IN EFI_FILE_PROTOCOL *This)
#define NULL
Definition: Base.h:319
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
#define OFFSET_OF(TYPE, Field)
Definition: Base.h:758
#define OUT
Definition: Base.h:284
#define ASSERT_EFI_ERROR(StatusParameter)
Definition: DebugLib.h:462
#define EFI_SECTION_PE32
UINT32 EFI_FV_FILE_ATTRIBUTES
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
EFI_FILE_INFO * FileInfo(IN EFI_FILE_HANDLE FHand)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
CHAR16 FileName[1]
Definition: FileInfo.h:52
UINT64 FileSize
Definition: FileInfo.h:27
Definition: Base.h:213