]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix Bug to convert low Hex string to handle L'A' - L'F'
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 13 Apr 2009 08:15:51 +0000 (08:15 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 13 Apr 2009 08:15:51 +0000 (08:15 +0000)
Fix Bug in HiiConstructConfigHdr API to support NULL DriverHandle.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8074 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Library/UefiHiiLib/HiiLib.c

index 997e36aeb11dea84f00a94147259591f560de8d1..384bab4ed6f3d80bb83b9e683c62c1200d008e6b 100644 (file)
@@ -699,7 +699,7 @@ InternalHiiLowerConfigString (
       Lower = TRUE;\r
     } else if (*String == L'&') {\r
       Lower = FALSE;\r
       Lower = TRUE;\r
     } else if (*String == L'&') {\r
       Lower = FALSE;\r
-    } else if (Lower && *String > L'A' && *String <= L'F') {\r
+    } else if (Lower && *String >= L'A' && *String <= L'F') {\r
       *String = (CHAR16) (*String - L'A' + L'a');\r
     }\r
   }\r
       *String = (CHAR16) (*String - L'A' + L'a');\r
     }\r
   }\r
@@ -927,7 +927,6 @@ InternalHiiBrowserCallback (
                             the Device Path associated with DriverHandle is converted\r
                             to a 2 Unicode character hexidecimal string.\r
 \r
                             the Device Path associated with DriverHandle is converted\r
                             to a 2 Unicode character hexidecimal string.\r
 \r
-  @retval NULL   DriverHandle does not support the Device Path Protocol.\r
   @retval NULL   DriverHandle does not support the Device Path Protocol.\r
   @retval Other  A pointer to the Null-terminate Unicode <ConfigHdr> string\r
 \r
   @retval NULL   DriverHandle does not support the Device Path Protocol.\r
   @retval Other  A pointer to the Null-terminate Unicode <ConfigHdr> string\r
 \r
@@ -957,19 +956,22 @@ HiiConstructConfigHdr (
     NameLength = StrLen (Name);\r
   }\r
 \r
     NameLength = StrLen (Name);\r
   }\r
 \r
+  DevicePath = NULL;\r
+  DevicePathSize = 0;\r
   //\r
   // Retrieve DevicePath Protocol associated with DriverHandle\r
   //\r
   //\r
   // Retrieve DevicePath Protocol associated with DriverHandle\r
   //\r
-  DevicePath = DevicePathFromHandle (DriverHandle);\r
-  if (DevicePath == NULL) {\r
-    return NULL;\r
+  if (DriverHandle != NULL) {\r
+    DevicePath = DevicePathFromHandle (DriverHandle);\r
+    if (DevicePath == NULL) {\r
+      return NULL;\r
+    }\r
+    //\r
+    // Compute the size of the device path in bytes\r
+    //\r
+    DevicePathSize = GetDevicePathSize (DevicePath);\r
   }\r
 \r
   }\r
 \r
-  //\r
-  // Compute the size of the device path in bytes\r
-  //\r
-  DevicePathSize = GetDevicePathSize (DevicePath);\r
-\r
   //\r
   // GUID=<HexCh>32&NAME=<Char>NameLength&PATH=<HexChar>DevicePathSize <Null>\r
   // | 5 | sizeof (EFI_GUID) * 2 | 6 | NameStrLen*4 | 6 | DevicePathSize * 2 | 1 |\r
   //\r
   // GUID=<HexCh>32&NAME=<Char>NameLength&PATH=<HexChar>DevicePathSize <Null>\r
   // | 5 | sizeof (EFI_GUID) * 2 | 6 | NameStrLen*4 | 6 | DevicePathSize * 2 | 1 |\r