UnicodeSPrint(RetVal, VersionStringSize, L"0x%08x", DriverEfiVersion->FirmwareVersion);\r
return (RetVal);\r
}\r
+/**\r
+ Function to convert device path to string.\r
+\r
+ This will allocate the return buffer from boot services pool.\r
+\r
+ @param[in] DevPath Pointer to device path instance.\r
+ @param[in] Verbose TRUE for additional information, FALSE otherwise.\r
+ @param[in] Length Maximum allowed text length of the device path.\r
+\r
+ @retval A pointer to a string containing the information.\r
+**/\r
+CHAR16*\r
+ConvertDevicePathToShortText(\r
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *DevPath,\r
+ IN CONST BOOLEAN Verbose,\r
+ IN CONST UINTN Length\r
+ )\r
+{\r
+ CHAR16 *Temp;\r
+ CHAR16 *Temp2;\r
+ UINTN Size;\r
+\r
+ //\r
+ // I cannot decide whether to allow shortcuts here (the second BOOLEAN on the next line)\r
+ //\r
+ Temp = ConvertDevicePathToText(DevPath, TRUE, TRUE);\r
+ if (!Verbose && Temp != NULL && StrLen(Temp) > Length) {\r
+ Temp2 = NULL;\r
+ Size = 0;\r
+ Temp2 = StrnCatGrow(&Temp2, &Size, L"..", 0);\r
+ Temp2 = StrnCatGrow(&Temp2, &Size, Temp+(StrLen(Temp) - (Length - 2)), 0);\r
+ FreePool(Temp);\r
+ Temp = Temp2;\r
+ }\r
+ return (Temp);\r
+}\r
\r
/**\r
Function to dump information about DevicePath protocol.\r
@param[in] TheHandle The handle that has the protocol installed.\r
@param[in] Verbose TRUE for additional information, FALSE otherwise.\r
\r
- @retval A poitner to a string containing the information.\r
+ @retval A pointer to a string containing the information.\r
**/\r
CHAR16*\r
EFIAPI\r
{\r
EFI_DEVICE_PATH_PROTOCOL *DevPath;\r
CHAR16 *Temp;\r
- CHAR16 *Temp2;\r
EFI_STATUS Status;\r
- UINTN Size;\r
Temp = NULL;\r
\r
Status = gBS->OpenProtocol(TheHandle, &gEfiDevicePathProtocolGuid, (VOID**)&DevPath, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);\r
if (!EFI_ERROR(Status)) {\r
- //\r
- // I cannot decide whether to allow shortcuts here (the second BOOLEAN on the next line)\r
- //\r
- Temp = ConvertDevicePathToText(DevPath, TRUE, TRUE);\r
+ Temp = ConvertDevicePathToShortText (DevPath, Verbose, 30);\r
gBS->CloseProtocol(TheHandle, &gEfiDevicePathProtocolGuid, gImageHandle, NULL);\r
}\r
- if (!Verbose && Temp != NULL && StrLen(Temp) > 30) {\r
- Temp2 = NULL;\r
- Size = 0;\r
- Temp2 = StrnCatGrow(&Temp2, &Size, L"..", 0);\r
- Temp2 = StrnCatGrow(&Temp2, &Size, Temp+(StrLen(Temp) - 28), 0);\r
- FreePool(Temp);\r
- Temp = Temp2;\r
+ return (Temp);\r
+}\r
+\r
+/**\r
+ Function to dump information about LoadedImageDevicePath protocol.\r
+\r
+ This will allocate the return buffer from boot services pool.\r
+\r
+ @param[in] TheHandle The handle that has the protocol installed.\r
+ @param[in] Verbose TRUE for additional information, FALSE otherwise.\r
+\r
+ @retval A pointer to a string containing the information.\r
+**/\r
+CHAR16*\r
+EFIAPI\r
+LoadedImageDevicePathProtocolDumpInformation(\r
+ IN CONST EFI_HANDLE TheHandle,\r
+ IN CONST BOOLEAN Verbose\r
+ )\r
+{\r
+ EFI_DEVICE_PATH_PROTOCOL *DevPath;\r
+ CHAR16 *Temp;\r
+ EFI_STATUS Status;\r
+ Temp = NULL;\r
+\r
+ Status = gBS->OpenProtocol(TheHandle, &gEfiLoadedImageDevicePathProtocolGuid, (VOID**)&DevPath, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);\r
+ if (!EFI_ERROR(Status)) {\r
+ Temp = ConvertDevicePathToShortText (DevPath, Verbose, 30);\r
+ gBS->CloseProtocol(TheHandle, &gEfiDevicePathProtocolGuid, gImageHandle, NULL);\r
}\r
return (Temp);\r
}\r
STATIC CONST GUID_INFO_BLOCK mGuidStringList[] = {\r
{STRING_TOKEN(STR_LOADED_IMAGE), &gEfiLoadedImageProtocolGuid, LoadedImageProtocolDumpInformation},\r
{STRING_TOKEN(STR_DEVICE_PATH), &gEfiDevicePathProtocolGuid, DevicePathProtocolDumpInformation},\r
- {STRING_TOKEN(STR_IMAGE_PATH), &gEfiLoadedImageDevicePathProtocolGuid, DevicePathProtocolDumpInformation},\r
+ {STRING_TOKEN(STR_IMAGE_PATH), &gEfiLoadedImageDevicePathProtocolGuid, LoadedImageDevicePathProtocolDumpInformation},\r
{STRING_TOKEN(STR_DEVICE_PATH_UTIL), &gEfiDevicePathUtilitiesProtocolGuid, NULL},\r
{STRING_TOKEN(STR_DEVICE_PATH_TXT), &gEfiDevicePathToTextProtocolGuid, NULL},\r
{STRING_TOKEN(STR_DEVICE_PATH_FTXT), &gEfiDevicePathFromTextProtocolGuid, NULL},\r