]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c
MdeModulePkg/Universal: Fix typos in comments
[mirror_edk2.git] / MdeModulePkg / Universal / PlatformDriOverrideDxe / PlatDriOverrideDxe.c
index d29c050a030b15b4ffefdb715ee25369a80286a8..eddd75a162cbab8d28a0d0c5945c2e0a3e23113a 100644 (file)
@@ -13,7 +13,7 @@
   4. It save all the mapping info in NV variables which will be consumed\r
      by platform override protocol driver to publish the platform override protocol.\r
 \r
-Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2015, 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
@@ -333,6 +333,7 @@ UpdateDeviceSelectPage (
   EFI_STATUS                                Status;\r
   UINTN                                     Index;\r
   UINTN                                     DevicePathHandleCount;\r
+  UINTN                                     NewStrSize;\r
   CHAR16                                    *NewString;\r
   EFI_STRING_ID                             NewStringToken;\r
   CHAR16                                    *ControllerName;\r
@@ -489,14 +490,15 @@ UpdateDeviceSelectPage (
     // Export the driver name string and create item in set options page\r
     //\r
     Len = StrSize (ControllerName);\r
-    NewString = AllocateZeroPool (Len + StrSize (L"--"));\r
+    NewStrSize = Len + StrSize (L"--");\r
+    NewString = AllocateZeroPool (NewStrSize);\r
     ASSERT (NewString != NULL);\r
     if (EFI_ERROR (CheckMapping (ControllerDevicePath,NULL, &mMappingDataBase, NULL, NULL))) {\r
-      StrCat (NewString, L"--");\r
+      StrCatS (NewString, NewStrSize/sizeof(CHAR16), L"--");\r
     } else {\r
-      StrCat (NewString, L"**");\r
+      StrCatS (NewString, NewStrSize/sizeof(CHAR16), L"**");\r
     }\r
-    StrCat (NewString, ControllerName);\r
+    StrCatS (NewString, NewStrSize/sizeof(CHAR16), ControllerName);\r
 \r
     NewStringToken = HiiSetString (Private->RegisteredHandle, mControllerToken[Index], NewString, NULL);\r
     ASSERT (NewStringToken != 0);\r
@@ -539,7 +541,7 @@ UpdateDeviceSelectPage (
   @param  ImageHandle          The Image handle\r
 \r
   @return                      Handle to Driver binding\r
-  @retval NULL                 The paramter is not valid or the driver binding handle is not found.\r
+  @retval NULL                 The parameter is not valid or the driver binding handle is not found.\r
 \r
 **/\r
 EFI_HANDLE\r
@@ -622,6 +624,7 @@ UpdateBindingDriverSelectPage (
 {\r
   EFI_STATUS                                Status;\r
   UINTN                                     Index;\r
+  UINTN                                     NewStrSize;\r
   CHAR16                                    *NewString;\r
   EFI_STRING_ID                             NewStringToken;\r
   EFI_STRING_ID                             NewStringHelpToken;\r
@@ -814,7 +817,8 @@ UpdateBindingDriverSelectPage (
     //\r
     // First create the driver image name\r
     //\r
-    NewString = AllocateZeroPool (StrSize (DriverName));\r
+    NewStrSize = StrSize (DriverName);\r
+    NewString = AllocateZeroPool (NewStrSize);\r
     ASSERT (NewString != NULL); \r
     if (EFI_ERROR (CheckMapping (mControllerDevicePathProtocol[mSelectedCtrIndex], LoadedImageDevicePath, &mMappingDataBase, NULL, NULL))) {\r
       mDriSelection[Index] = FALSE;\r
@@ -822,7 +826,7 @@ UpdateBindingDriverSelectPage (
       mDriSelection[Index] = TRUE;\r
       mLastSavedDriverImageNum++;\r
     }\r
-    StrCat (NewString, DriverName);\r
+    StrCatS (NewString, NewStrSize/sizeof(CHAR16), DriverName);\r
     NewStringToken = HiiSetString (Private->RegisteredHandle, mDriverImageToken[Index], NewString, NULL);\r
     ASSERT (NewStringToken != 0);\r
     mDriverImageToken[Index] = NewStringToken;\r
@@ -836,9 +840,10 @@ UpdateBindingDriverSelectPage (
     //\r
     DriverName = DevicePathToStr (LoadedImageDevicePath);\r
 \r
-    NewString = AllocateZeroPool (StrSize (DriverName));\r
+    NewStrSize = StrSize (DriverName);\r
+    NewString = AllocateZeroPool (NewStrSize);\r
     ASSERT (NewString != NULL); \r
-    StrCat (NewString, DriverName);\r
+    StrCatS (NewString, NewStrSize/sizeof(CHAR16), DriverName);\r
     NewStringHelpToken = HiiSetString (Private->RegisteredHandle, DriverImageFilePathToken[Index], NewString, NULL);\r
     ASSERT (NewStringHelpToken != 0);\r
     DriverImageFilePathToken[Index] = NewStringHelpToken;\r
@@ -1572,7 +1577,7 @@ DriverLoaded (
 }\r
 \r
 /**\r
-  The driver Entry Point. The funciton will export a disk device class formset and\r
+  The driver Entry Point. The function will export a disk device class formset and\r
   its callback function to hii database.\r
 \r
   @param  ImageHandle    The firmware allocated handle for the EFI image.\r
@@ -1635,6 +1640,19 @@ PlatDriOverrideDxeInit (
   mCallbackInfo->PlatformDriverOverride.GetDriver      = GetDriver;\r
   mCallbackInfo->PlatformDriverOverride.GetDriverPath  = GetDriverPath;\r
   mCallbackInfo->PlatformDriverOverride.DriverLoaded   = DriverLoaded;\r
+\r
+  //\r
+  // Locate ConfigRouting protocol\r
+  //\r
+  Status = gBS->LocateProtocol (\r
+                  &gEfiHiiConfigRoutingProtocolGuid,\r
+                  NULL,\r
+                  (VOID **) &mCallbackInfo->HiiConfigRouting\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    goto Finish;\r
+  }\r
+\r
   //\r
   // Install Device Path Protocol and Config Access protocol to driver handle\r
   // Install Platform Driver Override Protocol to driver handle\r
@@ -1668,18 +1686,6 @@ PlatDriOverrideDxeInit (
     goto Finish;\r
   }\r
 \r
-  //\r
-  // Locate ConfigRouting protocol\r
-  //\r
-  Status = gBS->LocateProtocol (\r
-                  &gEfiHiiConfigRoutingProtocolGuid,\r
-                  NULL,\r
-                  (VOID **) &mCallbackInfo->HiiConfigRouting\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    goto Finish;\r
-  }\r
-\r
   //\r
   // Clear all the globle variable\r
   //\r