mirror of
https://github.com/reactos/reactos.git
synced 2026-05-30 23:33:24 +08:00
[WIN32SS:ENG] Set VGA device as child of primary device
That way, we don't have anymore the VGA device together with primary device in device list. Change also EngpUnlinkGraphicsDevice() function to add back VGA device to device list when removing its parent from device list. CORE-18522
This commit is contained in:
@@ -152,6 +152,10 @@ EngpUnlinkGraphicsDevice(
|
||||
}
|
||||
else
|
||||
{
|
||||
/* At first, link again associated VGA Device */
|
||||
if (pGraphicsDevice->pVgaDevice)
|
||||
EngpLinkGraphicsDevice(pGraphicsDevice->pVgaDevice);
|
||||
|
||||
/* We need to remove current device */
|
||||
pGraphicsDevice = pGraphicsDevice->pNextGraphicsDevice;
|
||||
|
||||
@@ -247,7 +251,7 @@ EngpUpdateGraphicsDeviceList(VOID)
|
||||
bFoundNewDevice = TRUE;
|
||||
|
||||
/* Set the first one as primary device */
|
||||
if (!gpPrimaryGraphicsDevice)
|
||||
if (!gpPrimaryGraphicsDevice || EngpHasVgaDriver(gpPrimaryGraphicsDevice))
|
||||
{
|
||||
gpPrimaryGraphicsDevice = pGraphicsDevice;
|
||||
TRACE("gpPrimaryGraphicsDevice = %p\n", gpPrimaryGraphicsDevice);
|
||||
@@ -257,6 +261,18 @@ EngpUpdateGraphicsDeviceList(VOID)
|
||||
/* Close the device map registry key */
|
||||
ZwClose(hkey);
|
||||
|
||||
/* Can we link VGA device to primary device? */
|
||||
if (gpPrimaryGraphicsDevice &&
|
||||
gpVgaGraphicsDevice &&
|
||||
gpPrimaryGraphicsDevice != gpVgaGraphicsDevice &&
|
||||
!gpPrimaryGraphicsDevice->pVgaDevice)
|
||||
{
|
||||
/* Yes. Remove VGA device from global list, and attach it to primary device */
|
||||
TRACE("Linking VGA device %S to primary device %S\n", gpVgaGraphicsDevice->szNtDeviceName, gpPrimaryGraphicsDevice->szNtDeviceName);
|
||||
EngpUnlinkGraphicsDevice(gpVgaGraphicsDevice);
|
||||
gpPrimaryGraphicsDevice->pVgaDevice = gpVgaGraphicsDevice;
|
||||
}
|
||||
|
||||
if (bFoundNewDevice && gbBaseVideo)
|
||||
{
|
||||
PGRAPHICS_DEVICE pToDelete;
|
||||
|
||||
Reference in New Issue
Block a user