//\r
Buffer = AllocateZeroPool (BufferSize);\r
if (Buffer == NULL) {\r
+ *VariableSize = 0;\r
return NULL;\r
}\r
//\r
//\r
Status = gRT->GetVariable (Name, VendorGuid, NULL, &BufferSize, Buffer);\r
if (EFI_ERROR (Status)) {\r
+ FreePool (Buffer);\r
BufferSize = 0;\r
+ Buffer = NULL;\r
}\r
}\r
\r
+ ASSERT (((Buffer == NULL) && (BufferSize == 0)) ||\r
+ ((Buffer != NULL) && (BufferSize != 0))\r
+ );\r
*VariableSize = BufferSize;\r
return Buffer;\r
}\r
*EnBootOptionCount = 0;\r
Index = 0;\r
\r
+ ASSERT (BbsIndexArray != NULL);\r
+ ASSERT (DeviceTypeArray != NULL);\r
ASSERT (*EnBootOption != NULL);\r
ASSERT (*DisBootOption != NULL);\r
\r
UnicodeSPrint (OptionName, sizeof (OptionName), L"Boot%04x", BootOrder[Index]);\r
InitializeListHead (&List);\r
BootOption = BdsLibVariableToOption (&List, OptionName);\r
- ASSERT_EFI_ERROR (BootOption != NULL);\r
+ ASSERT (BootOption != NULL);\r
\r
if ((DevicePathType (BootOption->DevicePath) == BBS_DEVICE_PATH) &&\r
(DevicePathSubType (BootOption->DevicePath) == BBS_BBS_DP)) {\r
//\r
StartPosition = BootOrderSize / sizeof (UINT16);\r
NewBootOption = AllocatePool (DevOrderCount * sizeof (UINT16));\r
+ ASSERT (NewBootOption != NULL);\r
while (DevOrderCount-- != 0) {\r
for (Index = 0; Index < BootOrderSize / sizeof (UINT16); Index++) {\r
if (BbsIndexArray[Index] == (DevOrder[DevOrderCount] & 0xFF)) {\r
UnicodeSPrint (OptionName, sizeof (OptionName), L"Boot%04x", BootOrder[Index]);\r
InitializeListHead (&List);\r
BootOption = BdsLibVariableToOption (&List, OptionName);\r
- ASSERT_EFI_ERROR (BootOption != NULL);\r
+ ASSERT (BootOption != NULL);\r
\r
if ((DevicePathType (BootOption->DevicePath) == BBS_DEVICE_PATH) &&\r
(DevicePathSubType (BootOption->DevicePath) == BBS_BBS_DP)) {\r