mirror of
https://github.com/reactos/reactos.git
synced 2026-06-03 01:41:13 +08:00
[WIN32K] Check if a graphics device already exists before trying to add it
This avoids DPRINTs alleging a failure to open a device. Also improve another DPRINT.
This commit is contained in:
@@ -37,6 +37,7 @@ EngpUpdateGraphicsDeviceList(VOID)
|
||||
{
|
||||
ULONG iDevNum, iVGACompatible = -1, ulMaxObjectNumber = 0;
|
||||
WCHAR awcDeviceName[20];
|
||||
UNICODE_STRING ustrDeviceName;
|
||||
WCHAR awcBuffer[256];
|
||||
NTSTATUS Status;
|
||||
PGRAPHICS_DEVICE pGraphicsDevice;
|
||||
@@ -73,6 +74,14 @@ EngpUpdateGraphicsDeviceList(VOID)
|
||||
{
|
||||
/* Create the adapter's key name */
|
||||
swprintf(awcDeviceName, L"\\Device\\Video%lu", iDevNum);
|
||||
RtlInitUnicodeString(&ustrDeviceName, awcDeviceName);
|
||||
|
||||
/* Check if the device exists already */
|
||||
pGraphicsDevice = EngpFindGraphicsDevice(&ustrDeviceName, iDevNum, 0);
|
||||
if (pGraphicsDevice != NULL)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Read the reg key name */
|
||||
cbValue = sizeof(awcBuffer);
|
||||
|
||||
@@ -257,7 +257,7 @@ UserEnumDisplayDevices(
|
||||
if (!pGraphicsDevice)
|
||||
{
|
||||
/* No device found */
|
||||
ERR("No GRAPHICS_DEVICE found\n");
|
||||
ERR("No GRAPHICS_DEVICE found for '%wZ', iDevNum %lu\n", pustrDevice, iDevNum);
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user