From 87ba1dad432d7fa0954c5b79d30f69ec7ec7d51f Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 14 Oct 2011 14:50:22 +0000 Subject: [PATCH] [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. svn path=/trunk/; revision=54135 --- reactos/drivers/video/videoprt/videoprt.c | 28 ++++------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/reactos/drivers/video/videoprt/videoprt.c b/reactos/drivers/video/videoprt/videoprt.c index f90801d986a..3f6adb391b2 100644 --- a/reactos/drivers/video/videoprt/videoprt.c +++ b/reactos/drivers/video/videoprt/videoprt.c @@ -359,7 +359,7 @@ IntVideoPortFindAdapter( 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 @@ IntVideoPortFindAdapter( 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",