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

Go to the source code of this file.

Macros

#define LOCAL_EFI_WIN_NT_THUNK_PROTOCOL_GUID
 
#define LOCAL_EFI_WIN_NT_BUS_DRIVER_IO_PROTOCOL_GUID
 
#define LOCAL_EFI_WIN_NT_SERIAL_PORT_GUID
 
#define LOCAL_EFI_ISA_IO_PROTOCOL_GUID
 
#define LOCAL_EFI_ISA_ACPI_PROTOCOL_GUID
 

Functions

CHAR16 * FindLoadedImageFileName (IN EFI_LOADED_IMAGE_PROTOCOL *LoadedImage)
 
CHAR16 * ConvertMemoryType (IN CONST EFI_MEMORY_TYPE Memory)
 
CHAR16 * ConvertPixelFormat (IN CONST EFI_GRAPHICS_PIXEL_FORMAT Fmt)
 
EFI_STATUS EFIAPI HandleParsingLibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
VOID HandleParsingHiiInit (VOID)
 
EFI_STATUS EFIAPI HandleParsingLibDestructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
CHAR16 *EFIAPI LoadedImageProtocolDumpInformation (IN CONST EFI_HANDLE TheHandle, IN CONST BOOLEAN Verbose)
 
CHAR16 *EFIAPI GraphicsOutputProtocolDumpInformation (IN CONST EFI_HANDLE TheHandle, IN CONST BOOLEAN Verbose)
 
CHAR16 *EFIAPI EdidDiscoveredProtocolDumpInformation (IN CONST EFI_HANDLE TheHandle, IN CONST BOOLEAN Verbose)
 
CHAR16 *EFIAPI EdidActiveProtocolDumpInformation (IN CONST EFI_HANDLE TheHandle, IN CONST BOOLEAN Verbose)
 
CHAR16 *EFIAPI PciRootBridgeIoDumpInformation (IN CONST EFI_HANDLE TheHandle, IN CONST BOOLEAN Verbose)
 
CHAR16 *EFIAPI TxtOutProtocolDumpInformation (IN CONST EFI_HANDLE TheHandle, IN CONST BOOLEAN Verbose)
 
CHAR16 *EFIAPI DriverEfiVersionProtocolDumpInformation (IN CONST EFI_HANDLE TheHandle, IN CONST BOOLEAN Verbose)
 
CHAR16 * ConvertDevicePathToShortText (IN CONST EFI_DEVICE_PATH_PROTOCOL *DevPath, IN CONST BOOLEAN Verbose, IN CONST UINTN Length)
 
STATIC CHAR16 *EFIAPI DevicePathProtocolDumpInformationEx (IN CONST EFI_HANDLE TheHandle, IN CONST BOOLEAN Verbose, IN EFI_GUID *Protocol)
 
CHAR16 *EFIAPI DevicePathProtocolDumpInformation (IN CONST EFI_HANDLE TheHandle, IN CONST BOOLEAN Verbose)
 
CHAR16 *EFIAPI LoadedImageDevicePathProtocolDumpInformation (IN CONST EFI_HANDLE TheHandle, IN CONST BOOLEAN Verbose)
 
CHAR16 *EFIAPI BusSpecificDriverOverrideProtocolDumpInformation (IN CONST EFI_HANDLE TheHandle, IN CONST BOOLEAN Verbose)
 
CHAR16 *EFIAPI BlockIoProtocolDumpInformation (IN CONST EFI_HANDLE TheHandle, IN CONST BOOLEAN Verbose)
 
CHAR16 *EFIAPI DebugSupportProtocolDumpInformation (IN CONST EFI_HANDLE TheHandle, IN CONST BOOLEAN Verbose)
 
CHAR16 *EFIAPI PciIoProtocolDumpInformation (IN CONST EFI_HANDLE TheHandle, IN CONST BOOLEAN Verbose)
 
CHAR16 *EFIAPI UsbIoProtocolDumpInformation (IN CONST EFI_HANDLE TheHandle, IN CONST BOOLEAN Verbose)
 
CHAR16 *EFIAPI AdapterInformationDumpInformation (IN CONST EFI_HANDLE TheHandle, IN CONST BOOLEAN Verbose)
 
CHAR16 *EFIAPI FirmwareManagementDumpInformation (IN CONST EFI_HANDLE TheHandle, IN CONST BOOLEAN Verbose)
 
CHAR16 *EFIAPI PartitionInfoProtocolDumpInformation (IN CONST EFI_HANDLE TheHandle, IN CONST BOOLEAN Verbose)
 
CONST GUID_INFO_BLOCKInternalShellGetNodeFromGuid (IN CONST EFI_GUID *Guid)
 
EFI_STATUS InsertNewGuidNameMapping (IN CONST EFI_GUID *Guid, IN CONST EFI_STRING_ID NameID, IN CONST DUMP_PROTOCOL_INFO DumpFunc OPTIONAL)
 
EFI_STATUS EFIAPI AddNewGuidNameMapping (IN CONST EFI_GUID *Guid, IN CONST CHAR16 *TheName, IN CONST CHAR8 *Lang OPTIONAL)
 
CHAR16 *EFIAPI GetStringNameFromGuid (IN CONST EFI_GUID *Guid, IN CONST CHAR8 *Lang OPTIONAL)
 
CHAR16 *EFIAPI GetProtocolInformationDump (IN CONST EFI_HANDLE TheHandle, IN CONST EFI_GUID *Guid, IN CONST BOOLEAN Verbose)
 
EFI_STATUS EFIAPI GetGuidFromStringName (IN CONST CHAR16 *Name, IN CONST CHAR8 *Lang OPTIONAL, OUT EFI_GUID **Guid)
 
CHAR8 *EFIAPI GetBestLanguageForDriver (IN CONST CHAR8 *SupportedLanguages, IN CONST CHAR8 *InputLanguage, IN BOOLEAN Iso639Language)
 
CONST CHAR16 *EFIAPI GetStringNameFromHandle (IN CONST EFI_HANDLE TheHandle, IN CONST CHAR8 *Language)
 
EFI_STATUS InternalShellInitHandleList (VOID)
 
UINTN EFIAPI ConvertHandleToHandleIndex (IN CONST EFI_HANDLE TheHandle)
 
EFI_HANDLE EFIAPI ConvertHandleIndexToHandle (IN CONST UINTN TheIndex)
 
EFI_STATUS EFIAPI ParseHandleDatabaseByRelationshipWithType (IN CONST EFI_HANDLE DriverBindingHandle OPTIONAL, IN CONST EFI_HANDLE ControllerHandle OPTIONAL, IN UINTN *HandleCount, OUT EFI_HANDLE **HandleBuffer, OUT UINTN **HandleType)
 
EFI_STATUS EFIAPI ParseHandleDatabaseByRelationship (IN CONST EFI_HANDLE DriverBindingHandle OPTIONAL, IN CONST EFI_HANDLE ControllerHandle OPTIONAL, IN CONST UINTN Mask, IN UINTN *MatchingHandleCount, OUT EFI_HANDLE **MatchingHandleBuffer OPTIONAL)
 
EFI_STATUS EFIAPI ParseHandleDatabaseForChildControllers (IN CONST EFI_HANDLE ControllerHandle, OUT UINTN *MatchingHandleCount, OUT EFI_HANDLE **MatchingHandleBuffer OPTIONAL)
 
VOID * BuffernCatGrow (IN OUT VOID **DestinationBuffer, IN OUT UINTN *DestinationSize, IN VOID *SourceBuffer, IN UINTN SourceSize)
 
EFI_STATUS EFIAPI ParseHandleDatabaseForChildDevices (IN CONST EFI_HANDLE DriverHandle, IN UINTN *MatchingHandleCount, OUT EFI_HANDLE **MatchingHandleBuffer OPTIONAL)
 
EFI_HANDLE *EFIAPI GetHandleListByProtocol (IN CONST EFI_GUID *ProtocolGuid OPTIONAL)
 
EFI_HANDLE *EFIAPI GetHandleListByProtocolList (IN CONST EFI_GUID **ProtocolGuids)
 
EFI_STATUS EFIAPI GetAllMappingGuids (OUT EFI_GUID *Guids, IN OUT UINTN *Count)
 

Variables

EFI_HII_HANDLE mHandleParsingHiiHandle = NULL
 
HANDLE_INDEX_LIST mHandleList
 
GUID_INFO_BLOCKmGuidList
 
UINTN mGuidListCount
 
STATIC CONST UINTN VersionStringSize = 60
 
STATIC CONST EFI_GUID WinNtThunkProtocolGuid = LOCAL_EFI_WIN_NT_THUNK_PROTOCOL_GUID
 
STATIC CONST EFI_GUID WinNtIoProtocolGuid = LOCAL_EFI_WIN_NT_BUS_DRIVER_IO_PROTOCOL_GUID
 
STATIC CONST EFI_GUID WinNtSerialPortGuid = LOCAL_EFI_WIN_NT_SERIAL_PORT_GUID
 
STATIC CONST EFI_GUID EfiIsaIoProtocolGuid = LOCAL_EFI_ISA_IO_PROTOCOL_GUID
 
STATIC CONST EFI_GUID EfiIsaAcpiProtocolGuid = LOCAL_EFI_ISA_ACPI_PROTOCOL_GUID
 
STATIC CONST GUID_INFO_BLOCK mGuidStringListNT []
 
STATIC CONST GUID_INFO_BLOCK mGuidStringList []
 

Detailed Description

Provides interface to advanced shell functionality for parsing both handle and protocol database.

Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
(C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
(C) Copyright 2015-2021 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file UefiHandleParsingLib.c.

Macro Definition Documentation

◆ LOCAL_EFI_ISA_ACPI_PROTOCOL_GUID

#define LOCAL_EFI_ISA_ACPI_PROTOCOL_GUID
Value:
{ \
0x64a892dc, 0x5561, 0x4536, { 0x92, 0xc7, 0x79, 0x9b, 0xfc, 0x18, 0x33, 0x55 } \
}

Definition at line 2198 of file UefiHandleParsingLib.c.

◆ LOCAL_EFI_ISA_IO_PROTOCOL_GUID

#define LOCAL_EFI_ISA_IO_PROTOCOL_GUID
Value:
{ \
0x7ee2bd44, 0x3da0, 0x11d4, { 0x9a, 0x38, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
}

Definition at line 2194 of file UefiHandleParsingLib.c.

◆ LOCAL_EFI_WIN_NT_BUS_DRIVER_IO_PROTOCOL_GUID

#define LOCAL_EFI_WIN_NT_BUS_DRIVER_IO_PROTOCOL_GUID
Value:
{ \
0x96eb4ad6, 0xa32a, 0x11d4, { 0xbc, 0xfd, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \
}

Definition at line 2178 of file UefiHandleParsingLib.c.

◆ LOCAL_EFI_WIN_NT_SERIAL_PORT_GUID

#define LOCAL_EFI_WIN_NT_SERIAL_PORT_GUID
Value:
{ \
0xc95a93d, 0xa006, 0x11d4, { 0xbc, 0xfa, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \
}

Definition at line 2183 of file UefiHandleParsingLib.c.

◆ LOCAL_EFI_WIN_NT_THUNK_PROTOCOL_GUID

#define LOCAL_EFI_WIN_NT_THUNK_PROTOCOL_GUID
Value:
{ \
0x58c518b1, 0x76f3, 0x11d4, { 0xbc, 0xea, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \
}

Definition at line 2173 of file UefiHandleParsingLib.c.

Function Documentation

◆ AdapterInformationDumpInformation()

CHAR16 *EFIAPI AdapterInformationDumpInformation ( IN CONST EFI_HANDLE  TheHandle,
IN CONST BOOLEAN  Verbose 
)

Function to dump information about EfiAdapterInformation Protocol.

Parameters
[in]TheHandleThe handle that has the protocol installed.
[in]VerboseTRUE for additional information, FALSE otherwise.
Return values
Apointer to a string containing the information.

Definition at line 1412 of file UefiHandleParsingLib.c.

◆ AddNewGuidNameMapping()

EFI_STATUS EFIAPI AddNewGuidNameMapping ( IN CONST EFI_GUID Guid,
IN CONST CHAR16 *  TheName,
IN CONST CHAR8 *Lang  OPTIONAL 
)

Function to add a new GUID/Name mapping.

This cannot overwrite an existing mapping.

Parameters
[in]GuidThe Guid
[in]TheNameThe Guid's name
[in]LangRFC4646 language code list or NULL
Return values
EFI_SUCCESSThe operation was successful
EFI_ACCESS_DENIEDThere was a duplicate
EFI_OUT_OF_RESOURCESA memory allocation failed
EFI_INVALID_PARAMETERGuid or TheName was NULL

Definition at line 2675 of file UefiHandleParsingLib.c.

◆ BlockIoProtocolDumpInformation()

CHAR16 *EFIAPI BlockIoProtocolDumpInformation ( IN CONST EFI_HANDLE  TheHandle,
IN CONST BOOLEAN  Verbose 
)

Function to dump information about BlockIo protocol.

This will allocate the return buffer from boot services pool.

Parameters
[in]TheHandleThe handle that has the protocol installed.
[in]VerboseTRUE for additional information, FALSE otherwise.
Return values
Apointer to a string containing the information.

Definition at line 1110 of file UefiHandleParsingLib.c.

◆ BuffernCatGrow()

VOID * BuffernCatGrow ( IN OUT VOID **  DestinationBuffer,
IN OUT UINTN DestinationSize,
IN VOID *  SourceBuffer,
IN UINTN  SourceSize 
)

Appends 1 buffer to another buffer. This will re-allocate the destination buffer if necessary to fit all of the data.

If DestinationBuffer is NULL, then ASSERT().

Parameters
[in,out]DestinationBufferThe pointer to the pointer to the buffer to append onto.
[in,out]DestinationSizeThe pointer to the size of DestinationBuffer.
[in]SourceBufferThe pointer to the buffer to append onto DestinationBuffer.
[in]SourceSizeThe number of bytes of SourceBuffer to append.
Return values
NULLA memory allocation failed.
NULLA parameter was invalid.
Returns
A pointer to (*DestinationBuffer).

Definition at line 3644 of file UefiHandleParsingLib.c.

◆ BusSpecificDriverOverrideProtocolDumpInformation()

CHAR16 *EFIAPI BusSpecificDriverOverrideProtocolDumpInformation ( IN CONST EFI_HANDLE  TheHandle,
IN CONST BOOLEAN  Verbose 
)

Function to dump information about BusSpecificDriverOverride protocol.

This will allocate the return buffer from boot services pool.

Parameters
[in]TheHandleThe handle that has the protocol installed.
[in]VerboseTRUE for additional information, FALSE otherwise.
Return values
Apointer to a string containing the information.

Definition at line 1024 of file UefiHandleParsingLib.c.

◆ ConvertDevicePathToShortText()

CHAR16 * ConvertDevicePathToShortText ( IN CONST EFI_DEVICE_PATH_PROTOCOL DevPath,
IN CONST BOOLEAN  Verbose,
IN CONST UINTN  Length 
)

Function to convert device path to string.

This will allocate the return buffer from boot services pool.

Parameters
[in]DevPathPointer to device path instance.
[in]VerboseTRUE for additional information, FALSE otherwise.
[in]LengthMaximum allowed text length of the device path.
Return values
Apointer to a string containing the information.

Definition at line 898 of file UefiHandleParsingLib.c.

◆ ConvertHandleIndexToHandle()

EFI_HANDLE EFIAPI ConvertHandleIndexToHandle ( IN CONST UINTN  TheIndex)

Function to retrieve the EFI_HANDLE from the human-friendly index.

Parameters
[in]TheIndexThe index to retrieve the EFI_HANDLE for.
Return values
NULLThe index was invalid.
Returns
The EFI_HANDLE that index represents.

Definition at line 3096 of file UefiHandleParsingLib.c.

◆ ConvertHandleToHandleIndex()

UINTN EFIAPI ConvertHandleToHandleIndex ( IN CONST EFI_HANDLE  TheHandle)

Function to retrieve the human-friendly index of a given handle. If the handle does not have a index one will be automatically assigned. The index value is valid until the termination of the shell application.

Parameters
[in]TheHandleThe handle to retrieve an index for.
Return values
0A memory allocation failed.
Returns
The index of the handle.

Definition at line 3023 of file UefiHandleParsingLib.c.

◆ ConvertMemoryType()

CHAR16 * ConvertMemoryType ( IN CONST EFI_MEMORY_TYPE  Memory)

Function to translate the EFI_MEMORY_TYPE into a string.

Parameters
[in]MemoryThe memory type.
Return values
Astring representation of the type allocated from BS Pool.

Definition at line 93 of file UefiHandleParsingLib.c.

◆ ConvertPixelFormat()

CHAR16 * ConvertPixelFormat ( IN CONST EFI_GRAPHICS_PIXEL_FORMAT  Fmt)

Function to translate the EFI_GRAPHICS_PIXEL_FORMAT into a string.

Parameters
[in]FmtThe format type.
Return values
Astring representation of the type allocated from BS Pool.

Definition at line 146 of file UefiHandleParsingLib.c.

◆ DebugSupportProtocolDumpInformation()

CHAR16 *EFIAPI DebugSupportProtocolDumpInformation ( IN CONST EFI_HANDLE  TheHandle,
IN CONST BOOLEAN  Verbose 
)

Function to dump information about DebugSupport Protocol.

Parameters
[in]TheHandleThe handle that has the protocol installed.
[in]VerboseTRUE for additional information, FALSE otherwise.
Return values
Apointer to a string containing the information.

Definition at line 1189 of file UefiHandleParsingLib.c.

◆ DevicePathProtocolDumpInformation()

CHAR16 *EFIAPI DevicePathProtocolDumpInformation ( IN CONST EFI_HANDLE  TheHandle,
IN CONST BOOLEAN  Verbose 
)

Function to dump information about DevicePath protocol.

This will allocate the return buffer from boot services pool.

Parameters
[in]TheHandleThe handle that has the protocol installed.
[in]VerboseTRUE for additional information, FALSE otherwise.
Return values
Apointer to a string containing the information.

Definition at line 984 of file UefiHandleParsingLib.c.

◆ DevicePathProtocolDumpInformationEx()

STATIC CHAR16 *EFIAPI DevicePathProtocolDumpInformationEx ( IN CONST EFI_HANDLE  TheHandle,
IN CONST BOOLEAN  Verbose,
IN EFI_GUID Protocol 
)

Function to dump protocol information.

This will allocate the return buffer from boot services pool.

Parameters
[in]TheHandleThe handle that has the protocol installed.
[in]VerboseTRUE for additional information, FALSE otherwise.
[in]ProtocolThe protocol is needed to dump.
Return values
Apointer to a string containing the information.

Definition at line 937 of file UefiHandleParsingLib.c.

◆ DriverEfiVersionProtocolDumpInformation()

CHAR16 *EFIAPI DriverEfiVersionProtocolDumpInformation ( IN CONST EFI_HANDLE  TheHandle,
IN CONST BOOLEAN  Verbose 
)

Function to dump information about EfiDriverSupportedEfiVersion protocol.

This will allocate the return buffer from boot services pool.

Parameters
[in]TheHandleThe handle that has the protocol installed.
[in]VerboseTRUE for additional information, FALSE otherwise.
Return values
Apoitner to a string containing the information.

Definition at line 861 of file UefiHandleParsingLib.c.

◆ EdidActiveProtocolDumpInformation()

CHAR16 *EFIAPI EdidActiveProtocolDumpInformation ( IN CONST EFI_HANDLE  TheHandle,
IN CONST BOOLEAN  Verbose 
)

Function to dump information about EDID Active Protocol.

This will allocate the return buffer from boot services pool.

Parameters
[in]TheHandleThe handle that has LoadedImage installed.
[in]VerboseTRUE for additional information, FALSE otherwise.
Return values
Apointer to a string containing the information.

Definition at line 557 of file UefiHandleParsingLib.c.

◆ EdidDiscoveredProtocolDumpInformation()

CHAR16 *EFIAPI EdidDiscoveredProtocolDumpInformation ( IN CONST EFI_HANDLE  TheHandle,
IN CONST BOOLEAN  Verbose 
)

Function to dump information about EDID Discovered Protocol.

This will allocate the return buffer from boot services pool.

Parameters
[in]TheHandleThe handle that has LoadedImage installed.
[in]VerboseTRUE for additional information, FALSE otherwise.
Return values
Apointer to a string containing the information.

Definition at line 488 of file UefiHandleParsingLib.c.

◆ FindLoadedImageFileName()

CHAR16 * FindLoadedImageFileName ( IN EFI_LOADED_IMAGE_PROTOCOL LoadedImage)

Function to find the file name associated with a LoadedImageProtocol.

Parameters
[in]LoadedImageAn instance of LoadedImageProtocol.
Return values
Astring representation of the file name associated with LoadedImage, or NULL if no name can be found.

Definition at line 35 of file UefiHandleParsingLib.c.

◆ FirmwareManagementDumpInformation()

CHAR16 *EFIAPI FirmwareManagementDumpInformation ( IN CONST EFI_HANDLE  TheHandle,
IN CONST BOOLEAN  Verbose 
)

Function to dump information about EFI_FIRMWARE_MANAGEMENT_PROTOCOL Protocol.

Parameters
[in]TheHandleThe handle that has the protocol installed.
[in]VerboseTRUE for additional information, FALSE otherwise.
Return values
Apointer to a string containing the information.

Definition at line 1652 of file UefiHandleParsingLib.c.

◆ GetAllMappingGuids()

EFI_STATUS EFIAPI GetAllMappingGuids ( OUT EFI_GUID Guids,
IN OUT UINTN Count 
)

Return all supported GUIDs.

Parameters
[out]GuidsThe buffer to return all supported GUIDs.
[in,out]CountOn input, the count of GUIDs the buffer can hold, On output, the count of GUIDs to return.
Return values
EFI_INVALID_PARAMETERCount is NULL.
EFI_BUFFER_TOO_SMALLBuffer is not enough to hold all GUIDs.
EFI_SUCCESSGUIDs are returned successfully.

Definition at line 3913 of file UefiHandleParsingLib.c.

◆ GetBestLanguageForDriver()

CHAR8 *EFIAPI GetBestLanguageForDriver ( IN CONST CHAR8 *  SupportedLanguages,
IN CONST CHAR8 *  InputLanguage,
IN BOOLEAN  Iso639Language 
)

Get best support language for this driver.

First base on the user input language to search, second base on the current platform used language to search, third get the first language from the support language list. The caller need to free the buffer of the best language.

Parameters
[in]SupportedLanguagesThe support languages for this driver.
[in]InputLanguageThe user input language.
[in]Iso639LanguageWhether get language for ISO639.
Returns
The best support language for this driver.

Definition at line 2860 of file UefiHandleParsingLib.c.

◆ GetGuidFromStringName()

EFI_STATUS EFIAPI GetGuidFromStringName ( IN CONST CHAR16 *  Name,
IN CONST CHAR8 *Lang  OPTIONAL,
OUT EFI_GUID **  Guid 
)

Function to get the Guid for a protocol or struct based on it's string name.

do not modify the returned Guid.

Parameters
[in]NameThe pointer to the string name.
[in]LangThe pointer to the language code.
[out]GuidThe pointer to the Guid.
Return values
EFI_SUCCESSThe operation was successful.

Definition at line 2785 of file UefiHandleParsingLib.c.

◆ GetHandleListByProtocol()

EFI_HANDLE *EFIAPI GetHandleListByProtocol ( IN CONST EFI_GUID *ProtocolGuid  OPTIONAL)

Function to get all handles that support a given protocol or all handles.

Parameters
[in]ProtocolGuidThe guid of the protocol to get handles for. If NULL then the function will return all handles.
Return values
NULLA memory allocation failed.
Returns
A NULL terminated list of handles.

Definition at line 3775 of file UefiHandleParsingLib.c.

◆ GetHandleListByProtocolList()

EFI_HANDLE *EFIAPI GetHandleListByProtocolList ( IN CONST EFI_GUID **  ProtocolGuids)

Function to get all handles that support some protocols.

Parameters
[in]ProtocolGuidsA NULL terminated list of protocol GUIDs.
Return values
NULLA memory allocation failed.
NULLProtocolGuids was NULL.
Returns
A NULL terminated list of EFI_HANDLEs.

Definition at line 3835 of file UefiHandleParsingLib.c.

◆ GetProtocolInformationDump()

CHAR16 *EFIAPI GetProtocolInformationDump ( IN CONST EFI_HANDLE  TheHandle,
IN CONST EFI_GUID Guid,
IN CONST BOOLEAN  Verbose 
)

Function to dump protocol information from a handle.

This function will return a allocated string buffer containing the information. The caller is responsible for freeing the memory.

If Guid is NULL, ASSERT(). If TheHandle is NULL, ASSERT().

Parameters
[in]TheHandleThe handle to dump information from.
[in]GuidThe GUID of the protocol to dump.
[in]VerboseTRUE for extra info. FALSE otherwise.
Returns
The pointer to string.
Return values
NULLAn error was encountered.

Definition at line 2749 of file UefiHandleParsingLib.c.

◆ GetStringNameFromGuid()

CHAR16 *EFIAPI GetStringNameFromGuid ( IN CONST EFI_GUID Guid,
IN CONST CHAR8 *Lang  OPTIONAL 
)

Function to get the name of a protocol or struct from it's GUID.

if Guid is NULL, then ASSERT.

Parameters
[in]GuidThe GUID to look for the name of.
[in]LangThe language to use.
Returns
pointer to string of the name. The caller is responsible to free this memory.

Definition at line 2714 of file UefiHandleParsingLib.c.

◆ GetStringNameFromHandle()

CONST CHAR16 *EFIAPI GetStringNameFromHandle ( IN CONST EFI_HANDLE  TheHandle,
IN CONST CHAR8 *  Language 
)

Function to retrieve the driver name (if possible) from the ComponentName or ComponentName2 protocol

Parameters
[in]TheHandleThe driver handle to get the name of.
[in]LanguageThe language to use.
Return values
NULLThe name could not be found.
Returns
A pointer to the string name. Do not de-allocate the memory.

Definition at line 2899 of file UefiHandleParsingLib.c.

◆ GraphicsOutputProtocolDumpInformation()

CHAR16 *EFIAPI GraphicsOutputProtocolDumpInformation ( IN CONST EFI_HANDLE  TheHandle,
IN CONST BOOLEAN  Verbose 
)

Function to dump information about GOP.

This will allocate the return buffer from boot services pool.

Parameters
[in]TheHandleThe handle that has LoadedImage installed.
[in]VerboseTRUE for additional information, FALSE otherwise.
Return values
Apoitner to a string containing the information.

Definition at line 355 of file UefiHandleParsingLib.c.

◆ HandleParsingHiiInit()

VOID HandleParsingHiiInit ( VOID  )

Initialization function for HII packages.

Definition at line 200 of file UefiHandleParsingLib.c.

◆ HandleParsingLibConstructor()

EFI_STATUS EFIAPI HandleParsingLibConstructor ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Constructor for the library.

Parameters
[in]ImageHandleIgnored.
[in]SystemTableIgnored.
Return values
EFI_SUCCESSThe operation was successful.

Definition at line 181 of file UefiHandleParsingLib.c.

◆ HandleParsingLibDestructor()

EFI_STATUS EFIAPI HandleParsingLibDestructor ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Destructor for the library. free any resources.

Parameters
[in]ImageHandleIgnored.
[in]SystemTableIgnored.
Return values
EFI_SUCCESSThe operation was successful.

Definition at line 220 of file UefiHandleParsingLib.c.

◆ InsertNewGuidNameMapping()

EFI_STATUS InsertNewGuidNameMapping ( IN CONST EFI_GUID Guid,
IN CONST EFI_STRING_ID  NameID,
IN CONST DUMP_PROTOCOL_INFO DumpFunc  OPTIONAL 
)

Function to add a new GUID/Name mapping.

Parameters
[in]GuidThe Guid
[in]NameIDThe STRING id of the HII string to use
[in]DumpFuncThe pointer to the dump function
Return values
EFI_SUCCESSThe operation was successful
EFI_OUT_OF_RESOURCESA memory allocation failed
EFI_INVALID_PARAMETERGuid NameId was invalid

Definition at line 2627 of file UefiHandleParsingLib.c.

◆ InternalShellGetNodeFromGuid()

CONST GUID_INFO_BLOCK * InternalShellGetNodeFromGuid ( IN CONST EFI_GUID Guid)

Function to get the node for a protocol or struct from it's GUID.

if Guid is NULL, then ASSERT.

Parameters
[in]GuidThe GUID to look for the name of.
Returns
The node.

Definition at line 2582 of file UefiHandleParsingLib.c.

◆ InternalShellInitHandleList()

EFI_STATUS InternalShellInitHandleList ( VOID  )

Function to initialize the file global mHandleList object for use in vonverting handles to index and index to handle.

Return values
EFI_SUCCESSThe operation was successful.

Definition at line 2970 of file UefiHandleParsingLib.c.

◆ LoadedImageDevicePathProtocolDumpInformation()

CHAR16 *EFIAPI LoadedImageDevicePathProtocolDumpInformation ( IN CONST EFI_HANDLE  TheHandle,
IN CONST BOOLEAN  Verbose 
)

Function to dump information about LoadedImageDevicePath protocol.

This will allocate the return buffer from boot services pool.

Parameters
[in]TheHandleThe handle that has the protocol installed.
[in]VerboseTRUE for additional information, FALSE otherwise.
Return values
Apointer to a string containing the information.

Definition at line 1004 of file UefiHandleParsingLib.c.

◆ LoadedImageProtocolDumpInformation()

CHAR16 *EFIAPI LoadedImageProtocolDumpInformation ( IN CONST EFI_HANDLE  TheHandle,
IN CONST BOOLEAN  Verbose 
)

Function to dump information about LoadedImage.

This will allocate the return buffer from boot services pool.

Parameters
[in]TheHandleThe handle that has LoadedImage installed.
[in]VerboseTRUE for additional information, FALSE otherwise.
Return values
Apoitner to a string containing the information.

Definition at line 251 of file UefiHandleParsingLib.c.

◆ ParseHandleDatabaseByRelationship()

EFI_STATUS EFIAPI ParseHandleDatabaseByRelationship ( IN CONST EFI_HANDLE DriverBindingHandle  OPTIONAL,
IN CONST EFI_HANDLE ControllerHandle  OPTIONAL,
IN CONST UINTN  Mask,
IN UINTN MatchingHandleCount,
OUT EFI_HANDLE **MatchingHandleBuffer  OPTIONAL 
)

Gets all the related EFI_HANDLEs based on the single EFI_HANDLE and the mask supplied.

This function will scan all EFI_HANDLES in the UEFI environment's handle database and return all the ones with the specified relationship (Mask) to the specified controller handle.

If both DriverBindingHandle and ControllerHandle are NULL, then ASSERT. If MatchingHandleCount is NULL, then ASSERT.

If MatchingHandleBuffer is not NULL upon a successful return the memory must be caller freed.

Parameters
[in]DriverBindingHandleHandle to a object with Driver Binding protocol on it.
[in]ControllerHandleHandle to a device with Device Path protocol on it.
[in]MaskMask of what relationship(s) is desired.
[in]MatchingHandleCountPoitner to UINTN specifying number of HANDLES in MatchingHandleBuffer.
[out]MatchingHandleBufferOn a successful return a buffer of MatchingHandleCount EFI_HANDLEs and a terminating NULL EFI_HANDLE.
Return values
EFI_SUCCESSThe operation was successful and any related handles are in MatchingHandleBuffer;
EFI_NOT_FOUNDNo matching handles were found.
EFI_INVALID_PARAMETERA parameter was invalid or out of range.

Definition at line 3412 of file UefiHandleParsingLib.c.

◆ ParseHandleDatabaseByRelationshipWithType()

EFI_STATUS EFIAPI ParseHandleDatabaseByRelationshipWithType ( IN CONST EFI_HANDLE DriverBindingHandle  OPTIONAL,
IN CONST EFI_HANDLE ControllerHandle  OPTIONAL,
IN UINTN HandleCount,
OUT EFI_HANDLE **  HandleBuffer,
OUT UINTN **  HandleType 
)

Gets all the related EFI_HANDLEs based on the mask supplied.

This function scans all EFI_HANDLES in the UEFI environment's handle database and returns the ones with the specified relationship (Mask) to the specified controller handle.

If both DriverBindingHandle and ControllerHandle are NULL, then ASSERT. If MatchingHandleCount is NULL, then ASSERT.

If MatchingHandleBuffer is not NULL upon a successful return the memory must be caller freed.

Parameters
[in]DriverBindingHandleThe handle with Driver Binding protocol on it.
[in]ControllerHandleThe handle with Device Path protocol on it.
[in]MatchingHandleCountThe pointer to UINTN that specifies the number of HANDLES in MatchingHandleBuffer.
[out]MatchingHandleBufferOn a successful return, a buffer of MatchingHandleCount EFI_HANDLEs with a terminating NULL EFI_HANDLE.
[out]HandleTypeAn array of type information.
Return values
EFI_SUCCESSThe operation was successful, and any related handles are in MatchingHandleBuffer.
EFI_NOT_FOUNDNo matching handles were found.
EFI_INVALID_PARAMETERA parameter was invalid or out of range.

Definition at line 3165 of file UefiHandleParsingLib.c.

◆ ParseHandleDatabaseForChildControllers()

EFI_STATUS EFIAPI ParseHandleDatabaseForChildControllers ( IN CONST EFI_HANDLE  ControllerHandle,
OUT UINTN MatchingHandleCount,
OUT EFI_HANDLE **MatchingHandleBuffer  OPTIONAL 
)

Gets handles for any child controllers of the passed in controller.

Parameters
[in]ControllerHandleThe handle of the "parent controller"
[out]MatchingHandleCountPointer to the number of handles in MatchingHandleBuffer on return.
[out]MatchingHandleBufferBuffer containing handles on a successful return.
Return values
EFI_SUCCESSThe operation was successful.

Definition at line 3535 of file UefiHandleParsingLib.c.

◆ ParseHandleDatabaseForChildDevices()

EFI_STATUS EFIAPI ParseHandleDatabaseForChildDevices ( IN CONST EFI_HANDLE  DriverHandle,
IN UINTN MatchingHandleCount,
OUT EFI_HANDLE **MatchingHandleBuffer  OPTIONAL 
)

Gets handles for any child devices produced by the passed in driver.

Parameters
[in]DriverHandleThe handle of the driver.
[in]MatchingHandleCountPointer to the number of handles in MatchingHandleBuffer on return.
[out]MatchingHandleBufferBuffer containing handles on a successful return.
Return values
EFI_SUCCESSThe operation was successful.
See also
ParseHandleDatabaseByRelationship

Definition at line 3699 of file UefiHandleParsingLib.c.

◆ PartitionInfoProtocolDumpInformation()

CHAR16 *EFIAPI PartitionInfoProtocolDumpInformation ( IN CONST EFI_HANDLE  TheHandle,
IN CONST BOOLEAN  Verbose 
)

Function to dump information about Partition Information protocol.

This will allocate the return buffer from boot services pool.

Parameters
[in]TheHandleThe handle that has the protocol installed.
[in]VerboseTRUE for additional information, FALSE otherwise.
Return values
Apointer to a string containing the information.

Definition at line 2099 of file UefiHandleParsingLib.c.

◆ PciIoProtocolDumpInformation()

CHAR16 *EFIAPI PciIoProtocolDumpInformation ( IN CONST EFI_HANDLE  TheHandle,
IN CONST BOOLEAN  Verbose 
)

Function to dump information about PciIoProtocol.

This will allocate the return buffer from boot services pool.

Parameters
[in]TheHandleThe handle that has PciRootBridgeIo installed.
[in]VerboseTRUE for additional information, FALSE otherwise.
Return values
Apoitner to a string containing the information.

Definition at line 1259 of file UefiHandleParsingLib.c.

◆ PciRootBridgeIoDumpInformation()

CHAR16 *EFIAPI PciRootBridgeIoDumpInformation ( IN CONST EFI_HANDLE  TheHandle,
IN CONST BOOLEAN  Verbose 
)

Function to dump information about PciRootBridgeIo.

This will allocate the return buffer from boot services pool.

Parameters
[in]TheHandleThe handle that has PciRootBridgeIo installed.
[in]VerboseTRUE for additional information, FALSE otherwise.
Return values
Apoitner to a string containing the information.

Definition at line 626 of file UefiHandleParsingLib.c.

◆ TxtOutProtocolDumpInformation()

CHAR16 *EFIAPI TxtOutProtocolDumpInformation ( IN CONST EFI_HANDLE  TheHandle,
IN CONST BOOLEAN  Verbose 
)

Function to dump information about SimpleTextOut.

This will allocate the return buffer from boot services pool.

Parameters
[in]TheHandleThe handle that has SimpleTextOut installed.
[in]VerboseTRUE for additional information, FALSE otherwise.
Return values
Apoitner to a string containing the information.

Definition at line 775 of file UefiHandleParsingLib.c.

◆ UsbIoProtocolDumpInformation()

CHAR16 *EFIAPI UsbIoProtocolDumpInformation ( IN CONST EFI_HANDLE  TheHandle,
IN CONST BOOLEAN  Verbose 
)

Function to dump information about UsbIoProtocol.

This will allocate the return buffer from boot services pool.

Parameters
[in]TheHandleThe handle that has PciRootBridgeIo installed.
[in]VerboseTRUE for additional information, FALSE otherwise.
Return values
Apoitner to a string containing the information.

Definition at line 1352 of file UefiHandleParsingLib.c.

Variable Documentation

◆ EfiIsaAcpiProtocolGuid

STATIC CONST EFI_GUID EfiIsaAcpiProtocolGuid = LOCAL_EFI_ISA_ACPI_PROTOCOL_GUID

Definition at line 2203 of file UefiHandleParsingLib.c.

◆ EfiIsaIoProtocolGuid

STATIC CONST EFI_GUID EfiIsaIoProtocolGuid = LOCAL_EFI_ISA_IO_PROTOCOL_GUID

Definition at line 2202 of file UefiHandleParsingLib.c.

◆ mGuidList

GUID_INFO_BLOCK* mGuidList

Definition at line 23 of file UefiHandleParsingLib.c.

◆ mGuidListCount

UINTN mGuidListCount

Definition at line 24 of file UefiHandleParsingLib.c.

◆ mGuidStringList

STATIC CONST GUID_INFO_BLOCK mGuidStringList[]

Definition at line 2212 of file UefiHandleParsingLib.c.

◆ mGuidStringListNT

STATIC CONST GUID_INFO_BLOCK mGuidStringListNT[]
Initial value:
= {
{ STRING_TOKEN (STR_WINNT_THUNK), (EFI_GUID *)&WinNtThunkProtocolGuid, NULL },
{ STRING_TOKEN (STR_WINNT_DRIVER_IO), (EFI_GUID *)&WinNtIoProtocolGuid, NULL },
{ STRING_TOKEN (STR_WINNT_SERIAL_PORT), (EFI_GUID *)&WinNtSerialPortGuid, NULL },
{ 0, NULL, NULL },
}
#define NULL
Definition: Base.h:319
#define STRING_TOKEN(t)
Definition: Base.h:213

Definition at line 2205 of file UefiHandleParsingLib.c.

◆ mHandleList

HANDLE_INDEX_LIST mHandleList
Initial value:
= {
{
{ NULL, NULL }, 0, 0
}, 0
}

Definition at line 18 of file UefiHandleParsingLib.c.

◆ mHandleParsingHiiHandle

EFI_HII_HANDLE mHandleParsingHiiHandle = NULL

Definition at line 17 of file UefiHandleParsingLib.c.

◆ VersionStringSize

STATIC CONST UINTN VersionStringSize = 60

Definition at line 847 of file UefiHandleParsingLib.c.

◆ WinNtIoProtocolGuid

STATIC CONST EFI_GUID WinNtIoProtocolGuid = LOCAL_EFI_WIN_NT_BUS_DRIVER_IO_PROTOCOL_GUID

Definition at line 2188 of file UefiHandleParsingLib.c.

◆ WinNtSerialPortGuid

STATIC CONST EFI_GUID WinNtSerialPortGuid = LOCAL_EFI_WIN_NT_SERIAL_PORT_GUID

Definition at line 2189 of file UefiHandleParsingLib.c.

◆ WinNtThunkProtocolGuid

STATIC CONST EFI_GUID WinNtThunkProtocolGuid = LOCAL_EFI_WIN_NT_THUNK_PROTOCOL_GUID

Definition at line 2187 of file UefiHandleParsingLib.c.