[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
This commit is contained in:
Timo Kreuzer 2011-10-14 14:50:22 +00:00
parent a7dfeac07a
commit 87ba1dad43

View file

@ -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",