]> git.proxmox.com Git - mirror_edk2.git/blobdiff - PerformancePkg/Dp_App/DpUtilities.c
Add new driver diagnostic type (EfiDriverDiagnosticTypeCancel) to follow UEFI Spec...
[mirror_edk2.git] / PerformancePkg / Dp_App / DpUtilities.c
index f44745fd1dd6042c89bcb03154c59cc551c80323..4daca0b853624539d27ab7ea45182f8ca7ca534d 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Utility functions used by the Dp application.\r
 \r
-  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -31,7 +31,6 @@
 #include <Protocol/DriverBinding.h>\r
 #include <Protocol/ComponentName2.h>\r
 #include <Protocol/DevicePath.h>\r
-#include <Protocol/DevicePathToText.h>\r
 \r
 #include <Guid/Performance.h>\r
 \r
@@ -220,7 +219,6 @@ GetNameFromHandle (
   UINTN                       StringSize;\r
   CHAR8                       *PlatformLanguage;\r
   EFI_COMPONENT_NAME2_PROTOCOL      *ComponentName2;\r
-  EFI_DEVICE_PATH_TO_TEXT_PROTOCOL  *DevicePathToText;\r
 \r
   //\r
   // Method 1: Get the name string from image PDB\r
@@ -270,7 +268,7 @@ GetNameFromHandle (
     //\r
     // Get the current platform language setting\r
     //\r
-    GetEfiGlobalVariable2 (L"PlatformLang", &PlatformLanguage, NULL);\r
+    GetEfiGlobalVariable2 (L"PlatformLang", (VOID**)&PlatformLanguage, NULL);\r
     Status = ComponentName2->GetDriverName (\r
                                ComponentName2,\r
                                PlatformLanguage != NULL ? PlatformLanguage : "en-US",\r
@@ -336,19 +334,12 @@ GetNameFromHandle (
       //\r
       // Method 5: Get the name string from image DevicePath\r
       //\r
-      Status = gBS->LocateProtocol (\r
-                      &gEfiDevicePathToTextProtocolGuid,\r
-                      NULL,\r
-                      (VOID **) &DevicePathToText\r
-                      );\r
-      if (!EFI_ERROR (Status)) {\r
-        NameString = DevicePathToText->ConvertDevicePathToText (LoadedImageDevicePath, TRUE, FALSE);\r
-        if (NameString != NULL) {\r
-          StrnCpy (mGaugeString, NameString, DP_GAUGE_STRING_LENGTH);\r
-          mGaugeString[DP_GAUGE_STRING_LENGTH] = 0;\r
-          FreePool (NameString);\r
-          return;\r
-        }\r
+      NameString = ConvertDevicePathToText (LoadedImageDevicePath, TRUE, FALSE);\r
+      if (NameString != NULL) {\r
+        StrnCpy (mGaugeString, NameString, DP_GAUGE_STRING_LENGTH);\r
+        mGaugeString[DP_GAUGE_STRING_LENGTH] = 0;\r
+        FreePool (NameString);\r
+        return;\r
       }\r
     }\r
   }\r