Author: jimtabor
Date: Thu Dec 27 20:56:31 2007
New Revision: 31463
URL:
http://svn.reactos.org/svn/reactos?rev=31463&view=rev
Log:
Support NtGdiGetDhpdev.
Modified:
trunk/reactos/subsystems/win32/win32k/include/dc.h
trunk/reactos/subsystems/win32/win32k/objects/dc.c
Modified: trunk/reactos/subsystems/win32/win32k/include/dc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/dc.h (original)
+++ trunk/reactos/subsystems/win32/win32k/include/dc.h Thu Dec 27 20:56:31 2007
@@ -49,13 +49,14 @@
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;
Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dc.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dc.c Thu Dec 27 20:56:31 2007
@@ -543,7 +543,7 @@
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 @@
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;
}