IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
)\r
{\r
- //\r
- // If gStatusCode is NULL, then see if a Status Code Protocol instance is present\r
- // in the handle database.\r
- //\r
- if (mReportStatusCode == NULL) {\r
- mReportStatusCode = InternalGetReportStatusCode ();\r
+ if ((ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ||\r
+ (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ||\r
+ (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE)) {\r
+ //\r
+ // If gStatusCode is NULL, then see if a Status Code Protocol instance is present\r
+ // in the handle database.\r
+ //\r
if (mReportStatusCode == NULL) {\r
- return EFI_UNSUPPORTED;\r
+ mReportStatusCode = InternalGetReportStatusCode ();\r
+ if (mReportStatusCode == NULL) {\r
+ return EFI_UNSUPPORTED;\r
+ }\r
}\r
+ \r
+ //\r
+ // A Status Code Protocol is present in the handle database, so pass in all the\r
+ // parameters to the ReportStatusCode() service of the Status Code Protocol\r
+ //\r
+ return (*mReportStatusCode) (Type, Value, Instance, (EFI_GUID *)CallerId, Data);\r
}\r
-\r
- //\r
- // A Status Code Protocol is present in the handle database, so pass in all the\r
- // parameters to the ReportStatusCode() service of the Status Code Protocol\r
- //\r
- return (*mReportStatusCode) (Type, Value, Instance, (EFI_GUID *)CallerId, Data);\r
+ \r
+ return EFI_UNSUPPORTED;\r
}\r
\r
\r