/* Converts a text device path node to URI device path structure. */
EFI_DEVICE_PATH_PROTOCOL* DevPathFromTextUri(IN CHAR16 *TextDeviceNode)
/* Converts a text device path node to URI device path structure. */
EFI_DEVICE_PATH_PROTOCOL* DevPathFromTextUri(IN CHAR16 *TextDeviceNode)
{
  CHAR16           *UriStr;
  UINTN            UriLength;
  URI_DEVICE_PATH  *Uri;
  UriStr    = GetNextParamStr (&TextDeviceNode);
  UriLength = StrnLenS (UriStr, MAX_UINT16 - sizeof (URI_DEVICE_PATH));
  Uri       = (URI_DEVICE_PATH *)CreateDeviceNode (
                                   MESSAGING_DEVICE_PATH,
                                   MSG_URI_DP,
                                   (UINT16)(sizeof (URI_DEVICE_PATH) + UriLength)
                                   );
  while (UriLength-- != 0) {
    Uri->Uri[UriLength] = (CHAR8)UriStr[UriLength];
  }
  return (EFI_DEVICE_PATH_PROTOCOL *)Uri;
}