mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[WIN32SS:ENG] Add EngpLinkGraphicsDevice, to add a device to gpGraphicsDeviceFirst list
This commit is contained in:
parent
3d01a103d7
commit
b3cdb7e713
1 changed files with 31 additions and 6 deletions
|
@ -98,6 +98,36 @@ EngpHasVgaDriver(
|
|||
return (_wcsnicmp(awcServiceName, L"VGA", 3) == 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Add a device to gpGraphicsDeviceFirst/gpGraphicsDeviceLast list (if not already present).
|
||||
*/
|
||||
_Requires_lock_held_(ghsemGraphicsDeviceList)
|
||||
static
|
||||
VOID
|
||||
EngpLinkGraphicsDevice(
|
||||
_In_ PGRAPHICS_DEVICE pToAdd)
|
||||
{
|
||||
PGRAPHICS_DEVICE pGraphicsDevice;
|
||||
|
||||
TRACE("EngLinkGraphicsDevice(%p)\n", pToAdd);
|
||||
|
||||
/* Search if device is not already linked */
|
||||
for (pGraphicsDevice = gpGraphicsDeviceFirst;
|
||||
pGraphicsDevice;
|
||||
pGraphicsDevice = pGraphicsDevice->pNextGraphicsDevice)
|
||||
{
|
||||
if (pGraphicsDevice == pToAdd)
|
||||
return;
|
||||
}
|
||||
|
||||
pToAdd->pNextGraphicsDevice = NULL;
|
||||
if (gpGraphicsDeviceLast)
|
||||
gpGraphicsDeviceLast->pNextGraphicsDevice = pToAdd;
|
||||
gpGraphicsDeviceLast = pToAdd;
|
||||
if (!gpGraphicsDeviceFirst)
|
||||
gpGraphicsDeviceFirst = pToAdd;
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove a device from gpGraphicsDeviceFirst/gpGraphicsDeviceLast list.
|
||||
*/
|
||||
|
@ -567,12 +597,7 @@ EngpRegisterGraphicsDevice(
|
|||
EngAcquireSemaphore(ghsemGraphicsDeviceList);
|
||||
|
||||
/* Insert the device into the global list */
|
||||
pGraphicsDevice->pNextGraphicsDevice = NULL;
|
||||
if (gpGraphicsDeviceLast)
|
||||
gpGraphicsDeviceLast->pNextGraphicsDevice = pGraphicsDevice;
|
||||
gpGraphicsDeviceLast = pGraphicsDevice;
|
||||
if (!gpGraphicsDeviceFirst)
|
||||
gpGraphicsDeviceFirst = pGraphicsDevice;
|
||||
EngpLinkGraphicsDevice(pGraphicsDevice);
|
||||
|
||||
/* Increment the device number */
|
||||
giDevNum++;
|
||||
|
|
Loading…
Reference in a new issue