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

Go to the source code of this file.

Functions

EFI_STATUS UnitTestValidateHandle (IN EFI_HANDLE UserHandle)
 
PROTOCOL_ENTRYUnitTestFindProtocolEntry (IN EFI_GUID *Protocol, IN BOOLEAN Create)
 
PROTOCOL_INTERFACEUnitTestFindProtocolInterface (IN IHANDLE *Handle, IN EFI_GUID *Protocol, IN VOID *Interface)
 
VOID UnitTestNotifyProtocolEntry (IN PROTOCOL_ENTRY *ProtEntry)
 
IHANDLEUnitTestGetNextLocateAllHandles (IN OUT LOCATE_POSITION *Position, OUT VOID **Interface)
 
IHANDLEUnitTestGetNextLocateByRegisterNotify (IN OUT LOCATE_POSITION *Position, OUT VOID **Interface)
 
IHANDLEUnitTestGetNextLocateByProtocol (IN OUT LOCATE_POSITION *Position, OUT VOID **Interface)
 
EFI_STATUS UnitTestDisconnectControllersUsingProtocolInterface (IN EFI_HANDLE UserHandle, IN PROTOCOL_INTERFACE *Prot)
 
PROTOCOL_INTERFACEUnitTestRemoveInterfaceFromProtocol (IN IHANDLE *Handle, IN EFI_GUID *Protocol, IN VOID *Interface)
 
PROTOCOL_INTERFACEUnitTestGetProtocolInterface (IN EFI_HANDLE UserHandle, IN EFI_GUID *Protocol)
 
EFI_STATUS UnitTestInstallProtocolInterfaceNotify (IN OUT EFI_HANDLE *UserHandle, IN EFI_GUID *Protocol, IN EFI_INTERFACE_TYPE InterfaceType, IN VOID *Interface, IN BOOLEAN Notify)
 
EFI_STATUS EFIAPI UnitTestInstallProtocolInterface (IN OUT EFI_HANDLE *UserHandle, IN EFI_GUID *Protocol, IN EFI_INTERFACE_TYPE InterfaceType, IN VOID *Interface)
 
EFI_STATUS EFIAPI UnitTestReinstallProtocolInterface (IN EFI_HANDLE UserHandle, IN EFI_GUID *Protocol, IN VOID *OldInterface, IN VOID *NewInterface)
 
EFI_STATUS EFIAPI UnitTestUninstallProtocolInterface (IN EFI_HANDLE UserHandle, IN EFI_GUID *Protocol, IN VOID *Interface)
 
EFI_STATUS EFIAPI UnitTestHandleProtocol (IN EFI_HANDLE UserHandle, IN EFI_GUID *Protocol, OUT VOID **Interface)
 
EFI_STATUS EFIAPI UnitTestRegisterProtocolNotify (IN EFI_GUID *Protocol, IN EFI_EVENT Event, OUT VOID **Registration)
 
EFI_STATUS EFIAPI UnitTestLocateHandle (IN EFI_LOCATE_SEARCH_TYPE SearchType, IN EFI_GUID *Protocol OPTIONAL, IN VOID *SearchKey OPTIONAL, IN OUT UINTN *BufferSize, OUT EFI_HANDLE *Buffer)
 
EFI_STATUS EFIAPI UnitTestLocateDevicePath (IN EFI_GUID *Protocol, IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath, OUT EFI_HANDLE *Device)
 
EFI_STATUS EFIAPI UnitTestInstallConfigurationTable (IN EFI_GUID *Guid, IN VOID *Table)
 
EFI_STATUS EFIAPI UnitTestOpenProtocol (IN EFI_HANDLE UserHandle, IN EFI_GUID *Protocol, OUT VOID **Interface OPTIONAL, IN EFI_HANDLE ImageHandle, IN EFI_HANDLE ControllerHandle, IN UINT32 Attributes)
 
EFI_STATUS EFIAPI UnitTestCloseProtocol (IN EFI_HANDLE UserHandle, IN EFI_GUID *Protocol, IN EFI_HANDLE AgentHandle, IN EFI_HANDLE ControllerHandle)
 
EFI_STATUS EFIAPI UnitTestOpenProtocolInformation (IN EFI_HANDLE UserHandle, IN EFI_GUID *Protocol, OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer, OUT UINTN *EntryCount)
 
EFI_STATUS EFIAPI UnitTestProtocolsPerHandle (IN EFI_HANDLE UserHandle, OUT EFI_GUID ***ProtocolBuffer, OUT UINTN *ProtocolBufferCount)
 
EFI_STATUS EFIAPI UnitTestLocateHandleBuffer (IN EFI_LOCATE_SEARCH_TYPE SearchType, IN EFI_GUID *Protocol OPTIONAL, IN VOID *SearchKey OPTIONAL, IN OUT UINTN *NumberHandles, OUT EFI_HANDLE **Buffer)
 
EFI_STATUS EFIAPI UnitTestLocateProtocol (IN EFI_GUID *Protocol, IN VOID *Registration OPTIONAL, OUT VOID **Interface)
 
EFI_STATUS EFIAPI UnitTestInstallMultipleProtocolInterfaces (IN OUT EFI_HANDLE *Handle,...)
 
EFI_STATUS EFIAPI UnitTestUninstallMultipleProtocolInterfaces (IN EFI_HANDLE Handle,...)
 

Variables

STATIC LIST_ENTRY mProtocolDatabase = INITIALIZE_LIST_HEAD_VARIABLE (mProtocolDatabase)
 
STATIC LIST_ENTRY gHandleList = INITIALIZE_LIST_HEAD_VARIABLE (gHandleList)
 
STATIC UINT64 gHandleDatabaseKey = 0
 
STATIC UINTN mEfiLocateHandleRequest = 0
 

Detailed Description

Implementation of protocol related services in the UEFI Boot Services table for use in unit tests.

Copyright (c) Microsoft Corporation SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file UnitTestUefiBootServicesTableLibProtocol.c.

Function Documentation

◆ UnitTestCloseProtocol()

EFI_STATUS EFIAPI UnitTestCloseProtocol ( IN EFI_HANDLE  UserHandle,
IN EFI_GUID Protocol,
IN EFI_HANDLE  AgentHandle,
IN EFI_HANDLE  ControllerHandle 
)

Closes a protocol on a handle that was opened using OpenProtocol().

Parameters
UserHandleThe handle for the protocol interface that was previously opened with OpenProtocol(), and is now being closed.
ProtocolThe published unique identifier of the protocol. It is the caller's responsibility to pass in a valid GUID.
AgentHandleThe handle of the agent that is closing the protocol interface.
ControllerHandleIf the agent that opened a protocol is a driver that follows the EFI Driver Model, then this parameter is the controller handle that required the protocol interface. If the agent does not follow the EFI Driver Model, then this parameter is optional and may be NULL.
Return values
EFI_SUCCESSThe protocol instance was closed.
EFI_INVALID_PARAMETERHandle, AgentHandle or ControllerHandle is not a valid EFI_HANDLE.
EFI_NOT_FOUNDCan not find the specified protocol or AgentHandle.

Definition at line 1370 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestDisconnectControllersUsingProtocolInterface()

EFI_STATUS UnitTestDisconnectControllersUsingProtocolInterface ( IN EFI_HANDLE  UserHandle,
IN PROTOCOL_INTERFACE Prot 
)

Attempts to disconnect all drivers that are using the protocol interface being queried. If failed, reconnect all drivers disconnected. Note: This function doesn't do parameters checking, it's caller's responsibility to pass in valid parameters.

Parameters
UserHandleThe handle on which the protocol is installed
ProtThe protocol to disconnect drivers from
Return values
EFI_SUCCESSDrivers using the protocol interface are all disconnected
EFI_ACCESS_DENIEDFailed to disconnect one or all of the drivers

Definition at line 343 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestFindProtocolEntry()

PROTOCOL_ENTRY * UnitTestFindProtocolEntry ( IN EFI_GUID Protocol,
IN BOOLEAN  Create 
)

Finds the protocol entry for the requested protocol.

Parameters
ProtocolThe ID of the protocol
CreateCreate a new entry if not found
Returns
Protocol entry

Definition at line 61 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestFindProtocolInterface()

PROTOCOL_INTERFACE * UnitTestFindProtocolInterface ( IN IHANDLE Handle,
IN EFI_GUID Protocol,
IN VOID *  Interface 
)

Finds the protocol instance for the requested handle and protocol. Note: This function doesn't do parameters checking, it's caller's responsibility to pass in valid parameters.

Parameters
HandleThe handle to search the protocol on
ProtocolGUID of the protocol
InterfaceThe interface for the protocol being searched
Returns
Protocol instance (NULL: Not found)

Definition at line 129 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestGetNextLocateAllHandles()

IHANDLE * UnitTestGetNextLocateAllHandles ( IN OUT LOCATE_POSITION Position,
OUT VOID **  Interface 
)

Routine to get the next Handle, when you are searching for all handles.

Parameters
PositionInformation about which Handle to seach for.
InterfaceReturn the interface structure for the matching protocol.
Returns
An pointer to IHANDLE if the next Position is not the end of the list. Otherwise,NULL is returned.

Definition at line 198 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestGetNextLocateByProtocol()

IHANDLE * UnitTestGetNextLocateByProtocol ( IN OUT LOCATE_POSITION Position,
OUT VOID **  Interface 
)

Routine to get the next Handle, when you are searching for a given protocol.

Parameters
PositionInformation about which Handle to seach for.
InterfaceReturn the interface structure for the matching protocol.
Returns
An pointer to IHANDLE if the next Position is not the end of the list. Otherwise,NULL is returned.

Definition at line 282 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestGetNextLocateByRegisterNotify()

IHANDLE * UnitTestGetNextLocateByRegisterNotify ( IN OUT LOCATE_POSITION Position,
OUT VOID **  Interface 
)

Routine to get the next Handle, when you are searching for register protocol notifies.

Parameters
PositionInformation about which Handle to seach for.
InterfaceReturn the interface structure for the matching protocol.
Returns
An pointer to IHANDLE if the next Position is not the end of the list. Otherwise,NULL is returned.

Definition at line 235 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestGetProtocolInterface()

PROTOCOL_INTERFACE * UnitTestGetProtocolInterface ( IN EFI_HANDLE  UserHandle,
IN EFI_GUID Protocol 
)

Locate a certain GUID protocol interface in a Handle's protocols.

Parameters
UserHandleThe handle to obtain the protocol interface on
ProtocolThe GUID of the protocol
Returns
The requested protocol interface for the handle

Definition at line 462 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestHandleProtocol()

EFI_STATUS EFIAPI UnitTestHandleProtocol ( IN EFI_HANDLE  UserHandle,
IN EFI_GUID Protocol,
OUT VOID **  Interface 
)

Queries a handle to determine if it supports a specified protocol.

Parameters
UserHandleThe handle being queried.
ProtocolThe published unique identifier of the protocol.
InterfaceSupplies the address where a pointer to the corresponding Protocol Interface is returned.
Returns
The requested protocol interface for the handle

Definition at line 841 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestInstallConfigurationTable()

EFI_STATUS EFIAPI UnitTestInstallConfigurationTable ( IN EFI_GUID Guid,
IN VOID *  Table 
)

Boot Service called to add, modify, or remove a system configuration table from the EFI System Table.

Parameters
GuidPointer to the GUID for the entry to add, update, or remove
TablePointer to the configuration table for the entry to add, update, or remove, may be NULL.
Returns
EFI_SUCCESS Guid, Table pair added, updated, or removed.
EFI_INVALID_PARAMETER Input GUID not valid.
EFI_NOT_FOUND Attempted to delete non-existant entry
EFI_OUT_OF_RESOURCES Not enough memory available

Definition at line 1086 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestInstallMultipleProtocolInterfaces()

EFI_STATUS EFIAPI UnitTestInstallMultipleProtocolInterfaces ( IN OUT EFI_HANDLE Handle,
  ... 
)

Installs a list of protocol interface into the boot services environment. This function calls InstallProtocolInterface() in a loop. If any error occurs all the protocols added by this function are removed. This is basically a lib function to save space.

Parameters
HandleThe handle to install the protocol handlers on, or NULL if a new handle is to be allocated
...EFI_GUID followed by protocol instance. A NULL terminates the list. The pairs are the arguments to InstallProtocolInterface(). All the protocols are added to Handle.
Return values
EFI_SUCCESSAll the protocol interface was installed.
EFI_OUT_OF_RESOURCESThere was not enough memory in pool to install all the protocols.
EFI_ALREADY_STARTEDA Device Path Protocol instance was passed in that is already present in the handle database.
EFI_INVALID_PARAMETERHandle is NULL.
EFI_INVALID_PARAMETERProtocol is already installed on the handle specified by Handle.

Definition at line 1575 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestInstallProtocolInterface()

EFI_STATUS EFIAPI UnitTestInstallProtocolInterface ( IN OUT EFI_HANDLE UserHandle,
IN EFI_GUID Protocol,
IN EFI_INTERFACE_TYPE  InterfaceType,
IN VOID *  Interface 
)

Wrapper function to UnitTestInstallProtocolInterfaceNotify. This is the public API which Calls the private one which contains a BOOLEAN parameter for notifications

Parameters
UserHandleThe handle to install the protocol handler on, or NULL if a new handle is to be allocated
ProtocolThe protocol to add to the handle
InterfaceTypeIndicates whether Interface is supplied in native form.
InterfaceThe interface for the protocol being added
Returns
Status code

Definition at line 683 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestInstallProtocolInterfaceNotify()

EFI_STATUS UnitTestInstallProtocolInterfaceNotify ( IN OUT EFI_HANDLE UserHandle,
IN EFI_GUID Protocol,
IN EFI_INTERFACE_TYPE  InterfaceType,
IN VOID *  Interface,
IN BOOLEAN  Notify 
)

Installs a protocol interface into the boot services environment.

Parameters
UserHandleThe handle to install the protocol handler on, or NULL if a new handle is to be allocated
ProtocolThe protocol to add to the handle
InterfaceTypeIndicates whether Interface is supplied in native form.
InterfaceThe interface for the protocol being added
Notifyindicates whether notify the notification list for this protocol
Return values
EFI_INVALID_PARAMETERInvalid parameter
EFI_OUT_OF_RESOURCESNo enough buffer to allocate
EFI_SUCCESSProtocol interface successfully installed

Definition at line 512 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestLocateDevicePath()

EFI_STATUS EFIAPI UnitTestLocateDevicePath ( IN EFI_GUID Protocol,
IN OUT EFI_DEVICE_PATH_PROTOCOL **  DevicePath,
OUT EFI_HANDLE Device 
)

Locates the handle to a device on the device path that best matches the specified protocol.

Parameters
ProtocolThe protocol to search for.
DevicePathOn input, a pointer to a pointer to the device path. On output, the device path pointer is modified to point to the remaining part of the devicepath.
DeviceA pointer to the returned device handle.
Return values
EFI_SUCCESSThe resulting handle was returned.
EFI_NOT_FOUNDNo handles matched the search.
EFI_INVALID_PARAMETEROne of the parameters has an invalid value.

Definition at line 1060 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestLocateHandle()

EFI_STATUS EFIAPI UnitTestLocateHandle ( IN EFI_LOCATE_SEARCH_TYPE  SearchType,
IN EFI_GUID *Protocol  OPTIONAL,
IN VOID *SearchKey  OPTIONAL,
IN OUT UINTN BufferSize,
OUT EFI_HANDLE Buffer 
)

Locates the requested handle(s) and returns them in Buffer.

Parameters
SearchTypeThe type of search to perform to locate the handles
ProtocolThe protocol to search for
SearchKeyDependant on SearchType
BufferSizeOn input the size of Buffer. On output the size of data returned.
BufferThe buffer to return the results in
Return values
EFI_BUFFER_TOO_SMALLBuffer too small, required buffer size is returned in BufferSize.
EFI_INVALID_PARAMETERInvalid parameter
EFI_SUCCESSSuccessfully found the requested handle(s) and returns them in Buffer.

Definition at line 901 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestLocateHandleBuffer()

EFI_STATUS EFIAPI UnitTestLocateHandleBuffer ( IN EFI_LOCATE_SEARCH_TYPE  SearchType,
IN EFI_GUID *Protocol  OPTIONAL,
IN VOID *SearchKey  OPTIONAL,
IN OUT UINTN NumberHandles,
OUT EFI_HANDLE **  Buffer 
)

Function returns an array of handles that support the requested protocol in a buffer allocated from pool. This is a version of UnitTestLocateHandle() that allocates a buffer for the caller.

Parameters
SearchTypeSpecifies which handle(s) are to be returned.
ProtocolProvides the protocol to search by. This parameter is only valid for SearchType ByProtocol.
SearchKeySupplies the search key depending on the SearchType.
NumberHandlesThe number of handles returned in Buffer.
BufferA pointer to the buffer to return the requested array of handles that support Protocol.
Return values
EFI_SUCCESSThe result array of handles was returned.
EFI_NOT_FOUNDNo handles match the search.
EFI_OUT_OF_RESOURCESThere is not enough pool memory to store the matching results.
EFI_INVALID_PARAMETEROne or more parameters are not valid.

Definition at line 1461 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestLocateProtocol()

EFI_STATUS EFIAPI UnitTestLocateProtocol ( IN EFI_GUID Protocol,
IN VOID *Registration  OPTIONAL,
OUT VOID **  Interface 
)

Return the first Protocol Interface that matches the Protocol GUID. If Registration is passed in, return a Protocol Instance that was just add to the system. If Registration is NULL return the first Protocol Interface you find.

Parameters
ProtocolThe protocol to search for
RegistrationOptional Registration Key returned from RegisterProtocolNotify()
InterfaceReturn the Protocol interface (instance).
Return values
EFI_SUCCESSIf a valid Interface is returned
EFI_INVALID_PARAMETERInvalid parameter
EFI_NOT_FOUNDProtocol interface not found

Definition at line 1543 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestNotifyProtocolEntry()

VOID UnitTestNotifyProtocolEntry ( IN PROTOCOL_ENTRY ProtEntry)

Signal event for every protocol in protocol entry.

Parameters
ProtEntryProtocol entry

Definition at line 173 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestOpenProtocol()

EFI_STATUS EFIAPI UnitTestOpenProtocol ( IN EFI_HANDLE  UserHandle,
IN EFI_GUID Protocol,
OUT VOID **Interface  OPTIONAL,
IN EFI_HANDLE  ImageHandle,
IN EFI_HANDLE  ControllerHandle,
IN UINT32  Attributes 
)

Locates the installed protocol handler for the handle, and invokes it to obtain the protocol interface. Usage information is registered in the protocol data base.

Parameters
UserHandleThe handle to obtain the protocol interface on
ProtocolThe ID of the protocol
InterfaceThe location to return the protocol interface
ImageHandleThe handle of the Image that is opening the protocol interface specified by Protocol and Interface.
ControllerHandleThe controller handle that is requiring this interface.
AttributesThe open mode of the protocol interface specified by Handle and Protocol.
Return values
EFI_INVALID_PARAMETERProtocol is NULL.
EFI_SUCCESSGet the protocol interface.

Definition at line 1116 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestOpenProtocolInformation()

EFI_STATUS EFIAPI UnitTestOpenProtocolInformation ( IN EFI_HANDLE  UserHandle,
IN EFI_GUID Protocol,
OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **  EntryBuffer,
OUT UINTN EntryCount 
)

Return information about Opened protocols in the system

Parameters
UserHandleThe handle to close the protocol interface on
ProtocolThe ID of the protocol
EntryBufferA pointer to a buffer of open protocol information in the form of EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures.
EntryCountNumber of EntryBuffer entries

Definition at line 1393 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestProtocolsPerHandle()

EFI_STATUS EFIAPI UnitTestProtocolsPerHandle ( IN EFI_HANDLE  UserHandle,
OUT EFI_GUID ***  ProtocolBuffer,
OUT UINTN ProtocolBufferCount 
)

Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated from pool.

Parameters
UserHandleThe handle from which to retrieve the list of protocol interface GUIDs.
ProtocolBufferA pointer to the list of protocol interface GUID pointers that are installed on Handle.
ProtocolBufferCountA pointer to the number of GUID pointers present in ProtocolBuffer.
Return values
EFI_SUCCESSThe list of protocol interface GUIDs installed on Handle was returned in ProtocolBuffer. The number of protocol interface GUIDs was returned in ProtocolBufferCount.
EFI_INVALID_PARAMETERHandle is NULL.
EFI_INVALID_PARAMETERHandle is not a valid EFI_HANDLE.
EFI_INVALID_PARAMETERProtocolBuffer is NULL.
EFI_INVALID_PARAMETERProtocolBufferCount is NULL.
EFI_OUT_OF_RESOURCESThere is not enough pool memory to store the results.

Definition at line 1428 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestRegisterProtocolNotify()

EFI_STATUS EFIAPI UnitTestRegisterProtocolNotify ( IN EFI_GUID Protocol,
IN EFI_EVENT  Event,
OUT VOID **  Registration 
)

Add a new protocol notification record for the request protocol.

Parameters
ProtocolThe requested protocol to add the notify registration
EventThe event to signal
RegistrationReturns the registration record
Return values
EFI_INVALID_PARAMETERInvalid parameter
EFI_SUCCESSSuccessfully returned the registration record that has been added

Definition at line 872 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestReinstallProtocolInterface()

EFI_STATUS EFIAPI UnitTestReinstallProtocolInterface ( IN EFI_HANDLE  UserHandle,
IN EFI_GUID Protocol,
IN VOID *  OldInterface,
IN VOID *  NewInterface 
)

Reinstall a protocol interface on a device handle. The OldInterface for Protocol is replaced by the NewInterface.

Parameters
UserHandleHandle on which the interface is to be reinstalled
ProtocolThe numeric ID of the interface
OldInterfaceA pointer to the old interface
NewInterfaceA pointer to the new interface
Return values
EFI_SUCCESSThe protocol interface was installed
EFI_NOT_FOUNDThe OldInterface on the handle was not found
EFI_INVALID_PARAMETEROne of the parameters has an invalid value

Definition at line 715 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestRemoveInterfaceFromProtocol()

PROTOCOL_INTERFACE * UnitTestRemoveInterfaceFromProtocol ( IN IHANDLE Handle,
IN EFI_GUID Protocol,
IN VOID *  Interface 
)

Removes Protocol from the protocol list (but not the handle list).

Parameters
HandleThe handle to remove protocol on.
ProtocolGUID of the protocol to be moved
InterfaceThe interface of the protocol
Returns
Protocol Entry

Definition at line 413 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestUninstallMultipleProtocolInterfaces()

EFI_STATUS EFIAPI UnitTestUninstallMultipleProtocolInterfaces ( IN EFI_HANDLE  Handle,
  ... 
)

Uninstalls a list of protocol interface in the boot services environment. This function calls UninstallProtocolInterface() in a loop. This is basically a lib function to save space.

Parameters
HandleThe handle to uninstall the protocol
...EFI_GUID followed by protocol instance. A NULL terminates the list. The pairs are the arguments to UninstallProtocolInterface(). All the protocols are added to Handle.
Returns
Status code

Definition at line 1599 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestUninstallProtocolInterface()

EFI_STATUS EFIAPI UnitTestUninstallProtocolInterface ( IN EFI_HANDLE  UserHandle,
IN EFI_GUID Protocol,
IN VOID *  Interface 
)

Uninstalls all instances of a protocol:interfacer from a handle. If the last protocol interface is remove from the handle, the handle is freed.

Parameters
UserHandleThe handle to remove the protocol handler from
ProtocolThe protocol, of protocol:interface, to remove
InterfaceThe interface, of protocol:interface, to remove
Return values
EFI_INVALID_PARAMETERProtocol is NULL.
EFI_SUCCESSProtocol interface successfully uninstalled.

Definition at line 740 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestValidateHandle()

EFI_STATUS UnitTestValidateHandle ( IN EFI_HANDLE  UserHandle)

Check whether a handle is a valid EFI_HANDLE

Parameters
UserHandleThe handle to check
Return values
EFI_INVALID_PARAMETERThe handle is NULL or not a valid EFI_HANDLE.
EFI_SUCCESSThe handle is valid EFI_HANDLE.

Definition at line 30 of file UnitTestUefiBootServicesTableLibProtocol.c.

Variable Documentation

◆ gHandleDatabaseKey

STATIC UINT64 gHandleDatabaseKey = 0

Definition at line 13 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ gHandleList

STATIC LIST_ENTRY gHandleList = INITIALIZE_LIST_HEAD_VARIABLE (gHandleList)

Definition at line 12 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ mEfiLocateHandleRequest

STATIC UINTN mEfiLocateHandleRequest = 0

Definition at line 14 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ mProtocolDatabase

STATIC LIST_ENTRY mProtocolDatabase = INITIALIZE_LIST_HEAD_VARIABLE (mProtocolDatabase)

Definition at line 11 of file UnitTestUefiBootServicesTableLibProtocol.c.