]> git.proxmox.com Git - mirror_edk2.git/commitdiff
fixed potential NULL pointer reference issue.
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 29 Dec 2008 07:10:16 +0000 (07:10 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 29 Dec 2008 07:10:16 +0000 (07:10 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7146 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Library/GenericBdsLib/BdsConsole.c
MdePkg/Library/UefiLib/UefiLibPrint.c

index d923804e3fdbef63030846b87f8c6298d3faba63..3d7758d7907f72d6ce3733637b12b716d7ac821b 100644 (file)
@@ -309,7 +309,7 @@ BdsLibConnectAllConsoles (
           &HandleCount,\r
           &HandleBuffer\r
           );\r
           &HandleCount,\r
           &HandleBuffer\r
           );\r
-  \r
+\r
   for (Index = 0; Index < HandleCount; Index++) {\r
     gBS->HandleProtocol (\r
             HandleBuffer[Index],\r
   for (Index = 0; Index < HandleCount; Index++) {\r
     gBS->HandleProtocol (\r
             HandleBuffer[Index],\r
@@ -416,7 +416,7 @@ BdsLibConnectAllDefaultConsoles (
   @param  PixelHeight   Height of GopBlt/BmpImage in pixels\r
   @param  PixelWidth    Width of GopBlt/BmpImage in pixels\r
 \r
   @param  PixelHeight   Height of GopBlt/BmpImage in pixels\r
   @param  PixelWidth    Width of GopBlt/BmpImage in pixels\r
 \r
-  @retval EFI_SUCCESS           GopBlt and GopBltSize are returned. \r
+  @retval EFI_SUCCESS           GopBlt and GopBltSize are returned.\r
   @retval EFI_UNSUPPORTED       BmpImage is not a valid *.BMP image\r
   @retval EFI_BUFFER_TOO_SMALL  The passed in GopBlt buffer is not big enough.\r
                                 GopBltSize will contain the required size.\r
   @retval EFI_UNSUPPORTED       BmpImage is not a valid *.BMP image\r
   @retval EFI_BUFFER_TOO_SMALL  The passed in GopBlt buffer is not big enough.\r
                                 GopBltSize will contain the required size.\r
@@ -587,7 +587,7 @@ ConvertBmpToGopBlt (
 \r
 \r
 /**\r
 \r
 \r
 /**\r
-  Use Console Control Protocol to lock the Console In Spliter virtual handle. \r
+  Use Console Control Protocol to lock the Console In Spliter virtual handle.\r
   This is the ConInHandle and ConIn handle in the EFI system table. All key\r
   presses will be ignored until the Password is typed in. The only way to\r
   disable the password is to type it in to a ConIn device.\r
   This is the ConInHandle and ConIn handle in the EFI system table. All key\r
   presses will be ignored until the Password is typed in. The only way to\r
   disable the password is to type it in to a ConIn device.\r
@@ -691,7 +691,8 @@ EnableQuietBoot (
   if (GraphicsOutput != NULL) {\r
     SizeOfX = GraphicsOutput->Mode->Info->HorizontalResolution;\r
     SizeOfY = GraphicsOutput->Mode->Info->VerticalResolution;\r
   if (GraphicsOutput != NULL) {\r
     SizeOfX = GraphicsOutput->Mode->Info->HorizontalResolution;\r
     SizeOfY = GraphicsOutput->Mode->Info->VerticalResolution;\r
-  } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {\r
+\r
+  } else if (UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport)) {\r
     Status = UgaDraw->GetMode (UgaDraw, &SizeOfX, &SizeOfY, &ColorDepth, &RefreshRate);\r
     if (EFI_ERROR (Status)) {\r
       return EFI_UNSUPPORTED;\r
     Status = UgaDraw->GetMode (UgaDraw, &SizeOfX, &SizeOfY, &ColorDepth, &RefreshRate);\r
     if (EFI_ERROR (Status)) {\r
       return EFI_UNSUPPORTED;\r
@@ -835,7 +836,7 @@ EnableQuietBoot (
                             Height,\r
                             Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)\r
                             );\r
                             Height,\r
                             Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)\r
                             );\r
-      } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {\r
+      } else if (UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport)) {\r
         Status = UgaDraw->Blt (\r
                             UgaDraw,\r
                             (EFI_UGA_PIXEL *) Blt,\r
         Status = UgaDraw->Blt (\r
                             UgaDraw,\r
                             (EFI_UGA_PIXEL *) Blt,\r
@@ -869,7 +870,7 @@ EnableQuietBoot (
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
-  Use Console Control to turn on UGA based Simple Text Out consoles. The UGA \r
+  Use Console Control to turn on UGA based Simple Text Out consoles. The UGA\r
   Simple Text Out screens will now be synced up with all non UGA output devices\r
 \r
   @retval EFI_SUCCESS     UGA devices are back in text mode and synced up.\r
   Simple Text Out screens will now be synced up with all non UGA output devices\r
 \r
   @retval EFI_SUCCESS     UGA devices are back in text mode and synced up.\r
index 4a23bf911c085fda4e46fb3a99d66d79d30ccc90..f67cd37a5c85396daee08ab8bcd33f274bb336ab 100644 (file)
@@ -48,7 +48,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_GRAPHICS_OUTPUT_BLT_PIXEL mEfiColors[16] = {
   @param Format   Null-terminated Unicode format string.\r
   @param Console  The output console.\r
   @param Marker   VA_LIST marker for the variable argument list.\r
   @param Format   Null-terminated Unicode format string.\r
   @param Console  The output console.\r
   @param Marker   VA_LIST marker for the variable argument list.\r
-  \r
+\r
   @return The number of Unicode characters in the produced\r
           output buffer not including the Null-terminator.\r
 **/\r
   @return The number of Unicode characters in the produced\r
           output buffer not including the Null-terminator.\r
 **/\r
@@ -85,22 +85,22 @@ InternalPrint (
   return Return;\r
 }\r
 \r
   return Return;\r
 }\r
 \r
-/** \r
-  Prints a formatted Unicode string to the console output device specified by \r
+/**\r
+  Prints a formatted Unicode string to the console output device specified by\r
   ConOut defined in the EFI_SYSTEM_TABLE.\r
 \r
   ConOut defined in the EFI_SYSTEM_TABLE.\r
 \r
-  This function prints a formatted Unicode string to the console output device \r
-  specified by ConOut in EFI_SYSTEM_TABLE and returns the number of Unicode \r
-  characters that printed to ConOut.  If the length of the formatted Unicode \r
-  string is greater than PcdUefiLibMaxPrintBufferSize, then only the first \r
+  This function prints a formatted Unicode string to the console output device\r
+  specified by ConOut in EFI_SYSTEM_TABLE and returns the number of Unicode\r
+  characters that printed to ConOut.  If the length of the formatted Unicode\r
+  string is greater than PcdUefiLibMaxPrintBufferSize, then only the first\r
   PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.\r
   If Format is NULL, then ASSERT().\r
   If Format is not aligned on a 16-bit boundary, then ASSERT().\r
 \r
   @param Format   Null-terminated Unicode format string.\r
   PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.\r
   If Format is NULL, then ASSERT().\r
   If Format is not aligned on a 16-bit boundary, then ASSERT().\r
 \r
   @param Format   Null-terminated Unicode format string.\r
-  @param ...      Variable argument list whose contents are accessed based \r
+  @param ...      Variable argument list whose contents are accessed based\r
                   on the format string specified by Format.\r
                   on the format string specified by Format.\r
-  \r
+\r
   @return Number of Unicode characters printed to ConOut.\r
 \r
 **/\r
   @return Number of Unicode characters printed to ConOut.\r
 \r
 **/\r
@@ -123,22 +123,22 @@ Print (
   return Return;\r
 }\r
 \r
   return Return;\r
 }\r
 \r
-/** \r
-  Prints a formatted Unicode string to the console output device specified by \r
+/**\r
+  Prints a formatted Unicode string to the console output device specified by\r
   StdErr defined in the EFI_SYSTEM_TABLE.\r
 \r
   StdErr defined in the EFI_SYSTEM_TABLE.\r
 \r
-  This function prints a formatted Unicode string to the console output device \r
-  specified by StdErr in EFI_SYSTEM_TABLE and returns the number of Unicode \r
-  characters that printed to StdErr.  If the length of the formatted Unicode \r
-  string is greater than PcdUefiLibMaxPrintBufferSize, then only the first \r
+  This function prints a formatted Unicode string to the console output device\r
+  specified by StdErr in EFI_SYSTEM_TABLE and returns the number of Unicode\r
+  characters that printed to StdErr.  If the length of the formatted Unicode\r
+  string is greater than PcdUefiLibMaxPrintBufferSize, then only the first\r
   PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.\r
   If Format is NULL, then ASSERT().\r
   If Format is not aligned on a 16-bit boundary, then ASSERT().\r
 \r
   @param Format   Null-terminated Unicode format string.\r
   PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.\r
   If Format is NULL, then ASSERT().\r
   If Format is not aligned on a 16-bit boundary, then ASSERT().\r
 \r
   @param Format   Null-terminated Unicode format string.\r
-  @param ...      Variable argument list whose contents are accessed based \r
+  @param ...      Variable argument list whose contents are accessed based\r
                   on the format string specified by Format.\r
                   on the format string specified by Format.\r
-  \r
+\r
   @return Number of Unicode characters printed to StdErr.\r
 \r
 **/\r
   @return Number of Unicode characters printed to StdErr.\r
 \r
 **/\r
@@ -213,21 +213,21 @@ AsciiInternalPrint (
   return Return;\r
 }\r
 \r
   return Return;\r
 }\r
 \r
-/** \r
-  Prints a formatted ASCII string to the console output device specified by \r
+/**\r
+  Prints a formatted ASCII string to the console output device specified by\r
   ConOut defined in the EFI_SYSTEM_TABLE.\r
 \r
   ConOut defined in the EFI_SYSTEM_TABLE.\r
 \r
-  This function prints a formatted ASCII string to the console output device \r
-  specified by ConOut in EFI_SYSTEM_TABLE and returns the number of ASCII \r
-  characters that printed to ConOut.  If the length of the formatted ASCII \r
-  string is greater than PcdUefiLibMaxPrintBufferSize, then only the first \r
+  This function prints a formatted ASCII string to the console output device\r
+  specified by ConOut in EFI_SYSTEM_TABLE and returns the number of ASCII\r
+  characters that printed to ConOut.  If the length of the formatted ASCII\r
+  string is greater than PcdUefiLibMaxPrintBufferSize, then only the first\r
   PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.\r
   If Format is NULL, then ASSERT().\r
 \r
   @param Format   Null-terminated ASCII format string.\r
   PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.\r
   If Format is NULL, then ASSERT().\r
 \r
   @param Format   Null-terminated ASCII format string.\r
-  @param ...      Variable argument list whose contents are accessed based \r
+  @param ...      Variable argument list whose contents are accessed based\r
                   on the format string specified by Format.\r
                   on the format string specified by Format.\r
-  \r
+\r
   @return Number of ASCII characters printed to ConOut.\r
 \r
 **/\r
   @return Number of ASCII characters printed to ConOut.\r
 \r
 **/\r
@@ -241,7 +241,7 @@ AsciiPrint (
   VA_LIST Marker;\r
   UINTN   Return;\r
   ASSERT (Format != NULL);\r
   VA_LIST Marker;\r
   UINTN   Return;\r
   ASSERT (Format != NULL);\r
-  \r
+\r
   VA_START (Marker, Format);\r
 \r
   Return = AsciiInternalPrint( Format, gST->ConOut, Marker);\r
   VA_START (Marker, Format);\r
 \r
   Return = AsciiInternalPrint( Format, gST->ConOut, Marker);\r
@@ -251,21 +251,21 @@ AsciiPrint (
   return Return;\r
 }\r
 \r
   return Return;\r
 }\r
 \r
-/** \r
-  Prints a formatted ASCII string to the console output device specified by \r
+/**\r
+  Prints a formatted ASCII string to the console output device specified by\r
   StdErr defined in the EFI_SYSTEM_TABLE.\r
 \r
   StdErr defined in the EFI_SYSTEM_TABLE.\r
 \r
-  This function prints a formatted ASCII string to the console output device \r
-  specified by StdErr in EFI_SYSTEM_TABLE and returns the number of ASCII \r
-  characters that printed to StdErr.  If the length of the formatted ASCII \r
-  string is greater than PcdUefiLibMaxPrintBufferSize, then only the first \r
+  This function prints a formatted ASCII string to the console output device\r
+  specified by StdErr in EFI_SYSTEM_TABLE and returns the number of ASCII\r
+  characters that printed to StdErr.  If the length of the formatted ASCII\r
+  string is greater than PcdUefiLibMaxPrintBufferSize, then only the first\r
   PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.\r
   If Format is NULL, then ASSERT().\r
 \r
   @param Format   Null-terminated ASCII format string.\r
   PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.\r
   If Format is NULL, then ASSERT().\r
 \r
   @param Format   Null-terminated ASCII format string.\r
-  @param ...      Variable argument list whose contents are accessed based \r
+  @param ...      Variable argument list whose contents are accessed based\r
                   on the format string specified by Format.\r
                   on the format string specified by Format.\r
-  \r
+\r
   @return Number of ASCII characters printed to ConErr.\r
 \r
 **/\r
   @return Number of ASCII characters printed to ConErr.\r
 \r
 **/\r
@@ -280,7 +280,7 @@ AsciiErrorPrint (
   UINTN   Return;\r
 \r
   ASSERT (Format != NULL);\r
   UINTN   Return;\r
 \r
   ASSERT (Format != NULL);\r
-  \r
+\r
   VA_START (Marker, Format);\r
 \r
   Return = AsciiInternalPrint( Format, gST->StdErr, Marker);\r
   VA_START (Marker, Format);\r
 \r
   Return = AsciiInternalPrint( Format, gST->StdErr, Marker);\r
@@ -291,19 +291,19 @@ AsciiErrorPrint (
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
-  Internal function to print a formatted Unicode string to a graphics console device specified by \r
+  Internal function to print a formatted Unicode string to a graphics console device specified by\r
   ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates.\r
 \r
   ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates.\r
 \r
-  This function prints a formatted Unicode string to the graphics console device \r
-  specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of \r
-  Unicode characters printed. The EFI_HII_FONT_PROTOCOL is used to convert the \r
-  string to a bitmap using the glyphs registered with the \r
+  This function prints a formatted Unicode string to the graphics console device\r
+  specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of\r
+  Unicode characters printed. The EFI_HII_FONT_PROTOCOL is used to convert the\r
+  string to a bitmap using the glyphs registered with the\r
   HII database.  No wrapping is performed, so any portions of the string the fall\r
   outside the active display region will not be displayed.\r
 \r
   HII database.  No wrapping is performed, so any portions of the string the fall\r
   outside the active display region will not be displayed.\r
 \r
-  If a graphics console device is not associated with the ConsoleOutputHandle \r
+  If a graphics console device is not associated with the ConsoleOutputHandle\r
   defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned.\r
   defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned.\r
-  If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no \r
+  If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no\r
   string is printed, and 0 is returned.\r
 \r
   @param  X            X coordinate to print the string.\r
   string is printed, and 0 is returned.\r
 \r
   @param  X            X coordinate to print the string.\r
@@ -313,13 +313,13 @@ AsciiErrorPrint (
                        then the foreground color of the current ConOut device\r
                        in the EFI_SYSTEM_TABLE is used.\r
   @param  BackGround   The background color of the string being printed.  This is\r
                        then the foreground color of the current ConOut device\r
                        in the EFI_SYSTEM_TABLE is used.\r
   @param  BackGround   The background color of the string being printed.  This is\r
-                       an optional parameter that may be NULL.  If it is NULL, \r
+                       an optional parameter that may be NULL.  If it is NULL,\r
                        then the background color of the current ConOut device\r
                        in the EFI_SYSTEM_TABLE is used.\r
   @param  Buffer       Null-terminated Unicode formatted string.\r
   @param  PrintNum     The number of Unicode formatted string to be printed.\r
 \r
                        then the background color of the current ConOut device\r
                        in the EFI_SYSTEM_TABLE is used.\r
   @param  Buffer       Null-terminated Unicode formatted string.\r
   @param  PrintNum     The number of Unicode formatted string to be printed.\r
 \r
-  @return  Number of Unicode Characters printed. Zero means no any character \r
+  @return  Number of Unicode Characters printed. Zero means no any character\r
            displayed successfully.\r
 \r
 **/\r
            displayed successfully.\r
 \r
 **/\r
@@ -393,7 +393,7 @@ InternalPrintGraphic (
   if (GraphicsOutput != NULL) {\r
     HorizontalResolution = GraphicsOutput->Mode->Info->HorizontalResolution;\r
     VerticalResolution = GraphicsOutput->Mode->Info->VerticalResolution;\r
   if (GraphicsOutput != NULL) {\r
     HorizontalResolution = GraphicsOutput->Mode->Info->HorizontalResolution;\r
     VerticalResolution = GraphicsOutput->Mode->Info->VerticalResolution;\r
-  } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {\r
+  } else if (UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport)) {\r
     UgaDraw->GetMode (UgaDraw, &HorizontalResolution, &VerticalResolution, &ColorDepth, &RefreshRate);\r
   } else {\r
     Status = EFI_UNSUPPORTED;\r
     UgaDraw->GetMode (UgaDraw, &HorizontalResolution, &VerticalResolution, &ColorDepth, &RefreshRate);\r
   } else {\r
     Status = EFI_UNSUPPORTED;\r
@@ -452,7 +452,7 @@ InternalPrintGraphic (
 \r
   if (GraphicsOutput != NULL) {\r
     Blt->Image.Screen = GraphicsOutput;\r
 \r
   if (GraphicsOutput != NULL) {\r
     Blt->Image.Screen = GraphicsOutput;\r
-    \r
+\r
     Status = HiiFont->StringToImage (\r
                          HiiFont,\r
                          EFI_HII_IGNORE_IF_NO_GLYPH | EFI_HII_DIRECT_TO_SCREEN,\r
     Status = HiiFont->StringToImage (\r
                          HiiFont,\r
                          EFI_HII_IGNORE_IF_NO_GLYPH | EFI_HII_DIRECT_TO_SCREEN,\r
@@ -530,21 +530,21 @@ Error:
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
-  Prints a formatted Unicode string to a graphics console device specified by \r
+  Prints a formatted Unicode string to a graphics console device specified by\r
   ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates.\r
 \r
   ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates.\r
 \r
-  This function prints a formatted Unicode string to the graphics console device \r
-  specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of \r
+  This function prints a formatted Unicode string to the graphics console device\r
+  specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of\r
   Unicode characters printed.  If the length of the formatted Unicode string is\r
   Unicode characters printed.  If the length of the formatted Unicode string is\r
-  greater than PcdUefiLibMaxPrintBufferSize, then only the first \r
+  greater than PcdUefiLibMaxPrintBufferSize, then only the first\r
   PcdUefiLibMaxPrintBufferSize characters are printed.  The EFI_HII_FONT_PROTOCOL\r
   PcdUefiLibMaxPrintBufferSize characters are printed.  The EFI_HII_FONT_PROTOCOL\r
-  is used to convert the string to a bitmap using the glyphs registered with the \r
+  is used to convert the string to a bitmap using the glyphs registered with the\r
   HII database.  No wrapping is performed, so any portions of the string the fall\r
   outside the active display region will not be displayed.\r
 \r
   HII database.  No wrapping is performed, so any portions of the string the fall\r
   outside the active display region will not be displayed.\r
 \r
-  If a graphics console device is not associated with the ConsoleOutputHandle \r
+  If a graphics console device is not associated with the ConsoleOutputHandle\r
   defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned.\r
   defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned.\r
-  If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no \r
+  If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no\r
   string is printed, and 0 is returned.\r
   If Format is NULL, then ASSERT().\r
   If Format is not aligned on a 16-bit boundary, then ASSERT().\r
   string is printed, and 0 is returned.\r
   If Format is NULL, then ASSERT().\r
   If Format is not aligned on a 16-bit boundary, then ASSERT().\r
@@ -556,13 +556,13 @@ Error:
                        then the foreground color of the current ConOut device\r
                        in the EFI_SYSTEM_TABLE is used.\r
   @param  BackGround   The background color of the string being printed.  This is\r
                        then the foreground color of the current ConOut device\r
                        in the EFI_SYSTEM_TABLE is used.\r
   @param  BackGround   The background color of the string being printed.  This is\r
-                       an optional parameter that may be NULL.  If it is NULL, \r
+                       an optional parameter that may be NULL.  If it is NULL,\r
                        then the background color of the current ConOut device\r
                        in the EFI_SYSTEM_TABLE is used.\r
                        then the background color of the current ConOut device\r
                        in the EFI_SYSTEM_TABLE is used.\r
-  @param  Format       Null-terminated Unicode format string.  See Print Library \r
+  @param  Format       Null-terminated Unicode format string.  See Print Library\r
                        for the supported format string syntax.\r
                        for the supported format string syntax.\r
-  @param  ...          Variable argument list whose contents are accessed based on \r
-                       the format string specified by Format.         \r
+  @param  ...          Variable argument list whose contents are accessed based on\r
+                       the format string specified by Format.\r
 \r
   @return  The number of Unicode characters printed.\r
 \r
 \r
   @return  The number of Unicode characters printed.\r
 \r
@@ -593,7 +593,7 @@ PrintXY (
 \r
   Buffer = (CHAR16 *) AllocatePool (BufferSize);\r
   ASSERT (Buffer != NULL);\r
 \r
   Buffer = (CHAR16 *) AllocatePool (BufferSize);\r
   ASSERT (Buffer != NULL);\r
-    \r
+\r
   PrintNum = UnicodeVSPrint (Buffer, BufferSize, Format, Marker);\r
 \r
   ReturnNum = InternalPrintGraphic (X, Y, ForeGround, BackGround, Buffer, PrintNum);\r
   PrintNum = UnicodeVSPrint (Buffer, BufferSize, Format, Marker);\r
 \r
   ReturnNum = InternalPrintGraphic (X, Y, ForeGround, BackGround, Buffer, PrintNum);\r
@@ -604,21 +604,21 @@ PrintXY (
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
-  Prints a formatted ASCII string to a graphics console device specified by \r
+  Prints a formatted ASCII string to a graphics console device specified by\r
   ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates.\r
 \r
   ConsoleOutputHandle defined in the EFI_SYSTEM_TABLE at the given (X,Y) coordinates.\r
 \r
-  This function prints a formatted ASCII string to the graphics console device \r
-  specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of \r
+  This function prints a formatted ASCII string to the graphics console device\r
+  specified by ConsoleOutputHandle in EFI_SYSTEM_TABLE and returns the number of\r
   ASCII characters printed.  If the length of the formatted ASCII string is\r
   ASCII characters printed.  If the length of the formatted ASCII string is\r
-  greater than PcdUefiLibMaxPrintBufferSize, then only the first \r
+  greater than PcdUefiLibMaxPrintBufferSize, then only the first\r
   PcdUefiLibMaxPrintBufferSize characters are printed.  The EFI_HII_FONT_PROTOCOL\r
   PcdUefiLibMaxPrintBufferSize characters are printed.  The EFI_HII_FONT_PROTOCOL\r
-  is used to convert the string to a bitmap using the glyphs registered with the \r
+  is used to convert the string to a bitmap using the glyphs registered with the\r
   HII database.  No wrapping is performed, so any portions of the string the fall\r
   outside the active display region will not be displayed.\r
 \r
   HII database.  No wrapping is performed, so any portions of the string the fall\r
   outside the active display region will not be displayed.\r
 \r
-  If a graphics console device is not associated with the ConsoleOutputHandle \r
+  If a graphics console device is not associated with the ConsoleOutputHandle\r
   defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned.\r
   defined in the EFI_SYSTEM_TABLE then no string is printed, and 0 is returned.\r
-  If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no \r
+  If the EFI_HII_FONT_PROTOCOL is not present in the handle database, then no\r
   string is printed, and 0 is returned.\r
   If Format is NULL, then ASSERT().\r
 \r
   string is printed, and 0 is returned.\r
   If Format is NULL, then ASSERT().\r
 \r
@@ -629,13 +629,13 @@ PrintXY (
                        then the foreground color of the current ConOut device\r
                        in the EFI_SYSTEM_TABLE is used.\r
   @param  BackGround   The background color of the string being printed.  This is\r
                        then the foreground color of the current ConOut device\r
                        in the EFI_SYSTEM_TABLE is used.\r
   @param  BackGround   The background color of the string being printed.  This is\r
-                       an optional parameter that may be NULL.  If it is NULL, \r
+                       an optional parameter that may be NULL.  If it is NULL,\r
                        then the background color of the current ConOut device\r
                        in the EFI_SYSTEM_TABLE is used.\r
                        then the background color of the current ConOut device\r
                        in the EFI_SYSTEM_TABLE is used.\r
-  @param  Format       Null-terminated ASCII format string.  See Print Library \r
+  @param  Format       Null-terminated ASCII format string.  See Print Library\r
                        for the supported format string syntax.\r
                        for the supported format string syntax.\r
-  @param  ...          Variable argument list whose contents are accessed based on \r
-                       the format string specified by Format.         \r
+  @param  ...          Variable argument list whose contents are accessed based on\r
+                       the format string specified by Format.\r
 \r
   @return  The number of ASCII characters printed.\r
 \r
 \r
   @return  The number of ASCII characters printed.\r
 \r
@@ -665,13 +665,13 @@ AsciiPrintXY (
 \r
   Buffer = (CHAR16 *) AllocatePool (BufferSize);\r
   ASSERT (Buffer != NULL);\r
 \r
   Buffer = (CHAR16 *) AllocatePool (BufferSize);\r
   ASSERT (Buffer != NULL);\r
-    \r
+\r
   PrintNum = UnicodeSPrintAsciiFormat (Buffer, BufferSize, Format, Marker);\r
 \r
   ReturnNum = InternalPrintGraphic (X, Y, ForeGround, BackGround, Buffer, PrintNum);\r
 \r
   FreePool (Buffer);\r
   PrintNum = UnicodeSPrintAsciiFormat (Buffer, BufferSize, Format, Marker);\r
 \r
   ReturnNum = InternalPrintGraphic (X, Y, ForeGround, BackGround, Buffer, PrintNum);\r
 \r
   FreePool (Buffer);\r
\r
+\r
   return ReturnNum;\r
 }\r
 \r
   return ReturnNum;\r
 }\r
 \r