ReactOS  0.4.15-dev-5122-g72bdbdd
pdevobj.c File Reference
#include <win32k.h>
#include <debug.h>
Include dependency graph for pdevobj.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

 DBG_DEFAULT_CHANNEL (EngPDev)
 
BOOL APIENTRY MultiEnableDriver (_In_ ULONG iEngineVersion, _In_ ULONG cj, _Inout_bytecount_(cj) PDRVENABLEDATA pded)
 
NTSTATUS NTAPI InitPDEVImpl (VOID)
 
PPDEVOBJ PDEVOBJ_AllocPDEV (VOID)
 
static VOID PDEVOBJ_vDeletePDEV (PPDEVOBJ ppdev)
 
VOID NTAPI PDEVOBJ_vRelease (_Inout_ PPDEVOBJ ppdev)
 
BOOL NTAPI PDEVOBJ_bEnablePDEV (_In_ PPDEVOBJ ppdev, _In_ PDEVMODEW pdevmode, _In_ PWSTR pwszLogAddress)
 
VOID NTAPI PDEVOBJ_vCompletePDEV (PPDEVOBJ ppdev)
 
static VOID PDEVOBJ_vFilterDriverHooks (_In_ PPDEVOBJ ppdev)
 
PSURFACE NTAPI PDEVOBJ_pSurface (PPDEVOBJ ppdev)
 
VOID PDEVOBJ_vEnableDisplay (_Inout_ PPDEVOBJ ppdev)
 
BOOL PDEVOBJ_bDisableDisplay (_Inout_ PPDEVOBJ ppdev)
 
VOID NTAPI PDEVOBJ_vRefreshModeList (PPDEVOBJ ppdev)
 
PPDEVOBJ PDEVOBJ_Create (_In_opt_ PGRAPHICS_DEVICE pGraphicsDevice, _In_opt_ PDEVMODEW pdm, _In_ ULONG dwAccelerationLevel, _In_ ULONG ldevtype)
 
FORCEINLINE VOID SwitchPointer (_Inout_ PVOID pvPointer1, _Inout_ PVOID pvPointer2)
 
BOOL NTAPI PDEVOBJ_bDynamicModeChange (PPDEVOBJ ppdev, PPDEVOBJ ppdev2)
 
BOOL NTAPI PDEVOBJ_bSwitchMode (PPDEVOBJ ppdev, PDEVMODEW pdm)
 
PPDEVOBJ NTAPI EngpGetPDEV (_In_opt_ PUNICODE_STRING pustrDeviceName)
 
LONG PDEVOBJ_lChangeDisplaySettings (_In_opt_ PUNICODE_STRING pustrDeviceName, _In_opt_ PDEVMODEW RequestedMode, _In_opt_ PMDEVOBJ pmdevOld, _Out_ PMDEVOBJ *ppmdevNew, _In_ BOOL bSearchClosestMode)
 
INT NTAPI PDEVOBJ_iGetColorManagementCaps (PPDEVOBJ ppdev)
 
VOID NTAPI PDEVOBJ_vGetDeviceCaps (IN PPDEVOBJ ppdev, OUT PDEVCAPS pDevCaps)
 
BOOL APIENTRY EngQueryDeviceAttribute (_In_ HDEV hdev, _In_ ENG_DEVICE_ATTRIBUTE devAttr, _In_reads_bytes_(cjInSize) PVOID pvIn, _In_ ULONG cjInSize, _Out_writes_bytes_(cjOutSize) PVOID pvOut, _In_ ULONG cjOutSize)
 
_Must_inspect_result_ _Ret_z_ LPWSTR APIENTRY EngGetDriverName (_In_ HDEV hdev)
 
INT APIENTRY NtGdiGetDeviceCaps (HDC hdc, INT Index)
 
 _Success_ (return!=FALSE)
 
DHPDEV APIENTRY NtGdiGetDhpdev (IN HDEV hdev)
 
PSIZEL FASTCALL PDEVOBJ_sizl (PPDEVOBJ ppdev, PSIZEL psizl)
 

Variables

static PPDEVOBJ gppdevList = NULL
 
static HSEMAPHORE ghsemPDEV
 
DRVFN gPanDispDrvFn []
 
ULONG gPanDispDrvCount
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 10 of file pdevobj.c.

Function Documentation

◆ _Success_()

_Success_ ( return!  = FALSE)

Definition at line 1210 of file pdevobj.c.

1216 {
1217  PDC pdc;
1218  DEVCAPS devcaps;
1219  BOOL bResult = TRUE;
1220 
1221  /* Lock the given DC */
1222  pdc = DC_LockDc(hDC);
1223  if (!pdc)
1224  {
1226  return FALSE;
1227  }
1228 
1229  /* Get the data */
1230  PDEVOBJ_vGetDeviceCaps(pdc->ppdev, &devcaps);
1231 
1232  /* Unlock the DC */
1233  DC_UnlockDc(pdc);
1234 
1235  /* Copy data to caller */
1236  _SEH2_TRY
1237  {
1238  ProbeForWrite(pDevCaps, sizeof(DEVCAPS), 1);
1239  RtlCopyMemory(pDevCaps, &devcaps, sizeof(DEVCAPS));
1240  }
1242  {
1244  bResult = FALSE;
1245  }
1246  _SEH2_END;
1247 
1248  return bResult;
1249 }
_Out_ PDEVCAPS pDevCaps
Definition: ntgdi.h:2664
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:217
#define TRUE
Definition: types.h:120
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
_SEH2_TRY
Definition: create.c:4226
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
VOID NTAPI PDEVOBJ_vGetDeviceCaps(IN PPDEVOBJ ppdev, OUT PDEVCAPS pDevCaps)
Definition: pdevobj.c:964
Definition: polytest.cpp:40
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
VOID FASTCALL SetLastNtError(NTSTATUS Status)
Definition: error.c:37
static HDC hDC
Definition: 3dtext.c:33
_SEH2_END
Definition: create.c:4400
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:235
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:40
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:165
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:28

◆ DBG_DEFAULT_CHANNEL()

DBG_DEFAULT_CHANNEL ( EngPDev  )

◆ EngGetDriverName()

_Must_inspect_result_ _Ret_z_ LPWSTR APIENTRY EngGetDriverName ( _In_ HDEV  hdev)

Definition at line 1049 of file pdevobj.c.

1050 {
1051  PPDEVOBJ ppdev = (PPDEVOBJ)hdev;
1052 
1053  ASSERT(ppdev);
1054  ASSERT(ppdev->pldev);
1055  ASSERT(ppdev->pldev->pGdiDriverInfo);
1056  ASSERT(ppdev->pldev->pGdiDriverInfo->DriverName.Buffer);
1057 
1058  return ppdev->pldev->pGdiDriverInfo->DriverName.Buffer;
1059 }
struct _LDEVOBJ * pldev
Definition: pdevobj.h:119
struct _PDEVOBJ * PPDEVOBJ
Definition: mdevobj.h:6
#define ASSERT(a)
Definition: mode.c:44
_In_ HDEV hdev
Definition: winddi.h:3449

◆ EngpGetPDEV()

PPDEVOBJ NTAPI EngpGetPDEV ( _In_opt_ PUNICODE_STRING  pustrDeviceName)

Definition at line 726 of file pdevobj.c.

728 {
729  UNICODE_STRING ustrCurrent;
730  PPDEVOBJ ppdev = NULL;
731  PGRAPHICS_DEVICE pGraphicsDevice;
732  ULONG i;
733 
734  /* Acquire PDEV lock */
736 
737  /* Did the caller pass a device name? */
738  if (pustrDeviceName)
739  {
740  /* Loop all present PDEVs */
741  for (i = 0; i < gpmdev->cDev; i++)
742  {
743  /* Get a pointer to the GRAPHICS_DEVICE */
744  pGraphicsDevice = gpmdev->dev[i].ppdev->pGraphicsDevice;
745 
746  /* Compare the name */
747  RtlInitUnicodeString(&ustrCurrent, pGraphicsDevice->szWinDeviceName);
748  if (RtlEqualUnicodeString(pustrDeviceName, &ustrCurrent, FALSE))
749  {
750  /* Found! */
751  ppdev = gpmdev->dev[i].ppdev;
752  break;
753  }
754  }
755  }
756  else if (gpmdev)
757  {
758  /* Otherwise use the primary PDEV */
759  ppdev = gpmdev->ppdevGlobal;
760  }
761 
762  /* Did we find one? */
763  if (ppdev)
764  {
765  /* Yes, reference the PDEV */
766  PDEVOBJ_vReference(ppdev);
767  }
768 
769  /* Release PDEV lock */
771 
772  return ppdev;
773 }
VOID WINAPI EngReleaseSemaphore(IN HSEMAPHORE hsem)
Definition: eng.c:235
WCHAR szWinDeviceName[CCHDEVICENAME/2]
Definition: pdevobj.h:60
FORCEINLINE VOID PDEVOBJ_vReference(_In_ PPDEVOBJ ppdev)
Definition: pdevobj.h:161
#define FALSE
Definition: types.h:117
static HSEMAPHORE ghsemPDEV
Definition: pdevobj.c:15
ENGAPI VOID APIENTRY EngAcquireSemaphore(_Inout_ HSEMAPHORE hsem)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
PPDEVOBJ ppdevGlobal
Definition: mdevobj.h:16
PMDEVOBJ gpmdev
Definition: mdevobj.c:14
PPDEVOBJ ppdev
Definition: mdevobj.h:10
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
PGRAPHICS_DEVICE pGraphicsDevice
Definition: pdevobj.h:127
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive)
ULONG cDev
Definition: mdevobj.h:15
MDEVDISPLAY dev[0]
Definition: mdevobj.h:17

Referenced by GreCreateCompatibleDC(), GreOpenDCW(), NtGdiExtEscape(), UserChangeDisplaySettings(), UserEnumCurrentDisplaySettings(), and UserEnumDisplaySettings().

◆ EngQueryDeviceAttribute()

BOOL APIENTRY EngQueryDeviceAttribute ( _In_ HDEV  hdev,
_In_ ENG_DEVICE_ATTRIBUTE  devAttr,
_In_reads_bytes_(cjInSize) PVOID  pvIn,
_In_ ULONG  cjInSize,
_Out_writes_bytes_(cjOutSize) PVOID  pvOut,
_In_ ULONG  cjOutSize 
)

Exported functions

Definition at line 1023 of file pdevobj.c.

1030 {
1031  PPDEVOBJ ppdev = (PPDEVOBJ)hdev;
1032 
1033  if (devAttr != QDA_ACCELERATION_LEVEL)
1034  return FALSE;
1035 
1036  if (cjOutSize >= sizeof(DWORD))
1037  {
1038  /* Set all Accelerations Level Key to enabled Full 0 to 5 turned off. */
1039  *(DWORD*)pvOut = ppdev->dwAccelerationLevel;
1040  return TRUE;
1041  }
1042 
1043  return FALSE;
1044 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
struct _PDEVOBJ * PPDEVOBJ
Definition: mdevobj.h:6
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD dwAccelerationLevel
Definition: pdevobj.h:132
_In_ HDEV hdev
Definition: winddi.h:3449

◆ InitPDEVImpl()

NTSTATUS NTAPI InitPDEVImpl ( VOID  )

Definition at line 30 of file pdevobj.c.

31 {
34  return STATUS_SUCCESS;
35 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
static HSEMAPHORE ghsemPDEV
Definition: pdevobj.c:15
HSEMAPHORE WINAPI EngCreateSemaphore(VOID)
Definition: eng.c:75
#define STATUS_SUCCESS
Definition: shellext.h:65

Referenced by DriverEntry().

◆ MultiEnableDriver()

BOOL APIENTRY MultiEnableDriver ( _In_ ULONG  iEngineVersion,
_In_ ULONG  cj,
_Inout_bytecount_(cj) PDRVENABLEDATA  pded 
)

Definition at line 17 of file multidisp.c.

21 {
23  return FALSE;
24 }
#define FALSE
Definition: types.h:117
#define UNIMPLEMENTED
Definition: debug.h:115

Referenced by PDEVOBJ_Create().

◆ NtGdiGetDeviceCaps()

INT APIENTRY NtGdiGetDeviceCaps ( HDC  hdc,
INT  Index 
)

Definition at line 1064 of file pdevobj.c.

1067 {
1068  PDC pdc;
1069  DEVCAPS devcaps;
1070 
1071  /* Lock the given DC */
1072  pdc = DC_LockDc(hdc);
1073  if (!pdc)
1074  {
1076  return 0;
1077  }
1078 
1079  /* Get the data */
1080  PDEVOBJ_vGetDeviceCaps(pdc->ppdev, &devcaps);
1081 
1082  /* Unlock the DC */
1083  DC_UnlockDc(pdc);
1084 
1085  /* Return capability */
1086  switch (Index)
1087  {
1088  case DRIVERVERSION:
1089  return devcaps.ulVersion;
1090 
1091  case TECHNOLOGY:
1092  return devcaps.ulTechnology;
1093 
1094  case HORZSIZE:
1095  return devcaps.ulHorzSize;
1096 
1097  case VERTSIZE:
1098  return devcaps.ulVertSize;
1099 
1100  case HORZRES:
1101  return devcaps.ulHorzRes;
1102 
1103  case VERTRES:
1104  return devcaps.ulVertRes;
1105 
1106  case LOGPIXELSX:
1107  return devcaps.ulLogPixelsX;
1108 
1109  case LOGPIXELSY:
1110  return devcaps.ulLogPixelsY;
1111 
1112  case BITSPIXEL:
1113  return devcaps.ulBitsPixel;
1114 
1115  case PLANES:
1116  return devcaps.ulPlanes;
1117 
1118  case NUMBRUSHES:
1119  return -1;
1120 
1121  case NUMPENS:
1122  return devcaps.ulNumPens;
1123 
1124  case NUMFONTS:
1125  return devcaps.ulNumFonts;
1126 
1127  case NUMCOLORS:
1128  return devcaps.ulNumColors;
1129 
1130  case ASPECTX:
1131  return devcaps.ulAspectX;
1132 
1133  case ASPECTY:
1134  return devcaps.ulAspectY;
1135 
1136  case ASPECTXY:
1137  return devcaps.ulAspectXY;
1138 
1139  case CLIPCAPS:
1140  return CP_RECTANGLE;
1141 
1142  case SIZEPALETTE:
1143  return devcaps.ulSizePalette;
1144 
1145  case NUMRESERVED:
1146  return 20;
1147 
1148  case COLORRES:
1149  return devcaps.ulColorRes;
1150 
1151  case DESKTOPVERTRES:
1152  return devcaps.ulVertRes;
1153 
1154  case DESKTOPHORZRES:
1155  return devcaps.ulHorzRes;
1156 
1157  case BLTALIGNMENT:
1158  return devcaps.ulBltAlignment;
1159 
1160  case SHADEBLENDCAPS:
1161  return devcaps.ulShadeBlend;
1162 
1163  case COLORMGMTCAPS:
1164  return devcaps.ulColorMgmtCaps;
1165 
1166  case PHYSICALWIDTH:
1167  return devcaps.ulPhysicalWidth;
1168 
1169  case PHYSICALHEIGHT:
1170  return devcaps.ulPhysicalHeight;
1171 
1172  case PHYSICALOFFSETX:
1173  return devcaps.ulPhysicalOffsetX;
1174 
1175  case PHYSICALOFFSETY:
1176  return devcaps.ulPhysicalOffsetY;
1177 
1178  case VREFRESH:
1179  return devcaps.ulVRefresh;
1180 
1181  case RASTERCAPS:
1182  return devcaps.ulRasterCaps;
1183 
1184  case CURVECAPS:
1185  return (CC_CIRCLES | CC_PIE | CC_CHORD | CC_ELLIPSES | CC_WIDE |
1187 
1188  case LINECAPS:
1189  return (LC_POLYLINE | LC_MARKER | LC_POLYMARKER | LC_WIDE |
1191 
1192  case POLYGONALCAPS:
1195 
1196  case TEXTCAPS:
1197  return devcaps.ulTextCaps;
1198 
1199  case CAPS1:
1200  case PDEVICESIZE:
1201  case SCALINGFACTORX:
1202  case SCALINGFACTORY:
1203  default:
1204  return 0;
1205  }
1206 
1207  return 0;
1208 }
#define CP_RECTANGLE
Definition: wingdi.h:826
#define DESKTOPHORZRES
Definition: wingdi.h:742
#define CC_PIE
Definition: wingdi.h:762
#define DESKTOPVERTRES
Definition: wingdi.h:743
#define NUMBRUSHES
Definition: wingdi.h:722
#define CC_CHORD
Definition: wingdi.h:763
#define BITSPIXEL
Definition: wingdi.h:720
#define HORZRES
Definition: wingdi.h:716
#define LOGPIXELSX
Definition: wingdi.h:718
ULONG ulBltAlignment
Definition: ntgdityp.h:327
#define NUMRESERVED
Definition: wingdi.h:733
#define LC_WIDE
Definition: wingdi.h:775
ULONG ulHorzRes
Definition: ntgdityp.h:304
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:217
#define PC_INTERIORS
Definition: wingdi.h:804
#define ASPECTX
Definition: wingdi.h:727
ULONG ulRasterCaps
Definition: ntgdityp.h:311
#define LC_POLYLINE
Definition: wingdi.h:772
#define CC_STYLED
Definition: wingdi.h:766
ULONG ulNumFonts
Definition: ntgdityp.h:309
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define COLORRES
Definition: wingdi.h:734
#define DRIVERVERSION
Definition: wingdi.h:705
#define PDEVICESIZE
Definition: wingdi.h:730
#define BLTALIGNMENT
Definition: wingdi.h:744
ULONG ulHorzSize
Definition: ntgdityp.h:302
#define SCALINGFACTORX
Definition: wingdi.h:739
#define LC_POLYMARKER
Definition: wingdi.h:774
#define POLYGONALCAPS
Definition: wingdi.h:779
ULONG ulBitsPixel
Definition: ntgdityp.h:306
#define PC_WINDPOLYGON
Definition: wingdi.h:798
ULONG ulPhysicalHeight
Definition: ntgdityp.h:320
#define RASTERCAPS
Definition: wingdi.h:745
#define TECHNOLOGY
Definition: wingdi.h:706
ULONG ulVRefresh
Definition: ntgdityp.h:324
#define TEXTCAPS
Definition: wingdi.h:806
#define PHYSICALHEIGHT
Definition: wingdi.h:736
ULONG ulShadeBlend
Definition: ntgdityp.h:332
#define PC_WIDESTYLED
Definition: wingdi.h:803
#define NUMCOLORS
Definition: wingdi.h:725
ULONG ulNumPens
Definition: ntgdityp.h:308
ULONG ulVertRes
Definition: ntgdityp.h:305
#define VREFRESH
Definition: wingdi.h:741
#define CC_INTERIORS
Definition: wingdi.h:768
ULONG ulVertSize
Definition: ntgdityp.h:303
ULONG ulAspectXY
Definition: ntgdityp.h:314
#define LC_MARKER
Definition: wingdi.h:773
VOID NTAPI PDEVOBJ_vGetDeviceCaps(IN PPDEVOBJ ppdev, OUT PDEVCAPS pDevCaps)
Definition: pdevobj.c:964
#define SCALINGFACTORY
Definition: wingdi.h:740
#define PC_STYLED
Definition: wingdi.h:802
#define CC_WIDE
Definition: wingdi.h:765
ULONG ulColorRes
Definition: ntgdityp.h:318
ULONG ulPhysicalOffsetY
Definition: ntgdityp.h:322
#define LC_STYLED
Definition: wingdi.h:776
ULONG ulAspectY
Definition: ntgdityp.h:313
#define PC_WIDE
Definition: wingdi.h:801
ULONG ulPlanes
Definition: ntgdityp.h:307
Definition: polytest.cpp:40
#define ASPECTXY
Definition: wingdi.h:729
ULONG ulVersion
Definition: ntgdityp.h:298
#define PHYSICALOFFSETY
Definition: wingdi.h:738
_In_ WDFCOLLECTION _In_ ULONG Index
#define CC_ROUNDRECT
Definition: wingdi.h:769
#define ASPECTY
Definition: wingdi.h:728
#define CLIPCAPS
Definition: wingdi.h:731
#define LC_WIDESTYLED
Definition: wingdi.h:777
#define SIZEPALETTE
Definition: wingdi.h:732
ULONG ulLogPixelsY
Definition: ntgdityp.h:316
HDC hdc
Definition: main.c:9
#define CC_ELLIPSES
Definition: wingdi.h:764
ULONG ulPhysicalOffsetX
Definition: ntgdityp.h:321
#define CAPS1
Definition: mmsystem.h:934
#define HORZSIZE
Definition: wingdi.h:714
#define PHYSICALOFFSETX
Definition: wingdi.h:737
#define PHYSICALWIDTH
Definition: wingdi.h:735
#define PC_RECTANGLE
Definition: wingdi.h:797
#define VERTSIZE
Definition: wingdi.h:715
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:235
#define NUMPENS
Definition: wingdi.h:723
#define LINECAPS
Definition: wingdi.h:770
ULONG ulTextCaps
Definition: ntgdityp.h:323
ULONG ulPhysicalWidth
Definition: ntgdityp.h:319
#define VERTRES
Definition: wingdi.h:717
#define PC_POLYGON
Definition: wingdi.h:794
#define PC_SCANLINE
Definition: wingdi.h:799
ULONG ulAspectX
Definition: ntgdityp.h:312
ULONG ulColorMgmtCaps
Definition: ntgdityp.h:333
#define LOGPIXELSY
Definition: wingdi.h:719
ULONG ulNumColors
Definition: ntgdityp.h:310
#define CC_WIDESTYLED
Definition: wingdi.h:767
ULONG ulSizePalette
Definition: ntgdityp.h:317
#define CC_CIRCLES
Definition: wingdi.h:761
ULONG ulLogPixelsX
Definition: ntgdityp.h:315
#define LC_INTERIORS
Definition: wingdi.h:778
#define CURVECAPS
Definition: wingdi.h:759
#define NUMFONTS
Definition: wingdi.h:724
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:28
ULONG ulTechnology
Definition: ntgdityp.h:299
#define PLANES
Definition: wingdi.h:721

◆ NtGdiGetDhpdev()

DHPDEV APIENTRY NtGdiGetDhpdev ( IN HDEV  hdev)

Definition at line 1253 of file pdevobj.c.

1255 {
1256  PPDEVOBJ ppdev;
1257  DHPDEV dhpdev = NULL;
1258 
1259  /* Check parameter */
1260  if (!hdev || (PCHAR)hdev < (PCHAR)MmSystemRangeStart)
1261  return NULL;
1262 
1263  /* Lock PDEV list */
1264  EngAcquireSemaphoreShared(ghsemPDEV);
1265 
1266  /* Walk through the list of PDEVs */
1267  for (ppdev = gppdevList; ppdev; ppdev = ppdev->ppdevNext)
1268  {
1269  /* Compare with the given HDEV */
1270  if (ppdev == (PPDEVOBJ)hdev)
1271  {
1272  /* Found the PDEV! Get it's dhpdev and break */
1273  dhpdev = ppdev->dhpdev;
1274  break;
1275  }
1276  }
1277 
1278  /* Unlock PDEV list */
1280 
1281  return dhpdev;
1282 }
DHPDEV dhpdev
Definition: pdevobj.h:120
signed char * PCHAR
Definition: retypes.h:7
VOID WINAPI EngReleaseSemaphore(IN HSEMAPHORE hsem)
Definition: eng.c:235
typedef DHPDEV(APIENTRY FN_DrvEnablePDEV)(_In_ DEVMODEW *pdm
struct _PDEVOBJ * ppdevNext
Definition: pdevobj.h:83
static HSEMAPHORE ghsemPDEV
Definition: pdevobj.c:15
static PPDEVOBJ gppdevList
Definition: pdevobj.c:14
#define NULL
Definition: types.h:112
#define MmSystemRangeStart
Definition: mm.h:32
_In_ HDEV hdev
Definition: winddi.h:3449

◆ PDEVOBJ_AllocPDEV()

PPDEVOBJ PDEVOBJ_AllocPDEV ( VOID  )

Definition at line 62 of file pdevobj.c.

63 {
64  PPDEVOBJ ppdev;
65 
67  if (!ppdev)
68  return NULL;
69 
70  RtlZeroMemory(ppdev, sizeof(PDEVOBJ));
71 
73  if (ppdev->hsemDevLock == NULL)
74  {
76  return NULL;
77  }
78 
79  /* Allocate EDD_DIRECTDRAW_GLOBAL for our ReactX driver */
81  if (ppdev->pEDDgpl)
83 
84  ppdev->cPdevRefs = 1;
85 
86  return ppdev;
87 }
LONG cPdevRefs
Definition: pdevobj.h:84
HSEMAPHORE hsemDevLock
Definition: pdevobj.h:89
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
struct _EDD_DIRECTDRAW_GLOBAL * pEDDgpl
Definition: pdevobj.h:149
#define NULL
Definition: types.h:112
HSEMAPHORE WINAPI EngCreateSemaphore(VOID)
Definition: eng.c:75
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
#define GDITAG_PDEV
Definition: tags.h:75

Referenced by PDEVOBJ_Create().

◆ PDEVOBJ_bDisableDisplay()

BOOL PDEVOBJ_bDisableDisplay ( _Inout_ PPDEVOBJ  ppdev)

Definition at line 360 of file pdevobj.c.

362 {
363  BOOL assertVal;
364 
365  if (ppdev->flFlags & PDEV_DISABLED)
366  return TRUE;
367 
368  TRACE("DrvAssertMode(dhpdev %p, FALSE)\n", ppdev->dhpdev);
369  assertVal = ppdev->pfn.AssertMode(ppdev->dhpdev, FALSE);
370  TRACE("DrvAssertMode(dhpdev %p, FALSE) => %d\n", ppdev->dhpdev, assertVal);
371 
372  if (assertVal)
373  ppdev->flFlags |= PDEV_DISABLED;
374 
375  return assertVal;
376 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by MDEVOBJ_bDisable(), PDEVOBJ_bSwitchMode(), PDEVOBJ_Create(), and PDEVOBJ_lChangeDisplaySettings().

◆ PDEVOBJ_bDynamicModeChange()

BOOL NTAPI PDEVOBJ_bDynamicModeChange ( PPDEVOBJ  ppdev,
PPDEVOBJ  ppdev2 
)

Definition at line 584 of file pdevobj.c.

587 {
588  union
589  {
590  DRIVER_FUNCTIONS pfn;
591  GDIINFO gdiinfo;
592  DEVINFO devinfo;
593  DWORD StateFlags;
594  } temp;
595 
596  /* Exchange driver functions */
597  temp.pfn = ppdev->pfn;
598  ppdev->pfn = ppdev2->pfn;
599  ppdev2->pfn = temp.pfn;
600 
601  /* Exchange LDEVs */
602  SwitchPointer(&ppdev->pldev, &ppdev2->pldev);
603 
604  /* Exchange DHPDEV */
605  SwitchPointer(&ppdev->dhpdev, &ppdev2->dhpdev);
606 
607  /* Exchange surfaces and associate them with their new PDEV */
608  SwitchPointer(&ppdev->pSurface, &ppdev2->pSurface);
609  ppdev->pSurface->SurfObj.hdev = (HDEV)ppdev;
610  ppdev2->pSurface->SurfObj.hdev = (HDEV)ppdev2;
611 
612  /* Exchange devinfo */
613  temp.devinfo = ppdev->devinfo;
614  ppdev->devinfo = ppdev2->devinfo;
615  ppdev2->devinfo = temp.devinfo;
616 
617  /* Exchange gdiinfo */
618  temp.gdiinfo = ppdev->gdiinfo;
619  ppdev->gdiinfo = ppdev2->gdiinfo;
620  ppdev2->gdiinfo = temp.gdiinfo;
621 
622  /* Exchange DEVMODE */
623  SwitchPointer(&ppdev->pdmwDev, &ppdev2->pdmwDev);
624 
625  /* Exchange state flags */
626  temp.StateFlags = ppdev->pGraphicsDevice->StateFlags;
628  ppdev2->pGraphicsDevice->StateFlags = temp.StateFlags;
629 
630  /* Notify each driver instance of its new HDEV association */
631  ppdev->pfn.CompletePDEV(ppdev->dhpdev, (HDEV)ppdev);
632  ppdev2->pfn.CompletePDEV(ppdev2->dhpdev, (HDEV)ppdev2);
633 
634  return TRUE;
635 }
DHPDEV dhpdev
Definition: pdevobj.h:120
struct _LDEVOBJ * pldev
Definition: pdevobj.h:119
#define TRUE
Definition: types.h:120
GDIINFO gdiinfo
Definition: pdevobj.h:123
DWORD StateFlags
Definition: pdevobj.h:66
SURFOBJ SurfObj
Definition: surface.h:8
PDEVMODEW pdmwDev
Definition: pdevobj.h:129
DRIVER_FUNCTIONS pfn
Definition: pdevobj.h:138
DEVINFO devinfo
Definition: pdevobj.h:122
unsigned long DWORD
Definition: ntddk_ex.h:95
HDEV hdev
Definition: winddi.h:1208
static calc_node_t temp
Definition: rpn_ieee.c:38
PSURFACE pSurface
Definition: pdevobj.h:124
PFN_DrvCompletePDEV CompletePDEV
Definition: ntgdityp.h:570
PGRAPHICS_DEVICE pGraphicsDevice
Definition: pdevobj.h:127
FORCEINLINE VOID SwitchPointer(_Inout_ PVOID pvPointer1, _Inout_ PVOID pvPointer2)
Definition: pdevobj.c:569

Referenced by PDEVOBJ_bSwitchMode(), and PDEVOBJ_lChangeDisplaySettings().

◆ PDEVOBJ_bEnablePDEV()

BOOL NTAPI PDEVOBJ_bEnablePDEV ( _In_ PPDEVOBJ  ppdev,
_In_ PDEVMODEW  pdevmode,
_In_ PWSTR  pwszLogAddress 
)

Definition at line 173 of file pdevobj.c.

177 {
178  PFN_DrvEnablePDEV pfnEnablePDEV;
179  ULONG i;
180 
181  /* Get the DrvEnablePDEV function */
182  pfnEnablePDEV = ppdev->pfn.EnablePDEV;
183 
184  /* Call the drivers DrvEnablePDEV function */
185  TRACE("DrvEnablePDEV(pdevmode %p (%dx%dx%d %d Hz) hdev %p (%S))\n",
186  pdevmode,
187  ppdev->pGraphicsDevice ? pdevmode->dmPelsWidth : 0,
188  ppdev->pGraphicsDevice ? pdevmode->dmPelsHeight : 0,
189  ppdev->pGraphicsDevice ? pdevmode->dmBitsPerPel : 0,
190  ppdev->pGraphicsDevice ? pdevmode->dmDisplayFrequency : 0,
191  ppdev,
192  ppdev->pGraphicsDevice ? ppdev->pGraphicsDevice->szNtDeviceName : L"");
193  ppdev->dhpdev = pfnEnablePDEV(pdevmode,
195  HS_DDI_MAX,
196  ppdev->ahsurf,
197  sizeof(GDIINFO),
198  (PULONG)&ppdev->gdiinfo,
199  sizeof(DEVINFO),
200  &ppdev->devinfo,
201  (HDEV)ppdev,
202  ppdev->pGraphicsDevice ? ppdev->pGraphicsDevice->pwszDescription : NULL,
203  ppdev->pGraphicsDevice ? ppdev->pGraphicsDevice->DeviceObject : NULL);
204  TRACE("DrvEnablePDEV(pdevmode %p hdev %p) => dhpdev %p\n", pdevmode, ppdev, ppdev->dhpdev);
205  if (ppdev->dhpdev == NULL)
206  {
207  ERR("Failed to enable PDEV\n");
208  return FALSE;
209  }
210 
211  /* Fix up some values */
212  if (ppdev->gdiinfo.ulLogPixelsX == 0)
213  ppdev->gdiinfo.ulLogPixelsX = 96;
214 
215  if (ppdev->gdiinfo.ulLogPixelsY == 0)
216  ppdev->gdiinfo.ulLogPixelsY = 96;
217 
218  /* Set raster caps */
219  ppdev->gdiinfo.flRaster = RC_OP_DX_OUTPUT | RC_GDI20_OUTPUT | RC_BIGFONT;
220  if ((ppdev->gdiinfo.ulTechnology != DT_PLOTTER) && (ppdev->gdiinfo.ulTechnology != DT_CHARSTREAM))
221  ppdev->gdiinfo.flRaster |= RC_STRETCHDIB | RC_STRETCHBLT | RC_DIBTODEV | RC_DI_BITMAP | RC_BITMAP64 | RC_BITBLT;
222  if (ppdev->gdiinfo.ulTechnology == DT_RASDISPLAY)
223  ppdev->gdiinfo.flRaster |= RC_FLOODFILL;
224  if (ppdev->devinfo.flGraphicsCaps & GCAPS_PALMANAGED)
225  ppdev->gdiinfo.flRaster |= RC_PALETTE;
226 
227  /* Setup Palette */
228  ppdev->ppalSurf = PALETTE_ShareLockPalette(ppdev->devinfo.hpalDefault);
229 
230  /* Setup hatch brushes */
231  for (i = 0; i < HS_DDI_MAX; i++)
232  {
233  if (ppdev->ahsurf[i] == NULL)
234  ppdev->ahsurf[i] = gahsurfHatch[i];
235  }
236 
237  TRACE("PDEVOBJ_bEnablePDEV - dhpdev = %p\n", ppdev->dhpdev);
238 
239  return TRUE;
240 }
#define RC_STRETCHBLT
Definition: wingdi.h:755
#define HS_DDI_MAX
Definition: winddi.h:3954
#define RC_BIGFONT
Definition: wingdi.h:781
#define RC_GDI20_OUTPUT
Definition: wingdi.h:786
#define TRUE
Definition: types.h:120
#define RC_BITMAP64
Definition: wingdi.h:783
#define DT_RASDISPLAY
Definition: wingdi.h:708
#define RC_FLOODFILL
Definition: wingdi.h:751
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
HSURF gahsurfHatch[HS_DDI_MAX]
Definition: engbrush.c:24
#define PALETTE_ShareLockPalette(hpal)
Definition: palette.h:57
#define TRACE(s)
Definition: solgame.cpp:4
#define RC_OP_DX_OUTPUT
Definition: wingdi.h:789
#define RC_PALETTE
Definition: wingdi.h:790
#define RC_BITBLT
Definition: wingdi.h:782
#define DT_PLOTTER
Definition: wingdi.h:707
_In_ LPWSTR pwszLogAddress
Definition: winddi.h:3548
#define DT_CHARSTREAM
Definition: wingdi.h:711
#define RC_DI_BITMAP
Definition: wingdi.h:785
#define ERR(fmt,...)
Definition: debug.h:110
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define RC_STRETCHDIB
Definition: wingdi.h:756
unsigned int * PULONG
Definition: retypes.h:1
#define NULL
Definition: types.h:112
#define RC_DIBTODEV
Definition: wingdi.h:750
FN_DrvEnablePDEV * PFN_DrvEnablePDEV
Definition: winddi.h:3558
unsigned int ULONG
Definition: retypes.h:1
#define GCAPS_PALMANAGED
Definition: winddi.h:341

Referenced by PDEVOBJ_Create().

◆ PDEVOBJ_bSwitchMode()

BOOL NTAPI PDEVOBJ_bSwitchMode ( PPDEVOBJ  ppdev,
PDEVMODEW  pdm 
)

Definition at line 640 of file pdevobj.c.

643 {
644  PPDEVOBJ ppdevTmp;
646  BOOL retval = FALSE;
647 
648  /* Lock the PDEV */
650 
651  /* And everything else */
653 
654  DPRINT1("PDEVOBJ_bSwitchMode, ppdev = %p, pSurface = %p\n", ppdev, ppdev->pSurface);
655 
656  // Lookup the GraphicsDevice + select DEVMODE
657  // pdm = LDEVOBJ_bProbeAndCaptureDevmode(ppdev, pdm);
658 
659  /* 1. Temporarily disable the current PDEV and reset video to its default mode */
660  if (!PDEVOBJ_bDisableDisplay(ppdev))
661  {
662  DPRINT1("PDEVOBJ_bDisableDisplay() failed\n");
663  goto leave;
664  }
665 
666  /* 2. Create new PDEV */
667  ppdevTmp = PDEVOBJ_Create(ppdev->pGraphicsDevice, pdm, 0, LDEV_DEVICE_DISPLAY);
668  if (!ppdevTmp)
669  {
670  DPRINT1("Failed to create a new PDEV\n");
671  goto leave2;
672  }
673 
674  /* 3. Create a new surface */
675  pSurface = PDEVOBJ_pSurface(ppdevTmp);
676  if (!pSurface)
677  {
678  DPRINT1("PDEVOBJ_pSurface failed\n");
679  PDEVOBJ_vRelease(ppdevTmp);
680  goto leave2;
681  }
682 
683  /* 4. Get DirectDraw information */
684  /* 5. Enable DirectDraw Not traced */
685  /* 6. Copy old PDEV state to new PDEV instance */
686 
687  /* 7. Switch the PDEVs */
688  if (!PDEVOBJ_bDynamicModeChange(ppdev, ppdevTmp))
689  {
690  DPRINT1("PDEVOBJ_bDynamicModeChange() failed\n");
691  PDEVOBJ_vRelease(ppdevTmp);
692  goto leave2;
693  }
694 
695  /* 8. Disable DirectDraw */
696 
697  PDEVOBJ_vRelease(ppdevTmp);
698 
699  /* Update primary display capabilities */
700  if (ppdev == gpmdev->ppdevGlobal)
701  {
702  PDEVOBJ_vGetDeviceCaps(ppdev, &GdiHandleTable->DevCaps);
703  }
704 
705  /* Success! */
706  retval = TRUE;
707 
708 leave2:
709  /* Set the new video mode, or restore the original one in case of failure */
710  PDEVOBJ_vEnableDisplay(ppdev);
711 
712 leave:
713  /* Unlock everything else */
715  /* Unlock the PDEV */
717 
718  DPRINT1("leave, ppdev = %p, pSurface = %p\n", ppdev, ppdev->pSurface);
719 
720  return retval;
721 }
VOID WINAPI EngReleaseSemaphore(IN HSEMAPHORE hsem)
Definition: eng.c:235
BOOL NTAPI PDEVOBJ_bDynamicModeChange(PPDEVOBJ ppdev, PPDEVOBJ ppdev2)
Definition: pdevobj.c:584
#define TRUE
Definition: types.h:120
PSURFACE NTAPI PDEVOBJ_pSurface(PPDEVOBJ ppdev)
Definition: pdevobj.c:310
PPDEVOBJ PDEVOBJ_Create(_In_opt_ PGRAPHICS_DEVICE pGraphicsDevice, _In_opt_ PDEVMODEW pdm, _In_ ULONG dwAccelerationLevel, _In_ ULONG ldevtype)
Definition: pdevobj.c:411
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
static HSEMAPHORE ghsemPDEV
Definition: pdevobj.c:15
ENGAPI VOID APIENTRY EngAcquireSemaphore(_Inout_ HSEMAPHORE hsem)
HSEMAPHORE hsemDevLock
Definition: pdevobj.h:89
VOID NTAPI PDEVOBJ_vGetDeviceCaps(IN PPDEVOBJ ppdev, OUT PDEVCAPS pDevCaps)
Definition: pdevobj.c:964
#define GdiHandleTable
Definition: win32nt.h:35
_In_ DD_SURFACE_LOCAL * pSurface
Definition: winddi.h:3481
BOOL PDEVOBJ_bDisableDisplay(_Inout_ PPDEVOBJ ppdev)
Definition: pdevobj.c:360
VOID PDEVOBJ_vEnableDisplay(_Inout_ PPDEVOBJ ppdev)
Definition: pdevobj.c:340
PPDEVOBJ ppdevGlobal
Definition: mdevobj.h:16
PMDEVOBJ gpmdev
Definition: mdevobj.c:14
PSURFACE pSurface
Definition: pdevobj.h:124
#define leave
Definition: btrfs_drv.h:138
#define DPRINT1
Definition: precomp.h:8
VOID NTAPI PDEVOBJ_vRelease(_Inout_ PPDEVOBJ ppdev)
Definition: pdevobj.c:104
PGRAPHICS_DEVICE pGraphicsDevice
Definition: pdevobj.h:127

Referenced by UserChangeDisplaySettings(), and UserRefreshDisplay().

◆ PDEVOBJ_Create()

PPDEVOBJ PDEVOBJ_Create ( _In_opt_ PGRAPHICS_DEVICE  pGraphicsDevice,
_In_opt_ PDEVMODEW  pdm,
_In_ ULONG  dwAccelerationLevel,
_In_ ULONG  ldevtype 
)

Definition at line 411 of file pdevobj.c.

416 {
417  PPDEVOBJ ppdev, ppdevMatch = NULL;
418  PLDEVOBJ pldev;
420 
421  TRACE("PDEVOBJ_Create(%p %p %d)\n", pGraphicsDevice, pdm, ldevtype);
422 
423  if (ldevtype != LDEV_DEVICE_META)
424  {
425  ASSERT(pGraphicsDevice);
426  ASSERT(pdm);
427  /* Search if we already have a PPDEV with the required characteristics.
428  * We will compare the graphics device, the devmode and the desktop
429  */
430  for (ppdev = gppdevList; ppdev; ppdev = ppdev->ppdevNext)
431  {
432  if (ppdev->pGraphicsDevice == pGraphicsDevice)
433  {
434  PDEVOBJ_vReference(ppdev);
435 
436  if (RtlEqualMemory(pdm, ppdev->pdmwDev, sizeof(DEVMODEW)) &&
437  ppdev->dwAccelerationLevel == dwAccelerationLevel)
438  {
439  PDEVOBJ_vReference(ppdev);
440  ppdevMatch = ppdev;
441  }
442  else
443  {
445  }
446 
447  PDEVOBJ_vRelease(ppdev);
448  }
449  }
450 
451  if (ppdevMatch)
452  {
453  PDEVOBJ_vEnableDisplay(ppdevMatch);
454 
455  return ppdevMatch;
456  }
457  }
458 
459  /* Try to get a display driver */
460  if (ldevtype == LDEV_DEVICE_META)
461  pldev = LDEVOBJ_pLoadInternal(MultiEnableDriver, ldevtype);
462  else
463  pldev = LDEVOBJ_pLoadDriver(pdm->dmDeviceName, ldevtype);
464  if (!pldev)
465  {
466  ERR("Could not load display driver '%S'\n",
467  (ldevtype == LDEV_DEVICE_META) ? L"" : pdm->dmDeviceName);
468  return NULL;
469  }
470 
471  /* Allocate a new PDEVOBJ */
472  ppdev = PDEVOBJ_AllocPDEV();
473  if (!ppdev)
474  {
475  ERR("failed to allocate a PDEV\n");
476  return NULL;
477  }
478 
479  if (ldevtype != LDEV_DEVICE_META)
480  {
481  ppdev->pGraphicsDevice = pGraphicsDevice;
482 
483  // DxEngGetHdevData asks for Graphics DeviceObject in hSpooler field
484  ppdev->hSpooler = ppdev->pGraphicsDevice->DeviceObject;
485 
486  /* Keep selected resolution */
487  if (ppdev->pdmwDev)
489  ppdev->pdmwDev = ExAllocatePoolWithTag(PagedPool, pdm->dmSize + pdm->dmDriverExtra, GDITAG_DEVMODE);
490  if (ppdev->pdmwDev)
491  {
492  RtlCopyMemory(ppdev->pdmwDev, pdm, pdm->dmSize + pdm->dmDriverExtra);
493  /* FIXME: this must be done in a better way */
494  pGraphicsDevice->StateFlags |= DISPLAY_DEVICE_PRIMARY_DEVICE | DISPLAY_DEVICE_ATTACHED_TO_DESKTOP;
495  }
496  }
497 
498  /* FIXME! */
499  ppdev->flFlags = PDEV_DISPLAY;
500 
501  /* HACK: Don't use the pointer */
502  ppdev->Pointer.Exclude.right = -1;
503 
504  /* Initialize PDEV */
505  ppdev->pldev = pldev;
506  ppdev->dwAccelerationLevel = dwAccelerationLevel;
507 
508  /* Copy the function table */
509  if ((ldevtype == LDEV_DEVICE_DISPLAY && dwAccelerationLevel >= 5) ||
510  pdm->dmFields & (DM_PANNINGWIDTH | DM_PANNINGHEIGHT))
511  {
512  ULONG i;
513 
514  /* Initialize missing fields */
515  if (!(pdm->dmFields & DM_PANNINGWIDTH))
516  pdm->dmPanningWidth = pdm->dmPelsWidth;
517  if (!(pdm->dmFields & DM_PANNINGHEIGHT))
518  pdm->dmPanningHeight = pdm->dmPelsHeight;
519 
520  /* Replace vtable by panning vtable */
521  for (i = 0; i < gPanDispDrvCount; i++)
523  }
524  else
525  {
526  ppdev->pfn = ppdev->pldev->pfn;
527  }
528 
529  /* Call the driver to enable the PDEV */
530  if (!PDEVOBJ_bEnablePDEV(ppdev, pdm, NULL))
531  {
532  ERR("Failed to enable PDEV!\n");
533  PDEVOBJ_vRelease(ppdev);
534  EngUnloadImage(pldev);
535  return NULL;
536  }
537 
538  /* Tell the driver that the PDEV is ready */
539  PDEVOBJ_vCompletePDEV(ppdev);
540 
541  /* Create the initial surface */
542  pSurface = PDEVOBJ_pSurface(ppdev);
543  if (!pSurface)
544  {
545  ERR("Failed to create surface\n");
546  PDEVOBJ_vRelease(ppdev);
547  EngUnloadImage(pldev);
548  return NULL;
549  }
550 
551  /* Remove some acceleration capabilities from driver */
553 
554  /* Set MovePointer function */
555  ppdev->pfnMovePointer = ppdev->pfn.MovePointer;
556  if (!ppdev->pfnMovePointer)
558 
559  /* Insert the PDEV into the list */
560  ppdev->ppdevNext = gppdevList;
561  gppdevList = ppdev;
562 
563  /* Return the PDEV */
564  return ppdev;
565 }
ULONG iFunc
Definition: winddi.h:530
#define GDITAG_DEVMODE
Definition: tags.h:73
PDEVICE_OBJECT DeviceObject
Definition: pdevobj.h:63
struct _LDEVOBJ * pldev
Definition: pdevobj.h:119
PFN_DrvMovePointer pfnMovePointer
Definition: pdevobj.h:113
FORCEINLINE VOID PDEVOBJ_vReference(_In_ PPDEVOBJ ppdev)
Definition: pdevobj.h:161
PSURFACE NTAPI PDEVOBJ_pSurface(PPDEVOBJ ppdev)
Definition: pdevobj.c:310
#define DM_PANNINGWIDTH
Definition: wingdi.h:1277
static VOID PDEVOBJ_vFilterDriverHooks(_In_ PPDEVOBJ ppdev)
Definition: pdevobj.c:254
PVOID apfn[INDEX_LAST]
Definition: pdevobj.h:139
struct _PDEVOBJ * ppdevNext
Definition: pdevobj.h:83
PFN pfn
Definition: winddi.h:531
long right
Definition: polytest.cpp:53
#define L(x)
Definition: ntvdm.h:50
FLONG flFlags
Definition: pdevobj.h:87
RECTL Exclude
Definition: pdevobj.h:39
ULONG gPanDispDrvCount
Definition: pandisp.c:501
PDEVMODEW pdmwDev
Definition: pdevobj.h:129
DRIVER_FUNCTIONS pfn
Definition: pdevobj.h:138
VOID NTAPI PDEVOBJ_vCompletePDEV(PPDEVOBJ ppdev)
Definition: pdevobj.c:244
#define DISPLAY_DEVICE_PRIMARY_DEVICE
Definition: wingdi.h:1398
#define TRACE(s)
Definition: solgame.cpp:4
static PPDEVOBJ gppdevList
Definition: pdevobj.c:14
#define ASSERT(a)
Definition: mode.c:44
NTSYSAPI ULONG NTAPI RtlEqualMemory(CONST VOID *Source1, CONST VOID *Source2, ULONG Length)
_In_ DD_SURFACE_LOCAL * pSurface
Definition: winddi.h:3481
#define DISPLAY_DEVICE_ATTACHED_TO_DESKTOP
Definition: wingdi.h:1396
WORD dmSize
Definition: wingdi.h:1620
BOOL PDEVOBJ_bDisableDisplay(_Inout_ PPDEVOBJ ppdev)
Definition: pdevobj.c:360
HANDLE hSpooler
Definition: pdevobj.h:125
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
BOOL APIENTRY MultiEnableDriver(_In_ ULONG iEngineVersion, _In_ ULONG cj, _Inout_bytecount_(cj) PDRVENABLEDATA pded)
Definition: multidisp.c:17
BOOL NTAPI PDEVOBJ_bEnablePDEV(_In_ PPDEVOBJ ppdev, _In_ PDEVMODEW pdevmode, _In_ PWSTR pwszLogAddress)
Definition: pdevobj.c:173
PFN_DrvMovePointer MovePointer
Definition: ntgdityp.h:599
#define ERR(fmt,...)
Definition: debug.h:110
VOID PDEVOBJ_vEnableDisplay(_Inout_ PPDEVOBJ ppdev)
Definition: pdevobj.c:340
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
PPDEVOBJ PDEVOBJ_AllocPDEV(VOID)
Definition: pdevobj.c:62
#define NULL
Definition: types.h:112
PLDEVOBJ LDEVOBJ_pLoadInternal(_In_ PFN_DrvEnableDriver pfnEnableDriver, _In_ ULONG ldevtype)
Definition: ldevobj.c:303
GDIPOINTER Pointer
Definition: pdevobj.h:144
DRVFN gPanDispDrvFn[]
Definition: pandisp.c:477
unsigned int ULONG
Definition: retypes.h:1
ENGAPI VOID APIENTRY EngUnloadImage(_In_ HANDLE hModule)
Definition: ldevobj.c:911
ENGAPI VOID APIENTRY EngMovePointer(_In_ SURFOBJ *pso, _In_ LONG x, _In_ LONG y, _In_ RECTL *prcl)
Definition: mouse.c:566
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
DWORD dwAccelerationLevel
Definition: pdevobj.h:132
VOID NTAPI PDEVOBJ_vRelease(_Inout_ PPDEVOBJ ppdev)
Definition: pdevobj.c:104
#define DM_PANNINGHEIGHT
Definition: wingdi.h:1278
PGRAPHICS_DEVICE pGraphicsDevice
Definition: pdevobj.h:127
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
PLDEVOBJ NTAPI LDEVOBJ_pLoadDriver(_In_z_ LPWSTR pwszDriverName, _In_ ULONG ldevtype)
Definition: ldevobj.c:347

Referenced by MDEVOBJ_Create(), PDEVOBJ_bSwitchMode(), and PDEVOBJ_lChangeDisplaySettings().

◆ PDEVOBJ_iGetColorManagementCaps()

INT NTAPI PDEVOBJ_iGetColorManagementCaps ( PPDEVOBJ  ppdev)

Definition at line 943 of file pdevobj.c.

944 {
945  INT ret = CM_NONE;
946 
947  if (ppdev->flFlags & PDEV_DISPLAY)
948  {
949  if (ppdev->devinfo.iDitherFormat == BMF_8BPP ||
951  ret = CM_GAMMA_RAMP;
952  }
953 
955  ret |= CM_CMYK_COLOR;
956  if (ppdev->devinfo.flGraphicsCaps & GCAPS_ICM)
957  ret |= CM_DEVICE_ICM;
958 
959  return ret;
960 }
#define GCAPS_CMYKCOLOR
Definition: winddi.h:347
int32_t INT
Definition: typedefs.h:58
FLONG flFlags
Definition: pdevobj.h:87
ULONG iDitherFormat
Definition: winddi.h:395
#define GCAPS2_CHANGEGAMMARAMP
Definition: winddi.h:370
DEVINFO devinfo
Definition: pdevobj.h:122
int ret
#define GCAPS_ICM
Definition: winddi.h:346
FLONG flGraphicsCaps
Definition: winddi.h:390
Definition: xlate.c:10
FLONG flGraphicsCaps2
Definition: winddi.h:399

Referenced by PDEVOBJ_vGetDeviceCaps().

◆ PDEVOBJ_lChangeDisplaySettings()

LONG PDEVOBJ_lChangeDisplaySettings ( _In_opt_ PUNICODE_STRING  pustrDeviceName,
_In_opt_ PDEVMODEW  RequestedMode,
_In_opt_ PMDEVOBJ  pmdevOld,
_Out_ PMDEVOBJ ppmdevNew,
_In_ BOOL  bSearchClosestMode 
)

Definition at line 776 of file pdevobj.c.

782 {
783  PGRAPHICS_DEVICE pGraphicsDevice = NULL;
784  PMDEVOBJ pmdev = NULL;
785  PDEVMODEW pdm = NULL;
787  ULONG i, j;
788 
789  TRACE("PDEVOBJ_lChangeDisplaySettings('%wZ' '%dx%dx%d (%d Hz)' %p %p)\n",
790  pustrDeviceName,
791  RequestedMode ? RequestedMode->dmPelsWidth : 0,
792  RequestedMode ? RequestedMode->dmPelsHeight : 0,
793  RequestedMode ? RequestedMode->dmBitsPerPel : 0,
794  RequestedMode ? RequestedMode->dmDisplayFrequency : 0,
795  pmdevOld, ppmdevNew);
796 
797  if (pustrDeviceName)
798  {
799  pGraphicsDevice = EngpFindGraphicsDevice(pustrDeviceName, 0);
800  if (!pGraphicsDevice)
801  {
802  ERR("Wrong device name provided: '%wZ'\n", pustrDeviceName);
803  lRet = DISP_CHANGE_BADPARAM;
804  goto cleanup;
805  }
806  }
807  else if (RequestedMode)
808  {
809  pGraphicsDevice = gpPrimaryGraphicsDevice;
810  if (!pGraphicsDevice)
811  {
812  ERR("Wrong device'\n");
813  lRet = DISP_CHANGE_BADPARAM;
814  goto cleanup;
815  }
816  }
817 
818  if (pGraphicsDevice)
819  {
820  if (!LDEVOBJ_bProbeAndCaptureDevmode(pGraphicsDevice, RequestedMode, &pdm, bSearchClosestMode))
821  {
822  ERR("DrvProbeAndCaptureDevmode() failed\n");
823  lRet = DISP_CHANGE_BADMODE;
824  goto cleanup;
825  }
826  }
827 
828  /* Here, we know that input parameters were correct */
829 
830  {
831  /* Create new MDEV. Note that if we provide a device name,
832  * MDEV will only contain one device.
833  * */
834 
835  if (pmdevOld)
836  {
837  /* Disable old MDEV */
838  if (MDEVOBJ_bDisable(pmdevOld))
839  {
840  /* Create new MDEV. On failure, reenable old MDEV */
841  pmdev = MDEVOBJ_Create(pustrDeviceName, pdm);
842  if (!pmdev)
843  MDEVOBJ_vEnable(pmdevOld);
844  }
845  }
846  else
847  {
848  pmdev = MDEVOBJ_Create(pustrDeviceName, pdm);
849  }
850 
851  if (!pmdev)
852  {
853  ERR("Failed to create new MDEV\n");
854  lRet = DISP_CHANGE_FAILED;
855  goto cleanup;
856  }
857 
858  lRet = DISP_CHANGE_SUCCESSFUL;
859  *ppmdevNew = pmdev;
860 
861  /* We now have to do the mode switch */
862 
863  if (pustrDeviceName && pmdevOld)
864  {
865  /* We changed settings of one device. Add other devices which were already present */
866  for (i = 0; i < pmdevOld->cDev; i++)
867  {
868  for (j = 0; j < pmdev->cDev; j++)
869  {
870  if (pmdev->dev[j].ppdev->pGraphicsDevice == pmdevOld->dev[i].ppdev->pGraphicsDevice)
871  {
872  if (PDEVOBJ_bDynamicModeChange(pmdevOld->dev[i].ppdev, pmdev->dev[j].ppdev))
873  {
874  PPDEVOBJ tmp = pmdevOld->dev[i].ppdev;
875  pmdevOld->dev[i].ppdev = pmdev->dev[j].ppdev;
876  pmdev->dev[j].ppdev = tmp;
877  }
878  else
879  {
880  ERR("Failed to apply new settings\n");
882  ASSERT(FALSE);
883  }
884  break;
885  }
886  }
887  if (j == pmdev->cDev)
888  {
889  PDEVOBJ_vReference(pmdevOld->dev[i].ppdev);
890  pmdev->dev[pmdev->cDev].ppdev = pmdevOld->dev[i].ppdev;
891  pmdev->cDev++;
892  }
893  }
894  }
895 
896  if (pmdev->cDev == 1)
897  {
898  pmdev->ppdevGlobal = pmdev->dev[0].ppdev;
899  }
900  else
901  {
902  /* Enable MultiDriver */
904  if (!pmdev->ppdevGlobal)
905  {
906  WARN("Failed to create meta-device. Using only first display\n");
907  PDEVOBJ_vReference(pmdev->dev[0].ppdev);
908  pmdev->ppdevGlobal = pmdev->dev[0].ppdev;
909  }
910  }
911 
912  if (pmdevOld)
913  {
914  /* Search PDEVs which were in pmdevOld, but are not anymore in pmdev, and disable them */
915  for (i = 0; i < pmdevOld->cDev; i++)
916  {
917  for (j = 0; j < pmdev->cDev; j++)
918  {
919  if (pmdev->dev[j].ppdev->pGraphicsDevice == pmdevOld->dev[i].ppdev->pGraphicsDevice)
920  break;
921  }
922  if (j == pmdev->cDev)
923  PDEVOBJ_bDisableDisplay(pmdevOld->dev[i].ppdev);
924  }
925  }
926  }
927 
928 cleanup:
929  if (lRet != DISP_CHANGE_SUCCESSFUL)
930  {
931  *ppmdevNew = NULL;
932  if (pmdev)
933  MDEVOBJ_vDestroy(pmdev);
934  if (pdm && pdm != RequestedMode)
936  }
937 
938  return lRet;
939 }
BOOL NTAPI PDEVOBJ_bDynamicModeChange(PPDEVOBJ ppdev, PPDEVOBJ ppdev2)
Definition: pdevobj.c:584
#define GDITAG_DEVMODE
Definition: tags.h:73
BOOL LDEVOBJ_bProbeAndCaptureDevmode(_Inout_ PGRAPHICS_DEVICE pGraphicsDevice, _In_ PDEVMODEW RequestedMode, _Out_ PDEVMODEW *pSelectedMode, _In_ BOOL bSearchClosestMode)
Definition: ldevobj.c:735
FORCEINLINE VOID PDEVOBJ_vReference(_In_ PPDEVOBJ ppdev)
Definition: pdevobj.h:161
#define WARN(fmt,...)
Definition: debug.h:112
PPDEVOBJ PDEVOBJ_Create(_In_opt_ PGRAPHICS_DEVICE pGraphicsDevice, _In_opt_ PDEVMODEW pdm, _In_ ULONG dwAccelerationLevel, _In_ ULONG ldevtype)
Definition: pdevobj.c:411
#define DISP_CHANGE_BADMODE
Definition: winuser.h:195
VOID MDEVOBJ_vDestroy(_Inout_ PMDEVOBJ pmdev)
Definition: mdevobj.c:164
PGRAPHICS_DEVICE gpPrimaryGraphicsDevice
Definition: device.c:15
#define FALSE
Definition: types.h:117
VOID MDEVOBJ_vEnable(_Inout_ PMDEVOBJ pmdev)
Definition: mdevobj.c:17
#define DISP_CHANGE_FAILED
Definition: winuser.h:194
#define DISP_CHANGE_BADPARAM
Definition: winuser.h:193
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define TRACE(s)
Definition: solgame.cpp:4
#define ASSERT(a)
Definition: mode.c:44
BOOL MDEVOBJ_bDisable(_Inout_ PMDEVOBJ pmdev)
Definition: mdevobj.c:29
#define DISP_CHANGE_SUCCESSFUL
Definition: winuser.h:190
BOOL PDEVOBJ_bDisableDisplay(_Inout_ PPDEVOBJ ppdev)
Definition: pdevobj.c:360
PMDEVOBJ MDEVOBJ_Create(_In_opt_ PUNICODE_STRING pustrDeviceName, _In_opt_ PDEVMODEW pdm)
Definition: mdevobj.c:57
PGRAPHICS_DEVICE NTAPI EngpFindGraphicsDevice(_In_opt_ PUNICODE_STRING pustrDevice, _In_ ULONG iDevNum)
Definition: device.c:469
#define ERR(fmt,...)
Definition: debug.h:110
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
PPDEVOBJ ppdevGlobal
Definition: mdevobj.h:16
PPDEVOBJ ppdev
Definition: mdevobj.h:10
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
#define UNIMPLEMENTED
Definition: debug.h:115
char * cleanup(char *str)
Definition: wpickclick.c:99
PGRAPHICS_DEVICE pGraphicsDevice
Definition: pdevobj.h:127
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
ULONG cDev
Definition: mdevobj.h:15
MDEVDISPLAY dev[0]
Definition: mdevobj.h:17

Referenced by co_IntInitializeDesktopGraphics().

◆ PDEVOBJ_pSurface()

PSURFACE NTAPI PDEVOBJ_pSurface ( PPDEVOBJ  ppdev)

Definition at line 310 of file pdevobj.c.

312 {
313  HSURF hsurf;
314 
315  /* Check if there is no surface for this PDEV yet */
316  if (ppdev->pSurface == NULL)
317  {
318  /* Call the drivers DrvEnableSurface */
319  TRACE("DrvEnableSurface(dhpdev %p)\n", ppdev->dhpdev);
320  hsurf = ppdev->pfn.EnableSurface(ppdev->dhpdev);
321  TRACE("DrvEnableSurface(dhpdev %p) => hsurf %p\n", ppdev->dhpdev, hsurf);
322  if (hsurf== NULL)
323  {
324  ERR("Failed to create PDEV surface!\n");
325  return NULL;
326  }
327 
328  /* Get a reference to the surface */
329  ppdev->pSurface = SURFACE_ShareLockSurface(hsurf);
330  NT_ASSERT(ppdev->pSurface != NULL);
331  }
332 
333  /* Increment reference count */
335 
336  return ppdev->pSurface;
337 }
DHPDEV dhpdev
Definition: pdevobj.h:120
PFN_DrvEnableSurface EnableSurface
Definition: ntgdityp.h:572
#define SURFACE_ShareLockSurface(hBMObj)
Definition: surface.h:91
DRIVER_FUNCTIONS pfn
Definition: pdevobj.h:138
typedef HSURF(APIENTRY FN_DrvEnableSurface)(_In_ DHPDEV dhpdev)
BASEOBJECT BaseObject
Definition: surface.h:6
#define TRACE(s)
Definition: solgame.cpp:4
#define ERR(fmt,...)
Definition: debug.h:110
VOID NTAPI GDIOBJ_vReferenceObjectByPointer(POBJ pobj)
Definition: gdiobj.c:734
#define NULL
Definition: types.h:112
PSURFACE pSurface
Definition: pdevobj.h:124
#define NT_ASSERT
Definition: rtlfuncs.h:3310

Referenced by DC_vInitDc(), DC_vUpdateDC(), IntCreatePrimarySurface(), PDEVOBJ_bSwitchMode(), and PDEVOBJ_Create().

◆ PDEVOBJ_sizl()

PSIZEL FASTCALL PDEVOBJ_sizl ( PPDEVOBJ  ppdev,
PSIZEL  psizl 
)

Definition at line 1286 of file pdevobj.c.

1287 {
1288  if (ppdev->flFlags & PDEV_META_DEVICE)
1289  {
1290  *psizl = ppdev->szlMetaRes;
1291  }
1292  else
1293  {
1294  psizl->cx = ppdev->gdiinfo.ulHorzRes;
1295  psizl->cy = ppdev->gdiinfo.ulVertRes;
1296  }
1297  return psizl;
1298 }
GDIINFO gdiinfo
Definition: pdevobj.h:123
FLONG flFlags
Definition: pdevobj.h:87
ULONG ulHorzRes
Definition: winddi.h:882
LONG cx
Definition: windef.h:334
SIZEL szlMetaRes
Definition: pdevobj.h:108
ULONG ulVertRes
Definition: winddi.h:883
LONG cy
Definition: windef.h:335

Referenced by DC_vUpdateDC(), MakeInfoDC(), and UserUpdateMonitorSize().

◆ PDEVOBJ_vCompletePDEV()

VOID NTAPI PDEVOBJ_vCompletePDEV ( PPDEVOBJ  ppdev)

Definition at line 244 of file pdevobj.c.

246 {
247  /* Call the drivers DrvCompletePDEV function */
248  TRACE("DrvCompletePDEV(dhpdev %p hdev %p)\n", ppdev->dhpdev, ppdev);
249  ppdev->pfn.CompletePDEV(ppdev->dhpdev, (HDEV)ppdev);
250 }
DHPDEV dhpdev
Definition: pdevobj.h:120
DRIVER_FUNCTIONS pfn
Definition: pdevobj.h:138
#define TRACE(s)
Definition: solgame.cpp:4
PFN_DrvCompletePDEV CompletePDEV
Definition: ntgdityp.h:570

Referenced by PDEVOBJ_Create().

◆ PDEVOBJ_vDeletePDEV()

static VOID PDEVOBJ_vDeletePDEV ( PPDEVOBJ  ppdev)
static

Definition at line 91 of file pdevobj.c.

93 {
95  if (ppdev->pdmwDev)
97  if (ppdev->pEDDgpl)
100 }
#define GDITAG_DEVMODE
Definition: tags.h:73
_Requires_lock_not_held_ hsem ENGAPI VOID APIENTRY EngDeleteSemaphore(_Inout_ __drv_freesMem(Mem) HSEMAPHORE hsem)
Definition: semaphor.c:106
PDEVMODEW pdmwDev
Definition: pdevobj.h:129
HSEMAPHORE hsemDevLock
Definition: pdevobj.h:89
struct _EDD_DIRECTDRAW_GLOBAL * pEDDgpl
Definition: pdevobj.h:149
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
#define GDITAG_PDEV
Definition: tags.h:75

Referenced by PDEVOBJ_vRelease().

◆ PDEVOBJ_vEnableDisplay()

VOID PDEVOBJ_vEnableDisplay ( _Inout_ PPDEVOBJ  ppdev)

Definition at line 340 of file pdevobj.c.

342 {
343  BOOL assertVal;
344 
345  if (!(ppdev->flFlags & PDEV_DISABLED))
346  return;
347 
348  /* Try to enable display until success */
349  do
350  {
351  TRACE("DrvAssertMode(dhpdev %p, TRUE)\n", ppdev->dhpdev);
352  assertVal = ppdev->pfn.AssertMode(ppdev->dhpdev, TRUE);
353  TRACE("DrvAssertMode(dhpdev %p, TRUE) => %d\n", ppdev->dhpdev, assertVal);
354  } while (!assertVal);
355 
356  ppdev->flFlags &= ~PDEV_DISABLED;
357 }
#define TRUE
Definition: types.h:120
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by MDEVOBJ_bDisable(), MDEVOBJ_vEnable(), PDEVOBJ_bSwitchMode(), and PDEVOBJ_Create().

◆ PDEVOBJ_vFilterDriverHooks()

static VOID PDEVOBJ_vFilterDriverHooks ( _In_ PPDEVOBJ  ppdev)
static

Definition at line 254 of file pdevobj.c.

256 {
257  PLDEVOBJ pldev = ppdev->pldev;
258  ULONG dwAccelerationLevel = ppdev->dwAccelerationLevel;
259 
260  if (!pldev->pGdiDriverInfo)
261  return;
262  if (pldev->ldevtype != LDEV_DEVICE_DISPLAY)
263  return;
264 
265  if (dwAccelerationLevel >= 1)
266  {
268  ppdev->apfn[INDEX_DrvCreateDeviceBitmap] = NULL;
269  }
270 
271  if (dwAccelerationLevel >= 2)
272  {
273  /* Remove sophisticated display accelerations */
274  ppdev->pSurface->flags &= ~(HOOK_STRETCHBLT |
275  HOOK_FILLPATH |
277  HOOK_LINETO |
280  }
281 
282  if (dwAccelerationLevel >= 3)
283  {
284  /* Disable DirectDraw and Direct3D accelerations */
285  /* FIXME: need to call DxDdSetAccelLevel */
287  }
288 
289  if (dwAccelerationLevel >= 4)
290  {
291  /* Remove almost all display accelerations */
292  ppdev->pSurface->flags &= ~HOOK_FLAGS |
293  HOOK_BITBLT |
294  HOOK_COPYBITS |
295  HOOK_TEXTOUT |
298 
299  }
300 
301  if (dwAccelerationLevel >= 5)
302  {
303  /* Disable all display accelerations */
304  /* (nothing to do. Already handled in PDEVOBJ_Create) */
305  }
306 }
#define HOOK_TRANSPARENTBLT
Definition: winddi.h:1434
#define HOOK_GRADIENTFILL
Definition: winddi.h:1436
#define HOOK_ALPHABLEND
Definition: winddi.h:1435
#define HOOK_FILLPATH
Definition: winddi.h:1426
#define HOOK_FLAGS
Definition: winddi.h:1438
#define HOOK_LINETO
Definition: winddi.h:1428
SYSTEM_GDI_DRIVER_INFORMATION * pGdiDriverInfo
Definition: ldevobj.h:19
#define HOOK_TEXTOUT
Definition: winddi.h:1423
#define HOOK_BITBLT
Definition: winddi.h:1420
#define HOOK_SYNCHRONIZE
Definition: winddi.h:1431
#define INDEX_DrvSetPointerShape
Definition: winddi.h:445
#define HOOK_COPYBITS
Definition: winddi.h:1429
#define HOOK_STRETCHBLT
Definition: winddi.h:1421
PVOID apfn[INDEX_LAST]
Definition: ldevobj.h:26
#define NULL
Definition: types.h:112
#define INDEX_DrvCreateDeviceBitmap
Definition: winddi.h:426
unsigned int ULONG
Definition: retypes.h:1
#define UNIMPLEMENTED
Definition: debug.h:115
LDEVTYPE ldevtype
Definition: ldevobj.h:20
#define HOOK_STROKEPATH
Definition: winddi.h:1425

Referenced by PDEVOBJ_Create().

◆ PDEVOBJ_vGetDeviceCaps()

VOID NTAPI PDEVOBJ_vGetDeviceCaps ( IN PPDEVOBJ  ppdev,
OUT PDEVCAPS  pDevCaps 
)

Definition at line 964 of file pdevobj.c.

967 {
968  PGDIINFO pGdiInfo = &ppdev->gdiinfo;
969 
970  pDevCaps->ulVersion = pGdiInfo->ulVersion;
971  pDevCaps->ulTechnology = pGdiInfo->ulTechnology;
972  pDevCaps->ulHorzSizeM = (pGdiInfo->ulHorzSize + 500) / 1000;
973  pDevCaps->ulVertSizeM = (pGdiInfo->ulVertSize + 500) / 1000;
974  pDevCaps->ulHorzSize = pGdiInfo->ulHorzSize;
975  pDevCaps->ulVertSize = pGdiInfo->ulVertSize;
976  pDevCaps->ulHorzRes = pGdiInfo->ulHorzRes;
977  pDevCaps->ulVertRes = pGdiInfo->ulVertRes;
978  pDevCaps->ulBitsPixel = pGdiInfo->cBitsPixel;
979  if (pDevCaps->ulBitsPixel == 15) pDevCaps->ulBitsPixel = 16;
980  pDevCaps->ulPlanes = pGdiInfo->cPlanes;
981  pDevCaps->ulNumPens = pGdiInfo->ulNumColors;
982  if (pDevCaps->ulNumPens != -1) pDevCaps->ulNumPens *= 5;
983  pDevCaps->ulNumFonts = 0; // PDEVOBJ_cFonts(ppdev);
984  pDevCaps->ulNumColors = pGdiInfo->ulNumColors;
985  pDevCaps->ulRasterCaps = pGdiInfo->flRaster;
986  pDevCaps->ulAspectX = pGdiInfo->ulAspectX;
987  pDevCaps->ulAspectY = pGdiInfo->ulAspectY;
988  pDevCaps->ulAspectXY = pGdiInfo->ulAspectXY;
989  pDevCaps->ulLogPixelsX = pGdiInfo->ulLogPixelsX;
990  pDevCaps->ulLogPixelsY = pGdiInfo->ulLogPixelsY;
991  pDevCaps->ulSizePalette = pGdiInfo->ulNumPalReg;
992  pDevCaps->ulColorRes = pGdiInfo->ulDACRed +
993  pGdiInfo->ulDACGreen +
994  pGdiInfo->ulDACBlue;
995  pDevCaps->ulPhysicalWidth = pGdiInfo->szlPhysSize.cx;
999  pDevCaps->ulTextCaps = pGdiInfo->flTextCaps;
1001  if (pGdiInfo->ulTechnology != DT_PLOTTER)
1003  pDevCaps->ulVRefresh = pGdiInfo->ulVRefresh;
1004  pDevCaps->ulDesktopHorzRes = pGdiInfo->ulHorzRes;
1005  pDevCaps->ulDesktopVertRes = pGdiInfo->ulVertRes;
1006  pDevCaps->ulBltAlignment = pGdiInfo->ulBltAlignment;
1011  pDevCaps->ulShadeBlend = pGdiInfo->flShadeBlend;
1013 }
SIZEL szlPhysSize
Definition: winddi.h:901
_Out_ PDEVCAPS pDevCaps
Definition: ntgdi.h:2664
#define TC_UA_ABLE
Definition: wingdi.h:818
ULONG flShadeBlend
Definition: winddi.h:920
ULONG ulBltAlignment
Definition: ntgdityp.h:327
ULONG ulHorzRes
Definition: ntgdityp.h:304
INT NTAPI PDEVOBJ_iGetColorManagementCaps(PPDEVOBJ ppdev)
Definition: pdevobj.c:943
ULONG ulDACRed
Definition: winddi.h:891
ULONG ulVertSizeM
Definition: ntgdityp.h:301
ULONG ulRasterCaps
Definition: ntgdityp.h:311
ULONG ulNumFonts
Definition: ntgdityp.h:309
ULONG yPanningAlignment
Definition: winddi.h:914
ULONG ulAspectY
Definition: winddi.h:895
ULONG ulDesktopVertRes
Definition: ntgdityp.h:326
ULONG ulHorzSize
Definition: ntgdityp.h:302
ULONG ulLogPixelsY
Definition: winddi.h:889
ULONG ulPanningHorzRes
Definition: winddi.h:911
ULONG ulBitsPixel
Definition: ntgdityp.h:306
ULONG cPlanes
Definition: winddi.h:885
ULONG flTextCaps
Definition: winddi.h:890
#define TC_SO_ABLE
Definition: wingdi.h:819
ULONG ulPhysicalHeight
Definition: ntgdityp.h:320
ULONG ulVRefresh
Definition: ntgdityp.h:324
LONG y
Definition: windef.h:330
ULONG ulPanningVertRes
Definition: ntgdityp.h:329
ULONG ulNumPalReg
Definition: winddi.h:902
ULONG ulShadeBlend
Definition: ntgdityp.h:332
ULONG ulVertSize
Definition: winddi.h:881
ULONG ulDACGreen
Definition: winddi.h:892
POINTL ptlPhysOffset
Definition: winddi.h:900
ULONG ulVersion
Definition: winddi.h:878
ULONG ulNumPens
Definition: ntgdityp.h:308
ULONG ulVertRes
Definition: ntgdityp.h:305
ULONG ulVertSize
Definition: ntgdityp.h:303
ULONG ulHorzRes
Definition: winddi.h:882
ULONG xPanningAlignment
Definition: ntgdityp.h:330
ULONG ulAspectXY
Definition: ntgdityp.h:314
LONG cx
Definition: windef.h:334
ULONG ulTechnology
Definition: winddi.h:879
ULONG ulAspectXY
Definition: winddi.h:896
ULONG xPanningAlignment
Definition: winddi.h:913
#define TC_VA_ABLE
Definition: wingdi.h:821
#define TC_OP_STROKE
Definition: wingdi.h:808
ULONG ulColorRes
Definition: ntgdityp.h:318
ULONG ulPhysicalOffsetY
Definition: ntgdityp.h:322
ULONG ulAspectY
Definition: ntgdityp.h:313
ULONG ulPlanes
Definition: ntgdityp.h:307
ULONG ulVersion
Definition: ntgdityp.h:298
ULONG ulBltAlignment
Definition: winddi.h:910
ULONG ulDACBlue
Definition: winddi.h:893
LONG x
Definition: windef.h:329
#define DT_PLOTTER
Definition: wingdi.h:707
ULONG ulHorzSize
Definition: winddi.h:880
ULONG ulPanningHorzRes
Definition: ntgdityp.h:328
ULONG ulDesktopHorzRes
Definition: ntgdityp.h:325
ULONG ulLogPixelsY
Definition: ntgdityp.h:316
ULONG flRaster
Definition: winddi.h:887
ULONG ulVRefresh
Definition: winddi.h:909
#define TC_OP_CHARACTER
Definition: wingdi.h:807
ULONG ulPhysicalOffsetX
Definition: ntgdityp.h:321
ULONG cBitsPixel
Definition: winddi.h:884
ULONG ulAspectX
Definition: winddi.h:894
ULONG ulTextCaps
Definition: ntgdityp.h:323
ULONG ulPhysicalWidth
Definition: ntgdityp.h:319
ULONG ulPanningVertRes
Definition: winddi.h:912
ULONG ulNumColors
Definition: winddi.h:886
ULONG ulAspectX
Definition: ntgdityp.h:312
ULONG ulColorMgmtCaps
Definition: ntgdityp.h:333
ULONG ulHorzSizeM
Definition: ntgdityp.h:300
ULONG ulNumColors
Definition: ntgdityp.h:310
ULONG ulLogPixelsX
Definition: winddi.h:888
ULONG ulVertRes
Definition: winddi.h:883
ULONG ulSizePalette
Definition: ntgdityp.h:317
ULONG yPanningAlignment
Definition: ntgdityp.h:331
ULONG ulLogPixelsX
Definition: ntgdityp.h:315
#define TC_CP_STROKE
Definition: wingdi.h:809
LONG cy
Definition: windef.h:335
ULONG ulTechnology
Definition: ntgdityp.h:299

Referenced by _Success_(), IntCreatePrimarySurface(), NtGdiGetDeviceCaps(), and PDEVOBJ_bSwitchMode().

◆ PDEVOBJ_vRefreshModeList()

VOID NTAPI PDEVOBJ_vRefreshModeList ( PPDEVOBJ  ppdev)

Definition at line 380 of file pdevobj.c.

382 {
383  PGRAPHICS_DEVICE pGraphicsDevice;
384  PDEVMODEINFO pdminfo, pdmiNext;
385 
386  /* Lock the PDEV */
388 
389  pGraphicsDevice = ppdev->pGraphicsDevice;
390 
391  /* Clear out the modes */
392  for (pdminfo = pGraphicsDevice->pdevmodeInfo;
393  pdminfo;
394  pdminfo = pdmiNext)
395  {
396  pdmiNext = pdminfo->pdmiNext;
398  }
399  pGraphicsDevice->pdevmodeInfo = NULL;
400  ExFreePoolWithTag(pGraphicsDevice->pDevModeList, GDITAG_GDEVICE);
401  pGraphicsDevice->pDevModeList = NULL;
402 
403  /* Update available display mode list */
404  LDEVOBJ_bBuildDevmodeList(pGraphicsDevice);
405 
406  /* Unlock PDEV */
408 }
VOID WINAPI EngReleaseSemaphore(IN HSEMAPHORE hsem)
Definition: eng.c:235
#define GDITAG_DEVMODE
Definition: tags.h:73
PDEVMODEENTRY pDevModeList
Definition: pdevobj.h:70
ENGAPI VOID APIENTRY EngAcquireSemaphore(_Inout_ HSEMAPHORE hsem)
HSEMAPHORE hsemDevLock
Definition: pdevobj.h:89
struct _DEVMODEINFO * pdmiNext
Definition: pdevobj.h:44
#define GDITAG_GDEVICE
Definition: tags.h:99
#define NULL
Definition: types.h:112
BOOL LDEVOBJ_bBuildDevmodeList(_Inout_ PGRAPHICS_DEVICE pGraphicsDevice)
Definition: ldevobj.c:563
PDEVMODEINFO pdevmodeInfo
Definition: pdevobj.h:68
PGRAPHICS_DEVICE pGraphicsDevice
Definition: pdevobj.h:127
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099

Referenced by UserEnumDisplaySettings().

◆ PDEVOBJ_vRelease()

VOID NTAPI PDEVOBJ_vRelease ( _Inout_ PPDEVOBJ  ppdev)

Definition at line 104 of file pdevobj.c.

106 {
107  /* Lock loader */
109 
110  /* Decrease reference count */
111  InterlockedDecrement(&ppdev->cPdevRefs);
112  ASSERT(ppdev->cPdevRefs >= 0);
113 
114  /* Check if references are left */
115  if (ppdev->cPdevRefs == 0)
116  {
117  /* Do we have a surface? */
118  if (ppdev->pSurface)
119  {
120  /* Release the surface and let the driver free it */
121  SURFACE_ShareUnlockSurface(ppdev->pSurface);
122  TRACE("DrvDisableSurface(dhpdev %p)\n", ppdev->dhpdev);
123  ppdev->pfn.DisableSurface(ppdev->dhpdev);
124  }
125 
126  /* Do we have a palette? */
127  if (ppdev->ppalSurf)
128  {
129  PALETTE_ShareUnlockPalette(ppdev->ppalSurf);
130  }
131 
132  /* Check if the PDEV was enabled */
133  if (ppdev->dhpdev != NULL)
134  {
135  /* Disable the PDEV */
136  TRACE("DrvDisablePDEV(dhpdev %p)\n", ppdev->dhpdev);
137  ppdev->pfn.DisablePDEV(ppdev->dhpdev);
138  }
139 
140  /* Remove it from list */
141  if (ppdev == gppdevList)
142  {
143  gppdevList = ppdev->ppdevNext;
144  }
145  else if (gppdevList)
146  {
147  PPDEVOBJ ppdevCurrent = gppdevList;
148  BOOL found = FALSE;
149  while (!found && ppdevCurrent->ppdevNext)
150  {
151  if (ppdevCurrent->ppdevNext == ppdev)
152  found = TRUE;
153  else
154  ppdevCurrent = ppdevCurrent->ppdevNext;
155  }
156  if (found)
157  ppdevCurrent->ppdevNext = ppdev->ppdevNext;
158  }
159 
160  /* Unload display driver */
161  EngUnloadImage(ppdev->pldev);
162 
163  /* Free it */
164  PDEVOBJ_vDeletePDEV(ppdev);
165  }
166 
167  /* Unlock loader */
169 }
VOID WINAPI EngReleaseSemaphore(IN HSEMAPHORE hsem)
Definition: eng.c:235
#define SURFACE_ShareUnlockSurface(pBMObj)
Definition: surface.h:102
#define TRUE
Definition: types.h:120
struct _PDEVOBJ * ppdevNext
Definition: pdevobj.h:83
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
static HSEMAPHORE ghsemPDEV
Definition: pdevobj.c:15
ENGAPI VOID APIENTRY EngAcquireSemaphore(_Inout_ HSEMAPHORE hsem)
#define TRACE(s)
Definition: solgame.cpp:4
static PPDEVOBJ gppdevList
Definition: pdevobj.c:14
#define ASSERT(a)
Definition: mode.c:44
static VOID PDEVOBJ_vDeletePDEV(PPDEVOBJ ppdev)
Definition: pdevobj.c:91
#define InterlockedDecrement
Definition: armddk.h:52
#define PALETTE_ShareUnlockPalette(ppal)
Definition: palette.h:59
#define NULL
Definition: types.h:112
ENGAPI VOID APIENTRY EngUnloadImage(_In_ HANDLE hModule)
Definition: ldevobj.c:911

Referenced by DC_vCleanup(), DxEngUnreferenceHdev(), GreCreateCompatibleDC(), GreOpenDCW(), MDEVOBJ_vDestroy(), NtGdiExtEscape(), PDEVOBJ_bSwitchMode(), PDEVOBJ_Create(), UserChangeDisplaySettings(), UserEnumCurrentDisplaySettings(), UserEnumDisplaySettings(), and UserRefreshDisplay().

◆ SwitchPointer()

FORCEINLINE VOID SwitchPointer ( _Inout_ PVOID  pvPointer1,
_Inout_ PVOID  pvPointer2 
)

Definition at line 569 of file pdevobj.c.

572 {
573  PVOID *ppvPointer1 = pvPointer1;
574  PVOID *ppvPointer2 = pvPointer2;
575  PVOID pvTemp;
576 
577  pvTemp = *ppvPointer1;
578  *ppvPointer1 = *ppvPointer2;
579  *ppvPointer2 = pvTemp;
580 }

Referenced by PDEVOBJ_bDynamicModeChange().

Variable Documentation

◆ ghsemPDEV

HSEMAPHORE ghsemPDEV
static

◆ gPanDispDrvCount

ULONG gPanDispDrvCount

Definition at line 501 of file pandisp.c.

Referenced by PDEVOBJ_Create().

◆ gPanDispDrvFn

DRVFN gPanDispDrvFn[]

Definition at line 477 of file pandisp.c.

Referenced by PDEVOBJ_Create().

◆ gppdevList

PPDEVOBJ gppdevList = NULL
static

Definition at line 14 of file pdevobj.c.

Referenced by NtGdiGetDhpdev(), PDEVOBJ_Create(), and PDEVOBJ_vRelease().