ReactOS  0.4.15-dev-5130-gc1c1279
pdevobj.h
Go to the documentation of this file.
1 #ifndef __WIN32K_PDEVOBJ_H
2 #define __WIN32K_PDEVOBJ_H
3 
4 /* PDEVOBJ flags */
6 {
7  PDEV_DISPLAY = 0x00000001, /* Display device */
8  PDEV_HARDWARE_POINTER = 0x00000002, /* Supports hardware cursor */
9  PDEV_SOFTWARE_POINTER = 0x00000004,
10  PDEV_GOTFONTS = 0x00000040, /* Has font driver */
11  PDEV_PRINTER = 0x00000080,
12  PDEV_ALLOCATEDBRUSHES = 0x00000100,
13  PDEV_HTPAL_IS_DEVPAL = 0x00000200,
14  PDEV_DISABLED = 0x00000400,
16  PDEV_FONTDRIVER = 0x00002000, /* Font device */
17  PDEV_GAMMARAMP_TABLE = 0x00004000,
18  PDEV_UMPD = 0x00008000,
19  PDEV_SHARED_DEVLOCK = 0x00010000,
20  PDEV_META_DEVICE = 0x00020000,
21  PDEV_DRIVER_PUNTED_CALL = 0x00040000, /* Driver calls back to GDI engine */
22  PDEV_CLONE_DEVICE = 0x00080000
23 };
24 
25 /* Type definitions ***********************************************************/
26 
27 typedef struct _GDIPOINTER /* should stay private to ENG? No, part of PDEVOBJ aka HDEV aka PDEV. */
28 {
29  /* Private GDI pointer handling information, required for software emulation */
37 
38  /* Public pointer information */
39  RECTL Exclude; /* Required publicly for SPS_ACCEPT_EXCLUDE */
41 
42 typedef struct _DEVMODEINFO
43 {
45  struct _LDEVOBJ *pldev;
49 
50 typedef struct _DEVMODEENTRY
51 {
54 
56 
57 typedef struct _GRAPHICS_DEVICE
58 {
66  DWORD StateFlags; /* See DISPLAY_DEVICE_* */
78 
79 typedef struct _PDEVOBJ
80 {
82 
83  struct _PDEVOBJ * ppdevNext;
87  FLONG flFlags; // flags
88 // FLONG flAccelerated;
89  HSEMAPHORE hsemDevLock; /* Device lock. */
90 // HSEMAPHORE hsemPointer;
92 // SIZEL szlPointer;
93 // SPRITESTATE SpriteState;
94 // HFONT hlfntDefault;
95 // HFONT hlfntAnsiVariable;
96 // HFONT hlfntAnsiFixed;
98  PWSTR pusPrtDataFileName; // DRIVER_INFO_2->pDataFile
99 // PVOID pDevHTInfo;
100 // RFONT * prfntActive;
101 // RFONT * prfntInactive;
102 // ULONG cInactive;
103 // BYTE ajbo[0x5C];
104 // ULONG cDirectDrawDisableLocks;
105 // PVOID TypeOneInfo;
106  PVOID pvGammaRamp; /* Gamma ramp pointer. */
108  SIZEL szlMetaRes; /* if PDEV_META_DEVICE */
109  // ULONG ulHorzRes;
110  // ULONG ulVertRes;
111 // PFN_DrvSetPointerShape pfnDrvSetPointerShape;
112 // PFN_DrvMovePointer pfnDrvMovePointer;
114 // PFN_DrvSynchronize pfnDrvSynchronize;
115 // PFN_DrvSynchronizeSurface pfnDrvSynchronizeSurface;
116 // PFN_DrvSetPalette pfnDrvSetPalette;
117 // PFN_DrvNotify pfnDrvNotify;
118 // ULONG TagSig;
119  struct _LDEVOBJ * pldev;
120  DHPDEV dhpdev; /* DHPDEV for device. */
121  struct _PALETTE* ppalSurf; /* PEPALOBJ/PPALETTE for this device. */
124  PSURFACE pSurface; /* SURFACE for this device. */
125  HANDLE hSpooler; /* Handle to spooler, if spooler dev driver, DeviceObject if graphics device */
126 // PVOID pDesktopId;
129  PDEVMODEW pdmwDev; /* Ptr->DEVMODEW.dmSize + dmDriverExtra == alloc size. */
130 // DWORD Unknown3;
131  FLONG DxDd_Flags; /* DxDD active status flags set by CapabilityOverride Registry Key while Create Info DC type */
132  DWORD dwAccelerationLevel; /* Set by Accelerations.Level (0 - 5) Registry Key while Create Info DC type */
133 // PVOID WatchDogContext;
134 // ULONG WatchDogs;
135  union
136  {
139  PVOID apfn[INDEX_LAST]; // B8C 0x0598
140  };
141 
142  /* ros specific */
145  /* Stuff to keep track of software cursors; win32k gdi part */
146  UINT SafetyRemoveLevel; /* at what level was the cursor removed?
147  0 for not removed */
150 } PDEVOBJ, *PPDEVOBJ;
151 
152 /* Function prototypes ********************************************************/
153 
154 PPDEVOBJ
155 NTAPI
157  _In_opt_ PUNICODE_STRING pustrDevice);
158 
160 VOID
162  _In_ PPDEVOBJ ppdev)
163 {
164  ASSERT(ppdev);
165 
166  /* Fail if the PDEV is being destroyed */
167  if (ppdev->cPdevRefs == 0)
168  {
169  ASSERT(FALSE);
170  return;
171  }
172  ASSERT(ppdev->cPdevRefs > 0);
173 
174  InterlockedIncrement(&ppdev->cPdevRefs);
175 }
176 
177 VOID
178 NTAPI
180  _Inout_ PPDEVOBJ ppdev);
181 
182 PSURFACE
183 NTAPI
185  _In_ PPDEVOBJ ppdev);
186 
187 VOID
188 NTAPI
190  _In_ PPDEVOBJ ppdev,
192 
193 CODE_SEG("INIT")
194 NTSTATUS
195 NTAPI
197 
198 PSIZEL
199 FASTCALL
201  _In_ PPDEVOBJ ppdev,
202  _Out_ PSIZEL psizl);
203 
204 BOOL
205 NTAPI
207  PPDEVOBJ ppdev,
208  PDEVMODEW pdm);
209 
210 BOOL
211 NTAPI
213  _Inout_ PPDEVOBJ ppdev,
214  _Inout_ PPDEVOBJ ppdev2);
215 
216 VOID
218  _Inout_ PPDEVOBJ ppdev);
219 
220 BOOL
222  _Inout_ PPDEVOBJ ppdev);
223 
224 PPDEVOBJ
226  _In_opt_ PGRAPHICS_DEVICE pGraphicsDevice,
227  _In_opt_ PDEVMODEW pdm,
228  _In_ ULONG dwAccelerationLevel,
229  _In_ ULONG ldevtype);
230 
231 /* Change display settings:
232  * - pustrDeviceName: name of the device to change settings. Can be NULL to specify whole display surface
233  * - RequestedMode: new parameters for device. Ignored if pstrDeviceName is NULL
234  * - pmdevOld: old MDEVOBJ. Can be NULL if we are creating the first one
235  * - ppdevNew: MDEVOBJ created by this function, with the new settings
236  * - bSearchClosestMode: do we need to search exact requested mode, or a mostly similar one
237  * Return value: a DISP_CHANGE_* value
238  */
239 LONG
241  _In_opt_ PUNICODE_STRING pustrDeviceName,
242  _In_opt_ PDEVMODEW RequestedMode,
243  _In_opt_ PMDEVOBJ pmdevOld,
244  _Out_ PMDEVOBJ *ppmdevNew,
245  _In_ BOOL bSearchClosestMode);
246 
247 #endif /* !__WIN32K_PDEVOBJ_H */
DHPDEV dhpdev
Definition: pdevobj.h:120
_Out_ PDEVCAPS pDevCaps
Definition: ntgdi.h:2664
SIZEL Size
Definition: pdevobj.h:31
LONG cPdevRefs
Definition: pdevobj.h:84
BOOL Enabled
Definition: pdevobj.h:30
#define HS_DDI_MAX
Definition: winddi.h:3954
typedef DHPDEV(APIENTRY FN_DrvEnablePDEV)(_In_ DEVMODEW *pdm
#define _In_opt_
Definition: ms_sal.h:309
#define _Inout_
Definition: ms_sal.h:378
PVOID RemoteTypeOne
Definition: pdevobj.h:107
PDEVICE_OBJECT DeviceObject
Definition: pdevobj.h:63
struct _LDEVOBJ * pldev
Definition: pdevobj.h:119
struct _DEVMODEENTRY DEVMODEENTRY
VOID NTAPI PDEVOBJ_vGetDeviceCaps(_In_ PPDEVOBJ ppdev, _Out_ PDEVCAPS pDevCaps)
POINTL HotSpot
Definition: pdevobj.h:32
#define _Out_
Definition: ms_sal.h:345
PFN_DrvMovePointer pfnMovePointer
Definition: pdevobj.h:113
POINTL ptlPointer
Definition: pdevobj.h:91
WCHAR szWinDeviceName[CCHDEVICENAME/2]
Definition: pdevobj.h:60
PPDEVOBJ PDEVOBJ_Create(_In_opt_ PGRAPHICS_DEVICE pGraphicsDevice, _In_opt_ PDEVMODEW pdm, _In_ ULONG dwAccelerationLevel, _In_ ULONG ldevtype)
Definition: pdevobj.c:411
FORCEINLINE VOID PDEVOBJ_vReference(_In_ PPDEVOBJ ppdev)
Definition: pdevobj.h:161
WCHAR szNtDeviceName[CCHDEVICENAME/2]
Definition: pdevobj.h:59
uint16_t * PWSTR
Definition: typedefs.h:56
GDIINFO gdiinfo
Definition: pdevobj.h:123
struct _GRAPHICS_DEVICE * PGRAPHICS_DEVICE
DWORD StateFlags
Definition: pdevobj.h:66
ULONG cbdevmodeInfo
Definition: pdevobj.h:67
LONG NTSTATUS
Definition: precomp.h:26
SURFACE * psurfSave
Definition: pdevobj.h:35
PDEVMODEENTRY pDevModeList
Definition: pdevobj.h:70
FN_DrvMovePointer * PFN_DrvMovePointer
Definition: winddi.h:3735
PVOID apfn[INDEX_LAST]
Definition: pdevobj.h:139
POINTL ptlOrigion
Definition: pdevobj.h:128
#define FASTCALL
Definition: nt_native.h:50
PVOID pvGammaRamp
Definition: pdevobj.h:106
struct _DEVMODEINFO DEVMODEINFO
PDEVMODEW pdm
Definition: pdevobj.h:53
struct _PDEVOBJ * ppdevNext
Definition: pdevobj.h:83
struct _PDEVOBJ * PPDEVOBJ
PPDEVOBJ NTAPI EngpGetPDEV(_In_opt_ PUNICODE_STRING pustrDevice)
Definition: pdevobj.c:726
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
DRIVER_FUNCTIONS DriverFunctions
Definition: pdevobj.h:137
FLONG flFlags
Definition: pdevobj.h:87
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
NTSTATUS NTAPI InitPDEVImpl(VOID)
Definition: pdevobj.c:30
RECTL Exclude
Definition: pdevobj.h:39
PWSTR pusPrtDataFileName
Definition: pdevobj.h:98
ULONG cbdevmode
Definition: pdevobj.h:46
LPWSTR pwszDescription
Definition: pdevobj.h:72
LONG cPdevOpenRefs
Definition: pdevobj.h:85
struct _PALETTE * ppalSurf
Definition: pdevobj.h:121
struct _GDIPOINTER * PGDIPOINTER
#define _In_
Definition: ms_sal.h:308
_PDEVFLAGS
Definition: pdevobj.h:5
PDEVMODEW pdmwDev
Definition: pdevobj.h:129
HSEMAPHORE hsemDevLock
Definition: pdevobj.h:89
DRIVER_FUNCTIONS pfn
Definition: pdevobj.h:138
unsigned long FLONG
Definition: ntbasedef.h:366
SIZEL szlMetaRes
Definition: pdevobj.h:108
DEVMODEW adevmode[1]
Definition: pdevobj.h:47
PDEVICE_OBJECT PhysDeviceHandle
Definition: pdevobj.h:64
typedef HSURF(APIENTRY FN_DrvEnableSurface)(_In_ DHPDEV dhpdev)
struct _DEVMODEINFO * PDEVMODEINFO
SURFACE * psurfMask
Definition: pdevobj.h:34
struct _GRAPHICS_DEVICE * pNextGraphicsDevice
Definition: pdevobj.h:61
#define ASSERT(a)
Definition: mode.c:44
DWORD_PTR HSEMAPHORE
Definition: axcore.idl:60
__wchar_t WCHAR
Definition: xmlstorage.h:180
LPWSTR pDiplayDrivers
Definition: pdevobj.h:71
ULONG cDevModes
Definition: pdevobj.h:69
struct _DEVMODEINFO * pdmiNext
Definition: pdevobj.h:44
DEVINFO devinfo
Definition: pdevobj.h:122
struct _PDEVOBJ PDEVOBJ
struct _PDEVOBJ * ppdevParent
Definition: pdevobj.h:86
unsigned long DWORD
Definition: ntddk_ex.h:95
FLONG flags
Definition: pdevobj.h:36
DWORD dwMonCnt
Definition: pdevobj.h:73
* PFILE_OBJECT
Definition: iotypes.h:1998
SURFACE * psurfColor
Definition: pdevobj.h:33
HANDLE hSpooler
Definition: pdevobj.h:125
PVIDEO_MONITOR_DEVICE pvMonDev
Definition: pdevobj.h:74
#define INDEX_LAST
Definition: winddi.h:521
UINT SafetyRemoveCount
Definition: pdevobj.h:148
ULONG DxDd_nCount
Definition: pdevobj.h:143
DWORD ProtocolType
Definition: pdevobj.h:76
struct _EDD_DIRECTDRAW_GLOBAL * pEDDgpl
Definition: pdevobj.h:149
LONG PDEVOBJ_lChangeDisplaySettings(_In_opt_ PUNICODE_STRING pustrDeviceName, _In_opt_ PDEVMODEW RequestedMode, _In_opt_ PMDEVOBJ pmdevOld, _Out_ PMDEVOBJ *ppmdevNew, _In_ BOOL bSearchClosestMode)
Definition: pdevobj.c:776
BOOL PDEVOBJ_bDisableDisplay(_Inout_ PPDEVOBJ ppdev)
Definition: pdevobj.c:360
struct _GRAPHICS_DEVICE GRAPHICS_DEVICE
FLONG DxDd_Flags
Definition: pdevobj.h:131
#define InterlockedIncrement
Definition: armddk.h:53
#define CCHDEVICENAME
Definition: ddrawi.h:63
PSURFACE NTAPI PDEVOBJ_pSurface(_In_ PPDEVOBJ ppdev)
#define FORCEINLINE
Definition: wdftypes.h:67
struct _GRAPHICS_DEVICE * pVgaDevice
Definition: pdevobj.h:62
unsigned int UINT
Definition: ndis.h:50
PSURFACE pSurface
Definition: pdevobj.h:124
GDIPOINTER Pointer
Definition: pdevobj.h:144
BASEOBJECT BaseObject
Definition: pdevobj.h:81
DWORD hkClassDriverConfig
Definition: pdevobj.h:65
struct _DEVMODEENTRY * PDEVMODEENTRY
unsigned int ULONG
Definition: retypes.h:1
VOID NTAPI PDEVOBJ_vRelease(_Inout_ PPDEVOBJ ppdev)
Definition: pdevobj.c:104
DWORD dwFlags
Definition: pdevobj.h:52
struct _GDIPOINTER GDIPOINTER
PSIZEL FASTCALL PDEVOBJ_sizl(_In_ PPDEVOBJ ppdev, _Out_ PSIZEL psizl)
UINT SafetyRemoveLevel
Definition: pdevobj.h:146
DWORD dwAccelerationLevel
Definition: pdevobj.h:132
WCHAR * LPWSTR
Definition: xmlstorage.h:184
HSURF ahsurf[HS_DDI_MAX]
Definition: pdevobj.h:97
PDEVMODEINFO pdevmodeInfo
Definition: pdevobj.h:68
PGRAPHICS_DEVICE pGraphicsDevice
Definition: pdevobj.h:127
static CODE_SEG("PAGE")
Definition: isapnp.c:1482
struct _LDEVOBJ * pldev
Definition: pdevobj.h:45
VOID PDEVOBJ_vEnableDisplay(_Inout_ PPDEVOBJ ppdev)
Definition: pdevobj.c:340
BOOL NTAPI PDEVOBJ_bSwitchMode(PPDEVOBJ ppdev, PDEVMODEW pdm)
Definition: pdevobj.c:640
PFILE_OBJECT FileObject
Definition: pdevobj.h:75
BOOL NTAPI PDEVOBJ_bDynamicModeChange(_Inout_ PPDEVOBJ ppdev, _Inout_ PPDEVOBJ ppdev2)