Rename GDIDEVICE to PDEVOBJ. Is seems ms uses both PDEV and PDEVOBJ, whith the latter being the C++ representation. But we don't use C++ and PDEVOBJ seems to be a more appropriate name, as PDEV is often used by display drivers.

Make DC.ppdev of type PDEVOBJ* and remove a bunch of typecasts.

svn path=/trunk/; revision=40137
This commit is contained in:
Timo Kreuzer 2009-03-20 18:02:55 +00:00
parent f0b2b4bfa6
commit b4cc54f089
21 changed files with 159 additions and 156 deletions

View file

@ -45,7 +45,7 @@ EngCreateDriverObj(
{
PEDRIVEROBJ pedo;
HDRVOBJ hdo;
GDIDEVICE *ppdev = (GDIDEVICE*)hdev;
PDEVOBJ *ppdev = (PDEVOBJ*)hdev;
/* Allocate a new DRIVEROBJ */
pedo = DRIVEROBJ_AllocObjectWithHandle();

View file

@ -43,7 +43,7 @@ MouseSafetyOnDrawStart(SURFOBJ *SurfObj, LONG HazardX1,
*/
{
LONG tmp;
GDIDEVICE *ppdev;
PDEVOBJ *ppdev;
GDIPOINTER *pgp;
ASSERT(SurfObj != NULL);
@ -101,7 +101,7 @@ MouseSafetyOnDrawEnd(SURFOBJ *SurfObj)
* FUNCTION: Notify the mouse driver that drawing has finished on a surface.
*/
{
GDIDEVICE *ppdev;
PDEVOBJ *ppdev;
GDIPOINTER *pgp;
ASSERT(SurfObj != NULL);
@ -138,7 +138,7 @@ MouseSafetyOnDrawEnd(SURFOBJ *SurfObj)
/* SOFTWARE MOUSE POINTER IMPLEMENTATION **************************************/
VOID INTERNAL_CALL
IntHideMousePointer(GDIDEVICE *ppdev, SURFOBJ *psoDest)
IntHideMousePointer(PDEVOBJ *ppdev, SURFOBJ *psoDest)
{
GDIPOINTER *pgp;
POINTL pt;
@ -207,7 +207,7 @@ IntHideMousePointer(GDIDEVICE *ppdev, SURFOBJ *psoDest)
}
VOID INTERNAL_CALL
IntShowMousePointer(GDIDEVICE *ppdev, SURFOBJ *psoDest)
IntShowMousePointer(PDEVOBJ *ppdev, SURFOBJ *psoDest)
{
GDIPOINTER *pgp;
SURFOBJ *SaveSurface;
@ -335,7 +335,7 @@ EngSetPointerShape(
IN RECTL *prcl,
IN FLONG fl)
{
GDIDEVICE *ppdev;
PDEVOBJ *ppdev;
SURFOBJ *psoTemp;
GDIPOINTER *pgp;
@ -536,7 +536,7 @@ EngMovePointer(
IN LONG y,
IN RECTL *prcl)
{
GDIDEVICE *ppdev;
PDEVOBJ *ppdev;
GDIPOINTER *pgp;
ASSERT(pso);

View file

@ -38,14 +38,14 @@
VOID FASTCALL
ColorCorrection(PPALGDI PalGDI, PPALETTEENTRY PaletteEntry, ULONG Colors)
{
PGDIDEVICE pGDev = (PGDIDEVICE)PalGDI->hPDev;
PPDEVOBJ ppdev = (PPDEVOBJ)PalGDI->hPDev;
if (!pGDev) return;
if (!ppdev) return;
if (pGDev->flFlags & PDEV_GAMMARAMP_TABLE)
if (ppdev->flFlags & PDEV_GAMMARAMP_TABLE)
{
INT i;
PGAMMARAMP GammaRamp = (PGAMMARAMP)pGDev->pvGammaRamp;
PGAMMARAMP GammaRamp = (PGAMMARAMP)ppdev->pvGammaRamp;
for ( i = 0; i < Colors; i++)
{
PaletteEntry[i].peRed += GammaRamp->Red[i];

View file

@ -508,21 +508,21 @@ EngCreateDeviceSurface(IN DHSURF dhsurf,
*/
BOOL APIENTRY
EngAssociateSurface(IN HSURF hsurf,
IN HDEV Dev,
IN HDEV hdev,
IN ULONG Hooks)
{
SURFOBJ *pso;
PSURFACE psurf;
GDIDEVICE* Device;
PDEVOBJ* Device;
Device = (GDIDEVICE*)Dev;
Device = (PDEVOBJ*)hdev;
psurf = SURFACE_LockSurface(hsurf);
ASSERT(psurf);
pso = &psurf->SurfObj;
/* Associate the hdev */
pso->hdev = Dev;
pso->hdev = hdev;
pso->dhpdev = Device->hPDev;
/* Hook up specified functions */

View file

@ -9,7 +9,7 @@
/* Get/SetBounds/Rect support. */
#define DCB_WINDOWMGR 0x8000 /* Queries the Windows bounding rectangle instead of the application's */
/* GDIDEVICE flags */
/* PDEVOBJ flags */
#define PDEV_DISPLAY 0x00000001 /* Display device */
#define PDEV_HARDWARE_POINTER 0x00000002 /* Supports hardware cursor */
#define PDEV_SOFTWARE_POINTER 0x00000004
@ -29,6 +29,69 @@
/* Type definitions ***********************************************************/
// FIXME: move me to an appropriate header
typedef struct _GDIPOINTER /* should stay private to ENG? No, part of PDEVOBJ aka HDEV aka PDEV. */
{
/* private GDI pointer handling information, required for software emulation */
BOOL Enabled;
SIZEL Size;
POINTL HotSpot;
XLATEOBJ *XlateObject;
HSURF ColorSurface;
HSURF MaskSurface;
HSURF SaveSurface;
int ShowPointer; /* counter negtive do not show the mouse postive show the mouse */
/* public pointer information */
RECTL Exclude; /* required publicly for SPS_ACCEPT_EXCLUDE */
PGD_MOVEPOINTER MovePointer;
ULONG Status;
} GDIPOINTER, *PGDIPOINTER;
typedef struct _PDEVOBJ
{
BASEOBJECT BaseObject;
struct _PDEVOBJ *ppdevNext;
INT cPdevRefs;
INT cPdevOpenRefs;
struct _PDEVOBJ *ppdevParent;
FLONG flFlags;
PERESOURCE hsemDevLock; /* Device lock. */
PVOID pvGammaRamp; /* Gamma ramp pointer. */
HSURF FillPatterns[HS_DDI_MAX];
ULONG DxDd_nCount;
DHPDEV hPDev; /* DHPDEV for device. */
PVOID ppalSurf; /* PEPALOBJ/PPALGDI for this device. */
DEVINFO DevInfo;
GDIINFO GDIInfo;
HSURF pSurface; /* SURFACE for this device. */
HANDLE hSpooler; /* Handle to spooler, if spooler dev driver. */
ULONG DisplayNumber;
PVOID pGraphicsDev; /* PGRAPHICS_DEVICE */
DEVMODEW DMW;
PVOID pdmwDev; /* Ptr->DEVMODEW.dmSize + dmDriverExtra == alloc size. */
FLONG DxDd_Flags; /* DxDD active status flags. */
PFILE_OBJECT VideoFileObject;
BOOLEAN PreparedDriver;
GDIPOINTER Pointer;
/* Stuff to keep track of software cursors; win32k gdi part */
UINT SafetyRemoveLevel; /* at what level was the cursor removed?
0 for not removed */
UINT SafetyRemoveCount;
DRIVER_FUNCTIONS DriverFunctions;
struct _EDD_DIRECTDRAW_GLOBAL * pEDDgpl;
} PDEVOBJ, *PPDEVOBJ;
typedef struct _ROS_DC_INFO
{
HRGN hClipRgn; /* Clip region (may be 0) */
@ -106,10 +169,10 @@ typedef struct _DC
Do not (re)move this. */
BASEOBJECT BaseObject;
DHPDEV dhpdev; /* <- GDIDEVICE.hPDev DHPDEV for device. */
DHPDEV dhpdev; /* <- PDEVOBJ.hPDev DHPDEV for device. */
INT dctype;
INT fs;
PVOID ppdev; /* PGDIDEVICE aka PDEVOBJ */
PPDEVOBJ ppdev;
PVOID hsem; /* PERESOURCE aka HSEMAPHORE */
FLONG flGraphicsCaps;
FLONG flGraphicsCaps2;
@ -155,66 +218,6 @@ typedef struct _GRAPHICS_DEVICE
DWORD StateFlags; /* See DISPLAY_DEVICE_* */
} GRAPHICS_DEVICE, *PGRAPHICS_DEVICE;
typedef struct _GDIPOINTER /* should stay private to ENG? No, part of GDIDEVICE aka HDEV aka PDEV. */
{
/* private GDI pointer handling information, required for software emulation */
BOOL Enabled;
SIZEL Size;
POINTL HotSpot;
XLATEOBJ *XlateObject;
HSURF ColorSurface;
HSURF MaskSurface;
HSURF SaveSurface;
int ShowPointer; /* counter negtive do not show the mouse postive show the mouse */
/* public pointer information */
RECTL Exclude; /* required publicly for SPS_ACCEPT_EXCLUDE */
PGD_MOVEPOINTER MovePointer;
ULONG Status;
} GDIPOINTER, *PGDIPOINTER;
typedef struct _GDIDEVICE
{
BASEOBJECT BaseObject;
struct _GDIDEVICE *ppdevNext;
INT cPdevRefs;
INT cPdevOpenRefs;
struct _GDIDEVICE *ppdevParent;
FLONG flFlags;
PERESOURCE hsemDevLock; /* Device lock. */
PVOID pvGammaRamp; /* Gamma ramp pointer. */
HSURF FillPatterns[HS_DDI_MAX];
ULONG DxDd_nCount;
DHPDEV hPDev; /* DHPDEV for device. */
PVOID ppalSurf; /* PEPALOBJ/PPALGDI for this device. */
DEVINFO DevInfo;
GDIINFO GDIInfo;
HSURF pSurface; /* SURFACE for this device. */
HANDLE hSpooler; /* Handle to spooler, if spooler dev driver. */
ULONG DisplayNumber;
PVOID pGraphicsDev; /* PGRAPHICS_DEVICE */
DEVMODEW DMW;
PVOID pdmwDev; /* Ptr->DEVMODEW.dmSize + dmDriverExtra == alloc size. */
FLONG DxDd_Flags; /* DxDD active status flags. */
PFILE_OBJECT VideoFileObject;
BOOLEAN PreparedDriver;
GDIPOINTER Pointer;
/* Stuff to keep track of software cursors; win32k gdi part */
UINT SafetyRemoveLevel; /* at what level was the cursor removed?
0 for not removed */
UINT SafetyRemoveCount;
DRIVER_FUNCTIONS DriverFunctions;
struct _EDD_DIRECTDRAW_GLOBAL * pEDDgpl;
} GDIDEVICE, *PGDIDEVICE;
/* Internal functions *********************************************************/
@ -226,7 +229,7 @@ typedef struct _GDIDEVICE
extern PDC defaultDCstate;
NTSTATUS FASTCALL InitDcImpl(VOID);
PGDIDEVICE FASTCALL IntEnumHDev(VOID);
PPDEVOBJ FASTCALL IntEnumHDev(VOID);
HDC FASTCALL DC_AllocDC(PUNICODE_STRING Driver);
VOID FASTCALL DC_InitDC(HDC DCToInit);
HDC FASTCALL DC_FindOpenDC(PUNICODE_STRING Driver);
@ -264,15 +267,15 @@ UINT FASTCALL IntGdiSetTextAlign(HDC hDC, UINT Mode);
UINT APIENTRY IntGdiGetTextAlign(HDC hDC);
COLORREF APIENTRY IntGdiGetTextColor(HDC hDC);
INT APIENTRY IntGdiSetStretchBltMode(HDC hDC, INT stretchBltMode);
VOID FASTCALL IntGdiReferencePdev(PGDIDEVICE pPDev);
VOID FASTCALL IntGdiUnreferencePdev(PGDIDEVICE pPDev, DWORD CleanUpType);
VOID FASTCALL IntGdiReferencePdev(PPDEVOBJ pPDev);
VOID FASTCALL IntGdiUnreferencePdev(PPDEVOBJ pPDev, DWORD CleanUpType);
HDC FASTCALL IntGdiCreateDisplayDC(HDEV hDev, ULONG DcType, BOOL EmptyDC);
BOOL FASTCALL IntGdiCleanDC(HDC hDC);
VOID FASTCALL IntvGetDeviceCaps(PGDIDEVICE, PDEVCAPS);
VOID FASTCALL IntvGetDeviceCaps(PPDEVOBJ, PDEVCAPS);
HPEN FASTCALL IntGdiSelectPen(PDC,HPEN);
HBRUSH FASTCALL IntGdiSelectBrush(PDC,HBRUSH);
INT FASTCALL IntGdiGetDeviceCaps(PDC,INT);
extern PGDIDEVICE pPrimarySurface;
extern PPDEVOBJ pPrimarySurface;
#endif /* not __WIN32K_DC_H */

View file

@ -1,7 +1,7 @@
#ifndef _WIN32K_MONITOR_H
#define _WIN32K_MONITOR_H
struct GDIDEVICE;
//struct PDEVOBJ;
/* monitor object */
typedef struct _MONITOR_OBJECT
@ -11,7 +11,7 @@ typedef struct _MONITOR_OBJECT
BOOL IsPrimary; /* wether this is the primary monitor */
UNICODE_STRING DeviceName; /* name of the monitor */
GDIDEVICE *GdiDevice; /* pointer to the GDI device to
PDEVOBJ *GdiDevice; /* pointer to the GDI device to
which this monitor is attached */
struct _MONITOR_OBJECT *Prev, *Next; /* doubly linked list */
} MONITOR_OBJECT, *PMONITOR_OBJECT;
@ -20,8 +20,8 @@ typedef struct _MONITOR_OBJECT
NTSTATUS InitMonitorImpl();
NTSTATUS CleanupMonitorImpl();
NTSTATUS IntAttachMonitor(GDIDEVICE *pGdiDevice, ULONG DisplayNumber);
NTSTATUS IntDetachMonitor(GDIDEVICE *pGdiDevice);
NTSTATUS IntAttachMonitor(PDEVOBJ *pGdiDevice, ULONG DisplayNumber);
NTSTATUS IntDetachMonitor(PDEVOBJ *pGdiDevice);
PMONITOR_OBJECT FASTCALL UserGetMonitorObject(IN HMONITOR);
#endif /* _WIN32K_MONITOR_H */

View file

@ -57,8 +57,8 @@ BOOL INTERNAL_CALL SURFACE_Cleanup(PVOID ObjectBody);
BOOL INTERNAL_CALL SURFACE_InitBitsLock(SURFACE *pBMObj);
void INTERNAL_CALL SURFACE_CleanupBitsLock(SURFACE *pBMObj);
#define GDIDEV(SurfObj) ((GDIDEVICE *)((SurfObj)->hdev))
#define GDIDEVFUNCS(SurfObj) ((GDIDEVICE *)((SurfObj)->hdev))->DriverFunctions
#define GDIDEV(SurfObj) ((PDEVOBJ *)((SurfObj)->hdev))
#define GDIDEVFUNCS(SurfObj) ((PDEVOBJ *)((SurfObj)->hdev))->DriverFunctions
INT FASTCALL BitsPerFormat (ULONG Format);
ULONG FASTCALL BitmapFormat (WORD Bits, DWORD Compression);

View file

@ -35,7 +35,7 @@ intEnableReactXDriver(HDC hdc)
NTSTATUS Status;
PEPROCESS Proc = NULL;
PDC pDC = NULL;
PGDIDEVICE pDev = NULL;
PPDEVOBJ pDev = NULL;
PGD_DXDDENABLEDIRECTDRAW pfnDdEnableDirectDraw = NULL;
BOOL success = FALSE;
@ -59,7 +59,7 @@ intEnableReactXDriver(HDC hdc)
return FALSE;
}
pDev = (PGDIDEVICE)pDC->ppdev;
pDev = pDC->ppdev;
/* test see if drv got a dx interface or not */
if ( ( pDev->DriverFunctions.DisableDirectDraw == NULL) ||

View file

@ -281,7 +281,7 @@ DxEngGetHdevData(HDEV hDev,
DXEGSHDEVDATA Type)
{
DWORD_PTR retVal = 0;
PGDIDEVICE PDev = (PGDIDEVICE)hDev;
PPDEVOBJ PDev = (PPDEVOBJ)hDev;
DPRINT1("ReactX Calling : DxEngGetHdevData DXEGSHDEVDATA : %ld\n", Type);
@ -416,7 +416,7 @@ DxEngSetHdevData(HDEV hDev,
if ( Type == DxEGShDevData_dd_nCount )
{
((PGDIDEVICE)hDev)->DxDd_nCount = Data;
((PPDEVOBJ)hDev)->DxDd_nCount = Data;
retVal = TRUE; // Set
}
return retVal;
@ -514,7 +514,7 @@ DxEngIncDispUniq()
* The function DxEngLockHdev lock the internal PDEV
*
* @param HDEV type
* it is a pointer to win32k internal pdev struct known as PGDIDEVICE
* it is a pointer to win32k internal pdev struct known as PPDEVOBJ
* @return
* This function returns TRUE no matter what.
@ -527,7 +527,7 @@ BOOLEAN
APIENTRY
DxEngLockHdev(HDEV hDev)
{
PGDIDEVICE ppdev = (PGDIDEVICE)hDev;
PPDEVOBJ ppdev = (PPDEVOBJ)hDev;
PERESOURCE Resource;
DPRINT1("ReactX Calling : DxEngLockHdev \n");
@ -551,7 +551,7 @@ DxEngLockHdev(HDEV hDev)
* The function DxEngUnlockHdev unlock the internal PDEV
*
* @param HDEV type
* it is a pointer to win32k internal pdev struct known as PGDIDEVICE
* it is a pointer to win32k internal pdev struct known as PPDEVOBJ
* @return
* This function returns TRUE no matter what.
@ -564,7 +564,7 @@ BOOLEAN
APIENTRY
DxEngUnlockHdev(HDEV hDev)
{
PGDIDEVICE ppdev = (PGDIDEVICE)hDev;
PPDEVOBJ ppdev = (PPDEVOBJ)hDev;
PERESOURCE Resource = ppdev->hsemDevLock;
DPRINT1("ReactX Calling : DxEngUnlockHdev \n");
@ -585,7 +585,7 @@ BOOLEAN
APIENTRY
DxEngReferenceHdev(HDEV hDev)
{
IntGdiReferencePdev((PGDIDEVICE) hDev);
IntGdiReferencePdev((PPDEVOBJ) hDev);
/* ALWAYS return true */
return TRUE;
}
@ -675,7 +675,7 @@ BOOLEAN
APIENTRY
DxEngIsHdevLockedByCurrentThread(HDEV hDev)
{ // base on EngIsSemaphoreOwnedByCurrentThread w/o the Ex call.
PERESOURCE pSem = ((PGDIDEVICE)hDev)->hsemDevLock;
PERESOURCE pSem = ((PPDEVOBJ)hDev)->hsemDevLock;
return pSem->OwnerEntry.OwnerThread == (ERESOURCE_THREAD)PsGetCurrentThread();
}
@ -687,7 +687,7 @@ BOOLEAN
APIENTRY
DxEngUnreferenceHdev(HDEV hDev)
{
IntGdiUnreferencePdev((PGDIDEVICE) hDev, 0);
IntGdiUnreferencePdev((PPDEVOBJ) hDev, 0);
return TRUE; // Always true.
}

View file

@ -120,7 +120,7 @@ IntSetCursor(PWINSTATION_OBJECT WinSta, PCURICON_OBJECT NewCursor,
return Ret;
}
dcbmp = dc->rosdc.hBitmap;
DevInfo = (PDEVINFO)&((GDIDEVICE *)dc->ppdev)->DevInfo;
DevInfo = (PDEVINFO)&dc->ppdev->DevInfo;
DC_UnlockDc(dc);
psurf = SURFACE_LockSurface(dcbmp);
@ -1753,7 +1753,7 @@ UserShowCursor(BOOL bShow)
HBITMAP hbmpDc;
SURFOBJ *SurfObj;
SURFACE *psurfDc;
GDIDEVICE *ppdev;
PDEVOBJ *ppdev;
GDIPOINTER *pgp;
int showpointer=0;

View file

@ -1181,7 +1181,7 @@ IntMouseInput(MOUSEINPUT *mi)
{
IntEngMovePointer(pso, MousePos.x, MousePos.y, &(GDIDEV(pso)->Pointer.Exclude));
}
/* Only now, update the info in the GDIDEVICE, so EngMovePointer can
/* Only now, update the info in the PDEVOBJ, so EngMovePointer can
* use the old values to move the pointer image */
gpsi->ptCursor.x = MousePos.x;
gpsi->ptCursor.y = MousePos.y;

View file

@ -40,8 +40,8 @@ InitMetrics(VOID)
pScreenDC = DC_LockDc(hScreenDC);
if (pScreenDC)
{
Width = ((PGDIDEVICE)pScreenDC->ppdev)->GDIInfo.ulHorzRes;
Height = ((PGDIDEVICE)pScreenDC->ppdev)->GDIInfo.ulVertRes;
Width = pScreenDC->ppdev->GDIInfo.ulHorzRes;
Height = pScreenDC->ppdev->GDIInfo.ulVertRes;
DC_UnlockDc(pScreenDC);
}
NtGdiDeleteObjectApp(hScreenDC);

View file

@ -151,14 +151,14 @@ UserGetMonitorObject(IN HMONITOR hMonitor)
*
* Arguments
*
* pGdiDevice Pointer to the GDIDEVICE onto which the monitor was attached
* pGdiDevice Pointer to the PDEVOBJ onto which the monitor was attached
* DisplayNumber Display Number (starting with 0)
*
* Return value
* Returns a NTSTATUS
*/
NTSTATUS
IntAttachMonitor(IN GDIDEVICE *pGdiDevice,
IntAttachMonitor(IN PDEVOBJ *pGdiDevice,
IN ULONG DisplayNumber)
{
PMONITOR_OBJECT Monitor;
@ -211,13 +211,13 @@ IntAttachMonitor(IN GDIDEVICE *pGdiDevice,
*
* Arguments
*
* pGdiDevice Pointer to the GDIDEVICE from which the monitor was detached
* pGdiDevice Pointer to the PDEVOBJ from which the monitor was detached
*
* Return value
* Returns a NTSTATUS
*/
NTSTATUS
IntDetachMonitor(IN GDIDEVICE *pGdiDevice)
IntDetachMonitor(IN PDEVOBJ *pGdiDevice)
{
PMONITOR_OBJECT Monitor;

View file

@ -281,7 +281,7 @@ NtGdiCreateCompatibleBitmap(
Dc = DC_LockDc(hDC);
DPRINT("NtGdiCreateCompatibleBitmap(%04x,%d,%d, bpp:%d) = \n",
hDC, Width, Height, ((PGDIDEVICE)Dc->ppdev)->GDIInfo.cBitsPixel);
hDC, Width, Height, Dc->ppdev->GDIInfo.cBitsPixel);
if (NULL == Dc)
{

View file

@ -449,7 +449,7 @@ IntGetSystemPaletteEntries(HDC hDC,
}
else
{
Ret = ((PGDIDEVICE)dc->ppdev)->GDIInfo.ulNumPalReg;
Ret = dc->ppdev->GDIInfo.ulNumPalReg;
}
}

View file

@ -668,36 +668,36 @@ IntGdiSetMapMode(PDC dc,
case MM_LOMETRIC:
pdcattr->szlWindowExt.cx = 3600;
pdcattr->szlWindowExt.cy = 2700;
pdcattr->szlViewportExt.cx = ((PGDIDEVICE)dc->ppdev)->GDIInfo.ulHorzRes;
pdcattr->szlViewportExt.cy = -((PGDIDEVICE)dc->ppdev)->GDIInfo.ulVertRes;
pdcattr->szlViewportExt.cx = dc->ppdev->GDIInfo.ulHorzRes;
pdcattr->szlViewportExt.cy = -dc->ppdev->GDIInfo.ulVertRes;
break;
case MM_HIMETRIC:
pdcattr->szlWindowExt.cx = 36000;
pdcattr->szlWindowExt.cy = 27000;
pdcattr->szlViewportExt.cx = ((PGDIDEVICE)dc->ppdev)->GDIInfo.ulHorzRes;
pdcattr->szlViewportExt.cy = -((PGDIDEVICE)dc->ppdev)->GDIInfo.ulVertRes;
pdcattr->szlViewportExt.cx = dc->ppdev->GDIInfo.ulHorzRes;
pdcattr->szlViewportExt.cy = -dc->ppdev->GDIInfo.ulVertRes;
break;
case MM_LOENGLISH:
pdcattr->szlWindowExt.cx = 1417;
pdcattr->szlWindowExt.cy = 1063;
pdcattr->szlViewportExt.cx = ((PGDIDEVICE)dc->ppdev)->GDIInfo.ulHorzRes;
pdcattr->szlViewportExt.cy = -((PGDIDEVICE)dc->ppdev)->GDIInfo.ulVertRes;
pdcattr->szlViewportExt.cx = dc->ppdev->GDIInfo.ulHorzRes;
pdcattr->szlViewportExt.cy = -dc->ppdev->GDIInfo.ulVertRes;
break;
case MM_HIENGLISH:
pdcattr->szlWindowExt.cx = 14173;
pdcattr->szlWindowExt.cy = 10630;
pdcattr->szlViewportExt.cx = ((PGDIDEVICE)dc->ppdev)->GDIInfo.ulHorzRes;
pdcattr->szlViewportExt.cy = -((PGDIDEVICE)dc->ppdev)->GDIInfo.ulVertRes;
pdcattr->szlViewportExt.cx = dc->ppdev->GDIInfo.ulHorzRes;
pdcattr->szlViewportExt.cy = -dc->ppdev->GDIInfo.ulVertRes;
break;
case MM_TWIPS:
pdcattr->szlWindowExt.cx = 20409;
pdcattr->szlWindowExt.cy = 15307;
pdcattr->szlViewportExt.cx = ((PGDIDEVICE)dc->ppdev)->GDIInfo.ulHorzRes;
pdcattr->szlViewportExt.cy = -((PGDIDEVICE)dc->ppdev)->GDIInfo.ulVertRes;
pdcattr->szlViewportExt.cx = dc->ppdev->GDIInfo.ulHorzRes;
pdcattr->szlViewportExt.cy = -dc->ppdev->GDIInfo.ulVertRes;
break;
case MM_ANISOTROPIC:

View file

@ -29,8 +29,8 @@
// --------------------------------------------------------- File Statics
static GDIDEVICE PrimarySurface;
PGDIDEVICE pPrimarySurface = &PrimarySurface;
static PDEVOBJ PrimarySurface;
PPDEVOBJ pPrimarySurface = &PrimarySurface;
static KEVENT VideoDriverNeedsPreparation;
static KEVENT VideoDriverPrepared;
PDC defaultDCstate = NULL;
@ -358,7 +358,7 @@ IntPrepareDriver()
RtlZeroMemory(&PrimarySurface, sizeof(PrimarySurface));
// if (!pPrimarySurface) pPrimarySurface = ExAllocatePoolWithTag(PagedPool, sizeof(GDIDEVICE), TAG_GDIPDEV);
// if (!pPrimarySurface) pPrimarySurface = ExAllocatePoolWithTag(PagedPool, sizeof(PDEVOBJ), TAG_GDIPDEV);
PrimarySurface.VideoFileObject = DRIVER_FindMPDriver(DisplayNumber);
@ -824,8 +824,8 @@ IntGdiCreateDC(PUNICODE_STRING Driver,
// ATM we only have one display.
pdcattr->ulDirty_ |= DC_PRIMARY_DISPLAY;
pdc->rosdc.bitsPerPixel = ((PGDIDEVICE)pdc->ppdev)->GDIInfo.cBitsPixel *
((PGDIDEVICE)pdc->ppdev)->GDIInfo.cPlanes;
pdc->rosdc.bitsPerPixel = pdc->ppdev->GDIInfo.cBitsPixel *
pdc->ppdev->GDIInfo.cPlanes;
DPRINT("Bits per pel: %u\n", pdc->rosdc.bitsPerPixel);
pdc->flGraphicsCaps = PrimarySurface.DevInfo.flGraphicsCaps;
@ -836,14 +836,14 @@ IntGdiCreateDC(PUNICODE_STRING Driver,
pdcattr->jROP2 = R2_COPYPEN;
pdc->erclWindow.top = pdc->erclWindow.left = 0;
pdc->erclWindow.right = ((PGDIDEVICE)pdc->ppdev)->GDIInfo.ulHorzRes;
pdc->erclWindow.bottom = ((PGDIDEVICE)pdc->ppdev)->GDIInfo.ulVertRes;
pdc->erclWindow.right = pdc->ppdev->GDIInfo.ulHorzRes;
pdc->erclWindow.bottom = pdc->ppdev->GDIInfo.ulVertRes;
pdc->dclevel.flPath &= ~DCPATH_CLOCKWISE; // Default is CCW.
pdcattr->iCS_CP = ftGdiGetTextCharsetInfo(pdc,NULL,0);
hVisRgn = NtGdiCreateRectRgn(0, 0, ((PGDIDEVICE)pdc->ppdev)->GDIInfo.ulHorzRes,
((PGDIDEVICE)pdc->ppdev)->GDIInfo.ulVertRes);
hVisRgn = NtGdiCreateRectRgn(0, 0, pdc->ppdev->GDIInfo.ulHorzRes,
pdc->ppdev->GDIInfo.ulVertRes);
if (!CreateAsIC)
{
@ -1245,8 +1245,8 @@ IntGetAspectRatioFilter(PDC pDC,
{
// "This specifies that Windows should only match fonts that have the
// same aspect ratio as the display.", Programming Windows, Fifth Ed.
AspectRatio->cx = ((PGDIDEVICE)pDC->ppdev)->GDIInfo.ulLogPixelsX;
AspectRatio->cy = ((PGDIDEVICE)pDC->ppdev)->GDIInfo.ulLogPixelsY;
AspectRatio->cx = pDC->ppdev->GDIInfo.ulLogPixelsX;
AspectRatio->cy = pDC->ppdev->GDIInfo.ulLogPixelsY;
}
else
{
@ -1595,7 +1595,7 @@ IntGdiSetDCState ( HDC hDC, HDC hDCSave )
INT
FASTCALL
IntcFonts(PGDIDEVICE pDevObj)
IntcFonts(PPDEVOBJ pDevObj)
{
ULONG_PTR Junk;
// Msdn DrvQueryFont:
@ -1614,7 +1614,7 @@ IntcFonts(PGDIDEVICE pDevObj)
INT
FASTCALL
IntGetColorManagementCaps(PGDIDEVICE pDevObj)
IntGetColorManagementCaps(PPDEVOBJ pDevObj)
{
INT ret = CM_NONE;
@ -1635,7 +1635,7 @@ INT FASTCALL
IntGdiGetDeviceCaps(PDC dc, INT Index)
{
INT ret = 0;
PGDIDEVICE ppdev = dc->ppdev;
PPDEVOBJ ppdev = dc->ppdev;
/* Retrieve capability */
switch (Index)
{
@ -1834,7 +1834,7 @@ NtGdiGetDeviceCaps(HDC hDC,
VOID
FASTCALL
IntvGetDeviceCaps(
PGDIDEVICE pDevObj,
PPDEVOBJ pDevObj,
PDEVCAPS pDevCaps)
{
ULONG Tmp = 0;
@ -2715,7 +2715,7 @@ DC_LockDisplay(HDC hDC)
PERESOURCE Resource;
PDC dc = DC_LockDc(hDC);
if (!dc) return;
Resource = ((PGDIDEVICE)dc->ppdev)->hsemDevLock;
Resource = dc->ppdev->hsemDevLock;
DC_UnlockDc(dc);
if (!Resource) return;
KeEnterCriticalRegion();
@ -2729,7 +2729,7 @@ DC_UnlockDisplay(HDC hDC)
PERESOURCE Resource;
PDC dc = DC_LockDc(hDC);
if (!dc) return;
Resource = ((PGDIDEVICE)dc->ppdev)->hsemDevLock;
Resource = dc->ppdev->hsemDevLock;
DC_UnlockDc(dc);
if (!Resource) return;
ExReleaseResourceLite( Resource );
@ -2749,7 +2749,7 @@ IntIsPrimarySurface(SURFOBJ *SurfObj)
//
// Enumerate HDev
//
PGDIDEVICE FASTCALL
PPDEVOBJ FASTCALL
IntEnumHDev(VOID)
{
// I guess we will soon have more than one primary surface.
@ -2759,7 +2759,7 @@ IntEnumHDev(VOID)
VOID FASTCALL
IntGdiReferencePdev(PGDIDEVICE ppdev)
IntGdiReferencePdev(PPDEVOBJ ppdev)
{
if(!hsemDriverMgmt) hsemDriverMgmt = EngCreateSemaphore(); // Hax, should be in dllmain.c
IntGdiAcquireSemaphore(hsemDriverMgmt);
@ -2768,13 +2768,13 @@ IntGdiReferencePdev(PGDIDEVICE ppdev)
}
VOID FASTCALL
IntGdiUnreferencePdev(PGDIDEVICE ppdev, DWORD CleanUpType)
IntGdiUnreferencePdev(PPDEVOBJ ppdev, DWORD CleanUpType)
{
IntGdiAcquireSemaphore(hsemDriverMgmt);
ppdev->cPdevRefs--;
if (!ppdev->cPdevRefs)
{
// Handle the destruction of ppdev or GDIDEVICE or PDEVOBJ or PDEV etc.
// Handle the destruction of ppdev or PDEVOBJ or PDEVOBJ or PDEV etc.
}
IntGdiReleaseSemaphore(hsemDriverMgmt);
}
@ -2813,7 +2813,7 @@ GetDisplayNumberFromDeviceName(
DesktopHDC = UserGetWindowDC(DesktopObject);
pDC = DC_LockDc(DesktopHDC);
*DisplayNumber = ((GDIDEVICE *)pDC->ppdev)->DisplayNumber;
*DisplayNumber = pDC->ppdev->DisplayNumber;
DC_UnlockDc(pDC);
UserReleaseDC(DesktopObject, DesktopHDC, FALSE);
@ -3338,7 +3338,7 @@ IntChangeDisplaySettings(
{
return FALSE;
}
swprintf (szBuffer, L"\\\\.\\DISPLAY%lu", ((GDIDEVICE *)DC->ppdev)->DisplayNumber);
swprintf (szBuffer, L"\\\\.\\DISPLAY%lu", DC->ppdev->DisplayNumber);
DC_UnlockDc(DC);
RtlInitUnicodeString(&InDeviceName, szBuffer);
@ -3437,9 +3437,9 @@ APIENTRY
NtGdiGetDhpdev(
IN HDEV hdev)
{
PGDIDEVICE ppdev, pGdiDevice = (PGDIDEVICE) hdev;
PPDEVOBJ ppdev, pGdiDevice = (PPDEVOBJ) hdev;
if (!pGdiDevice) return NULL;
if ( pGdiDevice < (PGDIDEVICE)MmSystemRangeStart) return NULL;
if ( pGdiDevice < (PPDEVOBJ)MmSystemRangeStart) return NULL;
ppdev = pPrimarySurface;
IntGdiAcquireSemaphore(hsemDriverMgmt);
do

View file

@ -279,7 +279,7 @@ IntSetDIBits(
else
{
// Destination palette obtained from the hDC
DDB_Palette = ((GDIDEVICE *)DC->ppdev)->DevInfo.hpalDefault;
DDB_Palette = DC->ppdev->DevInfo.hpalDefault;
}
hDCPalette = PALETTE_LockPalette(DDB_Palette);
if (NULL == hDCPalette)
@ -522,7 +522,7 @@ NtGdiSetDIBitsToDeviceInternal(
}
/* Obtain destination palette from the DC */
pDCPalette = PALETTE_LockPalette(((GDIDEVICE *)pDC->ppdev)->DevInfo.hpalDefault);
pDCPalette = PALETTE_LockPalette(pDC->ppdev->DevInfo.hpalDefault);
if (!pDCPalette)
{
SetLastWin32Error(ERROR_INVALID_HANDLE);
@ -531,7 +531,7 @@ NtGdiSetDIBitsToDeviceInternal(
}
DDBPaletteType = pDCPalette->Mode;
DDBPalette = ((GDIDEVICE *)pDC->ppdev)->DevInfo.hpalDefault;
DDBPalette = pDC->ppdev->DevInfo.hpalDefault;
PALETTE_UnlockPalette(pDCPalette);
DIBPalette = BuildDIBPalette(bmi, (PINT)&DIBPaletteType);

View file

@ -19,7 +19,7 @@ VOID
FASTCALL
DoDeviceSync( SURFOBJ *Surface, PRECTL Rect, FLONG fl)
{
PGDIDEVICE Device = (GDIDEVICE*)Surface->hdev;
PPDEVOBJ Device = (PDEVOBJ*)Surface->hdev;
// No punting and "Handle to a surface, provided that the surface is device-managed.
// Otherwise, dhsurf is zero".
if (!(Device->flFlags & PDEV_DRIVER_PUNTED_CALL) && (Surface->dhsurf))
@ -40,7 +40,7 @@ FASTCALL
SynchonizeDriver(FLONG Flags)
{
SURFOBJ *SurfObj;
PGDIDEVICE Device;
PPDEVOBJ Device;
if (Flags & GCAPS2_SYNCFLUSH)
Flags = DSS_FLUSH_EVENT;

View file

@ -99,7 +99,7 @@ BOOL
FASTCALL
IntGetDeviceGammaRamp(HDEV hPDev, PGAMMARAMP Ramp)
{
PGDIDEVICE pGDev = (PGDIDEVICE) hPDev;
PPDEVOBJ pGDev = (PPDEVOBJ) hPDev;
int i;
if (!(pGDev->flFlags & PDEV_DISPLAY )) return FALSE;
@ -234,7 +234,7 @@ UpdateDeviceGammaRamp( HDEV hPDev )
BOOL Ret = FALSE;
PPALGDI palGDI;
PALOBJ *palPtr;
PGDIDEVICE pGDev = (PGDIDEVICE) hPDev;
PPDEVOBJ pGDev = (PPDEVOBJ) hPDev;
if ((pGDev->DevInfo.iDitherFormat == BMF_8BPP) ||
(pGDev->DevInfo.iDitherFormat == BMF_16BPP) ||
@ -290,7 +290,7 @@ IntSetDeviceGammaRamp(HDEV hPDev, PGAMMARAMP Ramp, BOOL Test)
{
WORD IcmGR, i, R, G, B;
BOOL Ret = FALSE, TstPeak;
PGDIDEVICE pGDev = (PGDIDEVICE) hPDev;
PPDEVOBJ pGDev = (PPDEVOBJ) hPDev;
if (!hPDev) return FALSE;

View file

@ -119,7 +119,7 @@ IntGdiExtEscape(
/* FIXME - Handle psurf == NULL !!!!!! */
if ( NULL == ((GDIDEVICE *)dc->ppdev)->DriverFunctions.Escape )
if ( NULL == dc->ppdev->DriverFunctions.Escape )
{
Result = IntEngExtEscape(
&psurf->SurfObj,
@ -131,7 +131,7 @@ IntGdiExtEscape(
}
else
{
Result = ((GDIDEVICE *)dc->ppdev)->DriverFunctions.Escape(
Result = dc->ppdev->DriverFunctions.Escape(
&psurf->SurfObj,
Escape,
InSize,