\r
#include "DevicePath.h"\r
\r
-/**\r
- Adjusts the size of a previously allocated buffer.\r
-\r
- @param OldPool A pointer to the buffer whose size is being adjusted.\r
- @param OldSize The size of the current buffer.\r
- @param NewSize The size of the new buffer.\r
-\r
- @return A pointer to the new buffer or NULL if allocation fails.\r
-\r
-**/\r
-VOID *\r
-ReallocatePool (\r
- IN VOID *OldPool,\r
- IN UINTN OldSize,\r
- IN UINTN NewSize\r
- )\r
-{\r
- VOID *NewPool;\r
-\r
- NewPool = NULL;\r
- if (NewSize != 0) {\r
- NewPool = AllocateZeroPool (NewSize);\r
- }\r
-\r
- if (OldPool != NULL) {\r
- if (NewPool != NULL) {\r
- CopyMem (NewPool, OldPool, OldSize < NewSize ? OldSize : NewSize);\r
- }\r
-\r
- FreePool (OldPool);\r
- }\r
-\r
- return NewPool;\r
-}\r
-\r
/**\r
Concatenates a formatted unicode string to allocated pool. The caller must\r
free the resulting buffer.\r
Size = StrSize (AppendStr) - sizeof (UINT16);\r
Size = Size + StrSize (Str->Str);\r
Str->Str = ReallocatePool (\r
- Str->Str,\r
- StrSize (Str->Str),\r
- Size\r
- );\r
+ StrSize (Str->Str),\r
+ Size,\r
+ Str->Str\r
+ );\r
ASSERT (Str->Str != NULL);\r
}\r
\r
}\r
\r
/**\r
- Converts a PCI device path structure to its string representive.\r
+ Converts a PCI device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts a PC Card device path structure to its string representive.\r
+ Converts a PC Card device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts a Memory Map device path structure to its string representive.\r
+ Converts a Memory Map device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts a Vendor device path structure to its string representive.\r
+ Converts a Vendor device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
} else if (CompareGuid (&Vendor->Guid, &gEfiVTUTF8Guid)) {\r
CatPrint (Str, L"VenUft8()");\r
return ;\r
- } else if (CompareGuid (&Vendor->Guid, &mEfiDevicePathMessagingUartFlowControlGuid)) {\r
+ } else if (CompareGuid (&Vendor->Guid, &gEfiUartDevicePathGuid)) {\r
FlowControlMap = (((UART_FLOW_CONTROL_DEVICE_PATH *) Vendor)->FlowControlMap);\r
switch (FlowControlMap & 0x00000003) {\r
case 0:\r
}\r
\r
return ;\r
- } else if (CompareGuid (&Vendor->Guid, &mEfiDevicePathMessagingSASGuid)) {\r
+ } else if (CompareGuid (&Vendor->Guid, &gEfiSasDevicePathGuid)) {\r
CatPrint (\r
Str,\r
L"SAS(0x%lx,0x%lx,0x%x,",\r
}\r
\r
/**\r
- Converts a Controller device path structure to its string representive.\r
+ Converts a Controller device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts a ACPI device path structure to its string representive.\r
+ Converts a ACPI device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts a ACPI extended HID device path structure to its string representive.\r
+ Converts a ACPI extended HID device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts a ACPI address device path structure to its string representive.\r
+ Converts a ACPI address device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts a ATAPI device path structure to its string representive.\r
+ Converts a ATAPI device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts a SCSI device path structure to its string representive.\r
+ Converts a SCSI device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts a Fibre device path structure to its string representive.\r
+ Converts a Fibre device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts a 1394 device path structure to its string representive.\r
+ Converts a 1394 device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts a USB device path structure to its string representive.\r
+ Converts a USB device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts a USB WWID device path structure to its string representive.\r
+ Converts a USB WWID device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
// In case no NULL terminator in SerialNumber, create a new one with NULL terminator\r
//\r
NewStr = AllocateCopyPool ((Length + 1) * sizeof (CHAR16), SerialNumberStr);\r
+ ASSERT (NewStr != NULL);\r
NewStr [Length] = 0;\r
SerialNumberStr = NewStr;\r
}\r
}\r
\r
/**\r
- Converts a Logic Unit device path structure to its string representive.\r
+ Converts a Logic Unit device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts a USB class device path structure to its string representive.\r
+ Converts a USB class device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts a SATA device path structure to its string representive.\r
+ Converts a SATA device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts a I20 device path structure to its string representive.\r
+ Converts a I20 device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts a MAC address device path structure to its string representive.\r
+ Converts a MAC address device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts a IPv4 device path structure to its string representive.\r
+ Converts a IPv4 device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts a IPv6 device path structure to its string representive.\r
+ Converts a IPv6 device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts an Infini Band device path structure to its string representive.\r
+ Converts an Infini Band device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts a UART device path structure to its string representive.\r
+ Converts a UART device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts an iSCSI device path structure to its string representive.\r
+ Converts an iSCSI device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts a Hard drive device path structure to its string representive.\r
+ Converts a Hard drive device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts a CDROM device path structure to its string representive.\r
+ Converts a CDROM device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts a File device path structure to its string representive.\r
+ Converts a File device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts a Media protocol device path structure to its string representive.\r
+ Converts a Media protocol device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts a Firmware Volume device path structure to its string representive.\r
+ Converts a Firmware Volume device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts a Firmware Volume File device path structure to its string representive.\r
+ Converts a Firmware Volume File device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts a BIOS Boot Specification device path structure to its string representive.\r
+ Converts a BIOS Boot Specification device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts an End-of-Device-Path structure to its string representive.\r
+ Converts an End-of-Device-Path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
}\r
\r
/**\r
- Converts an unknown device path structure to its string representive.\r
+ Converts an unknown device path structure to its string representative.\r
\r
- @param Str The string representive of input device.\r
+ @param Str The string representative of input device.\r
@param DevPath The input device path structure.\r
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation\r
of the display node is used, where applicable. If DisplayOnly\r
// Shrink pool used for string allocation\r
//\r
NewSize = (Str.Len + 1) * sizeof (CHAR16);\r
- Str.Str = ReallocatePool (Str.Str, NewSize, NewSize);\r
+ Str.Str = ReallocatePool (NewSize, NewSize, Str.Str);\r
ASSERT (Str.Str != NULL);\r
Str.Str[Str.Len] = 0;\r
return Str.Str;\r
}\r
\r
NewSize = (Str.Len + 1) * sizeof (CHAR16);\r
- Str.Str = ReallocatePool (Str.Str, NewSize, NewSize);\r
+ Str.Str = ReallocatePool (NewSize, NewSize, Str.Str);\r
ASSERT (Str.Str != NULL);\r
Str.Str[Str.Len] = 0;\r
return Str.Str;\r