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

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI GetVariable2 (IN CONST CHAR16 *Name, IN CONST EFI_GUID *Guid, OUT VOID **Value, OUT UINTN *Size OPTIONAL)
 
EFI_STATUS EFIAPI GetVariable3 (IN CONST CHAR16 *Name, IN CONST EFI_GUID *Guid, OUT VOID **Value, OUT UINTN *Size OPTIONAL, OUT UINT32 *Attr OPTIONAL)
 
EFI_STATUS EFIAPI GetEfiGlobalVariable2 (IN CONST CHAR16 *Name, OUT VOID **Value, OUT UINTN *Size OPTIONAL)
 

Detailed Description

The UEFI Library provides functions and macros that simplify the development of UEFI Drivers and UEFI Applications. These functions and macros help manage EFI events, build simple locks utilizing EFI Task Priority Levels (TPLs), install EFI Driver Model related protocols, manage Unicode string tables for UEFI Drivers, and print messages on the console output and standard error devices.

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

Definition in file MockUefiLib.c.

Function Documentation

◆ GetEfiGlobalVariable2()

EFI_STATUS EFIAPI GetEfiGlobalVariable2 ( IN CONST CHAR16 *  Name,
OUT VOID **  Value,
OUT UINTN *Size  OPTIONAL 
)

Returns a pointer to an allocated buffer that contains the contents of a variable retrieved through the UEFI Runtime Service GetVariable(). This function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables. The returned buffer is allocated using AllocatePool(). The caller is responsible for freeing this buffer with FreePool().

If Name is NULL, then ASSERT(). If Value is NULL, then ASSERT().

Parameters
[in]NameThe pointer to a Null-terminated Unicode string.
[out]ValueThe buffer point saved the variable info.
[out]SizeThe buffer size of the variable.
Returns
EFI_OUT_OF_RESOURCES Allocate buffer failed.
EFI_SUCCESS Find the specified variable.
Others Errors Return errors from call to gRT->GetVariable.

Definition at line 194 of file MockUefiLib.c.

◆ GetVariable2()

EFI_STATUS EFIAPI GetVariable2 ( IN CONST CHAR16 *  Name,
IN CONST EFI_GUID Guid,
OUT VOID **  Value,
OUT UINTN *Size  OPTIONAL 
)

Returns the status whether get the variable success. The function retrieves variable through the UEFI Runtime Service GetVariable(). The returned buffer is allocated using AllocatePool(). The caller is responsible for freeing this buffer with FreePool().

If Name is NULL, then ASSERT(). If Guid is NULL, then ASSERT(). If Value is NULL, then ASSERT().

Parameters
[in]NameThe pointer to a Null-terminated Unicode string.
[in]GuidThe pointer to an EFI_GUID structure
[out]ValueThe buffer point saved the variable info.
[out]SizeThe buffer size of the variable.
Returns
EFI_OUT_OF_RESOURCES Allocate buffer failed.
EFI_SUCCESS Find the specified variable.
Others Errors Return errors from call to gRT->GetVariable.

Definition at line 41 of file MockUefiLib.c.

◆ GetVariable3()

EFI_STATUS EFIAPI GetVariable3 ( IN CONST CHAR16 *  Name,
IN CONST EFI_GUID Guid,
OUT VOID **  Value,
OUT UINTN *Size  OPTIONAL,
OUT UINT32 *Attr  OPTIONAL 
)

Return the attributes of the variable.

Returns the status whether get the variable success. The function retrieves variable through the UEFI Runtime Service GetVariable(). The returned buffer is allocated using AllocatePool(). The caller is responsible for freeing this buffer with FreePool(). The attributes are returned if the caller provides a valid Attribute parameter.

If Name is NULL, then ASSERT(). If Guid is NULL, then ASSERT(). If Value is NULL, then ASSERT().

Parameters
[in]NameThe pointer to a Null-terminated Unicode string.
[in]GuidThe pointer to an EFI_GUID structure
[out]ValueThe buffer point saved the variable info.
[out]SizeThe buffer size of the variable.
[out]AttrThe pointer to the variable attributes as found in var store
Return values
EFI_OUT_OF_RESOURCESAllocate buffer failed.
EFI_SUCCESSFind the specified variable.
OthersErrors Return errors from call to gRT->GetVariable.

Definition at line 117 of file MockUefiLib.c.