From c99bd73dfddffe6f589b42f5e8dff77be6df92f7 Mon Sep 17 00:00:00 2001 From: Rafal Kupiec Date: Fri, 16 Feb 2024 22:03:00 +0100 Subject: [PATCH] Use uppercase when printing status codes --- xtldr/config.c | 6 +++--- xtldr/debug.c | 2 +- xtldr/efiutils.c | 2 +- xtldr/protocol.c | 10 +++++----- xtldr/textui.c | 8 ++++---- xtldr/volume.c | 18 +++++++++--------- xtldr/xtldr.c | 26 +++++++++++++------------- 7 files changed, 36 insertions(+), 36 deletions(-) diff --git a/xtldr/config.c b/xtldr/config.c index b0a8249..e3b6791 100644 --- a/xtldr/config.c +++ b/xtldr/config.c @@ -50,7 +50,7 @@ BlGetConfigValue(IN CONST PWCHAR ConfigName) if(Status != STATUS_EFI_SUCCESS) { /* Memory allocation failure, return NULL */ - BlDebugPrint(L"ERROR: Memory allocation failure (Status Code: 0x%lx)\n", Status); + BlDebugPrint(L"ERROR: Memory allocation failure (Status Code: 0x%lX)\n", Status); return NULL; } @@ -148,7 +148,7 @@ BlpLoadConfiguration() if(Status != STATUS_EFI_SUCCESS) { /* Failed to load configuration */ - BlDebugPrint(L"Failed to load FS0:/EFI/BOOT/XTLDR/XTLDR.INI configuration file (Status Code: 0x%lx)\n", Status); + BlDebugPrint(L"Failed to load FS0:/EFI/BOOT/XTLDR/XTLDR.INI configuration file (Status Code: 0x%lX)\n", Status); return Status; } @@ -157,7 +157,7 @@ BlpLoadConfiguration() if(Status != STATUS_EFI_SUCCESS) { /* Failed to parse configuration */ - BlDebugPrint(L"Failed to parse FS0:/EFI/BOOT/XTLDR/XTLDR.INI configuration file (Status Code: 0x%lx)\n", Status); + BlDebugPrint(L"Failed to parse FS0:/EFI/BOOT/XTLDR/XTLDR.INI configuration file (Status Code: 0x%lX)\n", Status); return Status; } diff --git a/xtldr/debug.c b/xtldr/debug.c index f05750d..75c2fd0 100644 --- a/xtldr/debug.c +++ b/xtldr/debug.c @@ -235,7 +235,7 @@ BlpInitializeSerialPort(IN ULONG PortNumber, /* Print debug message depending on port settings */ if(PortAddress) { - BlConsolePrint(L"Initializing serial console at COM port address: 0x%lx\n", PortAddress); + BlConsolePrint(L"Initializing serial console at COM port address: 0x%lX\n", PortAddress); } else { diff --git a/xtldr/efiutils.c b/xtldr/efiutils.c index 50d8fb4..ee50b81 100644 --- a/xtldr/efiutils.c +++ b/xtldr/efiutils.c @@ -32,7 +32,7 @@ BlExitBootServices() if(Status != STATUS_EFI_SUCCESS) { /* Memory allocation failure */ - BlDebugPrint(L"ERROR: Memory allocation failure (Status Code: 0x%lx)\n", Status); + BlDebugPrint(L"ERROR: Memory allocation failure (Status Code: 0x%lX)\n", Status); return Status; } diff --git a/xtldr/protocol.c b/xtldr/protocol.c index 26ddee4..d57967c 100644 --- a/xtldr/protocol.c +++ b/xtldr/protocol.c @@ -246,7 +246,7 @@ BlLoadModule(IN PWCHAR ModuleName) if(Status != STATUS_EFI_SUCCESS) { /* Failed to load module, print error message and return status code */ - BlDebugPrint(L"Failed to load dependency module '%S', (Status Code: 0x%lx)\n", DepsData, Status); + BlDebugPrint(L"Failed to load dependency module '%S', (Status Code: 0x%lX)\n", DepsData, Status); return STATUS_EFI_UNSUPPORTED; } @@ -299,7 +299,7 @@ BlLoadModule(IN PWCHAR ModuleName) else { /* Failed to load module */ - BlDebugPrint(L"ERROR: Unable to load module '%S' (Status Code: 0x%lx)\n", ModuleName, Status); + BlDebugPrint(L"ERROR: Unable to load module '%S' (Status Code: 0x%lX)\n", ModuleName, Status); } /* Return error status code */ @@ -312,7 +312,7 @@ BlLoadModule(IN PWCHAR ModuleName) if(Status != STATUS_EFI_SUCCESS) { /* Failed to open LoadedImage protocol */ - BlDebugPrint(L"ERROR: Unable to access module interface (Status Code: 0x%lx)\n", Status); + BlDebugPrint(L"ERROR: Unable to access module interface (Status Code: 0x%lX)\n", Status); return Status; } @@ -340,7 +340,7 @@ BlLoadModule(IN PWCHAR ModuleName) if(Status != STATUS_EFI_SUCCESS) { /* Failed to start module image */ - BlDebugPrint(L"ERROR: Failed to start module '%S' (Status Code: 0x%lx)\n", ModuleName, Status); + BlDebugPrint(L"ERROR: Failed to start module '%S' (Status Code: 0x%lX)\n", ModuleName, Status); return Status; } @@ -383,7 +383,7 @@ BlLoadModules(IN PWCHAR ModulesList) if(Status != STATUS_EFI_SUCCESS) { /* Failed to load module, print error message and set new return value */ - BlDebugPrint(L"ERROR: Failed to load module '%S', (Status Code: 0x%lx)\n", Module, Status); + BlDebugPrint(L"ERROR: Failed to load module '%S', (Status Code: 0x%lX)\n", Module, Status); ReturnStatus = STATUS_EFI_LOAD_ERROR; } diff --git a/xtldr/textui.c b/xtldr/textui.c index d9d2226..52838fc 100644 --- a/xtldr/textui.c +++ b/xtldr/textui.c @@ -139,7 +139,7 @@ BlDisplayBootMenu() if(Status != STATUS_SUCCESS) { /* Failed to boot OS */ - BlDebugPrint(L"ERROR: Failed to boot '%S' (Status Code: 0x%lx)\n", + BlDebugPrint(L"ERROR: Failed to boot '%S' (Status Code: 0x%lX)\n", MenuEntries[HighligtedEntryId].EntryName, Status); BlDisplayErrorDialog(L"XTLDR", L"Failed to startup the selected Operating System."); } @@ -283,7 +283,7 @@ BlDisplayBootMenu() if(Status != STATUS_SUCCESS) { /* Failed to boot OS */ - BlDebugPrint(L"ERROR: Failed to boot '%S' (Status Code: 0x%lx)\n", + BlDebugPrint(L"ERROR: Failed to boot '%S' (Status Code: 0x%lX)\n", MenuEntries[HighligtedEntryId].EntryName, Status); BlDisplayErrorDialog(L"XTLDR", L"Failed to startup the selected Operating System."); } @@ -456,7 +456,7 @@ BlDisplayInputDialog(IN PWCHAR Caption, if(Status != STATUS_EFI_SUCCESS) { /* Memory allocation failure, print error message and return */ - BlDebugPrint(L"ERROR: Memory allocation failure (Status Code: 0x%lx)\n", Status); + BlDebugPrint(L"ERROR: Memory allocation failure (Status Code: 0x%lX)\n", Status); BlDisplayErrorDialog(L"XTLDR", L"Failed to allocate memory for input field buffer."); return; } @@ -1217,7 +1217,7 @@ BlpDrawDialogMessage(IN PXTBL_DIALOG_HANDLE Handle, if(Status != STATUS_EFI_SUCCESS) { /* Memory allocation failure, print debug message and return */ - BlDebugPrint(L"ERROR: Memory allocation failure (Status Code: 0x%lx)\n", Status); + BlDebugPrint(L"ERROR: Memory allocation failure (Status Code: 0x%lX)\n", Status); return; } diff --git a/xtldr/volume.c b/xtldr/volume.c index d4c9378..ee1376b 100644 --- a/xtldr/volume.c +++ b/xtldr/volume.c @@ -70,7 +70,7 @@ BlEnumerateBlockDevices() Status = BlpDiscoverEfiBlockDevices(&BlockDevices); if(Status != STATUS_EFI_SUCCESS) { - BlDebugPrint(L"ERROR: Failed to discover EFI block devices (Status Code: 0x%lx)\n", Status); + BlDebugPrint(L"ERROR: Failed to discover EFI block devices (Status Code: 0x%lX)\n", Status); return Status; } @@ -169,7 +169,7 @@ BlEnumerateBlockDevices() Status = BlAllocateMemoryPool(sizeof(EFI_BLOCK_DEVICE), (PVOID *)&BlockDevice); if(Status != STATUS_EFI_SUCCESS) { - BlDebugPrint(L"ERROR: Failed to allocate memory pool for block device (Status Code: 0x%lx)\n", Status); + BlDebugPrint(L"ERROR: Failed to allocate memory pool for block device (Status Code: 0x%lX)\n", Status); return STATUS_EFI_OUT_OF_RESOURCES; } @@ -305,7 +305,7 @@ BlGetEfiPath(IN PWCHAR SystemPath, if(Status != STATUS_EFI_SUCCESS) { /* Failed to allocate memory, print error message and return status code */ - BlDebugPrint(L"ERROR: Memory allocation failure (Status Code: 0x%lx)\n", Status); + BlDebugPrint(L"ERROR: Memory allocation failure (Status Code: 0x%lX)\n", Status); return STATUS_EFI_OUT_OF_RESOURCES; } @@ -408,7 +408,7 @@ BlGetVolumeDevicePath(IN PWCHAR SystemPath, if(Status != STATUS_EFI_SUCCESS) { /* Failed to parse system path */ - BlDebugPrint(L"ERROR: Failed to parse system path: '%s' (Status Code: 0x%lx)\n", SystemPath, Status); + BlDebugPrint(L"ERROR: Failed to parse system path: '%s' (Status Code: 0x%lX)\n", SystemPath, Status); return Status; } @@ -667,7 +667,7 @@ BlpDiscoverEfiBlockDevices(OUT PLIST_ENTRY BlockDevices) if(Status != STATUS_EFI_SUCCESS) { /* Failed to locate handles */ - BlDebugPrint(L"ERROR: Failed to locate block devices handles (Status Code: 0x%lx)\n", Status); + BlDebugPrint(L"ERROR: Failed to locate block devices handles (Status Code: 0x%lX)\n", Status); return Status; } @@ -683,7 +683,7 @@ BlpDiscoverEfiBlockDevices(OUT PLIST_ENTRY BlockDevices) if(Status != STATUS_EFI_SUCCESS || Io == NULL) { /* Failed to open I/O protocol, skip it */ - BlDebugPrint(L"WARNING: Failed to open EFI Block I/O protocol (Status Code: 0x%lx)\n", Status); + BlDebugPrint(L"WARNING: Failed to open EFI Block I/O protocol (Status Code: 0x%lX)\n", Status); continue; } @@ -701,7 +701,7 @@ BlpDiscoverEfiBlockDevices(OUT PLIST_ENTRY BlockDevices) if(Status != STATUS_EFI_SUCCESS || DevicePath == NULL) { /* Device failed to handle DP protocol */ - BlDebugPrint(L"WARNING: Unable to open DevicePath protocol (Status Code: 0x%lx)\n", Status); + BlDebugPrint(L"WARNING: Unable to open DevicePath protocol (Status Code: 0x%lX)\n", Status); EfiSystemTable->BootServices->CloseProtocol(Handles[Index], &IoGuid, EfiImageHandle, NULL); continue; } @@ -711,7 +711,7 @@ BlpDiscoverEfiBlockDevices(OUT PLIST_ENTRY BlockDevices) if(Status != STATUS_EFI_SUCCESS) { /* Memory allocation failure */ - BlDebugPrint(L"ERROR: Failed to allocate memory pool for block device (Status Code: 0x%lx)\n", Status); + BlDebugPrint(L"ERROR: Failed to allocate memory pool for block device (Status Code: 0x%lX)\n", Status); EfiSystemTable->BootServices->CloseProtocol(Handles[Index], &DevicePathGuid, EfiImageHandle, NULL); EfiSystemTable->BootServices->CloseProtocol(Handles[Index], &IoGuid, EfiImageHandle, NULL); return Status; @@ -942,7 +942,7 @@ BlpDuplicateDevicePath(IN PEFI_DEVICE_PATH_PROTOCOL DevicePath) if(Status != STATUS_EFI_SUCCESS) { /* Failed to allocate memory */ - BlDebugPrint(L"ERROR: Failed to allocate memory pool for device path duplicate (Status Code: 0x%lx)\n", Status); + BlDebugPrint(L"ERROR: Failed to allocate memory pool for device path duplicate (Status Code: 0x%lX)\n", Status); return NULL; } diff --git a/xtldr/xtldr.c b/xtldr/xtldr.c index 8e311cb..1267ab3 100644 --- a/xtldr/xtldr.c +++ b/xtldr/xtldr.c @@ -56,9 +56,9 @@ BlInitializeBootLoader() /* Protocol opened successfully, print useful debug information */ BlConsolePrint(L"\n---------- BOOTLOADER DEBUG ----------\n" L"Pointer Size : %d\n" - L"Image Base Address: 0x%lx\n" - L"Image Base Size : 0x%lx\n" - L"Image Revision : 0x%lx\n" + L"Image Base Address: 0x%lX\n" + L"Image Base Size : 0x%lX\n" + L"Image Revision : 0x%lX\n" L"--------------------------------------\n", sizeof(PVOID), LoadedImage->ImageBase, @@ -204,7 +204,7 @@ BlInvokeBootProtocol(IN PLIST_ENTRY OptionsList) if(Status != STATUS_EFI_SUCCESS) { /* Failed to allocate memory, print error message and return status code */ - BlDebugPrint(L"ERROR: Memory allocation failure (Status Code: 0x%lx)\n", Status); + BlDebugPrint(L"ERROR: Memory allocation failure (Status Code: 0x%lX)\n", Status); return STATUS_EFI_OUT_OF_RESOURCES; } @@ -224,7 +224,7 @@ BlInvokeBootProtocol(IN PLIST_ENTRY OptionsList) if(Status != STATUS_EFI_SUCCESS) { /* Failed to find volume */ - BlDebugPrint(L"ERROR: Failed to find volume device path (Status Code: 0x%lx)\n", Status); + BlDebugPrint(L"ERROR: Failed to find volume device path (Status Code: 0x%lX)\n", Status); return Status; } @@ -233,7 +233,7 @@ BlInvokeBootProtocol(IN PLIST_ENTRY OptionsList) if(Status != STATUS_EFI_SUCCESS) { /* Failed to get EFI path */ - BlDebugPrint(L"ERROR: Failed to get EFI path (Status Code: 0x%lx)\n", Status); + BlDebugPrint(L"ERROR: Failed to get EFI path (Status Code: 0x%lX)\n", Status); return Status; } } @@ -267,7 +267,7 @@ BlInvokeBootProtocol(IN PLIST_ENTRY OptionsList) if(Status != STATUS_EFI_SUCCESS) { /* Failed to load modules, print error message and return status code */ - BlDebugPrint(L"ERROR: Failed to load XTLDR modules (Status Code: 0x%lx)\n", Status); + BlDebugPrint(L"ERROR: Failed to load XTLDR modules (Status Code: 0x%lX)\n", Status); return STATUS_EFI_NOT_READY; } @@ -276,7 +276,7 @@ BlInvokeBootProtocol(IN PLIST_ENTRY OptionsList) if(Status != STATUS_EFI_SUCCESS) { /* Failed to get boot protocol GUID */ - BlDebugPrint(L"ERROR: Unable to find appropriate boot protocol (Status Code: 0x%lx)\n", Status); + BlDebugPrint(L"ERROR: Unable to find appropriate boot protocol (Status Code: 0x%lX)\n", Status); return STATUS_EFI_UNSUPPORTED; } @@ -285,7 +285,7 @@ BlInvokeBootProtocol(IN PLIST_ENTRY OptionsList) if(Status != STATUS_EFI_SUCCESS) { /* Failed to open boot protocol */ - BlDebugPrint(L"ERROR: Failed to open boot protocol (Status Code: 0x%lx)\n", Status); + BlDebugPrint(L"ERROR: Failed to open boot protocol (Status Code: 0x%lX)\n", Status); return Status; } @@ -363,7 +363,7 @@ BlStartXtLoader(IN EFI_HANDLE ImageHandle, if(Status != STATUS_EFI_SUCCESS) { /* Failed to disable the timer, print message */ - BlDebugPrint(L"WARNING: Failed to disable watchdog timer (Status Code: 0x%lx)\n", Status); + BlDebugPrint(L"WARNING: Failed to disable watchdog timer (Status Code: 0x%lX)\n", Status); } /* Install loader protocol */ @@ -371,7 +371,7 @@ BlStartXtLoader(IN EFI_HANDLE ImageHandle, if(Status != STATUS_EFI_SUCCESS) { /* Failed to register loader protocol */ - BlDebugPrint(L"ERROR: Failed to register XTLDR loader protocol (Status Code: 0x%lx)\n", Status); + BlDebugPrint(L"ERROR: Failed to register XTLDR loader protocol (Status Code: 0x%lX)\n", Status); return Status; } @@ -380,7 +380,7 @@ BlStartXtLoader(IN EFI_HANDLE ImageHandle, if(Status != STATUS_EFI_SUCCESS) { /* Failed to load modules */ - BlDebugPrint(L"ERROR: Failed to load XTLDR modules (Status Code: 0x%lx)\n", Status); + BlDebugPrint(L"ERROR: Failed to load XTLDR modules (Status Code: 0x%lX)\n", Status); BlDisplayErrorDialog(L"XTLDR", L"Failed to load some XTLDR modules."); } @@ -389,7 +389,7 @@ BlStartXtLoader(IN EFI_HANDLE ImageHandle, if(Status != STATUS_EFI_SUCCESS) { /* Failed to enumerate block devices */ - BlDebugPrint(L"ERROR: Failed to discover and enumerate block devices (Status Code: 0x%lx)\n", Status); + BlDebugPrint(L"ERROR: Failed to discover and enumerate block devices (Status Code: 0x%lX)\n", Status); return Status; }