4 * Definitions for video devices
6 * This file is part of the w32api package.
9 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
11 * THIS SOFTWARE IS NOT COPYRIGHTED
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
27 #pragma GCC system_header
37 #define VIDEO_DEVICE_NAME "DISPLAY%d"
38 #define WVIDEO_DEVICE_NAME L"DISPLAY%d"
40 #define DD_FULLSCREEN_VIDEO_DEVICE_NAME L"\\Device\\FSVideo"
42 DEFINE_GUID(GUID_DEVINTERFACE_DISPLAY_ADAPTER
, \
43 0x5b45201d, 0xf2f2, 0x4f3b, 0x85, 0xbb, 0x30, 0xff, 0x1f, 0x95, 0x35, 0x99);
46 #define IOCTL_VIDEO_DISABLE_CURSOR \
47 CTL_CODE (FILE_DEVICE_VIDEO, 0x109, METHOD_BUFFERED, FILE_ANY_ACCESS)
49 #define IOCTL_VIDEO_DISABLE_POINTER \
50 CTL_CODE(FILE_DEVICE_VIDEO, 0x10f, METHOD_BUFFERED, FILE_ANY_ACCESS)
52 #define IOCTL_VIDEO_ENABLE_CURSOR \
53 CTL_CODE(FILE_DEVICE_VIDEO, 0x108, METHOD_BUFFERED, FILE_ANY_ACCESS)
55 #define IOCTL_VIDEO_ENABLE_POINTER \
56 CTL_CODE(FILE_DEVICE_VIDEO, 0x10e, METHOD_BUFFERED, FILE_ANY_ACCESS)
58 #define IOCTL_VIDEO_FREE_PUBLIC_ACCESS_RANGES \
59 CTL_CODE(FILE_DEVICE_VIDEO, 0x119, METHOD_BUFFERED, FILE_ANY_ACCESS)
61 #define IOCTL_VIDEO_GET_BANK_SELECT_CODE \
62 CTL_CODE(FILE_DEVICE_VIDEO, 0x115, METHOD_BUFFERED, FILE_ANY_ACCESS)
64 #define IOCTL_VIDEO_GET_CHILD_STATE \
65 CTL_CODE(FILE_DEVICE_VIDEO, 0x120, METHOD_BUFFERED, FILE_ANY_ACCESS)
67 #define IOCTL_VIDEO_GET_POWER_MANAGEMENT \
68 CTL_CODE(FILE_DEVICE_VIDEO, 0x11c, METHOD_BUFFERED, FILE_ANY_ACCESS)
70 #define IOCTL_VIDEO_HANDLE_VIDEOPARAMETERS \
71 CTL_CODE(FILE_DEVICE_VIDEO, 0x08, METHOD_BUFFERED, FILE_ANY_ACCESS)
73 #define IOCTL_VIDEO_LOAD_AND_SET_FONT \
74 CTL_CODE(FILE_DEVICE_VIDEO, 0x105, METHOD_BUFFERED, FILE_ANY_ACCESS)
76 #define IOCTL_VIDEO_MAP_VIDEO_MEMORY \
77 CTL_CODE(FILE_DEVICE_VIDEO, 0x116, METHOD_BUFFERED, FILE_ANY_ACCESS)
79 #define IOCTL_VIDEO_QUERY_AVAIL_MODES \
80 CTL_CODE(FILE_DEVICE_VIDEO, 0x100, METHOD_BUFFERED, FILE_ANY_ACCESS)
82 #define IOCTL_VIDEO_QUERY_COLOR_CAPABILITIES \
83 CTL_CODE(FILE_DEVICE_VIDEO, 0x11a, METHOD_BUFFERED, FILE_ANY_ACCESS)
85 #define IOCTL_VIDEO_QUERY_CURRENT_MODE \
86 CTL_CODE(FILE_DEVICE_VIDEO, 0x102, METHOD_BUFFERED, FILE_ANY_ACCESS)
88 #define IOCTL_VIDEO_QUERY_CURSOR_ATTR \
89 CTL_CODE(FILE_DEVICE_VIDEO, 0x10b, METHOD_BUFFERED, FILE_ANY_ACCESS)
91 #define IOCTL_VIDEO_QUERY_CURSOR_POSITION \
92 CTL_CODE(FILE_DEVICE_VIDEO, 0x10d, METHOD_BUFFERED, FILE_ANY_ACCESS)
94 #define IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES \
95 CTL_CODE(FILE_DEVICE_VIDEO, 0x101, METHOD_BUFFERED, FILE_ANY_ACCESS)
97 #define IOCTL_VIDEO_QUERY_POINTER_ATTR \
98 CTL_CODE(FILE_DEVICE_VIDEO, 0x111, METHOD_BUFFERED, FILE_ANY_ACCESS)
100 #define IOCTL_VIDEO_QUERY_POINTER_CAPABILITIES \
101 CTL_CODE(FILE_DEVICE_VIDEO, 0x114, METHOD_BUFFERED, FILE_ANY_ACCESS)
103 #define IOCTL_VIDEO_QUERY_POINTER_POSITION \
104 CTL_CODE(FILE_DEVICE_VIDEO, 0x113, METHOD_BUFFERED, FILE_ANY_ACCESS)
106 #define IOCTL_VIDEO_QUERY_PUBLIC_ACCESS_RANGES \
107 CTL_CODE(FILE_DEVICE_VIDEO, 0x118, METHOD_BUFFERED, FILE_ANY_ACCESS)
109 #define IOCTL_VIDEO_RESET_DEVICE \
110 CTL_CODE(FILE_DEVICE_VIDEO, 0x104, METHOD_BUFFERED, FILE_ANY_ACCESS)
112 #define IOCTL_VIDEO_RESTORE_HARDWARE_STATE \
113 CTL_CODE(FILE_DEVICE_VIDEO, 0x81, METHOD_BUFFERED, FILE_ANY_ACCESS)
115 #define IOCTL_VIDEO_SAVE_HARDWARE_STATE \
116 CTL_CODE(FILE_DEVICE_VIDEO, 0x80, METHOD_BUFFERED, FILE_ANY_ACCESS)
118 #define IOCTL_VIDEO_SET_CHILD_STATE_CONFIGURATION \
119 CTL_CODE(FILE_DEVICE_VIDEO, 0x122, METHOD_BUFFERED, FILE_ANY_ACCESS)
121 #define IOCTL_VIDEO_SET_COLOR_REGISTERS \
122 CTL_CODE(FILE_DEVICE_VIDEO, 0x107, METHOD_BUFFERED, FILE_ANY_ACCESS)
124 #define IOCTL_VIDEO_SET_CURRENT_MODE \
125 CTL_CODE(FILE_DEVICE_VIDEO, 0x103, METHOD_BUFFERED, FILE_ANY_ACCESS)
127 #define IOCTL_VIDEO_SET_CURSOR_ATTR \
128 CTL_CODE(FILE_DEVICE_VIDEO, 0x10a, METHOD_BUFFERED, FILE_ANY_ACCESS)
130 #define IOCTL_VIDEO_SET_CURSOR_POSITION \
131 CTL_CODE(FILE_DEVICE_VIDEO, 0x10c, METHOD_BUFFERED, FILE_ANY_ACCESS)
133 #define IOCTL_VIDEO_SET_PALETTE_REGISTERS \
134 CTL_CODE(FILE_DEVICE_VIDEO, 0x106, METHOD_BUFFERED, FILE_ANY_ACCESS)
136 #define IOCTL_VIDEO_SET_POINTER_ATTR \
137 CTL_CODE(FILE_DEVICE_VIDEO, 0x110, METHOD_BUFFERED, FILE_ANY_ACCESS)
139 #define IOCTL_VIDEO_SET_POINTER_POSITION \
140 CTL_CODE(FILE_DEVICE_VIDEO, 0x112, METHOD_BUFFERED, FILE_ANY_ACCESS)
142 #define IOCTL_VIDEO_SET_POWER_MANAGEMENT \
143 CTL_CODE(FILE_DEVICE_VIDEO, 0x11b, METHOD_BUFFERED, FILE_ANY_ACCESS)
145 #define IOCTL_VIDEO_SHARE_VIDEO_MEMORY \
146 CTL_CODE(FILE_DEVICE_VIDEO, 0x11d, METHOD_BUFFERED, FILE_ANY_ACCESS)
148 #define IOCTL_VIDEO_SWITCH_DUALVIEW \
149 CTL_CODE(FILE_DEVICE_VIDEO, 0x123, METHOD_BUFFERED, FILE_ANY_ACCESS)
151 #define IOCTL_VIDEO_UNMAP_VIDEO_MEMORY \
152 CTL_CODE(FILE_DEVICE_VIDEO, 0x117, METHOD_BUFFERED, FILE_ANY_ACCESS)
154 #define IOCTL_VIDEO_UNSHARE_VIDEO_MEMORY \
155 CTL_CODE(FILE_DEVICE_VIDEO, 0x11e, METHOD_BUFFERED, FILE_ANY_ACCESS)
157 #define IOCTL_VIDEO_VALIDATE_CHILD_STATE_CONFIGURATION \
158 CTL_CODE(FILE_DEVICE_VIDEO, 0x121, METHOD_BUFFERED, FILE_ANY_ACCESS)
162 typedef struct _VIDEO_MEMORY
{
163 PVOID RequestedVirtualAddress
;
164 } VIDEO_MEMORY
, *PVIDEO_MEMORY
;
166 typedef struct _VIDEO_MEMORY_INFORMATION
{
168 ULONG VideoRamLength
;
169 PVOID FrameBufferBase
;
170 ULONG FrameBufferLength
;
171 } VIDEO_MEMORY_INFORMATION
, *PVIDEO_MEMORY_INFORMATION
;
173 /* VIDEO_MODE.RequestedMode */
174 #define VIDEO_MODE_MAP_MEM_LINEAR 0x40000000
175 #define VIDEO_MODE_NO_ZERO_MEMORY 0x80000000
177 typedef struct _VIDEO_MODE
{
179 } VIDEO_MODE
, *PVIDEO_MODE
;
181 /* VIDEO_MODE_INFORMATION.AttributeFlags */
182 #define VIDEO_MODE_COLOR 0x0001
183 #define VIDEO_MODE_GRAPHICS 0x0002
184 #define VIDEO_MODE_PALETTE_DRIVEN 0x0004
185 #define VIDEO_MODE_MANAGED_PALETTE 0x0008
186 #define VIDEO_MODE_INTERLACED 0x0010
187 #define VIDEO_MODE_NO_OFF_SCREEN 0x0020
188 #define VIDEO_MODE_NO_64_BIT_ACCESS 0x0040
189 #define VIDEO_MODE_BANKED 0x0080
190 #define VIDEO_MODE_LINEAR 0x0100
192 typedef struct _VIDEO_MODE_INFORMATION
{
195 ULONG VisScreenWidth
;
196 ULONG VisScreenHeight
;
198 ULONG NumberOfPlanes
;
204 ULONG NumberGreenBits
;
205 ULONG NumberBlueBits
;
209 ULONG AttributeFlags
;
210 ULONG VideoMemoryBitmapWidth
;
211 ULONG VideoMemoryBitmapHeight
;
212 ULONG DriverSpecificAttributeFlags
;
213 } VIDEO_MODE_INFORMATION
, *PVIDEO_MODE_INFORMATION
;
215 typedef struct _VIDEO_NUM_MODES
{
217 ULONG ModeInformationLength
;
218 } VIDEO_NUM_MODES
, *PVIDEO_NUM_MODES
;
220 typedef enum _VIDEO_POWER_STATE
{
221 VideoPowerUnspecified
= 0,
229 } VIDEO_POWER_STATE
, *PVIDEO_POWER_STATE
;
231 typedef struct _VIDEO_POWER_MANAGEMENT
{
235 } VIDEO_POWER_MANAGEMENT
, *PVIDEO_POWER_MANAGEMENT
;
237 typedef struct _VIDEO_PUBLIC_ACCESS_RANGES
{
239 ULONG MappedInIoSpace
;
240 PVOID VirtualAddress
;
241 } VIDEO_PUBLIC_ACCESS_RANGES
, *PVIDEO_PUBLIC_ACCESS_RANGES
;
243 typedef struct _VIDEO_SHARE_MEMORY
{
244 HANDLE ProcessHandle
;
247 PVOID RequestedVirtualAddress
;
248 } VIDEO_SHARE_MEMORY
, *PVIDEO_SHARE_MEMORY
;
250 typedef struct _VIDEO_SHARE_MEMORY_INFORMATION
{
251 ULONG SharedViewOffset
;
252 ULONG SharedViewSize
;
253 PVOID VirtualAddress
;
254 } VIDEO_SHARE_MEMORY_INFORMATION
, *PVIDEO_SHARE_MEMORY_INFORMATION
;
256 /* VIDEO_BANK_SELECT.BankingFlags constants */
257 #define PLANAR_HC 0x00000001
259 /* VIDEO_BANK_SELECT.BankingType and PlanarHCBankingType constants */
260 typedef enum _VIDEO_BANK_TYPE
{
266 } VIDEO_BANK_TYPE
, *PVIDEO_BANK_TYPE
;
268 typedef struct _VIDEO_BANK_SELECT
{
273 ULONG PlanarHCBankingType
;
274 ULONG BitmapWidthInBytes
;
277 ULONG PlanarHCGranularity
;
279 ULONG PlanarHCBankCodeOffset
;
280 ULONG PlanarHCEnableCodeOffset
;
281 ULONG PlanarHCDisableCodeOffset
;
282 } VIDEO_BANK_SELECT
, *PVIDEO_BANK_SELECT
;
284 typedef struct _VIDEO_LOAD_FONT_INFORMATION
{
285 USHORT WidthInPixels
;
286 USHORT HeightInPixels
;
289 } VIDEO_LOAD_FONT_INFORMATION
, *PVIDEO_LOAD_FONT_INFORMATION
;
291 /* VIDEO_COLOR_CAPABILITIES.AttributeFlags constants */
292 #define VIDEO_DEVICE_COLOR 0x00000001
293 #define VIDEO_OPTIONAL_GAMMET_TABLE 0x00000002
295 typedef struct _VIDEO_COLOR_CAPABILITIES
{
297 ULONG AttributeFlags
;
298 LONG RedPhosphoreDecay
;
299 LONG GreenPhosphoreDecay
;
300 LONG BluePhosphoreDecay
;
301 LONG WhiteChromaticity_x
;
302 LONG WhiteChromaticity_y
;
303 LONG WhiteChromaticity_Y
;
304 LONG RedChromaticity_x
;
305 LONG RedChromaticity_y
;
306 LONG GreenChromaticity_x
;
307 LONG GreenChromaticity_y
;
308 LONG BlueChromaticity_x
;
309 LONG BlueChromaticity_y
;
314 } VIDEO_COLOR_CAPABILITIES
, *PVIDEO_COLOR_CAPABILITIES
;
316 typedef struct _VIDEO_CURSOR_ATTRIBUTES
{
323 } VIDEO_CURSOR_ATTRIBUTES
, *PVIDEO_CURSOR_ATTRIBUTES
;
325 typedef struct _VIDEO_CURSOR_POSITION
{
328 } VIDEO_CURSOR_POSITION
, *PVIDEO_CURSOR_POSITION
;
330 typedef struct _VIDEO_POINTER_ATTRIBUTES
{
339 } VIDEO_POINTER_ATTRIBUTES
, *PVIDEO_POINTER_ATTRIBUTES
;
341 /* VIDEO_POINTER_CAPABILITIES.Flags */
342 #define VIDEO_MODE_ASYNC_POINTER 0x01
343 #define VIDEO_MODE_MONO_POINTER 0x02
344 #define VIDEO_MODE_COLOR_POINTER 0x04
345 #define VIDEO_MODE_ANIMATE_START 0x08
346 #define VIDEO_MODE_ANIMATE_UPDATE 0x10
348 typedef struct _VIDEO_POINTER_CAPABILITIES
{
352 ULONG HWPtrBitmapStart
;
353 ULONG HWPtrBitmapEnd
;
354 } VIDEO_POINTER_CAPABILITIES
, *PVIDEO_POINTER_CAPABILITIES
;
356 typedef struct _VIDEO_POINTER_POSITION
{
359 } VIDEO_POINTER_POSITION
, *PVIDEO_POINTER_POSITION
;
362 /* VIDEO_HARDWARE_STATE_HEADER.VGAStateFlags constants */
363 #define VIDEO_STATE_NON_STANDARD_VGA 0x00000001
364 #define VIDEO_STATE_UNEMULATED_VGA_STATE 0x00000002
365 #define VIDEO_STATE_PACKED_CHAIN4_MODE 0x00000004
367 typedef struct _VIDEO_HARDWARE_STATE_HEADER
{
369 UCHAR PortValue
[0x30];
370 ULONG AttribIndexDataState
;
371 ULONG BasicSequencerOffset
;
372 ULONG BasicCrtContOffset
;
373 ULONG BasicGraphContOffset
;
374 ULONG BasicAttribContOffset
;
375 ULONG BasicDacOffset
;
376 ULONG BasicLatchesOffset
;
377 ULONG ExtendedSequencerOffset
;
378 ULONG ExtendedCrtContOffset
;
379 ULONG ExtendedGraphContOffset
;
380 ULONG ExtendedAttribContOffset
;
381 ULONG ExtendedDacOffset
;
382 ULONG ExtendedValidatorStateOffset
;
383 ULONG ExtendedMiscDataOffset
;
391 ULONG DIBBitsPerPixel
;
392 ULONG DIBXResolution
;
393 ULONG DIBYResolution
;
396 ULONG VesaInfoOffset
;
397 PVOID FrameBufferData
;
398 } VIDEO_HARDWARE_STATE_HEADER
, *PVIDEO_HARDWARE_STATE_HEADER
;
400 typedef struct _VIDEO_CLUTDATA
{
405 } VIDEO_CLUTDATA
, *PVIDEO_CLUTDATA
;
411 VIDEO_CLUTDATA RgbArray
;
414 } VIDEO_CLUT
, *PVIDEO_CLUT
;
416 typedef struct _VIDEO_PALETTE_DATA
{
420 } VIDEO_PALETTE_DATA
, *PVIDEO_PALETTE_DATA
;
422 typedef struct _VIDEO_HARDWARE_STATE
{
423 PVIDEO_HARDWARE_STATE_HEADER StateHeader
;
425 } VIDEO_HARDWARE_STATE
, *PVIDEO_HARDWARE_STATE
;
427 #define VIDEO_CHILD_ACTIVE 0x00000001
428 #define VIDEO_CHILD_DETACHED 0x00000002
429 #define VIDEO_CHILD_NOPRUNE_FREQ 0x80000000
430 #define VIDEO_CHILD_NOPRUNE_RESOLUTION 0x40000000
432 #define VIDEO_DUALVIEW_REMOVABLE 0x00000001
433 #define VIDEO_DUALVIEW_PRIMARY 0x80000000
434 #define VIDEO_DUALVIEW_SECONDARY 0x40000000
440 #endif /* __NTDDVDEO_H */