summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/HiiDatabaseDxe/String.c
diff options
context:
space:
mode:
authorEric Dong <eric.dong@intel.com>2013-08-20 07:13:28 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2013-08-20 07:13:28 +0000
commitc0a3c3da98cef6286a509eb685a4ff5375f8347b (patch)
treed669c96b27e3245ff9a16d2a9b66239891d7d71d /MdeModulePkg/Universal/HiiDatabaseDxe/String.c
parent5795218e88685dea1991469ebabfe2887a3679bb (diff)
downloadedk2-platforms-c0a3c3da98cef6286a509eb685a4ff5375f8347b.tar.xz
Refine the comments and code to follow spec.
Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14573 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/HiiDatabaseDxe/String.c')
-rw-r--r--MdeModulePkg/Universal/HiiDatabaseDxe/String.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/String.c b/MdeModulePkg/Universal/HiiDatabaseDxe/String.c
index c55305886f..f3c0555cbc 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/String.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/String.c
@@ -1590,7 +1590,8 @@ Done:
@retval EFI_INVALID_LANGUAGE - The string specified by StringId is available but
@retval EFI_BUFFER_TOO_SMALL The buffer specified by StringSize is too small to
hold the string.
- @retval EFI_INVALID_PARAMETER The String or Language or StringSize was NULL.
+ @retval EFI_INVALID_PARAMETER The Language or StringSize was NULL.
+ @retval EFI_INVALID_PARAMETER The value referenced by StringSize was not zero and String was NULL.
@retval EFI_OUT_OF_RESOURCES There were insufficient resources to complete the
request.
@@ -1775,7 +1776,8 @@ HiiSetString (
the length of Languages, in bytes.
@retval EFI_SUCCESS The languages were returned successfully.
- @retval EFI_INVALID_PARAMETER The Languages or LanguagesSize was NULL.
+ @retval EFI_INVALID_PARAMETER The LanguagesSize was NULL.
+ @retval EFI_INVALID_PARAMETER The value referenced by LanguagesSize is not zero and Languages is NULL.
@retval EFI_BUFFER_TOO_SMALL The LanguagesSize is too small to hold the list of
supported languages. LanguageSize is updated to
contain the required size.
@@ -1799,7 +1801,10 @@ HiiGetLanguages (
HII_STRING_PACKAGE_INSTANCE *StringPackage;
UINTN ResultSize;
- if (This == NULL || Languages == NULL || LanguagesSize == NULL || PackageList == NULL) {
+ if (This == NULL || LanguagesSize == NULL || PackageList == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+ if (*LanguagesSize != 0 && Languages == NULL) {
return EFI_INVALID_PARAMETER;
}
if (!IsHiiHandleValid (PackageList)) {
@@ -1871,15 +1876,16 @@ HiiGetLanguages (
points to the length of SecondaryLanguages in bytes.
@retval EFI_SUCCESS Secondary languages were correctly returned.
- @retval EFI_INVALID_PARAMETER PrimaryLanguage or SecondaryLanguages or
- SecondaryLanguagesSize was NULL.
+ @retval EFI_INVALID_PARAMETER PrimaryLanguage or SecondaryLanguagesSize was NULL.
+ @retval EFI_INVALID_PARAMETER The value referenced by SecondaryLanguagesSize is not
+ zero and SecondaryLanguages is NULL.
@retval EFI_BUFFER_TOO_SMALL The buffer specified by SecondaryLanguagesSize is
too small to hold the returned information.
SecondaryLanguageSize is updated to hold the size of
the buffer required.
@retval EFI_INVALID_LANGUAGE The language specified by PrimaryLanguage is not
present in the specified package list.
- @retval EFI_NOT_FOUND The specified PackageList is not in the Database.
+ @retval EFI_NOT_FOUND The specified PackageList is not in the Database.
**/
EFI_STATUS
@@ -1901,10 +1907,10 @@ HiiGetSecondaryLanguages (
CHAR8 *Languages;
UINTN ResultSize;
- if (This == NULL || PackageList == NULL || PrimaryLanguage == NULL) {
+ if (This == NULL || PackageList == NULL || PrimaryLanguage == NULL || SecondaryLanguagesSize == NULL) {
return EFI_INVALID_PARAMETER;
}
- if (SecondaryLanguages == NULL || SecondaryLanguagesSize == NULL) {
+ if (SecondaryLanguages == NULL && *SecondaryLanguagesSize != 0) {
return EFI_INVALID_PARAMETER;
}
if (!IsHiiHandleValid (PackageList)) {