Support NtGdiGetDhpdev.

svn path=/trunk/; revision=31463
This commit is contained in:
James Tabor 2007-12-27 17:56:31 +00:00
parent 5778b4df0d
commit 88eea4a9ce
2 changed files with 15 additions and 17 deletions

View file

@ -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;

View file

@ -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;
}