@@ -533,6 +533,7 @@ MsBootPolicyEntry(
533533IN EFI_SYSTEM_TABLE * SystemTable
534534 ) {
535535EFI_STATUS Status ;
536+ EFI_STATUS GraphicStatus ;
536537BOOT_SEQUENCE * BootSequence ;// Pointer to array of boot sequence entries
537538UINTN Index ;
538539EFI_LOADED_IMAGE_PROTOCOL * ImageInfo = NULL ;
@@ -595,9 +596,9 @@ MsBootPolicyEntry(
595596switch (BootSequence [Index ]) {
596597case MsBootPXE4 :
597598StartNetworking ();
598- Status = SetGraphicsConsoleMode (GCM_LOW_RES );
599- if (EFI_ERROR (Status )!= FALSE) {
600- DEBUG ((DEBUG_ERROR ,"%a Unable to set console mode - %r\n" ,__FUNCTION__ ,Status ));
599+ GraphicStatus = SetGraphicsConsoleMode (GCM_LOW_RES );
600+ if (EFI_ERROR (GraphicStatus )!= FALSE) {
601+ DEBUG ((DEBUG_ERROR ,"%a Unable to set console mode - %r\n" ,__FUNCTION__ ,GraphicStatus ));
601602 }
602603Status = SelectAndBootDevice (& gEfiLoadFileProtocolGuid ,FilterOnlyIPv4 );
603604break ;
@@ -611,26 +612,26 @@ MsBootPolicyEntry(
611612 }
612613if (EnableIPv6 ) {
613614StartNetworking ();
614- Status = SetGraphicsConsoleMode (GCM_LOW_RES );
615- if (EFI_ERROR (Status )!= FALSE) {
616- DEBUG ((DEBUG_ERROR ,"%a Unable to set console mode - %r\n" ,__FUNCTION__ ,Status ));
615+ GraphicStatus = SetGraphicsConsoleMode (GCM_LOW_RES );
616+ if (EFI_ERROR (GraphicStatus )!= FALSE) {
617+ DEBUG ((DEBUG_ERROR ,"%a Unable to set console mode - %r\n" ,__FUNCTION__ ,GraphicStatus ));
617618 }
618619Status = SelectAndBootDevice (& gEfiLoadFileProtocolGuid ,FilterOnlyIPv6 );
619620 }else {
620621Status = EFI_DEVICE_ERROR ;
621622 }
622623break ;
623624case MsBootHDD :
624- Status = SetGraphicsConsoleMode (GCM_NATIVE_RES );
625- if (EFI_ERROR (Status )!= FALSE) {
626- DEBUG ((DEBUG_ERROR ,"%a Unable to set console mode - %r\n" ,__FUNCTION__ ,Status ));
625+ GraphicStatus = SetGraphicsConsoleMode (GCM_NATIVE_RES );
626+ if (EFI_ERROR (GraphicStatus )!= FALSE) {
627+ DEBUG ((DEBUG_ERROR ,"%a Unable to set console mode - %r\n" ,__FUNCTION__ ,GraphicStatus ));
627628 }
628629Status = SelectAndBootDevice (& gEfiSimpleFileSystemProtocolGuid ,FilterNoUSB );
629630break ;
630631case MsBootUSB :
631- Status = SetGraphicsConsoleMode (GCM_NATIVE_RES );
632- if (EFI_ERROR (Status )!= FALSE) {
633- DEBUG ((DEBUG_ERROR ,"%a Unable to set console mode - %r\n" ,__FUNCTION__ ,Status ));
632+ GraphicStatus = SetGraphicsConsoleMode (GCM_NATIVE_RES );
633+ if (EFI_ERROR (GraphicStatus )!= FALSE) {
634+ DEBUG ((DEBUG_ERROR ,"%a Unable to set console mode - %r\n" ,__FUNCTION__ ,GraphicStatus ));
634635 }
635636Status = SelectAndBootDevice (& gEfiSimpleFileSystemProtocolGuid ,FilterOnlyUSB );
636637if (Status == EFI_NOT_FOUND )
@@ -661,14 +662,16 @@ MsBootPolicyEntry(
661662 }
662663Index ++ ;
663664 }
664- Status = SetGraphicsConsoleMode (GCM_NATIVE_RES );
665- if (EFI_ERROR (Status )!= FALSE) {
666- DEBUG ((DEBUG_ERROR ,"%a Unable to set console mode - %r\n" ,__FUNCTION__ ,Status ));
665+
666+ // Need to populate GraphicStatus here, otherwise logo function return value will override boot result
667+ GraphicStatus = SetGraphicsConsoleMode (GCM_NATIVE_RES );
668+ if (EFI_ERROR (GraphicStatus )!= FALSE) {
669+ DEBUG ((DEBUG_ERROR ,"%a Unable to set console mode - %r\n" ,__FUNCTION__ ,GraphicStatus ));
667670 gotoDone ;
668671 }
669- Status = DisplayBootGraphic (BG_SYSTEM_LOGO );
670- if (EFI_ERROR (Status )!= FALSE) {
671- DEBUG ((DEBUG_ERROR ,"%a Unable to set graphics - %r\n" ,__FUNCTION__ ,Status ));
672+ GraphicStatus = DisplayBootGraphic (BG_SYSTEM_LOGO );
673+ if (EFI_ERROR (GraphicStatus )!= FALSE) {
674+ DEBUG ((DEBUG_ERROR ,"%a Unable to set graphics - %r\n" ,__FUNCTION__ ,GraphicStatus ));
672675 }
673676
674677Done :