11.3 GetControllerName() Implementations

The GetControllerName() service retrieves the name of a controller a driver is managing or a child the driver has produced. The example below shows an empty implementation of the GetControllerName() service for the Component Name 2 Protocol. The recommended implementation style shown here allows the same GetControllerName() service implementation to be shared between both the Component Name Protocol and the Component Name 2 Protocol.

Example 130-GetControllerName () Service
#include <Uefi.h>
#include <Protocol/ComponentName2.h>

EFI_STATUS
EFIAPI
AbcGetControllerName (
  IN  EFI_COMPONENT_NAME2_PROTOCOL  *This,
  IN  EFI_HANDLE                    ControllerHandle,
  IN  EFI_HANDLE                    ChildHandle,       OPTIONAL
  IN  CHAR8                         *Language,
  OUT CHAR16                        **ControllerName
  )
{
}

The Component Name Protocols are available only for devices currently under a driver's management. Because UEFI supports connecting the minimum number of drivers and devices required to establish console and gain access to the boot device, there may be many unconnected devices for which a name may not be retrieved.