Unify wide string types across console and debug functions

This commit is contained in:
Aiken Harris 2025-09-03 10:41:24 +02:00
parent b2df65f5cc
commit 9f5daafad9
Signed by: harraiken
GPG Key ID: C40F06CB7493C1F5
4 changed files with 16 additions and 16 deletions

View File

@ -60,15 +60,15 @@ typedef EFI_STATUS (*PBL_CONFIG_SET_BOOT_OPTION_VALUE)(IN PLIST_ENTRY Options, I
typedef VOID (*PBL_CONSOLE_CLEAR_SCREEN)(); typedef VOID (*PBL_CONSOLE_CLEAR_SCREEN)();
typedef VOID (*PBL_CONSOLE_DISABLE_CURSOR)(); typedef VOID (*PBL_CONSOLE_DISABLE_CURSOR)();
typedef VOID (*PBL_CONSOLE_ENABLE_CURSOR)(); typedef VOID (*PBL_CONSOLE_ENABLE_CURSOR)();
typedef VOID (*PBL_CONSOLE_PRINT)(IN PUSHORT Format, IN ...); typedef VOID (*PBL_CONSOLE_PRINT)(IN PCWSTR Format, IN ...);
typedef VOID (*PBL_CONSOLE_QUERY_MODE)(OUT PUINT_PTR ResX, OUT PUINT_PTR ResY); typedef VOID (*PBL_CONSOLE_QUERY_MODE)(OUT PUINT_PTR ResX, OUT PUINT_PTR ResY);
typedef VOID (*PBL_CONSOLE_READ_KEY_STROKE)(OUT PEFI_INPUT_KEY Key); typedef VOID (*PBL_CONSOLE_READ_KEY_STROKE)(OUT PEFI_INPUT_KEY Key);
typedef VOID (*PBL_CONSOLE_RESET_INPUT_BUFFER)(); typedef VOID (*PBL_CONSOLE_RESET_INPUT_BUFFER)();
typedef VOID (*PBL_CONSOLE_SET_ATTRIBUTES)(IN ULONGLONG Attributes); typedef VOID (*PBL_CONSOLE_SET_ATTRIBUTES)(IN ULONGLONG Attributes);
typedef VOID (*PBL_CONSOLE_SET_CURSOR_POSITION)(IN ULONGLONG PosX, IN ULONGLONG PosY); typedef VOID (*PBL_CONSOLE_SET_CURSOR_POSITION)(IN ULONGLONG PosX, IN ULONGLONG PosY);
typedef VOID (*PBL_CONSOLE_WRITE)(IN PUSHORT String); typedef VOID (*PBL_CONSOLE_WRITE)(IN PCWSTR String);
typedef VOID (XTAPI *PBL_COPY_MEMORY)(OUT PVOID Destination, IN PCVOID Source, IN SIZE_T Length); typedef VOID (XTAPI *PBL_COPY_MEMORY)(OUT PVOID Destination, IN PCVOID Source, IN SIZE_T Length);
typedef VOID (*PBL_DEBUG_PRINT)(IN PUSHORT Format, IN ...); typedef VOID (*PBL_DEBUG_PRINT)(IN PCWSTR Format, IN ...);
typedef EFI_STATUS (*PBL_ENTER_FIRMWARE_SETUP)(); typedef EFI_STATUS (*PBL_ENTER_FIRMWARE_SETUP)();
typedef EFI_STATUS (*PBL_EXIT_BOOT_SERVICES)(); typedef EFI_STATUS (*PBL_EXIT_BOOT_SERVICES)();
typedef EFI_STATUS (*PBL_FIND_BOOT_PROTOCOL)(IN PWCHAR SystemType, OUT PEFI_GUID BootProtocolGuid); typedef EFI_STATUS (*PBL_FIND_BOOT_PROTOCOL)(IN PWCHAR SystemType, OUT PEFI_GUID BootProtocolGuid);

View File

@ -95,7 +95,7 @@ BlEnableConsoleCursor()
*/ */
XTCDECL XTCDECL
VOID VOID
BlConsolePrint(IN PUSHORT Format, BlConsolePrint(IN PCWSTR Format,
IN ...) IN ...)
{ {
RTL_PRINT_CONTEXT ConsolePrintContext, SerialPrintContext; RTL_PRINT_CONTEXT ConsolePrintContext, SerialPrintContext;
@ -138,9 +138,9 @@ BlConsolePrint(IN PUSHORT Format,
*/ */
XTCDECL XTCDECL
VOID VOID
BlConsoleWrite(IN PUSHORT String) BlConsoleWrite(IN PCWSTR String)
{ {
EfiSystemTable->ConOut->OutputString(EfiSystemTable->ConOut, String); EfiSystemTable->ConOut->OutputString(EfiSystemTable->ConOut, (PWSTR)String);
} }
/** /**
@ -292,9 +292,9 @@ BlSetCursorPosition(IN ULONGLONG PosX,
*/ */
XTCDECL XTCDECL
XTSTATUS XTSTATUS
BlpConsolePutChar(IN USHORT Character) BlpConsolePutChar(IN WCHAR Character)
{ {
USHORT Buffer[2]; WCHAR Buffer[2];
/* Check if character is a newline ('\n') */ /* Check if character is a newline ('\n') */
if(Character == L'\n') if(Character == L'\n')

View File

@ -24,7 +24,7 @@
*/ */
XTCDECL XTCDECL
VOID VOID
BlDebugPrint(IN PUSHORT Format, BlDebugPrint(IN PCWSTR Format,
IN ...) IN ...)
{ {
RTL_PRINT_CONTEXT ConsolePrintContext, SerialPrintContext; RTL_PRINT_CONTEXT ConsolePrintContext, SerialPrintContext;
@ -71,9 +71,9 @@ BlDebugPrint(IN PUSHORT Format,
*/ */
XTCDECL XTCDECL
XTSTATUS XTSTATUS
BlpDebugPutChar(IN USHORT Character) BlpDebugPutChar(IN WCHAR Character)
{ {
USHORT Buffer[2]; WCHAR Buffer[2];
/* Write character to the serial console */ /* Write character to the serial console */
Buffer[0] = Character; Buffer[0] = Character;

View File

@ -51,16 +51,16 @@ BlCloseVolume(IN PEFI_HANDLE VolumeHandle);
XTCDECL XTCDECL
VOID VOID
BlConsolePrint(IN PUSHORT Format, BlConsolePrint(IN PCWSTR Format,
IN ...); IN ...);
XTCDECL XTCDECL
VOID VOID
BlConsoleWrite(IN PUSHORT String); BlConsoleWrite(IN PCWSTR String);
XTCDECL XTCDECL
VOID VOID
BlDebugPrint(IN PUSHORT Format, BlDebugPrint(IN PCWSTR Format,
IN ...); IN ...);
XTCDECL XTCDECL
@ -418,11 +418,11 @@ BlpActivateSerialIOController();
XTCDECL XTCDECL
XTSTATUS XTSTATUS
BlpConsolePutChar(IN USHORT Character); BlpConsolePutChar(IN WCHAR Character);
XTCDECL XTCDECL
XTSTATUS XTSTATUS
BlpDebugPutChar(IN USHORT Character); BlpDebugPutChar(IN WCHAR Character);
XTCDECL XTCDECL
VOID VOID