Compare commits
No commits in common. "7aac701cc1b293b3494ac74d532d4e557755149e" and "5235ebdfa4370e35eff2a32ca66a6f176291cd83" have entirely different histories.
7aac701cc1
...
5235ebdfa4
@ -49,7 +49,6 @@ Return Value:
|
|||||||
//
|
//
|
||||||
Status = BlInitializeLibrary(InputParameters, &LibraryParameters);
|
Status = BlInitializeLibrary(InputParameters, &LibraryParameters);
|
||||||
if (!NT_SUCCESS(Status)) {
|
if (!NT_SUCCESS(Status)) {
|
||||||
ConsolePrintf(L"BlInitializeLibrary() failed: 0x%x\r\n", Status);
|
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,82 +0,0 @@
|
|||||||
/*++
|
|
||||||
|
|
||||||
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 "bootmgr.h"
|
|
||||||
|
|
||||||
extern SIMPLE_TEXT_OUTPUT_INTERFACE *EfiConOut;
|
|
||||||
|
|
||||||
VOID
|
|
||||||
ConsolePrint (
|
|
||||||
IN PWSTR String
|
|
||||||
)
|
|
||||||
|
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
Prints a string to the console.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
String - string to print.
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,92 +0,0 @@
|
|||||||
/*++
|
|
||||||
|
|
||||||
Copyright (c) 2024, Quinn Stephens.
|
|
||||||
Provided under the BSD 3-Clause license.
|
|
||||||
|
|
||||||
Module Name:
|
|
||||||
|
|
||||||
printf.c
|
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
Provides wide formatted string printing routines.
|
|
||||||
|
|
||||||
--*/
|
|
||||||
|
|
||||||
#include <wchar.h>
|
|
||||||
|
|
||||||
static
|
|
||||||
size_t
|
|
||||||
print_hex (
|
|
||||||
wchar_t *wcs,
|
|
||||||
size_t maxlen,
|
|
||||||
unsigned int num
|
|
||||||
)
|
|
||||||
|
|
||||||
{
|
|
||||||
wchar_t *dest;
|
|
||||||
size_t n;
|
|
||||||
int shift;
|
|
||||||
unsigned int x;
|
|
||||||
|
|
||||||
dest = wcs;
|
|
||||||
n = 0;
|
|
||||||
shift = 28;
|
|
||||||
while (n < maxlen && shift >= 0) {
|
|
||||||
x = (num >> shift) & 0xf;
|
|
||||||
if (x >= 0xa) {
|
|
||||||
*dest = 'a' + (x - 0xa);
|
|
||||||
} else {
|
|
||||||
*dest = '0' + x;
|
|
||||||
}
|
|
||||||
|
|
||||||
dest++;
|
|
||||||
n++;
|
|
||||||
shift -= 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
return n;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
vswprintf (
|
|
||||||
wchar_t *wcs,
|
|
||||||
size_t maxlen,
|
|
||||||
const wchar_t *format,
|
|
||||||
va_list args
|
|
||||||
)
|
|
||||||
|
|
||||||
{
|
|
||||||
wchar_t *dest;
|
|
||||||
size_t n, size;
|
|
||||||
|
|
||||||
dest = wcs;
|
|
||||||
n = 0;
|
|
||||||
while (n < maxlen && *format != '\0') {
|
|
||||||
if (*format != '%') {
|
|
||||||
*dest++ = *format++;
|
|
||||||
n++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
format++;
|
|
||||||
switch (*format) {
|
|
||||||
case 'x':
|
|
||||||
size = print_hex(dest, maxlen - n, va_arg(args, unsigned int));
|
|
||||||
n += size;
|
|
||||||
dest += size;
|
|
||||||
format++;
|
|
||||||
break;
|
|
||||||
case '\0':
|
|
||||||
break;
|
|
||||||
case '%':
|
|
||||||
default:
|
|
||||||
*dest++ = *format++;
|
|
||||||
n++;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
wcs[n] = '\0';
|
|
||||||
return (int)n;
|
|
||||||
}
|
|
@ -22,7 +22,6 @@ Abstract:
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
size_t wcslen(const wchar_t *str);
|
size_t wcslen(const wchar_t *str);
|
||||||
@ -36,8 +35,6 @@ wchar_t *wmemset(wchar_t *dest, wchar_t c, size_t count);
|
|||||||
wchar_t *wmemcpy(wchar_t *dest, const wchar_t *src, size_t count);
|
wchar_t *wmemcpy(wchar_t *dest, const wchar_t *src, size_t count);
|
||||||
wchar_t *wmemmove(wchar_t *dest, const wchar_t *src, size_t count);
|
wchar_t *wmemmove(wchar_t *dest, const wchar_t *src, size_t count);
|
||||||
|
|
||||||
int vswprintf(wchar_t *wcs, size_t maxlen, const wchar_t *format, va_list args);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user