1 #ifndef __WIN32K_PDEVOBJ_H
2 #define __WIN32K_PDEVOBJ_H
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,
15 PDEV_SYNCHRONIZE_ENABLED
= 0x00000800,
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
25 /* Type definitions ***********************************************************/
27 typedef struct _GDIPOINTER
/* should stay private to ENG? No, part of PDEVOBJ aka HDEV aka PDEV. */
29 /* Private GDI pointer handling information, required for software emulation */
38 /* Public pointer information */
39 RECTL Exclude
; /* Required publicly for SPS_ACCEPT_EXCLUDE */
40 } GDIPOINTER
, *PGDIPOINTER
;
42 typedef struct _DEVMODEINFO
44 struct _DEVMODEINFO
*pdmiNext
;
45 struct _LDEVOBJ
*pldev
;
48 } DEVMODEINFO
, *PDEVMODEINFO
;
50 typedef struct _DEVMODEENTRY
55 } DEVMODEENTRY
, *PDEVMODEENTRY
;
57 typedef struct _GRAPHICS_DEVICE
59 WCHAR szNtDeviceName
[CCHDEVICENAME
/2];
60 WCHAR szWinDeviceName
[CCHDEVICENAME
/2];
61 struct _GRAPHICS_DEVICE
* pNextGraphicsDevice
;
62 struct _GRAPHICS_DEVICE
* pVgaDevice
;
63 PDEVICE_OBJECT DeviceObject
;
64 PDEVICE_OBJECT PhysDeviceHandle
;
65 DWORD hkClassDriverConfig
;
66 DWORD StateFlags
; /* See DISPLAY_DEVICE_* */
68 PDEVMODEINFO pdevmodeInfo
;
70 PDEVMODEENTRY pDevModeList
;
71 LPWSTR pDiplayDrivers
;
72 LPWSTR pwszDescription
;
74 PVIDEO_MONITOR_DEVICE pvMonDev
;
75 PFILE_OBJECT FileObject
;
77 } GRAPHICS_DEVICE
, *PGRAPHICS_DEVICE
;
79 typedef struct _PDEVOBJ
81 BASEOBJECT BaseObject
;
83 struct _PDEVOBJ
* ppdevNext
;
86 struct _PDEVOBJ
* ppdevParent
;
87 FLONG flFlags
; // flags
88 // FLONG flAccelerated;
89 HSEMAPHORE hsemDevLock
; /* Device lock. */
90 // HSEMAPHORE hsemPointer;
93 // SPRITESTATE SpriteState;
94 // HFONT hlfntDefault;
95 // HFONT hlfntAnsiVariable;
96 // HFONT hlfntAnsiFixed;
97 HSURF ahsurf
[HS_DDI_MAX
];
98 PWSTR pusPrtDataFileName
; // DRIVER_INFO_2->pDataFile
100 // RFONT * prfntActive;
101 // RFONT * prfntInactive;
104 ULONG cDirectDrawDisableLocks
;
105 // PVOID TypeOneInfo;
106 PVOID pvGammaRamp
; /* Gamma ramp pointer. */
108 SIZEL szlMetaRes
; /* if PDEV_META_DEVICE */
111 // PFN_DrvSetPointerShape pfnDrvSetPointerShape;
112 // PFN_DrvMovePointer pfnDrvMovePointer;
113 PFN_DrvMovePointer pfnMovePointer
;
114 // PFN_DrvSynchronize pfnDrvSynchronize;
115 // PFN_DrvSynchronizeSurface pfnDrvSynchronizeSurface;
116 // PFN_DrvSetPalette pfnDrvSetPalette;
117 // PFN_DrvNotify pfnDrvNotify;
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 */
127 PGRAPHICS_DEVICE pGraphicsDevice
;
129 PDEVMODEW pdmwDev
; /* Ptr->DEVMODEW.dmSize + dmDriverExtra == alloc size. */
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;
137 DRIVER_FUNCTIONS DriverFunctions
;
138 DRIVER_FUNCTIONS pfn
;
139 PVOID apfn
[INDEX_LAST
]; // B8C 0x0598
144 /* Stuff to keep track of software cursors; win32k gdi part */
145 UINT SafetyRemoveLevel
; /* at what level was the cursor removed?
147 UINT SafetyRemoveCount
;
148 struct _EDD_DIRECTDRAW_GLOBAL
* pEDDgpl
;
149 } PDEVOBJ
, *PPDEVOBJ
;
151 /* Function prototypes ********************************************************/
156 _In_opt_ PUNICODE_STRING pustrDevice
);
165 /* Fail if the PDEV is being destroyed */
166 if (ppdev
->cPdevRefs
== 0)
171 ASSERT(ppdev
->cPdevRefs
> 0);
173 InterlockedIncrement(&ppdev
->cPdevRefs
);
179 _Inout_ PPDEVOBJ ppdev
);
184 _In_ PPDEVOBJ ppdev
);
188 PDEVOBJ_vGetDeviceCaps(
190 _Out_ PDEVCAPS pDevCaps
);
211 PDEVOBJ_bDynamicModeChange(
212 _Inout_ PPDEVOBJ ppdev
,
213 _Inout_ PPDEVOBJ ppdev2
);
216 PDEVOBJ_vEnableDisplay(
217 _Inout_ PPDEVOBJ ppdev
);
220 PDEVOBJ_bDisableDisplay(
221 _Inout_ PPDEVOBJ ppdev
);
225 _In_opt_ PGRAPHICS_DEVICE pGraphicsDevice
,
226 _In_opt_ PDEVMODEW pdm
,
227 _In_ ULONG dwAccelerationLevel
,
228 _In_ ULONG ldevtype
);
230 /* Change display settings:
231 * - pustrDeviceName: name of the device to change settings. Can be NULL to specify whole display surface
232 * - RequestedMode: new parameters for device. Ignored if pstrDeviceName is NULL
233 * - pmdevOld: old MDEVOBJ. Can be NULL if we are creating the first one
234 * - ppdevNew: MDEVOBJ created by this function, with the new settings
235 * - bSearchClosestMode: do we need to search exact requested mode, or a mostly similar one
236 * Return value: a DISP_CHANGE_* value
239 PDEVOBJ_lChangeDisplaySettings(
240 _In_opt_ PUNICODE_STRING pustrDeviceName
,
241 _In_opt_ PDEVMODEW RequestedMode
,
242 _In_opt_ PMDEVOBJ pmdevOld
,
243 _Out_ PMDEVOBJ
*ppmdevNew
,
244 _In_ BOOL bSearchClosestMode
);
246 #endif /* !__WIN32K_PDEVOBJ_H */