Author: cgutman
Date: Thu Oct 27 19:11:22 2011
New Revision: 54260

URL: http://svn.reactos.org/svn/reactos?rev=54260&view=rev
Log:
[FREELDR]
- Check VESA BIOS signature before reporting VESA extensions are present

Modified:
    trunk/reactos/boot/freeldr/freeldr/arch/i386/i386vid.c

Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/i386vid.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i386/i386vid.c?rev=54260&r1=54259&r2=54260&view=diff
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/i386vid.c [iso-8859-1] 
(original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/i386vid.c [iso-8859-1] Thu Oct 
27 19:11:22 2011
@@ -205,7 +205,7 @@
 
        if (Regs.w.ax != 0x004F)
        {
-               TRACE("Failed.\n");
+               ERR("VESA BIOS call failed\n");
                return 0x0000;
        }
 
@@ -222,22 +222,18 @@
        TRACE("SvgaInfo->ProductRevisionStringPtr = 0x%x\n", 
SvgaInfo->ProductRevisionStringPtr);
        TRACE("SvgaInfo->VBE/AF Version = 0x%x (BCD WORD)\n", 
SvgaInfo->VBE_AF_Version);
 
-       //TRACE("\nSupported VESA and OEM video modes:\n");
-       //VideoModes = (USHORT*)SvgaInfo->SupportedModeListPtr;
-       //for (Index=0; VideoModes[Index]!=0xFFFF; Index++)
-       //{
-       //      TRACE("Mode %d: 0x%x\n", Index, VideoModes[Index]);
-       //}
-
-       //if (SvgaInfo->VesaVersion >= 0x0200)
-       //{
-       //      TRACE("\nSupported accelerated video modes (VESA v2.0):\n");
-       //      VideoModes = (USHORT*)SvgaInfo->AcceleratedModeListPtr;
-       //      for (Index=0; VideoModes[Index]!=0xFFFF; Index++)
-       //      {
-       //              TRACE("Mode %d: 0x%x\n", Index, VideoModes[Index]);
-       //      }
-       //}
+    if (SvgaInfo->Signature[0] != 'V' ||
+        SvgaInfo->Signature[1] != 'E' ||
+        SvgaInfo->Signature[2] != 'S' ||
+        SvgaInfo->Signature[3] != 'A')
+    {
+        ERR("Bad signature in VESA information (%c%c%c%c)\n",
+            SvgaInfo->Signature[0],
+            SvgaInfo->Signature[1],
+            SvgaInfo->Signature[2],
+            SvgaInfo->Signature[3]);
+        return 0x0000;
+    }
 
        return SvgaInfo->VesaVersion;
 }


Reply via email to