summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg
diff options
context:
space:
mode:
Diffstat (limited to 'EdkCompatibilityPkg')
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.c54
1 files changed, 51 insertions, 3 deletions
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.c
index 01ae07ee04..7b905b49fc 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.c
+++ b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -23,6 +23,54 @@ Abstract:
EFI_BOOT_SCRIPT_SAVE_PROTOCOL *mBootScriptSave;
+UINTN
+EfiScriptLibAsciiStrLen (
+ IN CHAR8 *String
+ )
+/*++
+
+Routine Description:
+ Return the number of Ascii characters in String. This is not the same as
+ the length of the string in bytes.
+
+Arguments:
+ String - String to process
+
+Returns:
+ Number of Ascii characters in String
+
+--*/
+{
+ UINTN Length;
+
+ for (Length=0; *String; String++, Length++);
+ return Length;
+}
+
+UINTN
+EfiScriptLibStrLen (
+ IN CHAR16 *String
+ )
+/*++
+
+Routine Description:
+ Return the number of Unicode characters in String. This is not the same as
+ the length of the string in bytes.
+
+Arguments:
+ String - String to process
+
+Returns:
+ Number of Unicode characters in String
+
+--*/
+{
+ UINTN Length;
+
+ for (Length=0; *String; String++, Length++);
+ return Length;
+}
+
EFI_STATUS
EFIAPI
BootScriptSaveInitialize (
@@ -622,7 +670,7 @@ Returns:
{
return BootScriptSaveInformation (
TableName,
- (UINT32) EfiStrLen (String) * 2 + 2,
+ (UINT32) EfiScriptLibStrLen (String) * 2 + 2,
(EFI_PHYSICAL_ADDRESS) (UINTN) String
);
}
@@ -655,7 +703,7 @@ Returns:
{
return BootScriptSaveInformation (
TableName,
- (UINT32) EfiAsciiStrLen (String) + 1,
+ (UINT32) EfiScriptLibAsciiStrLen (String) + 1,
(EFI_PHYSICAL_ADDRESS) (UINTN) String
);
}