diff --git a/MsGraphicsPkg/SimpleWindowManagerDxe/WindowManager.c b/MsGraphicsPkg/SimpleWindowManagerDxe/WindowManager.c index 84fbabd909..5603306524 100644 --- a/MsGraphicsPkg/SimpleWindowManagerDxe/WindowManager.c +++ b/MsGraphicsPkg/SimpleWindowManagerDxe/WindowManager.c @@ -1518,9 +1518,6 @@ GopRegisteredCallback ( goto Exit; } - mAbsPointerMode.AbsoluteMaxX = mGop->Mode->Info->HorizontalResolution; - mAbsPointerMode.AbsoluteMaxY = mGop->Mode->Info->VerticalResolution; - // Determine if the Simple Rendering Engine Protocol is available on the same Console Out handle. The // Rendering Engine driver provides both Graphics Output and Rendering Engine protocols. // @@ -1531,9 +1528,13 @@ GopRegisteredCallback ( ); if (EFI_ERROR (Status)) { + mGop = NULL; goto Exit; } + mAbsPointerMode.AbsoluteMaxX = mGop->Mode->Info->HorizontalResolution; + mAbsPointerMode.AbsoluteMaxY = mGop->Mode->Info->VerticalResolution; + // Now that we found the Graphics Output Protocol, complete the second half of driver initialization. // Status = DriverInitStage2 (mImageHandle);