83 lines
994 B
C
83 lines
994 B
C
/*++
|
|
|
|
Copyright (c) 2024, Quinn Stephens.
|
|
Provided under the BSD 3-Clause license.
|
|
|
|
Module Name:
|
|
|
|
eficon.c
|
|
|
|
Abstract:
|
|
|
|
Provides EFI console utilities.
|
|
|
|
--*/
|
|
|
|
#include <stdarg.h>
|
|
#include <wchar.h>
|
|
#include "bootlib.h"
|
|
|
|
extern SIMPLE_TEXT_OUTPUT_INTERFACE *EfiConOut;
|
|
|
|
VOID
|
|
ConsolePrint (
|
|
IN PWSTR String
|
|
)
|
|
|
|
/*++
|
|
|
|
Routine Description:
|
|
|
|
Prints a string to the console.
|
|
|
|
Arguments:
|
|
|
|
String.
|
|
|
|
Return Value:
|
|
|
|
None.
|
|
|
|
--*/
|
|
|
|
{
|
|
EfiConOut->OutputString(EfiConOut, String);
|
|
}
|
|
|
|
VOID
|
|
ConsolePrintf (
|
|
IN PWSTR Format,
|
|
...
|
|
)
|
|
|
|
/*++
|
|
|
|
Routine Description:
|
|
|
|
Prints a formatted string to the console.
|
|
|
|
Arguments:
|
|
|
|
Format - Format string handled by vswprintf().
|
|
|
|
... - Arguments.
|
|
|
|
Return Value:
|
|
|
|
None.
|
|
|
|
--*/
|
|
|
|
{
|
|
int Status;
|
|
va_list Args;
|
|
WCHAR Buffer[256];
|
|
|
|
va_start(Args, Format);
|
|
Status = vswprintf(Buffer, sizeof(Buffer) / sizeof(WCHAR) - 1, Format, Args);
|
|
va_end(Args);
|
|
if (Status > 0) {
|
|
ConsolePrint(Buffer);
|
|
}
|
|
}
|