// Public NTLite display ABI declarations shared between kernel, drivers, and user mode. #pragma once // display.h - user/kernel shared display ABI types // This header is safe for user-mode code. It contains only plain syscall ABI // data types and capability bits. Kernel/driver provider interfaces live in // . #include #include #include #ifdef __cplusplus extern "C" { #endif typedef enum DISPLAY_PIXEL_FORMAT { DisplayPixelFormatUnknown = 0, DisplayPixelFormatX8R8G8B8 = 1, } DISPLAY_PIXEL_FORMAT; typedef struct DISPLAY_MODE { uint32_t Width; uint32_t Height; uint32_t Stride; // pixels per scanline DISPLAY_PIXEL_FORMAT Format; } DISPLAY_MODE; typedef struct DISPLAY_RECT { int32_t X; int32_t Y; int32_t W; int32_t H; } DISPLAY_RECT; #define SYS_SURFACE_FORMAT_XRGB8888 1u #define SYS_SURFACE_FLAG_NONE 0u #define SYS_SURFACE_MAX_RECTS 64u #define SYS_SURFACE_MAX_DIMENSION 16384u #define SYS_SURFACE_MAX_BYTES (256ull * 1024ull * 1024ull) #define SYS_SURFACE_MAP_READ 0x00000001u #define SYS_SURFACE_MAP_WRITE 0x00000002u typedef struct SYS_SURFACE_DESC { uint32_t Width; uint32_t Height; uint32_t PitchBytes; uint32_t Format; uint64_t PayloadBytes; uint64_t PageCount; uint64_t MapCount; uint64_t ContentGeneration; uint64_t CommitCount; uint64_t CommitRectCount; uint64_t CommitClippedRectCount; uint64_t CommitEmptyClipCount; DISPLAY_RECT LastDamageBounds; bool LastDamageValid; uint32_t Reserved; } SYS_SURFACE_DESC; typedef struct SYS_SURFACE_STATS { uint32_t Size; uint32_t Version; uint64_t CreatedSurfaces; uint64_t DestroyedSurfaces; uint64_t LiveSurfaces; uint64_t LivePages; uint64_t LiveBytes; uint64_t MapCalls; uint64_t CommitCalls; uint64_t CommitRectInputs; uint64_t CommitClippedRects; uint64_t CommitEmptyClips; uint64_t PhysicalPresentCalls; uint64_t PhysicalPresentBytesCopied; } SYS_SURFACE_STATS; typedef struct DISPLAY_STATS { uint64_t BlitCount; uint64_t FillRectCount; uint64_t CopyRectCount; uint64_t ReadRectCount; uint64_t PresentCount; uint64_t PresentRectCount; uint64_t DirectPresentCount; uint64_t ScanoutBytes; uint64_t DirtyRectCount; uint64_t DirtyAllCount; uint64_t BytesCopied; uint64_t SyncCount; uint64_t CursorMoveCount; uint64_t CursorShowCount; uint64_t CursorHideCount; } DISPLAY_STATS; #define DISPLAY_CAP_FRAMEBUFFER 0x00000001u #define DISPLAY_CAP_SOFTWARE_CURSOR 0x00000002u #define DISPLAY_CAP_HARDWARE_CURSOR 0x00000004u #define DISPLAY_CAP_ACCEL_FILL 0x00000008u #define DISPLAY_CAP_ACCEL_COPY 0x00000010u #define DISPLAY_CAP_PRESENT_SYNC 0x00000020u #define DISPLAY_CAP_VBLANK 0x00000040u #define DISPLAY_CAP_3D 0x00000080u #define DISPLAY_CAP_FRAME_EVENT 0x00000100u #define SYS_DISPLAY_NAME_MAX 32u #define DISPLAY_INFO_FLAG_PAT_WC_AVAILABLE 0x00000001u typedef struct SYS_DISPLAY_INFO { char PrimaryName[SYS_DISPLAY_NAME_MAX]; DISPLAY_MODE Mode; uint32_t Caps; uint32_t DeviceCount; uint32_t Flags; uint32_t Reserved; DISPLAY_STATS ManagerStats; DISPLAY_STATS DeviceStats; } SYS_DISPLAY_INFO; // Surfaces and damage rectangles are shared between DWM and native clients. _Static_assert(sizeof(DISPLAY_PIXEL_FORMAT) == 4u, "DISPLAY_PIXEL_FORMAT ABI width changed"); _Static_assert(sizeof(DISPLAY_RECT) == 16u, "DISPLAY_RECT ABI size changed"); _Static_assert(offsetof(SYS_SURFACE_DESC, LastDamageBounds) == 80u, "SYS_SURFACE_DESC damage offset changed"); _Static_assert(sizeof(SYS_SURFACE_DESC) == 104u, "SYS_SURFACE_DESC ABI size changed"); #ifdef __cplusplus } #endif