Author: tkreuzer
Date: Sat Oct 30 16:34:52 2010
New Revision: 49360
URL:
http://svn.reactos.org/svn/reactos?rev=49360&view=rev
Log:
[WIN32K]
Fix a bug in InitVideo: when looping through the adapters, reinitialize the cbValue before
querying the registry.
Also handle failure.
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/display.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/display.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/display.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/display.c [iso-8859-1] Sat Oct 30
16:34:52 2010
@@ -206,14 +206,19 @@
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);