Difference between revisions of "Techwiki:Win32k/PDEV"
ThePhysicist (talk | contribs) |
|||
(36 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
Windows XP version of PDEVOBJ | Windows XP version of PDEVOBJ | ||
− | + | <source lang="c"> | |
− | + | #define INDEX_LAST 93 // For XP | |
+ | #define HS_DDI_MAX 6 | ||
− | + | typedef struct _PDEV | |
− | + | { // W2k WXP | |
− | + | BASEOBJECT baseobj; // 000 000 | |
− | + | PPDEV ppdevNext; // 010 010 | |
− | + | int cPdevRefs; // 014 014 | |
− | + | int cPdevOpenRefs; // 018 018 | |
− | + | PPDEV ppdevParent; // 01C 01C | |
− | + | FLONG flags; // 020 020 | |
− | + | FLONG flAccelerated; // 024 024 | |
− | + | HSEMAPHORE hsemDevLock; // 028 028 | |
− | + | HSEMAPHORE hsemPointer; // 02C 02C | |
− | + | POINTL ptlPointer; // 030 030 | |
− | + | SIZEL szlPointer; // 038 038 | |
− | + | SPRITESTATE SpriteState; // 040 040 size = 1f4h | |
− | + | HFONT hlfntDefault; // 21C 234 HFONT at this offset verified on xp | |
− | + | HFONT hlfntAnsiVariable; // 220 238 HFONT at this offset verified on xp | |
− | + | HFONT hlfntAnsiFixed; // 224 23C HFONT at this offset verified on xp | |
− | + | HSURF ahsurf[HS_DDI_MAX]; // 228 240 HSURF at this offset verified on XP | |
− | + | PUSHORT pusPrtDataFileName; // 258 | |
− | + | PVOID pDevHTInfo; // 244 25C | |
− | + | PRFONT prfntActive; // 248 260 | |
− | + | PRFONT prfntInactive; // 24C 264 | |
− | + | ULONG cInactive; // 250 268 | |
− | + | BYTE ajbo[0x5C]; // 254 26C | |
− | + | ULONG cDirectDrawDisableLocks; // 2A8 2C8 | |
− | + | PVOID TypeOneInfo; // 2AC 2CC | |
− | + | PVOID pvGammaRamp; // 2B0 2D0 | |
− | + | PVOID RemoteTypeOne; // 2B4 2D4 | |
− | + | ULONG ulHorzRes; // 2B8 2D8 slz if PDEV_META_DEVICE | |
− | + | ULONG ulVertRes; // 2BC 2DC get it from here. | |
− | + | PFN pfnDrvSetPointerShape; // 2C0 2E0 | |
− | + | PFN pfnDrvMovePointer; // 2C4 2E4 | |
− | + | PFN pfnMovePointer; // 2C8 2E8 | |
− | + | PFN pfnDrvSynchronize; // 2CC 2EC (gdikdx: pfnSync) | |
− | + | PFN pfnDrvSynchronizeSurface; // 2F0 | |
− | + | PFN pfnDrvSetPalette; // 2F4 | |
− | + | PFN pfnDrvNotify; // 2F8 | |
− | + | ULONG TagSig; // 2FC = 'Pdev' | |
− | + | PLDEV pldev; // 2E0 300 | |
− | + | DHPDEV dhpdev; // 2E4 304 | |
− | + | PPALETTE ppalSurf; // 2E8 308 -> Gla8 | |
− | + | DEVINFO devinfo; // 2EC 30C | |
− | + | GDIINFO gdiinfo; // 418 438 | |
− | + | PSURFACE pSurface; // 548 568 | |
− | + | HANDLE hSpooler; // 54C 56C | |
− | + | PVOID pDesktopId; // 550 570 | |
− | + | EDD_DIRECTDRAW_GLOBAL eDirectDrawGlobal;// 558 W2k only | |
− | + | PGRAPHICS_DEVICE pGraphicsDevice; // 574 | |
− | + | POINTL ptlOrigion; // 578 | |
− | + | PDEVMODEW pdmwDev; // 580 | |
− | + | DWORD Unknown3; // 584 | |
− | + | FLONG DxDd_Flags; // 588 | |
− | + | LONG devAttr; // 58C | |
− | + | PVOID WatchDogContext; // 590 | |
− | + | PVOID WatchDogs; // 594 | |
− | + | PFN apfn[INDEX_LAST]; // B8C 598 | |
− | } | + | } PDEV, *PPDEV; // Xp size 0x70C or 1804 |
+ | |||
+ | // PDEV and EDDX extra data container. | ||
+ | typedef struct _PDEVEDD | ||
+ | { | ||
+ | PDEVOBJ pdevobj; | ||
+ | EDD_DIRECTDRAW_GLOBAL EDDgpl; | ||
+ | } PDEVEDD, *PPDEVEDD; | ||
+ | </source> | ||
+ | |||
===Members=== | ===Members=== | ||
''baseobj'' | ''baseobj'' | ||
− | :Structure used by the handle manager. Unused for a | + | :[[Techwiki:win32k/BASEOBJECT|BASEOBJECT]] Structure used by the handle manager. Unused for a PDEV. |
''ppdevNext'' | ''ppdevNext'' | ||
Line 70: | Line 80: | ||
''cPdevRefs'' | ''cPdevRefs'' | ||
− | : | + | :Number of references to this PDEV. |
''cPdevOpenRefs'' | ''cPdevOpenRefs'' | ||
''ppdevParent'' | ''ppdevParent'' | ||
− | :Pointer to the parent's PDEVOBJ. | + | :Pointer to the parent's PDEVOBJ. Points to this PDEV if no parent. |
''flags'' | ''flags'' | ||
:Flags. Can be a combination of the following values. | :Flags. Can be a combination of the following values. | ||
− | #define PDEV_DISPLAY | + | #define PDEV_DISPLAY 0x000001 |
− | #define PDEV_HARDWARE_POINTER | + | #define PDEV_HARDWARE_POINTER 0x000002 |
− | #define PDEV_SOFTWARE_POINTER | + | #define PDEV_SOFTWARE_POINTER 0x000004 |
− | #define PDEV_GOTFONTS | + | #define PDEV_GOTFONTS 0x000040 |
− | #define PDEV_PRINTER | + | #define PDEV_PRINTER 0x000080 |
− | #define PDEV_ALLOCATEDBRUSHES | + | #define PDEV_ALLOCATEDBRUSHES 0x000100 |
− | #define PDEV_HTPAL_IS_DEVPAL | + | #define PDEV_HTPAL_IS_DEVPAL 0x000200 |
− | #define PDEV_DISABLED | + | #define PDEV_DISABLED 0x000400 |
− | #define PDEV_SYNCHRONIZE_ENABLED | + | #define PDEV_SYNCHRONIZE_ENABLED 0x000800 |
− | #define PDEV_FONTDRIVER | + | #define PDEV_FONTDRIVER 0x002000 |
− | #define PDEV_GAMMARAMP_TABLE | + | #define PDEV_GAMMARAMP_TABLE 0x004000 |
− | #define PDEV_UMPD | + | #define PDEV_UMPD 0x008000 |
− | #define PDEV_SHARED_DEVLOCK | + | #define PDEV_SHARED_DEVLOCK 0x010000 |
− | #define PDEV_META_DEVICE | + | #define PDEV_META_DEVICE 0x020000 |
− | #define PDEV_DRIVER_PUNTED_CALL | + | #define PDEV_DRIVER_PUNTED_CALL 0x040000 |
− | #define PDEV_CLONE_DEVICE | + | #define PDEV_CLONE_DEVICE 0x080000 |
+ | #define PDEV_MOUSE_TRAILS 0x100000 | ||
+ | #define PDEV_SYNCHRONOUS_POINTER 0x200000 | ||
''flAccelerated'' | ''flAccelerated'' | ||
''hsemDevLock'' | ''hsemDevLock'' | ||
− | :DEVOBJ lock, == PERESOURCE | + | :DEVOBJ lock, == HSEMAPHORE == PERESOURCE |
''hsemPointer'' | ''hsemPointer'' | ||
Line 105: | Line 117: | ||
''ptlPointer'' | ''ptlPointer'' | ||
:Current position of the mouse pointer, if any. | :Current position of the mouse pointer, if any. | ||
+ | |||
+ | ''szlPointer'' | ||
+ | :Current dimensions of the pointer shape. | ||
''SpriteState'' | ''SpriteState'' | ||
+ | :[[Techwiki:win32k/SPRITESTATE|SPRITESTATE]] structure | ||
''hlfntDefault'' | ''hlfntDefault'' | ||
Line 119: | Line 135: | ||
''pusPrtDataFileName'' | ''pusPrtDataFileName'' | ||
+ | |||
''pDevHTInfo'' | ''pDevHTInfo'' | ||
+ | |||
''prfntActive'' | ''prfntActive'' | ||
+ | |||
''prfntInactive'' | ''prfntInactive'' | ||
+ | |||
''cInactive'' | ''cInactive'' | ||
+ | |||
''ajbo'' | ''ajbo'' | ||
− | :EBRUSHOBJ, was 0xFFFFFFFF on XP | + | :[[Techwiki:win32k/EBRUSHOBJ|EBRUSHOBJ]], was 0xFFFFFFFF on XP |
''cDirectDrawDisableLocks'' | ''cDirectDrawDisableLocks'' | ||
Line 162: | Line 183: | ||
''TagSig'' | ''TagSig'' | ||
: Tag Sign! 'Pdev' | : Tag Sign! 'Pdev' | ||
+ | |||
''pldev'' | ''pldev'' | ||
− | :Pointer to the corresponding LDEVOBJ. | + | :Pointer to the corresponding [[Techwiki:win32k/LDEVOBJ|LDEV]]. |
''dhpdev'' | ''dhpdev'' | ||
Line 169: | Line 191: | ||
''ppalSurf'' | ''ppalSurf'' | ||
+ | :Pointer to a [[Techwiki:win32k/PALETTE|PPALETTE]] structure that describes the palette of the surface. | ||
''devinfo'' | ''devinfo'' | ||
+ | :[[Techwiki:win32k/DEVINFO|DEVINFO]] | ||
''gdiinfo'' | ''gdiinfo'' | ||
+ | :[[Techwiki:win32k/GDIINFO|GDIINFO]] | ||
''pSurface'' | ''pSurface'' | ||
− | :(CONTAINING_RECORD +10h = SURFOBJ) | + | :(CONTAINING_RECORD +10h = SURFOBJ), the pointer will start at SURFOBJ of the [[Techwiki:win32k/SURFACE|SURFACE]] structure. |
''hSpooler'' | ''hSpooler'' | ||
Line 182: | Line 207: | ||
''pGraphicsDevice'' | ''pGraphicsDevice'' | ||
− | :PGRAPHICS_DEVICE see DISPLAY_DEVICE | + | :[[Techwiki:win32k/GRAPHICS_DEVICE|PGRAPHICS_DEVICE]] see DISPLAY_DEVICE |
''ptlOrigion'' | ''ptlOrigion'' | ||
''pdmwDev'' | ''pdmwDev'' | ||
− | : | + | : Pointer to a single DEVMODEW structure, describing the current display settings. The size of the allocation is |
+ | DEVMODEW.dmSize + dmDriverExtra. Allocated with Tag GDITAG_DEVMODE ('Gdev'). | ||
''DxDd_Flags'' | ''DxDd_Flags'' | ||
Line 202: | Line 228: | ||
''eDirectDrawGlobal'' | ''eDirectDrawGlobal'' | ||
+ | :Windows 2000 only. Unknown pointer to or structure to EDD_DIRECTDRAW_GLOBAL. | ||
===Remarks=== | ===Remarks=== | ||
Line 209: | Line 236: | ||
* http://www.osronline.com/DDKx/gloss/glossary_6bnd.htm#ddk_pdev_gg_gly | * http://www.osronline.com/DDKx/gloss/glossary_6bnd.htm#ddk_pdev_gg_gly | ||
* http://msdn2.microsoft.com/en-us/library/ms793426.aspx For apfn driver function table. | * http://msdn2.microsoft.com/en-us/library/ms793426.aspx For apfn driver function table. | ||
− | * [http:// | + | * [http://www.osronline.com/custom.cfm?name=articlePrint.cfm&id=173 From Andy's Bookshelf: WinDbg Extension for GDI] |
* gdikdx | * gdikdx |
Latest revision as of 03:27, 12 January 2020
Windows XP version of PDEVOBJ
#define INDEX_LAST 93 // For XP
#define HS_DDI_MAX 6
typedef struct _PDEV
{ // W2k WXP
BASEOBJECT baseobj; // 000 000
PPDEV ppdevNext; // 010 010
int cPdevRefs; // 014 014
int cPdevOpenRefs; // 018 018
PPDEV ppdevParent; // 01C 01C
FLONG flags; // 020 020
FLONG flAccelerated; // 024 024
HSEMAPHORE hsemDevLock; // 028 028
HSEMAPHORE hsemPointer; // 02C 02C
POINTL ptlPointer; // 030 030
SIZEL szlPointer; // 038 038
SPRITESTATE SpriteState; // 040 040 size = 1f4h
HFONT hlfntDefault; // 21C 234 HFONT at this offset verified on xp
HFONT hlfntAnsiVariable; // 220 238 HFONT at this offset verified on xp
HFONT hlfntAnsiFixed; // 224 23C HFONT at this offset verified on xp
HSURF ahsurf[HS_DDI_MAX]; // 228 240 HSURF at this offset verified on XP
PUSHORT pusPrtDataFileName; // 258
PVOID pDevHTInfo; // 244 25C
PRFONT prfntActive; // 248 260
PRFONT prfntInactive; // 24C 264
ULONG cInactive; // 250 268
BYTE ajbo[0x5C]; // 254 26C
ULONG cDirectDrawDisableLocks; // 2A8 2C8
PVOID TypeOneInfo; // 2AC 2CC
PVOID pvGammaRamp; // 2B0 2D0
PVOID RemoteTypeOne; // 2B4 2D4
ULONG ulHorzRes; // 2B8 2D8 slz if PDEV_META_DEVICE
ULONG ulVertRes; // 2BC 2DC get it from here.
PFN pfnDrvSetPointerShape; // 2C0 2E0
PFN pfnDrvMovePointer; // 2C4 2E4
PFN pfnMovePointer; // 2C8 2E8
PFN pfnDrvSynchronize; // 2CC 2EC (gdikdx: pfnSync)
PFN pfnDrvSynchronizeSurface; // 2F0
PFN pfnDrvSetPalette; // 2F4
PFN pfnDrvNotify; // 2F8
ULONG TagSig; // 2FC = 'Pdev'
PLDEV pldev; // 2E0 300
DHPDEV dhpdev; // 2E4 304
PPALETTE ppalSurf; // 2E8 308 -> Gla8
DEVINFO devinfo; // 2EC 30C
GDIINFO gdiinfo; // 418 438
PSURFACE pSurface; // 548 568
HANDLE hSpooler; // 54C 56C
PVOID pDesktopId; // 550 570
EDD_DIRECTDRAW_GLOBAL eDirectDrawGlobal;// 558 W2k only
PGRAPHICS_DEVICE pGraphicsDevice; // 574
POINTL ptlOrigion; // 578
PDEVMODEW pdmwDev; // 580
DWORD Unknown3; // 584
FLONG DxDd_Flags; // 588
LONG devAttr; // 58C
PVOID WatchDogContext; // 590
PVOID WatchDogs; // 594
PFN apfn[INDEX_LAST]; // B8C 598
} PDEV, *PPDEV; // Xp size 0x70C or 1804
// PDEV and EDDX extra data container.
typedef struct _PDEVEDD
{
PDEVOBJ pdevobj;
EDD_DIRECTDRAW_GLOBAL EDDgpl;
} PDEVEDD, *PPDEVEDD;
Members
baseobj
- BASEOBJECT Structure used by the handle manager. Unused for a PDEV.
ppdevNext
- Pointer to the next PDEV in the list.
cPdevRefs
- Number of references to this PDEV.
cPdevOpenRefs
ppdevParent
- Pointer to the parent's PDEVOBJ. Points to this PDEV if no parent.
flags
- Flags. Can be a combination of the following values.
#define PDEV_DISPLAY 0x000001 #define PDEV_HARDWARE_POINTER 0x000002 #define PDEV_SOFTWARE_POINTER 0x000004 #define PDEV_GOTFONTS 0x000040 #define PDEV_PRINTER 0x000080 #define PDEV_ALLOCATEDBRUSHES 0x000100 #define PDEV_HTPAL_IS_DEVPAL 0x000200 #define PDEV_DISABLED 0x000400 #define PDEV_SYNCHRONIZE_ENABLED 0x000800 #define PDEV_FONTDRIVER 0x002000 #define PDEV_GAMMARAMP_TABLE 0x004000 #define PDEV_UMPD 0x008000 #define PDEV_SHARED_DEVLOCK 0x010000 #define PDEV_META_DEVICE 0x020000 #define PDEV_DRIVER_PUNTED_CALL 0x040000 #define PDEV_CLONE_DEVICE 0x080000 #define PDEV_MOUSE_TRAILS 0x100000 #define PDEV_SYNCHRONOUS_POINTER 0x200000
flAccelerated
hsemDevLock
- DEVOBJ lock, == HSEMAPHORE == PERESOURCE
hsemPointer
ptlPointer
- Current position of the mouse pointer, if any.
szlPointer
- Current dimensions of the pointer shape.
SpriteState
- SPRITESTATE structure
hlfntDefault
- Handle to the devices default logical font.
hlfntAnsiVariable
hlfntAnsiFixed
ahsurf
- Array of handles for the standard fill patterns. See phsurfPatterns in DrvEnablePDEV documentation.
pusPrtDataFileName
pDevHTInfo
prfntActive
prfntInactive
cInactive
ajbo
- EBRUSHOBJ, was 0xFFFFFFFF on XP
cDirectDrawDisableLocks
TypeOneInfo
pvGammaRamp
- Gamma Ramp pointer.
RemoteTypeOne
- REMOTETYPEONENODE *
ulHorzRes
- slz if PDEV_META_DEVICE
ulVertRes
- get it from here.
pfnDrvSetPointerShape
- XP: win32k!WatchdogDrvSetPointerShape
pfnDrvMovePointer
- XP: win32k!WatchdogDrvMovePointer
pfnMovePointer
pfnDrvSynchronize
pfnDrvSynchronizeSurface (SURFACE *,RECTL *, FLONG)
pfnDrvSetPalette
pfnDrvNotify
- vNotify (ULONG, PVOID)
TagSig
- Tag Sign! 'Pdev'
pldev
- Pointer to the corresponding LDEV.
dhpdev
- Driver defined handle to the device.
ppalSurf
- Pointer to a PPALETTE structure that describes the palette of the surface.
devinfo
gdiinfo
pSurface
- (CONTAINING_RECORD +10h = SURFOBJ), the pointer will start at SURFOBJ of the SURFACE structure.
hSpooler
pDesktopId
pGraphicsDevice
- PGRAPHICS_DEVICE see DISPLAY_DEVICE
ptlOrigion
pdmwDev
- Pointer to a single DEVMODEW structure, describing the current display settings. The size of the allocation is
DEVMODEW.dmSize + dmDriverExtra. Allocated with Tag GDITAG_DEVMODE ('Gdev').
DxDd_Flags
devAttr
- EngQueryDeviceAttribute, ENG_DEVICE_ATTRIBUTE
WatchDogContext
WatchDogs
apfn
- Driver Function pointer table. See winddi.h. Is filled in by GDI according to the DRVFN return from the driver.
eDirectDrawGlobal
- Windows 2000 only. Unknown pointer to or structure to EDD_DIRECTDRAW_GLOBAL.
Remarks
- The pool tag for the structure is 'GDev'