X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=EdkNt32Pkg%2FLibrary%2FNt32OemHookStatusCodeLib%2FNt32OemHookStatusCodeLib.c;h=e2260273928bc68b0dc1cb47ceafed28fa51e086;hp=7596a723df5fc077ad4d8807ed72b8ea4fe98392;hb=35b309d6a956f9bc5c50b8b59ce578f3925c90d7;hpb=be800da98976f1d1b82390fd2819465163d109e1 diff --git a/EdkNt32Pkg/Library/Nt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c b/EdkNt32Pkg/Library/Nt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c index 7596a723df..e226027392 100644 --- a/EdkNt32Pkg/Library/Nt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c +++ b/EdkNt32Pkg/Library/Nt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c @@ -14,16 +14,16 @@ **/ -#include - // // Cache of WinNtThunk protocol -// +// +STATIC EFI_WIN_NT_THUNK_PROTOCOL *mWinNt; // // Cache of standard output handle . -// +// +STATIC HANDLE mStdOut; /** @@ -33,7 +33,7 @@ HANDLE mStdOut; @return Always return EFI_SUCCESS. **/ -EFI_SUCCESS +EFI_STATUS EFIAPI OemHookStatusCodeInitialize ( VOID @@ -47,11 +47,11 @@ OemHookStatusCodeInitialize ( // Locate NtThunkPpi for retrieving standard output handle // Status = PeiServicesLocatePpi ( - &gPeiNtThunkPpiGuid, - 0, - NULL, - (VOID **) &NtThunkPpi - ); + &gPeiNtThunkPpiGuid, + 0, + NULL, + (VOID **) &NtThunkPpi + ); ASSERT_EFI_ERROR (Status); @@ -151,8 +151,6 @@ OemHookStatusCodeReport ( NULL ); - CpuBreakpoint (); - return EFI_SUCCESS; } else if (Data != NULL && @@ -181,7 +179,14 @@ OemHookStatusCodeReport ( // // Print ERROR information into output buffer. // - CharCount = AsciiSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, "ERROR: C%x:V%x I%x", CodeType, Value, Instance); + CharCount = AsciiSPrint ( + Buffer, + EFI_STATUS_CODE_DATA_MAX_SIZE, + "ERROR: C%x:V%x I%x", + CodeType, + Value, + Instance + ); // // Make sure we don't try to print values that weren't intended to be printed, especially NULL GUID pointers. @@ -196,7 +201,7 @@ OemHookStatusCodeReport ( ); } - if (Data) { + if (Data != NULL) { CharCount += AsciiSPrint ( &Buffer[CharCount - 1], (EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof (Buffer[0]) * CharCount)), @@ -211,9 +216,22 @@ OemHookStatusCodeReport ( "\n\r" ); } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) { - CharCount = AsciiSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, "PROGRESS CODE: V%x I%x\n\r", Value, Instance); + CharCount = AsciiSPrint ( + Buffer, + EFI_STATUS_CODE_DATA_MAX_SIZE, + "PROGRESS CODE: V%x I%x\n\r", + Value, + Instance + ); } else { - CharCount = AsciiSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, "Undefined: C%x:V%x I%x\n\r", CodeType, Value, Instance); + CharCount = AsciiSPrint ( + Buffer, + EFI_STATUS_CODE_DATA_MAX_SIZE, + "Undefined: C%x:V%x I%x\n\r", + CodeType, + Value, + Instance + ); } //