ASSERT (!((ExtendedData == NULL) && (ExtendedDataSize != 0)));\r
ASSERT (!((ExtendedData != NULL) && (ExtendedDataSize == 0)));\r
\r
+ if (gBS == NULL || gBS->AllocatePool == NULL || gBS->FreePool == NULL) {\r
+ return EFI_UNSUPPORTED;\r
+ }\r
+\r
//\r
// Allocate space for the Status Code Header and its buffer\r
//\r
StatusCodeData = NULL;\r
- StatusCodeData = AllocatePool (sizeof (EFI_STATUS_CODE_DATA) + ExtendedDataSize);\r
+ gBS->AllocatePool (EfiBootServicesData, sizeof (EFI_STATUS_CODE_DATA) + ExtendedDataSize, (VOID **)&StatusCodeData);\r
if (StatusCodeData == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
}\r
//\r
// Free the allocated buffer\r
//\r
- FreePool (StatusCodeData);\r
+ gBS->FreePool (StatusCodeData);\r
\r
return Status;\r
}\r