Author: tkreuzer
Date: Fri Oct 14 14:50:22 2011
New Revision: 54135
URL: http://svn.reactos.org/svn/reactos?rev=54135&view=rev
Log:
[VIDEOPRT]
Remove an old hack, that caused an inconsistency between the display's device object name and the name of its symbolic link / registry key. The hack isn't needed anymore, because win32k now loads the next device if one isn't available. Fixes VBoxVideo being loaded together with framebuf.dll instead of VBoxDisp.dll and now the mouse pointer integration works completely.
Modified:
trunk/reactos/drivers/video/videoprt/videoprt.c
Modified: trunk/reactos/drivers/video/videoprt/videoprt.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/videoprt/vid…
==============================================================================
--- trunk/reactos/drivers/video/videoprt/videoprt.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/video/videoprt/videoprt.c [iso-8859-1] Fri Oct 14 14:50:22 2011
@@ -359,7 +359,7 @@
WCHAR SymlinkBuffer[20];
UNICODE_STRING SymlinkName;
BOOL LegacyDetection = FALSE;
- ULONG DeviceNumber, DisplayNumber;
+ ULONG DeviceNumber;
DeviceExtension = (PVIDEO_PORT_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
DeviceNumber = DeviceExtension->DeviceNumber;
@@ -480,30 +480,12 @@
RtlInitUnicodeString(&DeviceName, DeviceBuffer);
/* Create symbolic link "\??\DISPLAYx" */
-
- /* HACK: We need this to find the first available display to
- * use. We can't use the device number because then we could
- * end up with \Device\Video0 being non-functional because
- * HwFindAdapter returned an error. \Device\Video1 would be
- * the correct primary display but it would be set to DISPLAY2
- * so it would never be used and ROS would bugcheck on boot.
- * By doing it this way, we ensure that DISPLAY1 is always
- * functional. Another idea would be letting the IO manager
- * give our video devices names then getting those names
- * somehow and creating symbolic links to \Device\VideoX
- * and \??\DISPLAYX once we know that HwFindAdapter has succeeded.
- */
- DisplayNumber = 0;
- do
- {
- DisplayNumber++;
- swprintf(SymlinkBuffer, L"\\??\\DISPLAY%lu", DisplayNumber);
- RtlInitUnicodeString(&SymlinkName, SymlinkBuffer);
- }
- while (IoCreateSymbolicLink(&SymlinkName, &DeviceName) != STATUS_SUCCESS);
+ swprintf(SymlinkBuffer, L"\\??\\DISPLAY%lu", DeviceNumber + 1);
+ RtlInitUnicodeString(&SymlinkName, SymlinkBuffer);
+ IoCreateSymbolicLink(&SymlinkName, &DeviceName);
/* Add entry to DEVICEMAP\VIDEO key in registry. */
- swprintf(DeviceVideoBuffer, L"\\Device\\Video%d", DisplayNumber - 1);
+ swprintf(DeviceVideoBuffer, L"\\Device\\Video%d", DeviceNumber);
RtlWriteRegistryValue(
RTL_REGISTRY_DEVICEMAP,
L"VIDEO",
Author: tkreuzer
Date: Fri Oct 14 13:41:03 2011
New Revision: 54133
URL: http://svn.reactos.org/svn/reactos?rev=54133&view=rev
Log:
[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.
Modified:
trunk/reactos/subsystems/win32/win32k/eng/device.c
Modified: trunk/reactos/subsystems/win32/win32k/eng/device.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/eng/device.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/eng/device.c [iso-8859-1] Fri Oct 14 13:41:03 2011
@@ -148,13 +148,19 @@
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?