From d4fd0cd125ee3cd4acc698688d5f62ec0695e2c1 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 14 Oct 2011 13:41:03 +0000 Subject: [PATCH] [WIN32K] - 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 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/reactos/subsystems/win32/win32k/eng/device.c b/reactos/subsystems/win32/win32k/eng/device.c index b20ad072db2..6fd6c8746b8 100644 --- a/reactos/subsystems/win32/win32k/eng/device.c +++ b/reactos/subsystems/win32/win32k/eng/device.c @@ -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?