diff options
-rw-r--r-- | UefiMonitorTest/Graphics.c | 29 | ||||
-rw-r--r-- | UefiMonitorTest/Graphics.h | 12 |
2 files changed, 41 insertions, 0 deletions
diff --git a/UefiMonitorTest/Graphics.c b/UefiMonitorTest/Graphics.c index 2efbbdd..e6dd6b6 100644 --- a/UefiMonitorTest/Graphics.c +++ b/UefiMonitorTest/Graphics.c @@ -1,5 +1,6 @@ #include <Library/BaseLib.h> #include <Library/DebugLib.h> +#include <Library/HiiLib.h> #include <Library/MemoryAllocationLib.h> #include <Library/BaseMemoryLib.h> #include <Library/PrintLib.h> @@ -547,3 +548,31 @@ DrawStringF ( VA_END (Marker); return NumberOfPrinted; } + +UINTN +EFIAPI +DrawHiiStringF ( + IN GRAPHICS_CONTEXT *Graphics, + IN UINTN X, + IN UINTN Y, + IN CONST GRAPHICS_PIXEL_COLOR *Color, + IN CONST EFI_STRING_ID HiiFormatStringId, + IN CONST EFI_HII_HANDLE HiiFormatHandle, + ... + ) +{ + VA_LIST Marker; + CHAR16 *HiiFormatString; + UINTN NumberOfPrinted; + + NumberOfPrinted = 0; + + VA_START (Marker, HiiFormatHandle); + HiiFormatString = HiiGetString (HiiFormatHandle, HiiFormatStringId, NULL); + if (HiiFormatString != NULL) { + NumberOfPrinted = DrawStringVF(Graphics, X, Y, Color, HiiFormatString, Marker); + FreePool (HiiFormatString); + } + VA_END (Marker); + return NumberOfPrinted; +} diff --git a/UefiMonitorTest/Graphics.h b/UefiMonitorTest/Graphics.h index c516576..d822e0e 100644 --- a/UefiMonitorTest/Graphics.h +++ b/UefiMonitorTest/Graphics.h @@ -218,4 +218,16 @@ DrawStringF ( ... ); +UINTN +EFIAPI +DrawHiiStringF ( + IN GRAPHICS_CONTEXT *Graphics, + IN UINTN X, + IN UINTN Y, + IN CONST GRAPHICS_PIXEL_COLOR *Color, + IN CONST EFI_STRING_ID HiiFormatStringId, + IN CONST EFI_HII_HANDLE HiiFormatHandle, + ... + ); + #endif /* UMT_GRAPHICS_H */ |