\r
if (gRT->Hdr.Revision < 0x20000) {\r
return ((FRAMEWORK_EFI_RUNTIME_SERVICES*)gRT)->ReportStatusCode;\r
- } else if (gBS != NULL) {\r
+ } else if (gBS != NULL && gBS->LocateProtocol != NULL) {\r
Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID**)&StatusCodeProtocol);\r
if (!EFI_ERROR (Status) && StatusCodeProtocol != NULL) {\r
return StatusCodeProtocol->ReportStatusCode;\r
ASSERT (!((ExtendedData == NULL) && (ExtendedDataSize != 0)));\r
ASSERT (!((ExtendedData != NULL) && (ExtendedDataSize == 0)));\r
\r
- if (gBS == NULL) {\r
+ if (gBS == NULL || gBS->AllocatePool == NULL || gBS->FreePool == NULL) {\r
return EFI_UNSUPPORTED;\r
}\r
\r
//\r
// Fill in the extended data buffer\r
//\r
- CopyMem (StatusCodeData + 1, ExtendedData, ExtendedDataSize);\r
+ if (ExtendedData != NULL) {\r
+ CopyMem (StatusCodeData + 1, ExtendedData, ExtendedDataSize);\r
+ }\r
\r
//\r
// Report the status code\r