/** @file\r
\r
-Copyright (c) 2007, Intel Corporation\r
+Copyright (c) 2007 - 2008, Intel Corporation\r
All rights reserved. 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
\r
@retval EFI_SUCCESS The data associated with the Handle was removed\r
from the HII database.\r
- @retval EFI_NOT_FOUND The specified PackageList could not be found in\r
- database.\r
+ @retval EFI_NOT_FOUND The specified andle is not in database.\r
@retval EFI_INVALID_PARAMETER The Handle was not valid.\r
\r
**/\r
HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList;\r
HII_HANDLE *HiiHandle;\r
\r
- if (This == NULL || !IsHiiHandleValid (Handle)) {\r
+ if (This == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
+ if (!IsHiiHandleValid (Handle)) {\r
+ return EFI_NOT_FOUND;\r
+ }\r
+\r
Private = HII_DATABASE_DATABASE_PRIVATE_DATA_FROM_THIS (This);\r
\r
//\r
@retval EFI_SUCCESS The HII database was successfully updated.\r
@retval EFI_OUT_OF_RESOURCES Unable to allocate enough memory for the updated\r
database.\r
- @retval EFI_INVALID_PARAMETER Handle or PackageList was NULL.\r
- @retval EFI_NOT_FOUND The Handle was not valid or could not be found in\r
- database.\r
+ @retval EFI_INVALID_PARAMETER PackageList was NULL.\r
+ @retval EFI_NOT_FOUND The specified Handle is not in database.\r
\r
**/\r
EFI_STATUS\r
HII_DATABASE_PACKAGE_LIST_INSTANCE *OldPackageList;\r
EFI_HII_PACKAGE_HEADER PackageHeader;\r
\r
- if (This == NULL || PackageList == NULL || Handle == NULL) {\r
+ if (This == NULL || PackageList == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
@param Handle An array of EFI_HII_HANDLE instances returned.\r
\r
@retval EFI_SUCCESS The matching handles are outputed successfully.\r
+ HandleBufferLength is updated with the actual length.\r
@retval EFI_BUFFER_TO_SMALL The HandleBufferLength parameter indicates that\r
Handle is too small to support the number of\r
handles. HandleBufferLength is updated with a\r
value that will enable the data to fit.\r
@retval EFI_NOT_FOUND No matching handle could not be found in database.\r
@retval EFI_INVALID_PARAMETER Handle or HandleBufferLength was NULL.\r
+ \r
+ @retval EFI_INVALID_PARAMETER PackageType is not a EFI_HII_PACKAGE_TYPE_GUID but\r
+ PackageGuid is not NULL, PackageType is a EFI_HII_\r
+ PACKAGE_TYPE_GUID but PackageGuid is NULL.\r
\r
**/\r
EFI_STATUS\r
LIST_ENTRY *Link;\r
EFI_STATUS Status;\r
\r
- if (This == NULL || NotificationHandle == NULL) {\r
+ if (This == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
+ if (NotificationHandle == NULL) {\r
+ return EFI_NOT_FOUND;\r
+ }\r
+\r
Status = gBS->OpenProtocol (\r
NotificationHandle,\r
&mHiiDatabaseNotifyGuid,\r
EFI_OPEN_PROTOCOL_TEST_PROTOCOL\r
);\r
if (EFI_ERROR (Status)) {\r
- return EFI_INVALID_PARAMETER;\r
+ return EFI_NOT_FOUND;\r
}\r
\r
Private = HII_DATABASE_DATABASE_PRIVATE_DATA_FROM_THIS (This);\r
for (Index = 0; Index < LayoutCount; Index++) {\r
ResultSize += sizeof (EFI_GUID);\r
if (ResultSize <= *KeyGuidBufferLength) {\r
- CopyMem (KeyGuidBuffer + Index, Layout + sizeof (UINT16), sizeof (EFI_GUID));\r
+ CopyMem (KeyGuidBuffer + (ResultSize / sizeof (EFI_GUID) - 1), Layout + sizeof (UINT16), sizeof (EFI_GUID));\r
CopyMem (&LayoutLength, Layout, sizeof (UINT16));\r
Layout = Layout + LayoutLength;\r
}\r