[WIN32K]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 16 Oct 2011 09:15:19 +0000 (09:15 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 16 Oct 2011 09:15:19 +0000 (09:15 +0000)
- Fix insertion of the GRAPHICS_DEVICE into the global list. Fixes mode enumeration when the 2nd adapter is used.
- Remove a hack.

svn path=/trunk/; revision=54156

reactos/subsystems/win32/win32k/eng/device.c
reactos/subsystems/win32/win32k/ntuser/display.c

index eab8515..da22999 100644 (file)
@@ -220,7 +220,9 @@ EngpRegisterGraphicsDevice(
     EngAcquireSemaphore(ghsemGraphicsDeviceList);
 
     /* Insert the device into the global list */
-    pGraphicsDevice->pNextGraphicsDevice = gpGraphicsDeviceLast;
+    pGraphicsDevice->pNextGraphicsDevice = NULL;
+    if (gpGraphicsDeviceLast)
+        gpGraphicsDeviceLast->pNextGraphicsDevice = pGraphicsDevice;
     gpGraphicsDeviceLast = pGraphicsDevice;
     if (!gpGraphicsDeviceFirst)
         gpGraphicsDeviceFirst = pGraphicsDevice;
@@ -246,11 +248,13 @@ EngpFindGraphicsDevice(
     UNICODE_STRING ustrCurrent;
     PGRAPHICS_DEVICE pGraphicsDevice;
     ULONG i;
+    DPRINT("EngpFindGraphicsDevice('%wZ', %ld, 0x%lx)\n",
+           pustrDevice, iDevNum, dwFlags);
 
     /* Lock list */
     EngAcquireSemaphore(ghsemGraphicsDeviceList);
 
-    if (pustrDevice)
+    if (pustrDevice && pustrDevice->Buffer)
     {
         /* Loop through the list of devices */
         for (pGraphicsDevice = gpGraphicsDeviceFirst;
index c63ee17..27aa234 100644 (file)
@@ -307,7 +307,7 @@ UserEnumDisplayDevices(
         return STATUS_UNSUCCESSFUL;
     }
 
-    /* Open thhe device map registry key */
+    /* Open the device map registry key */
     Status = RegOpenKey(KEY_VIDEO, &hkey);
     if (!NT_SUCCESS(Status))
     {
@@ -354,10 +354,6 @@ NtUserEnumDisplayDevices(
     TRACE("Enter NtUserEnumDisplayDevices(%wZ, %ld)\n",
            pustrDevice, iDevNum);
 
-    // FIXME: HACK, desk.cpl passes broken crap
-    if (pustrDevice && iDevNum != 0)
-        return FALSE;
-
     dispdev.cb = sizeof(dispdev);
 
     if (pustrDevice)
@@ -423,7 +419,7 @@ NtUserEnumDisplayDevices(
         _SEH2_END
     }
 
-    ERR("Leave NtUserEnumDisplayDevices, Status = 0x%lx\n", Status);
+    TRACE("Leave NtUserEnumDisplayDevices, Status = 0x%lx\n", Status);
     /* Return the result */
 //    return Status;
     return NT_SUCCESS(Status); // FIXME
@@ -464,8 +460,8 @@ UserEnumDisplaySettings(
     PDEVMODEENTRY pdmentry;
     ULONG i, iFoundMode;
 
-    TRACE("Enter UserEnumDisplaySettings('%ls', %ld)\n",
-            pustrDevice ? pustrDevice->Buffer : NULL, iModeNum);
+    TRACE("Enter UserEnumDisplaySettings('%wZ', %ld)\n",
+            pustrDevice, iModeNum);
 
     /* Ask gdi for the GRAPHICS_DEVICE */
     pGraphicsDevice = EngpFindGraphicsDevice(pustrDevice, 0, 0);
@@ -570,8 +566,8 @@ NtUserEnumDisplaySettings(
     ULONG cbSize, cbExtra;
     DEVMODEW dmReg, *pdm;
 
-    TRACE("Enter NtUserEnumDisplaySettings(%ls, %ld)\n",
-            pustrDevice ? pustrDevice->Buffer : 0, iModeNum);
+    TRACE("Enter NtUserEnumDisplaySettings(%wZ, %ld, %p, 0x%lx)\n",
+            pustrDevice, iModeNum, lpDevMode, dwFlags);
 
     if (pustrDevice)
     {