30 IN OUT VOID **BufferPtr,
37 UINT64 SourceFileSize;
41 if ((FileHandle ==
NULL) || (FileSize ==
NULL)) {
42 return EFI_INVALID_PARAMETER;
50 Status = FileHandle->SetPosition (FileHandle, (UINT64)-1);
51 if (EFI_ERROR (Status)) {
55 Status = FileHandle->GetPosition (FileHandle, &SourceFileSize);
56 if (EFI_ERROR (Status)) {
60 Status = FileHandle->SetPosition (FileHandle, 0);
61 if (EFI_ERROR (Status)) {
65 BufferSize = (
UINTN)SourceFileSize + AdditionAllocateSize;
68 return EFI_OUT_OF_RESOURCES;
71 BufferSize = (
UINTN)SourceFileSize;
72 *FileSize = BufferSize;
74 Status = FileHandle->Read (FileHandle, &BufferSize, Buffer);
75 if (EFI_ERROR (Status) || (BufferSize != *FileSize)) {
78 Status = EFI_BAD_BUFFER_SIZE;
99 if (FileHandle !=
NULL) {
100 FileHandle->Close (FileHandle);
123 OUT UINT8 *OctetString,
130 for (Ptr1 = (
CONST UINT8 *)Integer, Ptr2 = OctetString + OSSizeInBytes - 1;
131 Ptr1 < (UINT8 *)(Integer + IntSizeInWords) && Ptr2 >= OctetString;
137 for ( ; Ptr1 < (
CONST UINT8 *)(Integer + IntSizeInWords) && *Ptr1 == 0; Ptr1++) {
140 if (Ptr1 < (
CONST UINT8 *)(Integer + IntSizeInWords)) {
141 return EFI_BUFFER_TOO_SMALL;
144 if (Ptr2 >= OctetString) {
145 ZeroMem (OctetString, Ptr2 - OctetString + 1);
173 L
"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
177 (
UINTN)Guid->Data4[0],
178 (
UINTN)Guid->Data4[1],
179 (
UINTN)Guid->Data4[2],
180 (
UINTN)Guid->Data4[3],
181 (
UINTN)Guid->Data4[4],
182 (
UINTN)Guid->Data4[5],
183 (
UINTN)Guid->Data4[6],
184 (
UINTN)Guid->Data4[7]
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
UINTN EFIAPI UnicodeSPrint(OUT CHAR16 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR16 *FormatString,...)
EFI_STATUS EFIAPI Int2OctStr(IN CONST UINTN *Integer, IN UINTN IntSizeInWords, OUT UINT8 *OctetString, IN UINTN OSSizeInBytes)
UINTN GuidToString(IN EFI_GUID *Guid, IN CHAR16 *Buffer, IN UINTN BufferSize)
EFI_STATUS ReadFileContent(IN EFI_FILE_HANDLE FileHandle, IN OUT VOID **BufferPtr, OUT UINTN *FileSize, IN UINTN AdditionAllocateSize)
VOID CloseFile(IN EFI_FILE_HANDLE FileHandle)