Skip to content

Commit

Permalink
EmulatorPkg: Add Signature to Graphics Structure
Browse files Browse the repository at this point in the history
When updating MdePkg's CR macro to enforce signature checking in
all usages, it was discovered that EmulatorPkg was initializing
a structure without setting the signature for it, causing an error
to be returned when CR now checked the signature.

This commit updates the graphics stack in EmulatorPkg to set the
signature of the data structure and check the return value of
the wrapper for the CR macro.

Signed-off-by: Oliver Smith-Denny <[email protected]>
  • Loading branch information
os-d authored and mergify[bot] committed Oct 8, 2024
1 parent 596773f commit 77c070b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions EmulatorPkg/Win/Host/WinGopInput.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,10 @@ WinNtWndRegisterKeyNotify (

Private = GRAPHICS_PRIVATE_DATA_FROM_THIS (GraphicsIo);

if (Private == NULL) {
return EFI_INVALID_PARAMETER;
}

Private->MakeRegisterdKeyCallback = MakeCallBack;
Private->BreakRegisterdKeyCallback = BreakCallBack;
Private->RegisterdKeyCallbackContext = Context;
Expand Down
1 change: 1 addition & 0 deletions EmulatorPkg/Win/Host/WinGopScreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,7 @@ WinNtGraphicsWindowOpen (

GopPrivateCreateQ (Private, &Private->QueueForRead);

Private->Signature = GRAPHICS_PRIVATE_DATA_SIGNATURE;
Private->GraphicsWindowIo.Size = WinNtWndSize;
Private->GraphicsWindowIo.CheckKey = WinNtWndCheckKey;
Private->GraphicsWindowIo.GetKey = WinNtWndGetKey;
Expand Down

0 comments on commit 77c070b

Please sign in to comment.