[WIN32K]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Fri, 14 Oct 2011 13:41:03 +0000 (13:41 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Fri, 14 Oct 2011 13:41:03 +0000 (13:41 +0000)
- Since some display drivers don't do as they should - return the drisplay driver name in the DEVMODE's dmDisplayName field - but return the miniport driver name, fix that name when creating the mode list. This fixes loading of VBox driver, when it is installed properly, which needs to be fixed as well.

svn path=/trunk/; revision=54133

reactos/subsystems/win32/win32k/eng/device.c

index b20ad07..6fd6c87 100644 (file)
@@ -148,13 +148,19 @@ EngpRegisterGraphicsDevice(
         pdminfo->pdmiNext = pGraphicsDevice->pdevmodeInfo;
         pGraphicsDevice->pdevmodeInfo = pdminfo;
 
-        /* Count DEVMODEs */
+        /* Loop all DEVMODEs */
         pdmEnd = (DEVMODEW*)((PCHAR)pdminfo->adevmode + pdminfo->cbdevmode);
         for (pdm = pdminfo->adevmode;
              pdm + 1 <= pdmEnd;
              pdm = (DEVMODEW*)((PCHAR)pdm + pdm->dmSize + pdm->dmDriverExtra))
         {
+            /* Count this DEVMODE */
             cModes++;
+
+            /* Some drivers like the VBox driver don't fill the dmDeviceName
+               with the name of the display driver. So fix that here. */
+            wcsncpy(pdm->dmDeviceName, pwsz, CCHDEVICENAME);
+            pdm->dmDeviceName[CCHDEVICENAME - 1] = 0;
         }
 
         // FIXME: release the driver again until it's used?