]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Use local version EfiScriptLibAsciiStrLen() and EfiScriptLibStrLen() function to...
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 29 Jul 2010 05:38:39 +0000 (05:38 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 29 Jul 2010 05:38:39 +0000 (05:38 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10711 6f19259b-4bc3-4df7-8a09-765794883524

EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.c

index 01ae07ee043152a83a3ee8d976b2862bd0278b30..7b905b49fc54690a6ac383181ef70db9e9170f15 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2010, 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
@@ -23,6 +23,54 @@ Abstract:
 \r
 EFI_BOOT_SCRIPT_SAVE_PROTOCOL *mBootScriptSave;\r
 \r
+UINTN\r
+EfiScriptLibAsciiStrLen (\r
+  IN CHAR8   *String\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  Return the number of Ascii characters in String. This is not the same as\r
+  the length of the string in bytes.\r
+\r
+Arguments:\r
+  String - String to process\r
+\r
+Returns:\r
+  Number of Ascii characters in String\r
+\r
+--*/\r
+{\r
+  UINTN Length;\r
+  \r
+  for (Length=0; *String; String++, Length++);\r
+  return Length;\r
+}\r
+\r
+UINTN\r
+EfiScriptLibStrLen (\r
+  IN CHAR16   *String\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  Return the number of Unicode characters in String. This is not the same as\r
+  the length of the string in bytes.\r
+\r
+Arguments:\r
+  String - String to process\r
+\r
+Returns:\r
+  Number of Unicode characters in String\r
+\r
+--*/\r
+{\r
+  UINTN Length;\r
+  \r
+  for (Length=0; *String; String++, Length++);\r
+  return Length;\r
+}\r
+\r
 EFI_STATUS\r
 EFIAPI\r
 BootScriptSaveInitialize (\r
@@ -622,7 +670,7 @@ Returns:
 {\r
   return BootScriptSaveInformation (      \r
            TableName,\r
-           (UINT32) EfiStrLen (String) * 2 + 2, \r
+           (UINT32) EfiScriptLibStrLen (String) * 2 + 2, \r
            (EFI_PHYSICAL_ADDRESS) (UINTN) String\r
            );\r
 }\r
@@ -655,7 +703,7 @@ Returns:
 {\r
   return BootScriptSaveInformation (      \r
            TableName,\r
-           (UINT32) EfiAsciiStrLen (String) + 1, \r
+           (UINT32) EfiScriptLibAsciiStrLen (String) + 1, \r
            (EFI_PHYSICAL_ADDRESS) (UINTN) String\r
            );\r
 }\r