diff options
author | Oliver Smith-Denny <osde@microsoft.com> | 2024-09-30 10:21:02 -0700 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-10-08 00:31:58 +0000 |
commit | 77c070b1a7b69ad29b628e90a430ad55a26fc30a (patch) | |
tree | 357185eea5d3c3034c6afd99702186f2ed718ab3 | |
parent | 596773f5e33ec03968b8e8621ff4958b3eeaf412 (diff) | |
download | edk2-77c070b1a7b69ad29b628e90a430ad55a26fc30a.tar.gz edk2-77c070b1a7b69ad29b628e90a430ad55a26fc30a.tar.bz2 edk2-77c070b1a7b69ad29b628e90a430ad55a26fc30a.zip |
EmulatorPkg: Add Signature to Graphics Structure
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 <osde@linux.microsoft.com>
-rw-r--r-- | EmulatorPkg/Win/Host/WinGopInput.c | 4 | ||||
-rw-r--r-- | EmulatorPkg/Win/Host/WinGopScreen.c | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/EmulatorPkg/Win/Host/WinGopInput.c b/EmulatorPkg/Win/Host/WinGopInput.c index 1c67a1cb40..22f12f1448 100644 --- a/EmulatorPkg/Win/Host/WinGopInput.c +++ b/EmulatorPkg/Win/Host/WinGopInput.c @@ -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;
diff --git a/EmulatorPkg/Win/Host/WinGopScreen.c b/EmulatorPkg/Win/Host/WinGopScreen.c index 661573d777..bcbd153cfd 100644 --- a/EmulatorPkg/Win/Host/WinGopScreen.c +++ b/EmulatorPkg/Win/Host/WinGopScreen.c @@ -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;
|