From a4b48e3576981e2d7f810ebb77f284bd4ff646e5 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 30 Oct 2010 16:34:52 +0000 Subject: [PATCH] [WIN32K] Fix a bug in InitVideo: when looping through the adapters, reinitialize the cbValue before querying the registry. Also handle failure. svn path=/trunk/; revision=49360 --- reactos/subsystems/win32/win32k/ntuser/display.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/reactos/subsystems/win32/win32k/ntuser/display.c b/reactos/subsystems/win32/win32k/ntuser/display.c index 7ab53638f1a..95f4aee4e7e 100644 --- a/reactos/subsystems/win32/win32k/ntuser/display.c +++ b/reactos/subsystems/win32/win32k/ntuser/display.c @@ -206,14 +206,19 @@ InitVideo( DPRINT("Found %ld devices\n", ulMaxObjectNumber); /* Loop through all adapters */ - cbValue = 256; for (iDevNum = 0; iDevNum <= ulMaxObjectNumber; iDevNum++) { /* Create the adapter's key name */ swprintf(awcDeviceName, L"\\Device\\Video%lu", iDevNum); /* Read the reg key name */ + cbValue = sizeof(awcBuffer); Status = RegQueryValue(hkey, awcDeviceName, REG_SZ, awcBuffer, &cbValue); + if (!NT_SUCCESS(Status)) + { + DPRINT1("failed to query the registry path:0x%lx\n", Status); + continue; + } pGraphicsDevice = InitDisplayDriver(awcDeviceName, awcBuffer); -- 2.17.1