Fix a bug to print correct message to ConOut and StdErr as they accept unicode string while DEBUG messages are all in Ascii

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3897 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qwang12
2007-09-20 06:40:26 +00:00
parent 179a2e9731
commit 457cfbaebc
2 changed files with 13 additions and 4 deletions

View File

@@ -53,6 +53,7 @@ DebugPrint (
)
{
CHAR16 Buffer[MAX_DEBUG_MESSAGE_LENGTH];
CHAR8 AsciiBuffer[MAX_DEBUG_MESSAGE_LENGTH];
VA_LIST Marker;
//
@@ -71,9 +72,11 @@ DebugPrint (
// Convert the DEBUG() message to a Unicode String
//
VA_START (Marker, Format);
UnicodeVSPrintAsciiFormat (Buffer, sizeof (Buffer), Format, Marker);
AsciiVSPrint (AsciiBuffer, sizeof (AsciiBuffer), Format, Marker);
AsciiStrToUnicodeStr (AsciiBuffer, Buffer);
VA_END (Marker);
//
// Send the print string to the Console Output device
//
@@ -115,11 +118,13 @@ DebugAssert (
)
{
CHAR16 Buffer[MAX_DEBUG_MESSAGE_LENGTH];
CHAR8 AsciiBuffer[MAX_DEBUG_MESSAGE_LENGTH];
//
// Generate the ASSERT() message in Unicode format
//
UnicodeSPrintAsciiFormat (Buffer, sizeof (Buffer), "ASSERT %s(%d): %s\n", FileName, LineNumber, Description);
AsciiSPrint (AsciiBuffer, sizeof (AsciiBuffer), "ASSERT %a(%d): %a\n", FileName, LineNumber, Description);
AsciiStrToUnicodeStr (AsciiBuffer, Buffer);
//
// Send the print string to the Console Output device