/* This function gets the device path associated with a mapping. */
CONST EFI_DEVICE_PATH_PROTOCOL* EFIAPI EfiShellGetDevicePathFromMap(IN CONST CHAR16 *Mapping)
/* This function gets the device path associated with a mapping. */
CONST EFI_DEVICE_PATH_PROTOCOL* EFIAPI EfiShellGetDevicePathFromMap(IN CONST CHAR16 *Mapping)
{
  SHELL_MAP_LIST  *MapListItem;
  CHAR16          *NewName;
  UINTN           Size;
  NewName = NULL;
  Size    = 0;
  StrnCatGrow (&NewName, &Size, Mapping, 0);
  if (Mapping[StrLen (Mapping)-1] != L':') {
    StrnCatGrow (&NewName, &Size, L":", 0);
  }
  MapListItem = ShellCommandFindMapItem (NewName);
  FreePool (NewName);
  if (MapListItem != NULL) {
    return (MapListItem->DevicePath);
  }
  return (NULL);
}