[I8042PRT]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Thu, 19 Mar 2015 22:37:43 +0000 (22:37 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Thu, 19 Mar 2015 22:37:43 +0000 (22:37 +0000)
Fix an off-by-one error in the SMTABLE string parsing code. Enable SYS_VERSION string for VirtualPc detection. Should hopefully fix VirtualPc mouse.

svn path=/trunk/; revision=66825

reactos/drivers/input/i8042prt/hwhacks.c

index 4f5bf94..83f3acc 100644 (file)
@@ -59,7 +59,7 @@ const HARDWARE_TABLE i8042HardwareTable[] =
 //    { {{BOARD_VENDOR, "RIOWORKS"}, {BOARD_NAME, "HDAMB"}, {BOARD_VERSION, "Rev E"}}, FL_NOLOOP },
 //    { {{BOARD_VENDOR, "ASUSTeK Computer Inc."}, {BOARD_NAME, "G1S"}, {BOARD_VERSION, "1.0"}}, FL_NOLOOP },
 
-    { {{SYS_VENDOR, "Microsoft Corporation"}, {SYS_PRODUCT, "Virtual Machine"}, /*{SYS_VERSION, "VS2005R2"} */}, FL_INITHACK },
+    { {{SYS_VENDOR, "Microsoft Corporation"}, {SYS_PRODUCT, "Virtual Machine"}, {SYS_VERSION, "VS2005R2"} }, FL_INITHACK },
     { {{SYS_VENDOR, "Dell Inc."}, {SYS_PRODUCT, "Latitude D530"}}, FL_INITHACK },
     { {{SYS_VENDOR, "Dell Inc."}, {SYS_PRODUCT, "Latitude D600"}}, FL_INITHACK },
 
@@ -77,15 +77,19 @@ GetDmiString(
     PCHAR String;
 
     StringIndex = ((PUCHAR)Header)[FieldOffset];
+    if (StringIndex == 0)
+    {
+        return NULL;
+    }
+
     String = (PCHAR)Header + Header->Length;
 
-    while (StringIndex != 0)
+    while (--StringIndex != 0)
     {
         while (*String != 0)
             String++;
 
         String++;
-        StringIndex--;
     }
 
     return String;