diff options
| author | Joursoir <chat@joursoir.net> | 2022-04-18 20:43:46 +0300 | 
|---|---|---|
| committer | Joursoir <chat@joursoir.net> | 2022-04-18 20:43:46 +0300 | 
| commit | 7a6015d9dfd115769eb2a1156ad3090e67f06215 (patch) | |
| tree | 26e79d845471ae60b83f16c1e5ddb861172b12b1 | |
| parent | 51b4786f58650c4a95f8a1c7e10d7302ae787ad9 (diff) | |
| download | umt-7a6015d9dfd115769eb2a1156ad3090e67f06215.tar.gz umt-7a6015d9dfd115769eb2a1156ad3090e67f06215.tar.bz2 umt-7a6015d9dfd115769eb2a1156ad3090e67f06215.zip | |
main: return EFI_STATUS from PrepareGraphicsInfo()
| -rw-r--r-- | UefiMonitorTest/UefiMonitorTest.c | 17 | 
1 files changed, 12 insertions, 5 deletions
| diff --git a/UefiMonitorTest/UefiMonitorTest.c b/UefiMonitorTest/UefiMonitorTest.c index ecffb3c..0493a5e 100644 --- a/UefiMonitorTest/UefiMonitorTest.c +++ b/UefiMonitorTest/UefiMonitorTest.c @@ -88,7 +88,7 @@ ParseGraphicsPixelFormat (  }  STATIC -VOID +EFI_STATUS  PrepareGraphicsInfo (    IN GRAPHICS_CONTEXT             *Graphics,    IN EFI_GRAPHICS_OUTPUT_PROTOCOL *Gop @@ -117,11 +117,11 @@ PrepareGraphicsInfo (      case PixelBltOnly:        ASSERT (FALSE); -      //return RETURN_UNSUPPORTED; +      return RETURN_UNSUPPORTED;      default:        ASSERT (FALSE); -      // return RETURN_INVALID_PARAMETER; +      return RETURN_INVALID_PARAMETER;    }    DEBUG (( @@ -142,7 +142,8 @@ PrepareGraphicsInfo (    Graphics->FrontBuffer = (UINT32 *)Gop->Mode->FrameBufferBase;    Graphics->BufferSize  = Gop->Mode->FrameBufferSize;    Graphics->BackBuffer  = AllocateCopyPool (Graphics->BufferSize, Graphics->FrontBuffer); -  ASSERT (Graphics->BackBuffer != NULL); +  if (Graphics->BackBuffer == NULL) +    return EFI_OUT_OF_RESOURCES;    Graphics->Width       = Gop->Mode->Info->HorizontalResolution;    Graphics->Height      = Gop->Mode->Info->VerticalResolution;    CopyMem (&Graphics->PixelMasks, BitMask, sizeof (*BitMask)); @@ -150,6 +151,8 @@ PrepareGraphicsInfo (    CopyMem (Graphics->PixelShr, PixelShr, sizeof (PixelShr));    Graphics->PixelWidth  = PixelWidth;    Graphics->Pitch       = Gop->Mode->Info->PixelsPerScanLine; + +  return EFI_SUCCESS;  }  STATIC @@ -499,7 +502,11 @@ UefiMain (      return EFI_NOT_FOUND;    } -  PrepareGraphicsInfo (&Graphics, Gop); +  Status = PrepareGraphicsInfo (&Graphics, Gop); +  if (EFI_ERROR(Status)) { +    Print (L"Error: Preparing graphics information is failed. %r\n", Status); +    return EFI_NOT_FOUND; +  }    Status = Run (&Graphics); | 
