mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00: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:
parent
39d8a822d2
commit
77e891b8ab
2 changed files with 10 additions and 1 deletions
|
@ -37,6 +37,7 @@ EngpUpdateGraphicsDeviceList(VOID)
|
||||||
{
|
{
|
||||||
ULONG iDevNum, iVGACompatible = -1, ulMaxObjectNumber = 0;
|
ULONG iDevNum, iVGACompatible = -1, ulMaxObjectNumber = 0;
|
||||||
WCHAR awcDeviceName[20];
|
WCHAR awcDeviceName[20];
|
||||||
|
UNICODE_STRING ustrDeviceName;
|
||||||
WCHAR awcBuffer[256];
|
WCHAR awcBuffer[256];
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PGRAPHICS_DEVICE pGraphicsDevice;
|
PGRAPHICS_DEVICE pGraphicsDevice;
|
||||||
|
@ -73,6 +74,14 @@ EngpUpdateGraphicsDeviceList(VOID)
|
||||||
{
|
{
|
||||||
/* Create the adapter's key name */
|
/* Create the adapter's key name */
|
||||||
swprintf(awcDeviceName, L"\\Device\\Video%lu", iDevNum);
|
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 */
|
/* Read the reg key name */
|
||||||
cbValue = sizeof(awcBuffer);
|
cbValue = sizeof(awcBuffer);
|
||||||
|
|
|
@ -257,7 +257,7 @@ UserEnumDisplayDevices(
|
||||||
if (!pGraphicsDevice)
|
if (!pGraphicsDevice)
|
||||||
{
|
{
|
||||||
/* No device found */
|
/* No device found */
|
||||||
ERR("No GRAPHICS_DEVICE found\n");
|
ERR("No GRAPHICS_DEVICE found for '%wZ', iDevNum %lu\n", pustrDevice, iDevNum);
|
||||||
return STATUS_UNSUCCESSFUL;
|
return STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue