diff --git a/reactos/subsystems/win32/win32k/include/dc.h b/reactos/subsystems/win32/win32k/include/dc.h index 3c2828b43c4..817a02e53d9 100644 --- a/reactos/subsystems/win32/win32k/include/dc.h +++ b/reactos/subsystems/win32/win32k/include/dc.h @@ -49,13 +49,14 @@ typedef struct _GDIPOINTER /* should stay private to ENG */ ULONG Status; } GDIPOINTER, *PGDIPOINTER; -typedef struct +typedef struct _GDIDEVICE { HANDLE Handle; // HSURF PVOID pvEntry; ULONG lucExcLock; ULONG Tid; + struct _GDIDEVICE *ppdevNext; FLONG flFlags; PERESOURCE hsemDevLock; diff --git a/reactos/subsystems/win32/win32k/objects/dc.c b/reactos/subsystems/win32/win32k/objects/dc.c index ec3fdd333ae..716e9ae319e 100644 --- a/reactos/subsystems/win32/win32k/objects/dc.c +++ b/reactos/subsystems/win32/win32k/objects/dc.c @@ -543,7 +543,7 @@ IntPrepareDriver() PrimarySurface.DisplayNumber = DisplayNumber; PrimarySurface.flFlags = PDEV_DISPLAY; // Hard set,, add more flags. PrimarySurface.hsemDevLock = (PERESOURCE)EngCreateSemaphore(); - + PrimarySurface.ppdevNext = NULL; // Fixme! We need to support more than display drvs. ret = TRUE; goto cleanup; } @@ -3353,22 +3353,19 @@ DHPDEV NtGdiGetDhpdev( IN HDEV hdev) { - PGDIDEVICE pGdiDevice = (PGDIDEVICE) hdev; + PGDIDEVICE pPDev, pGdiDevice = (PGDIDEVICE) hdev; if (!pGdiDevice) return NULL; - // ATM we have one, so this cheesie test - if (pGdiDevice != &PrimarySurface) return NULL; -// -// if ( pGdiDevice < MmSystemRangeStart) return NULL; -// pPDev = &PrimarySurface; -// KeEnterCriticalRegion(); -// do -// { -// if (pGdiDevice == pPDev) break; -// else -// pPDev = pPDev->ppdevNext; -// } while (pPDev != NULL); -// KeLeaveCriticalRegion(); -// if (!pPDev) return NULL; + if ( pGdiDevice < (PGDIDEVICE)MmSystemRangeStart) return NULL; + pPDev = &PrimarySurface; + KeEnterCriticalRegion(); + do + { + if (pGdiDevice == pPDev) break; + else + pPDev = pPDev->ppdevNext; + } while (pPDev != NULL); + KeLeaveCriticalRegion(); + if (!pPDev) return NULL; return pGdiDevice->PDev; }