/* Build terminal device path according to terminal type. */
EFI_STATUS SetTerminalDevicePath(IN TERMINAL_TYPE TerminalType, IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath, OUT EFI_DEVICE_PATH_PROTOCOL **TerminalDevicePath)
/* Build terminal device path according to terminal type. */
EFI_STATUS SetTerminalDevicePath(IN TERMINAL_TYPE TerminalType, IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath, OUT EFI_DEVICE_PATH_PROTOCOL **TerminalDevicePath)
{
  VENDOR_DEVICE_PATH  Node;
  ASSERT (TerminalType < ARRAY_SIZE (mTerminalType));
  Node.Header.Type    = MESSAGING_DEVICE_PATH;
  Node.Header.SubType = MSG_VENDOR_DP;
  SetDevicePathNodeLength (&Node.Header, sizeof (VENDOR_DEVICE_PATH));
  CopyGuid (&Node.Guid, mTerminalType[TerminalType]);
  *TerminalDevicePath = AppendDevicePathNode (
                          ParentDevicePath,
                          (EFI_DEVICE_PATH_PROTOCOL *)&Node
                          );
  if (*TerminalDevicePath == NULL) {
    return EFI_OUT_OF_RESOURCES;
  }
  return EFI_SUCCESS;
}