TianoCore EDK2 master
Loading...
Searching...
No Matches
SecureBootConfigMisc.c File Reference

Go to the source code of this file.

Functions

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)
 
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)
 

Detailed Description

Helper functions for SecureBoot configuration module.

Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file SecureBootConfigMisc.c.

Function Documentation

◆ CloseFile()

VOID CloseFile ( IN EFI_FILE_HANDLE  FileHandle)

Close an open file handle.

Parameters
[in]FileHandleThe file handle to close.

Definition at line 95 of file SecureBootConfigMisc.c.

◆ GuidToString()

UINTN GuidToString ( IN EFI_GUID Guid,
IN CHAR16 *  Buffer,
IN UINTN  BufferSize 
)

Worker function that prints an EFI_GUID into specified Buffer.

Parameters
[in]GuidPointer to GUID to print.
[in]BufferBuffer to print Guid into.
[in]BufferSizeSize of Buffer.
Return values
Numberof characters printed.

Definition at line 162 of file SecureBootConfigMisc.c.

◆ Int2OctStr()

EFI_STATUS EFIAPI Int2OctStr ( IN CONST UINTN Integer,
IN UINTN  IntSizeInWords,
OUT UINT8 *  OctetString,
IN UINTN  OSSizeInBytes 
)

Convert a nonnegative integer to an octet string of a specified length.

Parameters
[in]IntegerPointer to the nonnegative integer to be converted
[in]IntSizeInWordsLength of integer buffer in words
[out]OctetStringConverted octet string of the specified length
[in]OSSizeInBytesIntended length of resulting octet string in bytes

Returns:

Return values
EFI_SUCCESSData conversion successfully
EFI_BUFFER_TOOL_SMALLBuffer is too small for output string

Definition at line 120 of file SecureBootConfigMisc.c.

◆ ReadFileContent()

EFI_STATUS ReadFileContent ( IN EFI_FILE_HANDLE  FileHandle,
IN OUT VOID **  BufferPtr,
OUT UINTN FileSize,
IN UINTN  AdditionAllocateSize 
)

Read file content into BufferPtr, the size of the allocate buffer is *FileSize plus AdditionAllocateSize.

Parameters
[in]FileHandleThe file to be read.
[in,out]BufferPtrPointers to the pointer of allocated buffer.
[out]FileSizeSize of input file
[in]AdditionAllocateSizeAddition size the buffer need to be allocated. In case the buffer need to contain others besides the file content.
Return values
EFI_SUCCESSThe file was read into the buffer.
EFI_INVALID_PARAMETERA parameter was invalid.
EFI_OUT_OF_RESOURCESA memory allocation failed.
othersUnexpected error.

Definition at line 28 of file SecureBootConfigMisc.c.