4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Provides interface to advanced shell functionality for parsing both handle and protocol database.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This program and the accompanying materials
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync are licensed and made available under the terms and conditions of the BSD License
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync which accompanies this distribution. The full text of the license may be found at
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Function to get the name of a protocol or struct from it's GUID.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Guid is NULL, then ASSERT.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] Guid The GUID to look for the name of.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] Lang The language to use.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The pointer to a string of the name. The caller
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync is responsible to free this memory.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Function to get the Guid for a protocol or struct based on it's string name.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] Name The pointer to the string name.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] Lang The pointer to the language code (string).
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] Guid The pointer to the pointer to the Guid.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS The operation was successful.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Function to dump protocol information from a handle.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This function will return a allocated string buffer containing the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync information. The caller is responsible for freeing the memory.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Guid is NULL, ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If TheHandle is NULL, ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] TheHandle The handle to dump information from.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] Guid The GUID of the protocol to dump.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] Verbose TRUE for extra info. FALSE otherwise.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The pointer to string.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval NULL An error was encountered.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Function to retrieve the driver name (if possible) from the ComponentName or
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ComponentName2 protocol.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync The string returned must be callee freed.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] TheHandle The driver handle to get the name of.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] Language The language to use.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval NULL The name could not be found.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return A pointer to the string name. Do not de-allocate the memory.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#define HR_DRIVER_BINDING_HANDLE BIT2 // has driver binding
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#define HR_DEVICE_DRIVER BIT3 // device driver (hybrid?)
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#define HR_BUS_DRIVER BIT4 // a bus driver (hybrid?)
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#define HR_VALID_MASK (BIT1|BIT2|BIT3|BIT4|BIT5|BIT6|BIT7|BIT8|BIT9|BIT10|BIT11)
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Gets all the related EFI_HANDLEs based on the mask supplied.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This function will scan all EFI_HANDLES in the UEFI environment's handle database
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync and return all the ones with the specified relationship (Mask) to the specified
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync controller handle.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If both DriverBindingHandle and ControllerHandle are NULL, then ASSERT.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If MatchingHandleCount is NULL, then ASSERT.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If MatchingHandleBuffer is not NULL upon a successful return, the memory must be
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync caller freed.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] DriverBindingHandle The handle with Driver Binding protocol on it.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] ControllerHandle The handle with Device Path protocol on it.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] Mask The mask of what relationship(s) is desired.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] MatchingHandleCount The pointer to UINTN specifying number of HANDLES in
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync MatchingHandleBuffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[out] MatchingHandleBuffer On a successful return, a buffer of MatchingHandleCount
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EFI_HANDLEs with a terminating NULL EFI_HANDLE.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS The operation was successful, and any related handles
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync are in MatchingHandleBuffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_NOT_FOUND No matching handles were found.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_INVALID_PARAMETER A parameter was invalid or out of range.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @sa ParseHandleDatabaseByRelationshipWithType
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Gets all the related EFI_HANDLEs based on the mask supplied.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This function scans all EFI_HANDLES in the UEFI environment's handle database
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync and returns the ones with the specified relationship (Mask) to the specified
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync controller handle.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If both DriverBindingHandle and ControllerHandle are NULL, then ASSERT.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If MatchingHandleCount is NULL, then ASSERT.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If MatchingHandleBuffer is not NULL upon a successful return the memory must be
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync caller freed.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] DriverBindingHandle The handle with Driver Binding protocol on it.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] ControllerHandle The handle with Device Path protocol on it.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] MatchingHandleCount The pointer to UINTN that specifies the number of HANDLES in
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync MatchingHandleBuffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[out] MatchingHandleBuffer On a successful return, a buffer of MatchingHandleCount
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EFI_HANDLEs with a terminating NULL EFI_HANDLE.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[out] HandleType An array of type information.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS The operation was successful, and any related handles
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync are in MatchingHandleBuffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_NOT_FOUND No matching handles were found.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_INVALID_PARAMETER A parameter was invalid or out of range.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Gets handles for any parents of the passed in controller.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] ControllerHandle The handle of the controller.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] Count The pointer to the number of handles in
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync MatchingHandleBuffer on return.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[out] Buffer The buffer containing handles on a successful
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS The operation was successful.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @sa ParseHandleDatabaseByRelationship
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#define PARSE_HANDLE_DATABASE_PARENTS(ControllerHandle, Count, Buffer) \
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ParseHandleDatabaseByRelationship(NULL, ControllerHandle, HR_PARENT_HANDLE, Count, Buffer)
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Gets handles for any UEFI drivers of the passed in controller.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] ControllerHandle The handle of the controller.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] Count The pointer to the number of handles in
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync MatchingHandleBuffer on return.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[out] Buffer The buffer containing handles on a successful
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS The operation was successful.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @sa ParseHandleDatabaseByRelationship
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#define PARSE_HANDLE_DATABASE_UEFI_DRIVERS(ControllerHandle, Count, Buffer) \
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ParseHandleDatabaseByRelationship(NULL, ControllerHandle, HR_DRIVER_BINDING_HANDLE|HR_DEVICE_DRIVER, Count, Buffer)
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Gets handles for any children of the passed in controller by the passed in driver handle.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] DriverHandle The handle of the driver.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] ControllerHandle The handle of the controller.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] Count The pointer to the number of handles in
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync MatchingHandleBuffer on return.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[out] Buffer The buffer containing handles on a successful
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS The operation was successful.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @sa ParseHandleDatabaseByRelationship
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#define PARSE_HANDLE_DATABASE_MANAGED_CHILDREN(DriverHandle, ControllerHandle, Count, Buffer) \
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ParseHandleDatabaseByRelationship(DriverHandle, ControllerHandle, HR_CHILD_HANDLE|HR_DEVICE_HANDLE, Count, Buffer)
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Gets handles for any devices managed by the passed in driver.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] DriverHandle The handle of the driver.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] Count The pointer to the number of handles in
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync MatchingHandleBuffer on return.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[out] Buffer The buffer containing handles on a successful
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS The operation was successful.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @sa ParseHandleDatabaseByRelationship
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#define PARSE_HANDLE_DATABASE_DEVICES(DriverHandle, Count, Buffer) \
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ParseHandleDatabaseByRelationship(DriverHandle, NULL, HR_CONTROLLER_HANDLE|HR_DEVICE_HANDLE, Count, Buffer)
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Gets handles for any child devices produced by the passed in driver.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] DriverHandle The handle of the driver.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] MatchingHandleCount The pointer to the number of handles in
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync MatchingHandleBuffer on return.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[out] MatchingHandleBuffer The buffer containing handles on a successful
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS The operation was successful.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @sa ParseHandleDatabaseByRelationship
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Gets handles for any child controllers of the passed in controller.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] ControllerHandle The handle of the "parent controller".
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] MatchingHandleCount The pointer to the number of handles in
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync MatchingHandleBuffer on return.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[out] MatchingHandleBuffer The buffer containing handles on a successful
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS The operation was successful.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @sa ParseHandleDatabaseByRelationship
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Function to retrieve the human-friendly index of a given handle. If the handle
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync does not have a index one will be automatically assigned. The index value is valid
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync until the termination of the shell application.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] TheHandle The handle to retrieve an index for.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval 0 A memory allocation failed.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The index of the handle.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Function to retrieve the EFI_HANDLE from the human-friendly index.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] TheIndex The index to retrieve the EFI_HANDLE for.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval NULL The index was invalid.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return The EFI_HANDLE that index represents.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Function to get all handles that support a given protocol or all handles.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] ProtocolGuid The guid of the protocol to get handles for. If NULL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync then the function will return all handles.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval NULL A memory allocation failed.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return A NULL terminated list of handles.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Function to get all handles that support some protocols.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] ProtocolGuids A NULL terminated list of protocol GUIDs.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval NULL A memory allocation failed.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval NULL ProtocolGuids was NULL.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return A NULL terminated list of EFI_HANDLEs.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#endif // __HANDLE_PARSING_LIB__