Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1790 lines
61 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. ddvdeo.h
  5. Abstract:
  6. This is the include file that defines all constants and types for
  7. accessing the Video device.
  8. Author:
  9. Andre Vachon (andreva) 21-Jan-1992
  10. Revision History:
  11. --*/
  12. #ifndef _NTDDVDEO_
  13. #define _NTDDVDEO_
  14. #if _MSC_VER > 1000
  15. #pragma once
  16. #endif
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. #include <tvout.h>
  21. //
  22. // VideoIoControlFile InputBuffer/OutputBuffer record structures for
  23. // this device.
  24. //
  25. //
  26. // Name used to create the miniport logical device names
  27. //
  28. #define VIDEO_DEVICE_NAME "DISPLAY%d"
  29. #define WVIDEO_DEVICE_NAME L"DISPLAY%d"
  30. //
  31. // Display output interfaces
  32. //
  33. // DEFINE_GUID(GUID_DISPLAY_OUTPUT_INTERFACE_STANDARD, 0x96304D9F, 0x54b5, 0x11d1, 0x8b, 0x0f, 0x00, 0xa0, 0xc9, 0x06, 0x8f, 0xf3);
  34. //
  35. // Display adapter device interface
  36. // 5b45201d-f2f2-4f3b-85bb-30ff1f953599
  37. //
  38. DEFINE_GUID(GUID_DEVINTERFACE_DISPLAY_ADAPTER, 0x5b45201d, 0xf2f2, 0x4f3b, 0x85, 0xbb, 0x30, 0xff, 0x1f, 0x95, 0x35, 0x99);
  39. //
  40. // Obsolete device interface class GUID names.
  41. // (use of above GUID_DEVINTERFACE_* names is recommended).
  42. //
  43. #define GUID_DISPLAY_ADAPTER_INTERFACE GUID_DEVINTERFACE_DISPLAY_ADAPTER
  44. //
  45. // The first set of IOCTLs are handle by the port driver and never seen
  46. // by the miniport.
  47. //
  48. #define IOCTL_VIDEO_ENABLE_VDM \
  49. CTL_CODE(FILE_DEVICE_VIDEO, 0x00, METHOD_BUFFERED, FILE_ANY_ACCESS)
  50. #define IOCTL_VIDEO_DISABLE_VDM \
  51. CTL_CODE(FILE_DEVICE_VIDEO, 0x01, METHOD_BUFFERED, FILE_ANY_ACCESS)
  52. #define IOCTL_VIDEO_REGISTER_VDM \
  53. CTL_CODE(FILE_DEVICE_VIDEO, 0x02, METHOD_BUFFERED, FILE_ANY_ACCESS)
  54. #define IOCTL_VIDEO_SET_OUTPUT_DEVICE_POWER_STATE \
  55. CTL_CODE(FILE_DEVICE_VIDEO, 0x03, METHOD_BUFFERED, FILE_ANY_ACCESS)
  56. #define IOCTL_VIDEO_GET_OUTPUT_DEVICE_POWER_STATE \
  57. CTL_CODE(FILE_DEVICE_VIDEO, 0x04, METHOD_BUFFERED, FILE_ANY_ACCESS)
  58. #define IOCTL_VIDEO_MONITOR_DEVICE \
  59. CTL_CODE(FILE_DEVICE_VIDEO, 0x05, METHOD_BUFFERED, FILE_ANY_ACCESS)
  60. #define IOCTL_VIDEO_ENUM_MONITOR_PDO \
  61. CTL_CODE(FILE_DEVICE_VIDEO, 0x06, METHOD_BUFFERED, FILE_ANY_ACCESS)
  62. #define IOCTL_VIDEO_INIT_WIN32K_CALLBACKS \
  63. CTL_CODE(FILE_DEVICE_VIDEO, 0x07, METHOD_BUFFERED, FILE_ANY_ACCESS)
  64. #define IOCTL_VIDEO_HANDLE_VIDEOPARAMETERS \
  65. CTL_CODE(FILE_DEVICE_VIDEO, 0x08, METHOD_BUFFERED, FILE_ANY_ACCESS)
  66. #define IOCTL_VIDEO_IS_VGA_DEVICE \
  67. CTL_CODE(FILE_DEVICE_VIDEO, 0x09, METHOD_BUFFERED, FILE_ANY_ACCESS)
  68. #define IOCTL_VIDEO_USE_DEVICE_IN_SESSION \
  69. CTL_CODE(FILE_DEVICE_VIDEO, 0x0a, METHOD_BUFFERED, FILE_ANY_ACCESS)
  70. #define IOCTL_VIDEO_PREPARE_FOR_EARECOVERY \
  71. CTL_CODE(FILE_DEVICE_VIDEO, 0x0b, METHOD_BUFFERED, FILE_ANY_ACCESS)
  72. //
  73. // All these IOCTL's must be both handled by the port and miniport since
  74. // they require processing by both parties.
  75. //
  76. #define IOCTL_VIDEO_SAVE_HARDWARE_STATE \
  77. CTL_CODE(FILE_DEVICE_VIDEO, 0x80, METHOD_BUFFERED, FILE_ANY_ACCESS)
  78. #define IOCTL_VIDEO_RESTORE_HARDWARE_STATE \
  79. CTL_CODE(FILE_DEVICE_VIDEO, 0x81, METHOD_BUFFERED, FILE_ANY_ACCESS)
  80. //
  81. // All these IOCTL's are public and must/can be handled by the miniport
  82. // driver
  83. //
  84. #define IOCTL_VIDEO_QUERY_AVAIL_MODES \
  85. CTL_CODE(FILE_DEVICE_VIDEO, 0x100, METHOD_BUFFERED, FILE_ANY_ACCESS)
  86. #define IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES \
  87. CTL_CODE(FILE_DEVICE_VIDEO, 0x101, METHOD_BUFFERED, FILE_ANY_ACCESS)
  88. #define IOCTL_VIDEO_QUERY_CURRENT_MODE \
  89. CTL_CODE(FILE_DEVICE_VIDEO, 0x102, METHOD_BUFFERED, FILE_ANY_ACCESS)
  90. #define IOCTL_VIDEO_SET_CURRENT_MODE \
  91. CTL_CODE(FILE_DEVICE_VIDEO, 0x103, METHOD_BUFFERED, FILE_ANY_ACCESS)
  92. #define IOCTL_VIDEO_RESET_DEVICE \
  93. CTL_CODE(FILE_DEVICE_VIDEO, 0x104, METHOD_BUFFERED, FILE_ANY_ACCESS)
  94. #define IOCTL_VIDEO_LOAD_AND_SET_FONT \
  95. CTL_CODE(FILE_DEVICE_VIDEO, 0x105, METHOD_BUFFERED, FILE_ANY_ACCESS)
  96. #define IOCTL_VIDEO_SET_PALETTE_REGISTERS \
  97. CTL_CODE(FILE_DEVICE_VIDEO, 0x106, METHOD_BUFFERED, FILE_ANY_ACCESS)
  98. #define IOCTL_VIDEO_SET_COLOR_REGISTERS \
  99. CTL_CODE(FILE_DEVICE_VIDEO, 0x107, METHOD_BUFFERED, FILE_ANY_ACCESS)
  100. #define IOCTL_VIDEO_ENABLE_CURSOR \
  101. CTL_CODE(FILE_DEVICE_VIDEO, 0x108, METHOD_BUFFERED, FILE_ANY_ACCESS)
  102. #define IOCTL_VIDEO_DISABLE_CURSOR \
  103. CTL_CODE(FILE_DEVICE_VIDEO, 0x109, METHOD_BUFFERED, FILE_ANY_ACCESS)
  104. #define IOCTL_VIDEO_SET_CURSOR_ATTR \
  105. CTL_CODE(FILE_DEVICE_VIDEO, 0x10a, METHOD_BUFFERED, FILE_ANY_ACCESS)
  106. #define IOCTL_VIDEO_QUERY_CURSOR_ATTR \
  107. CTL_CODE(FILE_DEVICE_VIDEO, 0x10b, METHOD_BUFFERED, FILE_ANY_ACCESS)
  108. #define IOCTL_VIDEO_SET_CURSOR_POSITION \
  109. CTL_CODE(FILE_DEVICE_VIDEO, 0x10c, METHOD_BUFFERED, FILE_ANY_ACCESS)
  110. #define IOCTL_VIDEO_QUERY_CURSOR_POSITION \
  111. CTL_CODE(FILE_DEVICE_VIDEO, 0x10d, METHOD_BUFFERED, FILE_ANY_ACCESS)
  112. #define IOCTL_VIDEO_ENABLE_POINTER \
  113. CTL_CODE(FILE_DEVICE_VIDEO, 0x10e, METHOD_BUFFERED, FILE_ANY_ACCESS)
  114. #define IOCTL_VIDEO_DISABLE_POINTER \
  115. CTL_CODE(FILE_DEVICE_VIDEO, 0x10f, METHOD_BUFFERED, FILE_ANY_ACCESS)
  116. #define IOCTL_VIDEO_SET_POINTER_ATTR \
  117. CTL_CODE(FILE_DEVICE_VIDEO, 0x110, METHOD_BUFFERED, FILE_ANY_ACCESS)
  118. #define IOCTL_VIDEO_QUERY_POINTER_ATTR \
  119. CTL_CODE(FILE_DEVICE_VIDEO, 0x111, METHOD_BUFFERED, FILE_ANY_ACCESS)
  120. #define IOCTL_VIDEO_SET_POINTER_POSITION \
  121. CTL_CODE(FILE_DEVICE_VIDEO, 0x112, METHOD_BUFFERED, FILE_ANY_ACCESS)
  122. #define IOCTL_VIDEO_QUERY_POINTER_POSITION \
  123. CTL_CODE(FILE_DEVICE_VIDEO, 0x113, METHOD_BUFFERED, FILE_ANY_ACCESS)
  124. #define IOCTL_VIDEO_QUERY_POINTER_CAPABILITIES \
  125. CTL_CODE(FILE_DEVICE_VIDEO, 0x114, METHOD_BUFFERED, FILE_ANY_ACCESS)
  126. #define IOCTL_VIDEO_GET_BANK_SELECT_CODE \
  127. CTL_CODE(FILE_DEVICE_VIDEO, 0x115, METHOD_BUFFERED, FILE_ANY_ACCESS)
  128. #define IOCTL_VIDEO_MAP_VIDEO_MEMORY \
  129. CTL_CODE(FILE_DEVICE_VIDEO, 0x116, METHOD_BUFFERED, FILE_ANY_ACCESS)
  130. #define IOCTL_VIDEO_UNMAP_VIDEO_MEMORY \
  131. CTL_CODE(FILE_DEVICE_VIDEO, 0x117, METHOD_BUFFERED, FILE_ANY_ACCESS)
  132. #define IOCTL_VIDEO_QUERY_PUBLIC_ACCESS_RANGES \
  133. CTL_CODE(FILE_DEVICE_VIDEO, 0x118, METHOD_BUFFERED, FILE_ANY_ACCESS)
  134. #define IOCTL_VIDEO_FREE_PUBLIC_ACCESS_RANGES \
  135. CTL_CODE(FILE_DEVICE_VIDEO, 0x119, METHOD_BUFFERED, FILE_ANY_ACCESS)
  136. #define IOCTL_VIDEO_QUERY_COLOR_CAPABILITIES \
  137. CTL_CODE(FILE_DEVICE_VIDEO, 0x11a, METHOD_BUFFERED, FILE_ANY_ACCESS)
  138. //
  139. // New IOCTLs defined for product 1.0A
  140. //
  141. #define IOCTL_VIDEO_SET_POWER_MANAGEMENT \
  142. CTL_CODE(FILE_DEVICE_VIDEO, 0x11b, METHOD_BUFFERED, FILE_ANY_ACCESS)
  143. #define IOCTL_VIDEO_GET_POWER_MANAGEMENT \
  144. CTL_CODE(FILE_DEVICE_VIDEO, 0x11c, METHOD_BUFFERED, FILE_ANY_ACCESS)
  145. #define IOCTL_VIDEO_SHARE_VIDEO_MEMORY \
  146. CTL_CODE(FILE_DEVICE_VIDEO, 0x11d, METHOD_BUFFERED, FILE_ANY_ACCESS)
  147. #define IOCTL_VIDEO_UNSHARE_VIDEO_MEMORY \
  148. CTL_CODE(FILE_DEVICE_VIDEO, 0x11e, METHOD_BUFFERED, FILE_ANY_ACCESS)
  149. #define IOCTL_VIDEO_SET_COLOR_LUT_DATA \
  150. CTL_CODE(FILE_DEVICE_VIDEO, 0x11f, METHOD_BUFFERED, FILE_ANY_ACCESS)
  151. #define IOCTL_VIDEO_GET_CHILD_STATE \
  152. CTL_CODE(FILE_DEVICE_VIDEO, 0x120, METHOD_BUFFERED, FILE_ANY_ACCESS)
  153. #define IOCTL_VIDEO_VALIDATE_CHILD_STATE_CONFIGURATION \
  154. CTL_CODE(FILE_DEVICE_VIDEO, 0x121, METHOD_BUFFERED, FILE_ANY_ACCESS)
  155. #define IOCTL_VIDEO_SET_CHILD_STATE_CONFIGURATION \
  156. CTL_CODE(FILE_DEVICE_VIDEO, 0x122, METHOD_BUFFERED, FILE_ANY_ACCESS)
  157. #define IOCTL_VIDEO_SWITCH_DUALVIEW \
  158. CTL_CODE(FILE_DEVICE_VIDEO, 0x123, METHOD_BUFFERED, FILE_ANY_ACCESS)
  159. #define IOCTL_VIDEO_SET_BANK_POSITION \
  160. CTL_CODE(FILE_DEVICE_VIDEO, 0x124, METHOD_BUFFERED, FILE_ANY_ACCESS)
  161. #define IOCTL_VIDEO_QUERY_SUPPORTED_BRIGHTNESS \
  162. CTL_CODE(FILE_DEVICE_VIDEO, 0x125, METHOD_BUFFERED, FILE_ANY_ACCESS)
  163. #define IOCTL_VIDEO_QUERY_DISPLAY_BRIGHTNESS \
  164. CTL_CODE(FILE_DEVICE_VIDEO, 0x126, METHOD_BUFFERED, FILE_ANY_ACCESS)
  165. #define IOCTL_VIDEO_SET_DISPLAY_BRIGHTNESS \
  166. CTL_CODE(FILE_DEVICE_VIDEO, 0x127, METHOD_BUFFERED, FILE_ANY_ACCESS)
  167. //
  168. // All these IOCTL's are handled by the Far East Full Screen Video driver
  169. //
  170. #define IOCTL_FSVIDEO_COPY_FRAME_BUFFER \
  171. CTL_CODE(FILE_DEVICE_FULLSCREEN_VIDEO, 0x200, METHOD_BUFFERED, FILE_ANY_ACCESS)
  172. #define IOCTL_FSVIDEO_WRITE_TO_FRAME_BUFFER \
  173. CTL_CODE(FILE_DEVICE_FULLSCREEN_VIDEO, 0x201, METHOD_BUFFERED, FILE_ANY_ACCESS)
  174. #define IOCTL_FSVIDEO_REVERSE_MOUSE_POINTER \
  175. CTL_CODE(FILE_DEVICE_FULLSCREEN_VIDEO, 0x202, METHOD_BUFFERED, FILE_ANY_ACCESS)
  176. #define IOCTL_FSVIDEO_SET_CURRENT_MODE \
  177. CTL_CODE(FILE_DEVICE_FULLSCREEN_VIDEO, 0x203, METHOD_BUFFERED, FILE_ANY_ACCESS)
  178. #define IOCTL_FSVIDEO_SET_SCREEN_INFORMATION \
  179. CTL_CODE(FILE_DEVICE_FULLSCREEN_VIDEO, 0x204, METHOD_BUFFERED, FILE_ANY_ACCESS)
  180. #define IOCTL_FSVIDEO_SET_CURSOR_POSITION \
  181. CTL_CODE(FILE_DEVICE_FULLSCREEN_VIDEO, 0x205, METHOD_BUFFERED, FILE_ANY_ACCESS)
  182. //
  183. // Many of the video ICOTLs are modal. When ever the palette is set, or the
  184. // cursor is set or queried, it is done for the current mode.
  185. //
  186. // Modal specifies that the operation is only valid within a mode. Once a
  187. // set mode operation is performed, the state associated to the modal IOCTL
  188. // has been destroyed or reinitialized.
  189. // Non-modal IOCTLs have their state preserved across set-mode operations.
  190. //
  191. // Optional IOCTLs are IOCTLs the miniport can optionally support. If the
  192. // miniport does not support the IOCTL, it should return the appropriate
  193. // error status.
  194. // Required IOCTLs must be implemented in a miniport in order for the system
  195. // to system properly.
  196. //
  197. // IOCTL_VIDEO_ENABLE_VDM Non-Modal Private(1)
  198. // IOCTL_VIDEO_DISABLE_VDM Non-Modal Private(1)
  199. // IOCTL_VIDEO_REGISTER_VDM Non-Modal Private(1)
  200. //
  201. // IOCTL_VIDEO_SAVE_HARDWARE_STATE Non-Modal Required(2)
  202. // IOCTL_VIDEO_RESTORE_HARDWARE_STATE Non-Modal Required(2)
  203. //
  204. // IOCTL_VIDEO_QUERY_AVAIL_MODES Non-Modal Required
  205. // IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES Non-Modal Required
  206. // IOCTL_VIDEO_QUERY_CURRENT_MODE Modal Required
  207. // IOCTL_VIDEO_SET_CURRENT_MODE Non-Modal Required
  208. // IOCTL_VIDEO_RESET_DEVICE Non-Modal Required
  209. //
  210. // IOCTL_VIDEO_LOAD_AND_SET_FONT Modal Required(2)
  211. //
  212. // IOCTL_VIDEO_SET_PALETTE_REGISTERS Modal Required(2)
  213. // IOCTL_VIDEO_SET_COLOR_REGISTERS Modal Required(3)
  214. //
  215. // IOCTL_VIDEO_ENABLE_CURSOR Modal Required(2)
  216. // IOCTL_VIDEO_DISABLE_CURSOR Modal Required(2)
  217. // IOCTL_VIDEO_SET_CURSOR_ATTR Modal Required(2)
  218. // IOCTL_VIDEO_QUERY_CURSOR_ATTR Modal Required(2)
  219. // IOCTL_VIDEO_SET_CURSOR_POSITION Modal Required(2)
  220. // IOCTL_VIDEO_QUERY_CURSOR_POSITION Modal Required(2)
  221. //
  222. // IOCTL_VIDEO_ENABLE_POINTER Modal Optional
  223. // IOCTL_VIDEO_DISABLE_POINTER Modal Optional
  224. // IOCTL_VIDEO_SET_POINTER_ATTR Modal Optional
  225. // IOCTL_VIDEO_QUERY_POINTER_ATTR Modal Optional
  226. // IOCTL_VIDEO_SET_POINTER_POSITION Modal Optional
  227. // IOCTL_VIDEO_QUERY_POINTER_POSITION Modal Optional
  228. // IOCTL_VIDEO_QUERY_POINTER_CAPABILITIES Non-Modal Optional
  229. //
  230. // IOCTL_VIDEO_GET_BANK_SELECT_CODE Modal Required(2)
  231. //
  232. // IOCTL_VIDEO_MAP_VIDEO_MEMORY Special(4) Required
  233. // IOCTL_VIDEO_UNMAP_VIDEO_MEMORY Non-Modal Required
  234. // IOCTL_VIDEO_QUERY_PUBLIC_ACCESS_RANGES Non-Modal Optional
  235. // IOCTL_VIDEO_FREE_PUBLIC_ACCESS_RANGES Non-Modal Optional
  236. //
  237. // IOCTL_VIDEO_QUERY_COLOR_CAPABILITIES Non-Modal Optional
  238. //
  239. // IOCTL_VIDEO_SET_POWER_MANAGEMENT Non-Modal Optional
  240. // IOCTL_VIDEO_GET_POWER_MANAGEMENT Non-Modal Optional
  241. //
  242. // IOCTL_VIDEO_SET_COLOR_LUT_DATA Modal Optional
  243. //
  244. // (1) Private means the IOCTL is completely implemeted within the port driver
  245. // and the miniport does not need to support it.
  246. //
  247. // (2) These Required functions are for "Vga Compatible" miniports. They are
  248. // Optional for other, non vga-compatible (i.e frame buffers) drivers.
  249. // VGA compatible means here that the miniport implements all the VGA
  250. // functionality and that the VgaCompatible flag for the miniport in the
  251. // registry parameters is turned on.
  252. //
  253. // (3) This IOCTL is required if the device has a color lookup table (also
  254. // commonly called palette) the PALETTE IOCTL is used for VGA while the
  255. // COLOR IOCTL is the more general IOCTL that is called by the display
  256. // driver or application to set the colors in the devices internal
  257. // lookup table
  258. //
  259. // (4) This IOCTL is both modal and non-modal. It should map all of video
  260. // memory in the caller's address space. A set mode MUST NOT cause the
  261. // video memory to change location - in this sense it is non-modal.
  262. // However, this IOCTL returns the location size of the frame buffer within
  263. // video memory, and the frame buffer size and location may vary from mode
  264. // to mode - so that information is modal.
  265. //
  266. //
  267. // Any IOCTL that returns information should return in the status block the
  268. // size of the data returned.
  269. // If the output buffer was too small, an error should be returned.
  270. //
  271. //
  272. //
  273. //
  274. //
  275. // IOCTL_VIDEO_ENABLE_VDM
  276. // IOCTL_VIDEO_DISABLE_VDM
  277. // IOCTL_VIDEO_REGISTER_VDM
  278. //
  279. // These IOCTLs are used to enable or disable a VDM's access to the video
  280. // hardware. This call will cause the real video frame buffer to be mapped
  281. // into the VDM's address space and get the video validator connected to the
  282. // V86 emulator for direct video register access.
  283. //
  284. // Information used by this function is passed using the following structure:
  285. //
  286. typedef struct _VIDEO_VDM {
  287. HANDLE ProcessHandle;
  288. } VIDEO_VDM, *PVIDEO_VDM;
  289. //
  290. //ProcessHandle - Handle to the process for which this request must be
  291. // performed. This is required because the console calls the miniport on
  292. // the behalf of the VDM process; we are not performing this request in
  293. // the context of the current caller.
  294. //
  295. typedef struct _VIDEO_REGISTER_VDM {
  296. ULONG MinimumStateSize;
  297. } VIDEO_REGISTER_VDM, *PVIDEO_REGISTER_VDM;
  298. //
  299. //MinimumStateSize - Output value determining the minimum size required to
  300. // store the video hardware state when performing SAVE_HARDWARE_SATE or
  301. // RESTORE_HARDWARE_STATE Ioctls.
  302. //
  303. //
  304. // IOCTL_VIDEO_ENUM_MONITOR_PDO
  305. //
  306. // Descriptor of monitor devices
  307. //
  308. typedef struct tagVIDEO_MONITOR_DEVICE {
  309. ULONG flag; // The monitor is ON/OFF
  310. HANDLE pdo; // Monitor device handle
  311. ULONG HwID;
  312. } VIDEO_MONITOR_DEVICE, *PVIDEO_MONITOR_DEVICE;
  313. //
  314. // IOCTL_VIDEO_INIT_WIN32K_CALLBACKS
  315. //
  316. // List of function pointers used to make callbacks to win32k
  317. //
  318. typedef enum _VIDEO_WIN32K_CALLBACKS_PARAMS_TYPE {
  319. VideoPowerNotifyCallout = 1,
  320. VideoDisplaySwitchCallout,
  321. VideoEnumChildPdoNotifyCallout,
  322. VideoFindAdapterCallout,
  323. VideoWakeupCallout,
  324. VideoChangeDisplaySettingsCallout
  325. } VIDEO_WIN32K_CALLBACKS_PARAMS_TYPE;
  326. typedef struct _VIDEO_WIN32K_CALLBACKS_PARAMS {
  327. VIDEO_WIN32K_CALLBACKS_PARAMS_TYPE CalloutType;
  328. PVOID PhysDisp;
  329. ULONG_PTR Param;
  330. LONG Status;
  331. } VIDEO_WIN32K_CALLBACKS_PARAMS, *PVIDEO_WIN32K_CALLBACKS_PARAMS;
  332. typedef
  333. VOID
  334. (*PVIDEO_WIN32K_CALLOUT) (
  335. IN PVOID Params
  336. );
  337. typedef struct _VIDEO_WIN32K_CALLBACKS {
  338. PVOID PhysDisp;
  339. PVIDEO_WIN32K_CALLOUT Callout;
  340. ULONG bACPI;
  341. HANDLE pPhysDeviceObject;
  342. ULONG DualviewFlags;
  343. } VIDEO_WIN32K_CALLBACKS, *PVIDEO_WIN32K_CALLBACKS;
  344. //
  345. // IOCTL_VIDEO_USE_DEVICE_IN_SESSION
  346. //
  347. // Parameters to request new enabled/disabled state for a device
  348. //
  349. typedef struct _VIDEO_DEVICE_SESSION_STATUS {
  350. ULONG bEnable; // Is device being enabled or disabled
  351. ULONG bSuccess; // Was request validated
  352. } VIDEO_DEVICE_SESSION_STATUS, *PVIDEO_DEVICE_SESSION_STATUS;
  353. //
  354. // defines for Dualview Flags
  355. //
  356. #define VIDEO_DUALVIEW_REMOVABLE 0x00000001
  357. #define VIDEO_DUALVIEW_PRIMARY 0x80000000
  358. #define VIDEO_DUALVIEW_SECONDARY 0x40000000
  359. //
  360. // defines for child state flag
  361. //
  362. #define VIDEO_CHILD_ACTIVE 0x00000001
  363. #define VIDEO_CHILD_DETACHED 0x00000002
  364. #define VIDEO_CHILD_NOPRUNE_FREQ 0x80000000
  365. #define VIDEO_CHILD_NOPRUNE_RESOLUTION 0x40000000
  366. //
  367. // Second set of structures
  368. //
  369. //
  370. // These IOCTLs are used by the VDM and the console to communicate state
  371. // changes between the VDM and the kernel video driver.
  372. //
  373. // IOCTL_VIDEO_SAVE_HARDWARE_STATE -
  374. // IOCTL_VIDEO_RESTORE_HARDWARE_STATE -
  375. //
  376. //
  377. // This structure is at the start of the block used when saving or restoring
  378. // the state of the video hardware using ConsoleHardwareState().
  379. // the ULONG are offset to the location of the rest of the data. That data
  380. // is stored within the same memory block pointed to by the
  381. // VIDEO_HARDWARE_STATE structure, right after this header.
  382. //
  383. // Information used by this function is passed using the following structure:
  384. //
  385. typedef struct _VIDEO_HARDWARE_STATE_HEADER {
  386. ULONG Length;
  387. UCHAR PortValue[0x30];
  388. ULONG AttribIndexDataState;
  389. ULONG BasicSequencerOffset;
  390. ULONG BasicCrtContOffset;
  391. ULONG BasicGraphContOffset;
  392. ULONG BasicAttribContOffset;
  393. ULONG BasicDacOffset;
  394. ULONG BasicLatchesOffset;
  395. ULONG ExtendedSequencerOffset;
  396. ULONG ExtendedCrtContOffset;
  397. ULONG ExtendedGraphContOffset;
  398. ULONG ExtendedAttribContOffset;
  399. ULONG ExtendedDacOffset;
  400. ULONG ExtendedValidatorStateOffset;
  401. ULONG ExtendedMiscDataOffset;
  402. ULONG PlaneLength;
  403. ULONG Plane1Offset;
  404. ULONG Plane2Offset;
  405. ULONG Plane3Offset;
  406. ULONG Plane4Offset;
  407. ULONG VGAStateFlags;
  408. ULONG DIBOffset;
  409. ULONG DIBBitsPerPixel;
  410. ULONG DIBXResolution;
  411. ULONG DIBYResolution;
  412. ULONG DIBXlatOffset;
  413. ULONG DIBXlatLength;
  414. ULONG VesaInfoOffset;
  415. PVOID FrameBufferData;
  416. } VIDEO_HARDWARE_STATE_HEADER, *PVIDEO_HARDWARE_STATE_HEADER;
  417. //
  418. // defines for VGAStateFlags
  419. //
  420. #define VIDEO_STATE_NON_STANDARD_VGA 0x00000001
  421. #define VIDEO_STATE_UNEMULATED_VGA_STATE 0x00000002
  422. #define VIDEO_STATE_PACKED_CHAIN4_MODE 0x00000004
  423. typedef struct _VIDEO_HARDWARE_STATE {
  424. PVIDEO_HARDWARE_STATE_HEADER StateHeader;
  425. ULONG StateLength;
  426. } VIDEO_HARDWARE_STATE, *PVIDEO_HARDWARE_STATE;
  427. //
  428. //Length - Length of the basic structure. Used for versioning purposes. The
  429. // length field should be initialized to be equal to
  430. // sizeof(VIDEO_HARDWARE_STATE_HEADER).
  431. //
  432. //PortValue - Array of entries containing the data values for port 3B0 through
  433. // 3DF.
  434. //
  435. //AttribIndexDataState - State of the attribute index register.
  436. //
  437. //BasicSequencerOffset - Offset, in bytes, from the beginning of the structure,
  438. // to an array of fields containing the register values for the basic
  439. // sequencer register set of the VGA.
  440. //
  441. //BasicCrtContOffset - Offset, in bytes, from the beginning of the structure,
  442. // to an array of fields containing the register values for the basic
  443. // CRT register set of the VGA.
  444. //
  445. //BasicGraphContOffset - Offset, in bytes, from the beginning of the structure,
  446. // to an array of fields containing the register values for the basic
  447. // graphics controller register set of the VGA.
  448. //
  449. //BasicAttribContOffset - Offset, in bytes, from the beginning of the structure,
  450. // to an array of fields containing the register values for the basic
  451. // attribute controller register set of the VGA.
  452. //
  453. //BasicDacOffset - Offset, in bytes, from the beginning of the structure,
  454. // to an array of fields containing the register values for the basic
  455. // DAC registers of the VGA.
  456. //
  457. //BasicLatchesOffset - Offset, in bytes, from the beginning of the structure,
  458. // to an array of fields containing the register values for the basic
  459. // latches of the VGA.
  460. //
  461. //ExtendedSequencerOffset - Offset, in bytes, from the beginning of the structure,
  462. // to an array of fields containing the registers values for the extended
  463. // sequencer register set of the VGA.
  464. //
  465. //ExtendedCrtContOffset - Offset, in bytes, from the beginning of the structure,
  466. // to an array of fields containing the registers values for the extended
  467. // CRT register set of the VGA.
  468. //
  469. //ExtendedGraphContOffset - Offset, in bytes, from the beginning of the structure,
  470. // to an array of fields containing the registers values for the extended
  471. // graphics controller register set of the VGA.
  472. //
  473. //ExtendedAttribContOffset - Offset, in bytes, from the beginning of the structure,
  474. // to an array of fields containing the registers values for the extended
  475. // attribute controller register set of the VGA.
  476. //
  477. //ExtendedDacOffset - Offset, in bytes, from the beginning of the structure,
  478. // to an array of fields containing the registers values for the extended
  479. // DAC registers of the VGA.
  480. //
  481. //ExtendedValidatorStateOffset - Offset, in bytes, from the beginning of the
  482. // structure, to an area reserved for the miniport to put the unemulated
  483. // save state that the miniport uses to perform instruction validation for
  484. // DOS apps.
  485. //
  486. //ExtendedMiscDataOffset - Offset, in bytes, from the beginning of the structure,
  487. // to an area reserved for the use of the miniport.
  488. //
  489. //PlaneLength - Length of each of the following plane (if present)
  490. //
  491. //Plane1Offset - Offset, in bytes, from the beginning of the structure, to an
  492. // array of fields containing the data of the first plane of video memory.
  493. //
  494. //Plane2Offset - Offset, in bytes, from the beginning of the structure, to an
  495. // array of fields containing the data of the second plane of video memory.
  496. //
  497. //Plane3Offset - Offset, in bytes, from the beginning of the structure, to an
  498. // array of fields containing the data of the third plane of video memory.
  499. //
  500. //Plane4Offset - Offset, in bytes, from the beginning of the structure, to an
  501. // array of fields containing the data of the fourth plane of video memory.
  502. //
  503. //VGAStateFlags - Flags used for the interpretation of the VGA state.
  504. // VIDEO_STATE_NON_STANDARD_VGA is set when the set of registers the VGA
  505. // returns is not the basic set (all super vga's are not standard).
  506. // The VDM should not emulate the saved state unless a specific VDD
  507. // has been written for the device.
  508. // VIDEO_STATE_UNEMULATED_VGA_STATE specified the miniport has stored
  509. // informaiton in the ExtendedValidatorState field and the miniport
  510. // should treat this as a frozen state, whatever the registers say.
  511. // VIDEO_STATE_PACKED_CHAIN4_MODE indicates that in mode 13 (320x200x256).
  512. // the data is stored in a packed pixel format in the plane, as
  513. // opposed to the standard VGA format where the data is interleaved
  514. // at every four bytes, and on every 16K boundary, offset by one
  515. // extra byte.
  516. //
  517. //DIBOffset - Offset to the location of the DIB in the allocated data
  518. // structure. If NULL, no translation is available.
  519. //
  520. //DIBBitsPerPixel - Format of the DIB.
  521. //
  522. //DIBXResolution - Width of the DIB in pixels.
  523. //
  524. //DIBYResolution - Height of the DIB in pixels.
  525. //
  526. //DIBXlatOffset - Offset to the location of the translation vector
  527. // from DIB pixel values to 32-bit RGB (1 byte red, 1 byte green, 1 byte
  528. // blue, 1 byte empty). Maximum length 256. If NULL, the standard
  529. // VGA palette stored in this structure should be used.
  530. //
  531. //DIBXlatLength - Length of the RGB translation vector at DIBXlatOffset.
  532. //
  533. // For each of the offset fields, if an offset value is NULL, then there is
  534. // no data for that offset.
  535. // The length of a data area is:
  536. // 1) the specific length given to it : plane length (planes) or XResolution *
  537. // Yresolution * BitsPerPel (DIB)
  538. // 2) otherwise, the length = next_non-null_offset_value -
  539. // current_offset_value
  540. //
  541. //
  542. //StateHeader - Pointer to the VIDEO_HARDWARE_STATE_HEADER structure.
  543. //
  544. //StateLength - Size of the VIDEO_HARDWARE_STATE_HEADER structure.
  545. //
  546. //
  547. // IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES - Returns number of different modes
  548. // available on the controller.
  549. //
  550. // Information used by this function is passed using the following structure:
  551. //
  552. typedef struct _VIDEO_NUM_MODES {
  553. ULONG NumModes;
  554. ULONG ModeInformationLength;
  555. } VIDEO_NUM_MODES, *PVIDEO_NUM_MODES;
  556. //
  557. //NumModes - Returns the number of modes supported by the kernel driver.
  558. //
  559. //ModeInformationLength - Length of the VIDEO_MODE_INFORMATION structure
  560. // for the IOCTL_VIDEO QUERY_AVAILABLE_MODES IOCTL.
  561. //
  562. // IOCTL_VIDEO_SET_CURRENT_MODE - Is used to set the mode of the controller.
  563. //
  564. // Information used by this function is passed using the following structure:
  565. //
  566. typedef struct _VIDEO_MODE {
  567. ULONG RequestedMode;
  568. } VIDEO_MODE, *PVIDEO_MODE;
  569. #define VIDEO_MODE_NO_ZERO_MEMORY 0x80000000 // High order bit of the mode
  570. // determines if the set mode
  571. // should (0) or should not (1)
  572. // cause the video memory to be
  573. // zeroed out simultaneously to
  574. // the set mode operation.
  575. #define VIDEO_MODE_MAP_MEM_LINEAR 0x40000000 // Miniports which support this
  576. // flag will set a linear mode
  577. // if possible when this flag
  578. // is set. Note: Some miniports
  579. // may return a linear mode even
  580. // if this flag is not set.
  581. //
  582. //RequestedMode - Indicates in which mode the adapter should be initialized.
  583. //
  584. //
  585. // IOCTL_VIDEO_RESET_DEVICE - Is used to reset the mode of the adapter when GDI
  586. // gives up control of the device to allow a VDM to
  587. // access the hardware. x86 only.
  588. // The default mode should be whatever is the
  589. // default mode when the machine is booted
  590. //
  591. // No information is needed fo this function.
  592. //
  593. //
  594. // IOCTL_VIDEO_QUERY_AVAIL_MODES - Returns information about each available
  595. // mode on the controller.
  596. //
  597. // IOCTL_VIDEO_QUERY_CURRENT_MODE - Returns the information for the current
  598. // controller mode.
  599. //
  600. // Information used by this function is passed using the following structure:
  601. //
  602. // NOTE This structure is matched exactly with the DISP_MODE structure
  603. // in winddi.h - every change to this structure MUST be made to the
  604. // structure in winddi.h.
  605. //
  606. typedef struct _VIDEO_MODE_INFORMATION {
  607. ULONG Length;
  608. ULONG ModeIndex;
  609. ULONG VisScreenWidth;
  610. ULONG VisScreenHeight;
  611. ULONG ScreenStride;
  612. ULONG NumberOfPlanes;
  613. ULONG BitsPerPlane;
  614. ULONG Frequency;
  615. ULONG XMillimeter;
  616. ULONG YMillimeter;
  617. ULONG NumberRedBits;
  618. ULONG NumberGreenBits;
  619. ULONG NumberBlueBits;
  620. ULONG RedMask;
  621. ULONG GreenMask;
  622. ULONG BlueMask;
  623. ULONG AttributeFlags;
  624. ULONG VideoMemoryBitmapWidth;
  625. ULONG VideoMemoryBitmapHeight;
  626. ULONG DriverSpecificAttributeFlags;
  627. } VIDEO_MODE_INFORMATION, *PVIDEO_MODE_INFORMATION;
  628. //
  629. // Bit definitions for Attribute Flags
  630. //
  631. #define VIDEO_MODE_COLOR 0x0001 // 0 = Mono-compatible, 1 = Color
  632. #define VIDEO_MODE_GRAPHICS 0x0002 // 0 = Text mode, 1 = Graphics
  633. #define VIDEO_MODE_PALETTE_DRIVEN 0x0004 // 0 = Colors are direct
  634. // 1 = Colors are index to a palette
  635. #define VIDEO_MODE_MANAGED_PALETTE 0x0008 // 0 = Palette is fixed (must be
  636. // queried from miniport
  637. // 1 = Palette is settable.
  638. #define VIDEO_MODE_INTERLACED 0x0010 // 1 = Mode is interlaced
  639. // 0 = non-interlaced
  640. #define VIDEO_MODE_NO_OFF_SCREEN 0x0020 // 1 = Offscreen memory CAN NOT be
  641. // used to store information.
  642. // 0 = Offscreen memory is available
  643. #define VIDEO_MODE_NO_64_BIT_ACCESS 0x0040 // 1 = 64 bit memory writes to frame
  644. // buffer are not handled properly.
  645. // 0 = 64 bit memory writes to frame
  646. // buffer are handled properly.
  647. #define VIDEO_MODE_BANKED 0x0080 // 0 = undefined
  648. // 1 = this is a banked mode
  649. #define VIDEO_MODE_LINEAR 0x0100 // 0 = undefined
  650. // 1 = this is a linear mode
  651. //
  652. //Length - Length of the structure in bytes. Also used to do verisioning.
  653. //
  654. //ModeIndex - Number used to set this mode when calling the miniport driver.
  655. //
  656. //VisScreenWidth - Number of visible horizontal pixels on a scan line
  657. //
  658. //VisScreenHeight - Number of visible lines (or scan lines)
  659. //
  660. //ScreenStride - Delta, in *BYTES*, between the start of two scan lines.
  661. //
  662. // NOTE: the width and height are in pixels, but the stride is in bytes !!!
  663. //
  664. //NumberOfPlanes - Number of separate planes combined by the device.
  665. //
  666. //BitsPerPlane - Number of bits per pixel on a plane.
  667. //
  668. //Frequency - Screen Frequency, in Hertz.
  669. //
  670. //XMillimeter - Size of the horizontal active region on the output device,
  671. // in millimeters.
  672. //
  673. //YMillimeter - Size of the vertical active region on the output device,
  674. // in millimeters.
  675. //
  676. //NumberRedBits - Number of bits in the red DAC.
  677. //
  678. //NumberGreenBits - Number of bits in the green DAC.
  679. //
  680. //NumberBlueBits - Number of bits in the blue DAC.
  681. //
  682. //RedMask - Red color Mask for device with direct color modes. Bits turned
  683. // on indicate the bit is of color Red.
  684. //
  685. //GreenMask - Green color Mask for device with direct color modes. Bits
  686. // turned on indicate the bit is of color Green.
  687. //
  688. //BlueMask - Blue color Mask for device with direct color modes. Bits
  689. // turned on indicate the bit is of color Blue.
  690. //
  691. //AttributeFlags. Flags indicating certain behavior for the device.
  692. //
  693. //VideoMemoryBitmapWidth - Width of the video memory bitmap.
  694. // VisScreenWidth <= VideoMemoryBitmapWidth <= ScreenStride
  695. //
  696. //VideoMemoryBitmapHeight - Height of the video memory bitmap.
  697. // VisScreenHeight <= VideoMemoryBitmapHeight = VideoRamLength / ScreenStride
  698. //
  699. //DriverSpecificAttributeFlags - Flags indicating certain behavior for the
  700. // device that are private to the miniport\display driver.
  701. //
  702. //
  703. // IOCTL_VIDEO_LOAD_AND_SET_FONT - Is used to load a user-defined font.
  704. //
  705. // Information used by this function is passed using the following structure:
  706. //
  707. typedef struct _VIDEO_LOAD_FONT_INFORMATION {
  708. USHORT WidthInPixels;
  709. USHORT HeightInPixels;
  710. ULONG FontSize;
  711. UCHAR Font[1];
  712. } VIDEO_LOAD_FONT_INFORMATION, *PVIDEO_LOAD_FONT_INFORMATION;
  713. //
  714. //WidthInPixels - Width of the characters in the font, in pixels.
  715. //
  716. //HeigthInPixels - Heigth of the characters in the font, in pixels.
  717. //
  718. //FontSize - Size of the font buffer being passed in, in bytes.
  719. //
  720. //Font - Start of the font buffer.
  721. //
  722. //
  723. // IOCTL_VIDEO_SET_PALETTE_REGISTERS - Takes buffer containing
  724. // VIDEO_PALETTE_DATA where Colors[]
  725. // specifies the array containing the
  726. // color values for the palette registers.
  727. //
  728. // Information used by this function is passed using the following structure:
  729. //
  730. // NOTE: This should only be used by the VGA type drivers
  731. //
  732. typedef struct _VIDEO_PALETTE_DATA {
  733. USHORT NumEntries;
  734. USHORT FirstEntry;
  735. USHORT Colors[1];
  736. } VIDEO_PALETTE_DATA, *PVIDEO_PALETTE_DATA;
  737. //
  738. //NumEntries - Number of entries in the array of color values.
  739. //
  740. //FirstEntry - Location in the device palette to which the first entry in the
  741. // list of colors should be copied to. The other entries in the color list
  742. // should be copied sequentially, from this starting point into the device's
  743. // palette.
  744. //
  745. //Colors - Array of color entries to copy into the device's color palette.
  746. //
  747. //
  748. // IOCTL_VIDEO_SET_COLOR_REGISTERS - Takes buffer containing VIDEO_CLUT.
  749. //
  750. // Information used by this function is passed using the following structure:
  751. //
  752. typedef struct _VIDEO_CLUTDATA {
  753. UCHAR Red;
  754. UCHAR Green;
  755. UCHAR Blue;
  756. UCHAR Unused;
  757. } VIDEO_CLUTDATA, *PVIDEO_CLUTDATA;
  758. //
  759. //Red - Bits to be put in the Red portion of the color registers.
  760. //
  761. //Green - Bits to be put in the Green portion of the color registers.
  762. //
  763. //Blue - Bits to be put in the Blue portion of the color registers.
  764. //
  765. typedef struct {
  766. USHORT NumEntries;
  767. USHORT FirstEntry;
  768. union {
  769. VIDEO_CLUTDATA RgbArray;
  770. ULONG RgbLong;
  771. } LookupTable[1];
  772. } VIDEO_CLUT, *PVIDEO_CLUT;
  773. //
  774. //NumEntries - Number of entries in the LookupTable of color values.
  775. //
  776. //FirstEntry - Location in the device palette to which the first entry in the
  777. // LookupTable of colors should be copied to. The other entries in the
  778. // LookupTable should be copied sequentially, from this starting point into
  779. // the device's palette.
  780. //
  781. //LookupTable - Array of color entries to copy into the device's color
  782. // registers/palette. The color entries can be accessed as a genric 32 bit
  783. // value or as Red/Green/Blue/Unused fields.
  784. //
  785. //
  786. // NOTE: Cursor vs. Pointer:
  787. // A cursor is a rectangular set of pixels which are used to indicate the
  788. // location of input coming from the keyboard.
  789. //
  790. // A pointer is the set of pixels that are used to paint the shape
  791. // associated with the mouse.
  792. //
  793. //
  794. // IOCTL_VIDEO_QUERY_CURSOR_POSITION - Returns the location of the cursor on
  795. // the screen.
  796. //
  797. // IOCTL_VIDEO_SET_CURSOR_POSITION - Is used to set the location of the
  798. // cursor on the screen.
  799. //
  800. // Information used by this function is passed using the following structure:
  801. //
  802. typedef struct _VIDEO_CURSOR_POSITION {
  803. SHORT Column;
  804. SHORT Row;
  805. } VIDEO_CURSOR_POSITION, *PVIDEO_CURSOR_POSITION;
  806. //
  807. //Column - Column on which the cursor is located from the top left, in pixels.
  808. //
  809. //Row - Row on which the cusor is located from the top left, in pixels.
  810. //
  811. //
  812. // IOCTL_VIDEO_QUERY_CURSOR_ATTR - Returns all attributes of the cursor.
  813. //
  814. // IOCTL_VIDEO_SET_CURSOR_ATTR - Is used to set the attributes of the cursor.
  815. //
  816. // Information used by this function is passed using the following structure:
  817. //
  818. //
  819. // For the VGA:
  820. // TopScanLine will be stored in the height when an IOCTL is made
  821. // BottomScanLine will be stored in the width when an IOCTL is made
  822. //
  823. typedef struct _VIDEO_CURSOR_ATTRIBUTES {
  824. USHORT Width;
  825. USHORT Height;
  826. SHORT Column;
  827. SHORT Row;
  828. UCHAR Rate;
  829. UCHAR Enable;
  830. } VIDEO_CURSOR_ATTRIBUTES, *PVIDEO_CURSOR_ATTRIBUTES;
  831. //
  832. //Width - Width of the cursor, in pixels.
  833. //
  834. //Height - Height of the cursor, in scans.
  835. //
  836. //Column - Column on which the cursor is located from the top left, in pixels.
  837. //
  838. //Row - Row on which the cusor is located from the top left, in pixels.
  839. //
  840. //Rate - Rate at which the cursor whould flash.
  841. //
  842. //Enable - Non-zero to display cursor, 0 not to display.
  843. //
  844. //
  845. // IOCTL_VIDEO_QUERY_POINTER_POSITION - Returns the location of the pointer
  846. // on the screen
  847. //
  848. // IOCTL_VIDEO_SET_POINTER_POSITION - Is used to set the location of the
  849. // pointer on the screen.
  850. //
  851. // Information used by this function is passed using the following structure:
  852. //
  853. typedef struct _VIDEO_POINTER_POSITION {
  854. SHORT Column;
  855. SHORT Row;
  856. } VIDEO_POINTER_POSITION, *PVIDEO_POINTER_POSITION;
  857. //
  858. //Column - Column on which the cursor is located from the top left, in pixels.
  859. //
  860. //Row - Row on which the cusor is located from the top left, in pixels.
  861. //
  862. //
  863. // IOCTL_VIDEO_QUERY_POINTER_ATTR - Returns all attributes of the pointer.
  864. //
  865. // IOCTL_VIDEO_SET_POINTER_ATTR - Is used to set the attributes of the
  866. // pointer.
  867. //
  868. // Information used by this function is passed using the following structure:
  869. //
  870. typedef struct _VIDEO_POINTER_ATTRIBUTES {
  871. ULONG Flags;
  872. ULONG Width;
  873. ULONG Height;
  874. ULONG WidthInBytes;
  875. ULONG Enable;
  876. SHORT Column;
  877. SHORT Row;
  878. UCHAR Pixels[1];
  879. } VIDEO_POINTER_ATTRIBUTES, *PVIDEO_POINTER_ATTRIBUTES;
  880. //
  881. //Flags - color or mono pointer, same as for query pointer capabilities.
  882. //
  883. //Width - Width of the pointer, in pixels.
  884. //
  885. //Height - Height of the pointer, in scans.
  886. //
  887. //WidthInBytes - Width of the pointer, in bytes.
  888. //
  889. //Enable - Non-zero to display pointer, 0 not to display.
  890. //
  891. //Column - Column on which the cursor is located from the top left, in pixels.
  892. //
  893. //Row - Row on which the cusor is located from the top left, in pixels.
  894. //
  895. //Pixels - Start of pointer data, in device-compatible DIB format.
  896. // (Mask data is always in 1-bpp DIB format.)
  897. //
  898. //
  899. // IOCTL_VIDEO_QUERY_POINTER_CAPABILITIES - Returns capabilities of miniport
  900. // hardware cursor
  901. //
  902. typedef struct _VIDEO_POINTER_CAPABILITIES {
  903. ULONG Flags;
  904. ULONG MaxWidth;
  905. ULONG MaxHeight;
  906. ULONG HWPtrBitmapStart;
  907. ULONG HWPtrBitmapEnd;
  908. } VIDEO_POINTER_CAPABILITIES, *PVIDEO_POINTER_CAPABILITIES;
  909. //
  910. // Flag bit definitions
  911. //
  912. #define VIDEO_MODE_ASYNC_POINTER 0x01 // 1 if the cursor can be updated
  913. // asynchronously to drawing operations.
  914. #define VIDEO_MODE_MONO_POINTER 0x02 // 1 if a monochrome hardware pointer
  915. // is supported.
  916. #define VIDEO_MODE_COLOR_POINTER 0x04 // 1 if a color hardware pointer is
  917. // supported.
  918. #define VIDEO_MODE_ANIMATE_START 0x08 // The pointer being passed down has
  919. #define VIDEO_MODE_ANIMATE_UPDATE 0x10 // the same hotspot as the previous
  920. // pointer
  921. //
  922. //MaxWidth - Widest pointer bitmap the miniport should be requested to load
  923. // for either monochrome or color pointer.
  924. //
  925. //MaxHeight - widest pointer bitmap the miniport should be requested to load
  926. // for either monochrome color pointer handled.
  927. //
  928. //HWPtrBitmapStart = first offset in bitmap of memory used to store hardware
  929. // pointer bitmap, in CPU-addressable units (-1 if not applicable). For
  930. // planar modes (like VGA mode 12h), this is a planar offset; for linear
  931. // modes (like VGA mode 13h), this is a linear offset. The CPU-addressable
  932. // translation in HC planar mode is assumed to be linearaddress/4,
  933. // because there are four planes at each address.
  934. //
  935. //HWPtrBitmapEnd = last offset in bitmap of memory used to store hardware
  936. // pointer bitmap (-1 if not applicable).
  937. //
  938. // Note: Miniport has options to reject any call to set a pointer.
  939. //
  940. //
  941. // IOCTL_VIDEO_GET_BANK_SELECT_CODE - Called by the Windows display driver
  942. // to get a block of executable code used
  943. // to perform bank-switching in high
  944. // resolution SVGA drivers.
  945. //
  946. // Gets information needed to implement banking control for a selected mode.
  947. //
  948. // Information used by this function is passed using the following structures:
  949. //
  950. //
  951. // The input from the caller in the input buffer is a VIDEO_MODE structure, as
  952. // described under IOCTL_VIDEO_SET_CURRENT_MODE.
  953. //
  954. // RequestedMode - mode index for which banking information is desired.
  955. //
  956. //
  957. // Returned in output buffer.
  958. //
  959. typedef struct _VIDEO_BANK_SELECT {
  960. ULONG Length;
  961. ULONG Size;
  962. ULONG BankingFlags;
  963. ULONG BankingType;
  964. ULONG PlanarHCBankingType;
  965. ULONG BitmapWidthInBytes;
  966. ULONG BitmapSize;
  967. ULONG Granularity;
  968. ULONG PlanarHCGranularity;
  969. ULONG CodeOffset;
  970. ULONG PlanarHCBankCodeOffset;
  971. ULONG PlanarHCEnableCodeOffset;
  972. ULONG PlanarHCDisableCodeOffset;
  973. } VIDEO_BANK_SELECT, *PVIDEO_BANK_SELECT;
  974. //
  975. // Stored in the BankType and PlanarHCBankintType fields
  976. //
  977. typedef enum _VIDEO_BANK_TYPE {
  978. VideoNotBanked = 0,
  979. VideoBanked1RW,
  980. VideoBanked1R1W,
  981. VideoBanked2RW,
  982. NumVideoBankTypes
  983. } VIDEO_BANK_TYPE, *PVIDEO_BANK_TYPE;
  984. //
  985. // Defines for BankingFlags.
  986. //
  987. #define PLANAR_HC 0x00000001
  988. //
  989. //Note: planar high-color ("planar HC") mode is a special 8-bpp-and-up
  990. // CPU addressing mode in which four bytes can be accessed at
  991. // once by using the VGA's planar hardware. This mode is enabled
  992. // by turning off the Chain4 bit (bit 3 in Sequence Controller
  993. // register 4), so it is also known as non-Chain4 mode. Planar HC
  994. // mode can greatly accelerate operations such as solid fills,
  995. // some pattern fills, and some blits.
  996. //
  997. //Note: the term "CPU-addressable bytes" means offsets measured
  998. // in bytes as accessed by the CPU. In 16-color modes, this
  999. // merely means "measured in bytes" rather than "measured in
  1000. // pixels," where each byte contains 8 pixels, as usual.
  1001. // In normal high-color modes, "CPU-addressable bytes"
  1002. // is exactly what you'd expect; it's the number of pixels in 256
  1003. // color modes, pixels*2 in 16-bpp modes, and so on. However, in
  1004. // planar HC modes, there are four display memory bytes at every CPU-
  1005. // addressable byte, because four planes are at each address, so
  1006. // in 256 color modes the number of CPU-addressable bytes is
  1007. // pixels/4, in 16-bpp modes CPU-addressable bytes = pixels/2, and
  1008. // so on. Basically, "CPU-addressable bytes" just means the
  1009. // offsets the CPU needs to address banks properly in the
  1010. // specified mode.
  1011. //
  1012. //Note: the start address must be set to 0 (displayed pixels must
  1013. // start at offset 0 in display memory), and the banking windows
  1014. // must fit within the 64K area starting at A000:0; no 128K
  1015. // mappings, please, because there may be a monochrome adapter
  1016. // in the system.
  1017. //
  1018. //Length - Length of the basic structure. Used for versioning by checking the
  1019. // Length of the struct is at least as large as the value given by sizeof().
  1020. //
  1021. //Size - number of bytes required to hold all banking information for
  1022. // this mode, including the VIDEO_BANK_SELECT structure and all
  1023. // bank-switch code. This is the size of the buffer that
  1024. // VgaGetBankSelectCode requires in order properly to return info.
  1025. //
  1026. //BankingFlags - indicate the type of banking supported in this mode.
  1027. // PLANAR_HC - if set, indicates that planar high-color (HC) mode
  1028. // (non-Chain4 8-, 15-, 16-, 24-, and 32-bpp) is supported.
  1029. // If this bit is set, the following fields must be filled in:
  1030. // PlanarHCGranularity, pPlanarHCBankCode,
  1031. // pPlanarHCEnableCode, pPlanarHCDisableCode.
  1032. // This bit is ignored by the 16-color driver, as are the
  1033. // associated fields.
  1034. //
  1035. //BankingType - These are the banking types supported by the adapter
  1036. // when it is ina standard mode.
  1037. //
  1038. // VideoNotBanked - this mode does not support or require banking.
  1039. // VideoBanked1RW - this mode supports a single RW (readable and
  1040. // writable) banking window. The window is assumed to be
  1041. // 64K in size.
  1042. // VideoBanked1R1W - this mode supports a single window, but the
  1043. // window can be mapped to different areas of display memory
  1044. // for reads and for writes. The window is assumed to be
  1045. // 64K in size.
  1046. // VideoBanked2RW - this mode supports two independently mappable
  1047. // banking windows, each RW. Each window is assumed to be
  1048. // 32K in size. The second window is assumed
  1049. // to start immediately after the end of the first, at
  1050. // A000:8000.
  1051. //
  1052. //PlanarHCBankingType - These are the banking types supported by the
  1053. // adapter when it is in a PLANAR HC mode.
  1054. //
  1055. // See BankingType for defintions of each banking type.
  1056. //
  1057. //
  1058. //BitmapWidthInBytes - distance from start of one scan line to start
  1059. // of next, counted in CPU-addressable bytes (not pixels). The
  1060. // CPU-addressable distance from one scan line to the next is
  1061. // assumed to be BitmapWidthInBytes/4 in planar HC modes, because
  1062. // there are four planes at each address.
  1063. //
  1064. //BitmapSize - size of display memory in CPU-addressable bytes (for
  1065. // example, 256K on a 1 Mb SVGA in 16-color mode, because there
  1066. // are four bytes at each address). The CPU-addressable bitmap
  1067. // size is assumed to be BitmapSize/4 in planar HC modes, because
  1068. // there are four planes at each address.
  1069. //
  1070. //Granularity - granularity with which display memory may be mapped
  1071. // into a banking window. (That is, resolution with which the
  1072. // display memory address mapped to the start of a window may be
  1073. // set; anywhere from 1K to 64K, depending on the adapter. If
  1074. // Granularity < window size (either 64K or 32K), then adjacent
  1075. // banks can overlap, and broken rasters can always be avoided.
  1076. // If Granularity == window size, then banks are disjoint, and
  1077. // display memory is basically segmented into banks.) Granularity
  1078. // is measured in CPU-addressable bytes.
  1079. //
  1080. //PlanarHCGranularity - granularity with which display memory may be
  1081. // mapped into a banking window in planar HC mode.
  1082. // PlanarHCGranularity is measured in CPU-addressable bytes, and
  1083. // is typically but not always Granularity/4. Ignored in
  1084. // 16-color modes.
  1085. //
  1086. //CodeOffset - base of the code section in the structure.
  1087. //
  1088. //PlanarHCBankCodeOffset - offset from Code of executable code
  1089. // that performs planar HC mode bank switching. Ignored in
  1090. // 16-color modes.
  1091. //
  1092. //PlanarHCEnableCodeOffset - offset from Code of executable code
  1093. // that enables planar HC mode. Ignored in 16-color modes.
  1094. //
  1095. //PlanarHCDisableCodeOffset - offset from Code of executable code
  1096. // that disables planar HC mode. Ignored in 16-color modes.
  1097. //
  1098. //Specification for bank switch code at Code:
  1099. // Executes requested bank mappings.
  1100. //
  1101. // Input:
  1102. // EAX = bank number to which to map window #0
  1103. // EDX = bank number to which to map window #1
  1104. // interpreted according to BankingType as follows:
  1105. // VideoBanked1RW - the single window is mapped to bank EAX,
  1106. // EBX is ignored.
  1107. // VideoBanked1RW - the read window is mapped to bank EAX,
  1108. // the write window is mapped to bank EBX
  1109. // VideoBanked1R1W - the window at A000:0 is mapped to bank EAX,
  1110. // the window at A800:0 is mapped to bank EBX
  1111. //
  1112. // Output: none
  1113. //
  1114. // Note: the definition of "bank n" is the bank that starts at
  1115. // display memory offset Granularity*n. In other words,
  1116. // banks are assumed to start every Granularity CPU-addressable
  1117. // bytes, and are numbered from 0 to number of banks-1.
  1118. //
  1119. //Specification for planar HC executable code:
  1120. // ***To be filled in when we get to planar HC modes***
  1121. //
  1122. //
  1123. // IOCTL_VIDEO_MAP_VIDEO_MEMORY - Maps the frame buffer into the callers
  1124. // address space.
  1125. // IOCTL_VIDEO_UNMAP_VIDEO_MEMORY - Unmaps the frame buffer from the callers
  1126. // address space.
  1127. //
  1128. // Information used by this function is passed using the following structure:
  1129. //
  1130. typedef struct _VIDEO_MEMORY {
  1131. PVOID RequestedVirtualAddress;
  1132. } VIDEO_MEMORY, *PVIDEO_MEMORY;
  1133. //
  1134. //RequestedVirtualAddress - For MAP: Requested virtual address for the video
  1135. // memory. This value is optional. If zero is specified, the operating
  1136. // system will choose an appropriate location. For UNMAP: Virtual Address
  1137. // of the base of video memory. The size is implicit since it can not
  1138. // change (you can not add video memory dynamically!).
  1139. //
  1140. // IOCTL_VIDEO_SHARE_VIDEO_MEMORY - Maps the frame buffer to another process'
  1141. // address space. This IOCTL is initally
  1142. // defined to support DCI.
  1143. // IOCTL_VIDEO_UNSHARE_VIDEO_MEMORY - Unmaps a previously shared buffer.
  1144. //
  1145. // Note: for the MAP_VIDEO_MEMORY_IOCTL, the process handle is passed in
  1146. // the VirtualAddress filed, while for this IOCTL the handle is explicit.
  1147. //
  1148. typedef struct _VIDEO_SHARE_MEMORY {
  1149. HANDLE ProcessHandle;
  1150. ULONG ViewOffset;
  1151. ULONG ViewSize;
  1152. PVOID RequestedVirtualAddress;
  1153. } VIDEO_SHARE_MEMORY, *PVIDEO_SHARE_MEMORY;
  1154. typedef struct _VIDEO_SHARE_MEMORY_INFORMATION {
  1155. ULONG SharedViewOffset;
  1156. ULONG SharedViewSize;
  1157. PVOID VirtualAddress;
  1158. } VIDEO_SHARE_MEMORY_INFORMATION, *PVIDEO_SHARE_MEMORY_INFORMATION;
  1159. //
  1160. // IOCTL_VIDEO_MAP_VIDEO_MEMORY - Returns the virtual address and size of
  1161. // the frame buffer and video memory in the
  1162. // caller's address space.
  1163. // This IOCTL must be called after a call
  1164. // to the MAP IOCTL has been made.
  1165. //
  1166. typedef struct _VIDEO_MEMORY_INFORMATION {
  1167. PVOID VideoRamBase;
  1168. ULONG VideoRamLength;
  1169. PVOID FrameBufferBase;
  1170. ULONG FrameBufferLength;
  1171. } VIDEO_MEMORY_INFORMATION, *PVIDEO_MEMORY_INFORMATION;
  1172. //
  1173. //VideoRamBase - Virtual address of the Video RAM in the callers address space
  1174. // (only valid if the memory is mapped.
  1175. //
  1176. //VideoRamLength - Linear length of the Video RAM in the caller's virtual
  1177. // address space (memory accessible through a bank switch mechanism is not
  1178. // described by this value).
  1179. // This value must be equal to VideoMemoryBitmapHeight * ScreenStride
  1180. //
  1181. //FrameBufferBase - Virtual address of the Frame Buffer in the caller's
  1182. // address space. The Frame buffer is the actively displayed part of Video
  1183. // Ram.
  1184. //
  1185. //FrameBufferLength - Linear length of the Frame Buffer in the caller's
  1186. // virtual address space (memory accessible through a bank switch mechanism
  1187. // is not described by this value).
  1188. // This value must be equal to VisScreenWidth * ScreenStride
  1189. //
  1190. //
  1191. // IOCTL_VIDEO_QUERY_PUBLIC_ACCESS_RANGES - Returns the access range used to
  1192. // program the hardware directly.
  1193. // An array of these is returned if
  1194. // multiple ranges exist.
  1195. //
  1196. // IOCTL_VIDEO_FREE_PUBLIC_ACCESS_RANGES - Frees up the access ranges that were
  1197. // allocated by the QUERY_ACCESS_RANGES
  1198. // call.
  1199. //
  1200. // Information used by this function is passed using the following structure:
  1201. //
  1202. typedef struct _VIDEO_PUBLIC_ACCESS_RANGES {
  1203. ULONG InIoSpace;
  1204. ULONG MappedInIoSpace;
  1205. PVOID VirtualAddress;
  1206. } VIDEO_PUBLIC_ACCESS_RANGES, *PVIDEO_PUBLIC_ACCESS_RANGES;
  1207. //
  1208. //InIoSpace - Indicates if the hardware registers or ports are in IO space
  1209. // or in memory space.
  1210. //
  1211. //MappedInIoSpace - Indicates if under the current platform the registers or
  1212. // ports are mapped in IO Space or memory space.
  1213. //
  1214. //VirtualAddress - Location of the registers or IO ports as mapped under the
  1215. // current architecture.
  1216. //
  1217. //
  1218. // IOCTL_VIDEO_QUERY_COLOR_CAPABILITIES - Returns the color information
  1219. // found in the monitors VDDPs
  1220. // description file.
  1221. //
  1222. // NOTE: This structure must be filled out completely. A subset of the
  1223. // values can not be returned.
  1224. //
  1225. typedef struct _VIDEO_COLOR_CAPABILITIES {
  1226. ULONG Length;
  1227. ULONG AttributeFlags;
  1228. LONG RedPhosphoreDecay;
  1229. LONG GreenPhosphoreDecay;
  1230. LONG BluePhosphoreDecay;
  1231. LONG WhiteChromaticity_x;
  1232. LONG WhiteChromaticity_y;
  1233. LONG WhiteChromaticity_Y;
  1234. LONG RedChromaticity_x;
  1235. LONG RedChromaticity_y;
  1236. LONG GreenChromaticity_x;
  1237. LONG GreenChromaticity_y;
  1238. LONG BlueChromaticity_x;
  1239. LONG BlueChromaticity_y;
  1240. LONG WhiteGamma;
  1241. LONG RedGamma;
  1242. LONG GreenGamma;
  1243. LONG BlueGamma;
  1244. } VIDEO_COLOR_CAPABILITIES, *PVIDEO_COLOR_CAPABILITIES;
  1245. //
  1246. // Flag Bit definitions
  1247. //
  1248. #define VIDEO_DEVICE_COLOR 0x1 // Is this device support color (1)
  1249. // or monochrome only
  1250. #define VIDEO_OPTIONAL_GAMMET_TABLE 0x2 // Indicates that a gammet table can
  1251. // be queried/set for the device
  1252. // use other IOCTLs for that purpose.
  1253. //
  1254. //Length - Length of the basic structure. Used for versioning by checking the
  1255. // Length of the struct is at least as large as the value given by sizeof().
  1256. //
  1257. //AttributesFlag - List of falgs determining some of the properties of the
  1258. // device.
  1259. //
  1260. //See the VDDP documentation for the details on the various fields
  1261. //
  1262. //RedPhosphoreDecay
  1263. //GreenPhosphoreDecay
  1264. //BluePhosphoreDecay -
  1265. //
  1266. //WhiteChromaticity_x
  1267. //WhiteChromaticity_y
  1268. //WhiteChromaticity_Y -
  1269. //
  1270. //RedChromaticity_x
  1271. //RedChromaticity_y
  1272. //GreenChromaticity_x
  1273. //GreenChromaticity_y
  1274. //BlueChromaticity_x
  1275. //BlueChromaticity_y -
  1276. //
  1277. //WhiteGamma -
  1278. //
  1279. //RedGamma
  1280. //GreenGamma
  1281. //BlueGamma -
  1282. //
  1283. //All values returned in this structure are integers.
  1284. //The values returned must be floating point values * 10,000; i.e:
  1285. //a gamma of 2.34 would be returned as 23400.
  1286. //
  1287. //
  1288. // IOCTL_VIDEO_SET_POWER_MANAGEMENT - Tells the device to change the power
  1289. // consumption level of the device to the
  1290. // new state.
  1291. // IOCTL_VIDEO_GET_POWER_MANAGEMENT - Return the current power consumption
  1292. // level of the device.
  1293. //
  1294. // Private IOCTLs intercepted by the video port:
  1295. //
  1296. // IOCTL_VIDEO_SET_OUTPUT_DEVICE_POWER_STATE - Sets the power state on the
  1297. // output device
  1298. //
  1299. // IOCTL_VIDEO_GET_OUTPUT_DEVICE_POWER_STATE - Returns if it is possible to set
  1300. // this partcular power state on the
  1301. // output device (monitor, TV).
  1302. //
  1303. // NOTE:
  1304. // This IOCTL is based on the VESA DPMS proposal.
  1305. // Changes to the DPMS standard will be refelcted in this IOCTL.
  1306. //
  1307. typedef enum _VIDEO_POWER_STATE {
  1308. VideoPowerUnspecified = 0,
  1309. VideoPowerOn = 1,
  1310. VideoPowerStandBy,
  1311. VideoPowerSuspend,
  1312. VideoPowerOff,
  1313. VideoPowerHibernate,
  1314. VideoPowerShutdown,
  1315. VideoPowerMaximum
  1316. } VIDEO_POWER_STATE, *PVIDEO_POWER_STATE;
  1317. typedef struct _VIDEO_POWER_MANAGEMENT {
  1318. ULONG Length;
  1319. ULONG DPMSVersion;
  1320. ULONG PowerState;
  1321. } VIDEO_POWER_MANAGEMENT, *PVIDEO_POWER_MANAGEMENT;
  1322. //
  1323. //Length - Length of the structure in bytes. Also used to do verisioning.
  1324. //
  1325. //DPMSVersion - Version of the DPMS standard supported by the device.
  1326. // Only used in the "GET" IOCTL.
  1327. //
  1328. //PowerState - One of the power states listed in VIDEO_POWER_STATE.
  1329. //
  1330. //
  1331. // Note:
  1332. // Once the power has been turned off to the device, all other IOCTLs made
  1333. // to the miniport will be intercepted by the port driver and will return
  1334. // failiure, until the power on the device has been turned back on.
  1335. //
  1336. //
  1337. // IOCTL_VIDEO_SET_COLOR_LUT_DATA - Confugure color look up table on video adaptor.
  1338. //
  1339. typedef struct _VIDEO_COLOR_LUT_DATA {
  1340. ULONG Length;
  1341. ULONG LutDataFormat;
  1342. UCHAR LutData[1];
  1343. } VIDEO_COLOR_LUT_DATA, *PVIDEO_COLOR_LUT_DATA;
  1344. //
  1345. // Length - Length of the structure in bytes.
  1346. //
  1347. // LutDataFormat values - indicate data format in ColorLutTable.
  1348. //
  1349. // LutDataTable - color lut table data.
  1350. //
  1351. #define VIDEO_COLOR_LUT_DATA_FORMAT_RGB256WORDS 0x00000001
  1352. typedef struct _VIDEO_LUT_RGB256WORDS {
  1353. USHORT Red[256];
  1354. USHORT Green[256];
  1355. USHORT Blue[256];
  1356. } VIDEO_LUT_RGB256WORDS, *PVIDEO_LUT_RGB256WORDS;
  1357. #define VIDEO_COLOR_LUT_DATA_FORMAT_PRIVATEFORMAT 0x80000000
  1358. //
  1359. // VIDEO_COLOR_LUT_DATA_FORMAT_RGB256WORDS -
  1360. // Lut data has 3 array of 256 WORDs. 1st 256 WORDs array for Red, next
  1361. // for Blue, then Green. And its value have to be packed in the most
  1362. // significant bits of the WORDs (0 to 0xFF00 for 8 bit). This allows
  1363. // for 8, 12 and 16 bit RAMDAC independance. Thus Driver can shifts them
  1364. // right by 8, 4 or 0 places for 8, 12 and 16 bits RAMDAC.
  1365. //
  1366. // VIDEO_COLOR_LUT_DATA_FORMAT_PRIVATEFORMAT -
  1367. // Driver defined format. This value should be OR-ed with other driver
  1368. // internal identify index in 0 - 30 bits. Callee should know the detail
  1369. // format.
  1370. //
  1371. //
  1372. // BANK_POSITION
  1373. //
  1374. typedef struct _BANK_POSITION
  1375. {
  1376. ULONG ReadBankPosition;
  1377. ULONG WriteBankPosition;
  1378. } BANK_POSITION, *PBANK_POSITION;
  1379. //
  1380. // IOCTL_VIDEO_QUERY_SUPPORTED_BRIGHTNESS - Queries via _BCL the available backlight
  1381. // levels.
  1382. // IOCTL_VIDEO_QUERY_DISPLAY_BRIGHTNESS - Queries the current AC/DC backlight levels
  1383. // and indicates the current power state per
  1384. // ucDisplayPolicy.
  1385. // IOCTL_VIDEO_SET_DISPLAY_BRIGHTNESS - Sets via _BCM the AC/DC brightness of the
  1386. // backlight for the power states indicated
  1387. // in ucDisplayPolicy.
  1388. //
  1389. typedef struct _DISPLAY_BRIGHTNESS {
  1390. UCHAR ucDisplayPolicy;
  1391. UCHAR ucACBrightness;
  1392. UCHAR ucDCBrightness;
  1393. } DISPLAY_BRIGHTNESS, *PDISPLAY_BRIGHTNESS;
  1394. #define DISPLAYPOLICY_AC 0x00000001
  1395. #define DISPLAYPOLICY_DC 0x00000002
  1396. #define DISPLAYPOLICY_BOTH (DISPLAYPOLICY_AC | DISPLAYPOLICY_DC)
  1397. //+----------------------------------------------------------------------------
  1398. //
  1399. // Far East fullscreen support
  1400. //
  1401. //-----------------------------------------------------------------------------
  1402. #ifndef _WINCON_
  1403. typedef struct _COORD {
  1404. SHORT X;
  1405. SHORT Y;
  1406. } COORD, *PCOORD;
  1407. typedef struct _CHAR_INFO {
  1408. union {
  1409. WCHAR UnicodeChar;
  1410. CHAR AsciiChar;
  1411. } Char;
  1412. USHORT Attributes;
  1413. } CHAR_INFO, *PCHAR_INFO;
  1414. //
  1415. // Attributes flags:
  1416. //
  1417. #define FOREGROUND_BLUE 0x0001 // text color contains blue.
  1418. #define FOREGROUND_GREEN 0x0002 // text color contains green.
  1419. #define FOREGROUND_RED 0x0004 // text color contains red.
  1420. #define FOREGROUND_INTENSITY 0x0008 // text color is intensified.
  1421. #define BACKGROUND_BLUE 0x0010 // background color contains blue.
  1422. #define BACKGROUND_GREEN 0x0020 // background color contains green.
  1423. #define BACKGROUND_RED 0x0040 // background color contains red.
  1424. #define BACKGROUND_INTENSITY 0x0080 // background color is intensified.
  1425. #define COMMON_LVB_LEADING_BYTE 0x0100 // Leading Byte of DBCS
  1426. #define COMMON_LVB_TRAILING_BYTE 0x0200 // Trailing Byte of DBCS
  1427. #define COMMON_LVB_GRID_HORIZONTAL 0x0400 // DBCS: Grid attribute: top horizontal.
  1428. #define COMMON_LVB_GRID_LVERTICAL 0x0800 // DBCS: Grid attribute: left vertical.
  1429. #define COMMON_LVB_GRID_RVERTICAL 0x1000 // DBCS: Grid attribute: right vertical.
  1430. #define COMMON_LVB_REVERSE_VIDEO 0x4000 // DBCS: Reverse fore/back ground attribute.
  1431. #define COMMON_LVB_UNDERSCORE 0x8000 // DBCS: Underscore.
  1432. #define COMMON_LVB_SBCSDBCS 0x0300 // SBCS or DBCS flag.
  1433. //
  1434. // Share of conapi.h
  1435. //
  1436. #define CHAR_TYPE_SBCS 0 // Displayed SBCS character
  1437. #define CHAR_TYPE_LEADING 2 // Displayed leading byte of DBCS
  1438. #define CHAR_TYPE_TRAILING 3 // Displayed trailing byte of DBCS
  1439. //
  1440. // Share of foncache.h
  1441. //
  1442. #define BITMAP_BITS_BYTE_ALIGN 8 // BYTE align is 8 bit
  1443. #define BITMAP_BITS_WORD_ALIGN 16 // WORD align is 16 bit
  1444. #define BITMAP_ARRAY_BYTE 3 // BYTE array is 8 bit (shift count = 3)
  1445. #define BITMAP_PLANES 1
  1446. #define BITMAP_BITS_PIXEL 1
  1447. #define BYTE_ALIGN sizeof(UCHAR)
  1448. #define WORD_ALIGN sizeof(USHORT)
  1449. #endif // _WINCON_
  1450. typedef struct _FSCNTL_SCREEN_INFO {
  1451. COORD Position;
  1452. COORD ScreenSize;
  1453. ULONG nNumberOfChars;
  1454. } FSCNTL_SCREEN_INFO, *PFSCNTL_SCREEN_INFO;
  1455. typedef struct _FONT_IMAGE_INFO {
  1456. COORD FontSize;
  1457. PUCHAR ImageBits; // WORD aligned.
  1458. } FONT_IMAGE_INFO, *PFONT_IMAGE_INFO;
  1459. typedef struct _CHAR_IMAGE_INFO {
  1460. CHAR_INFO CharInfo;
  1461. FONT_IMAGE_INFO FontImageInfo;
  1462. } CHAR_IMAGE_INFO, *PCHAR_IMAGE_INFO;
  1463. //
  1464. // Share of consrv.h
  1465. //
  1466. #define SCREEN_BUFFER_POINTER(X,Y,XSIZE,CELLSIZE) (((XSIZE * (Y)) + (X)) * (ULONG)CELLSIZE)
  1467. typedef struct _VGA_CHAR {
  1468. CHAR Char;
  1469. CHAR Attributes;
  1470. } VGA_CHAR, *PVGA_CHAR;
  1471. //
  1472. // Define the Full Screen Video device name strings.
  1473. //
  1474. #define DD_FULLSCREEN_VIDEO_DEVICE_NAME L"\\Device\\FSVideo"
  1475. //
  1476. // IOCTL_FSVIDEO_COPY_FRAME_BUFFER - Copy in the frame buffer.
  1477. //
  1478. typedef struct _FSVIDEO_COPY_FRAME_BUFFER {
  1479. FSCNTL_SCREEN_INFO SrcScreen;
  1480. FSCNTL_SCREEN_INFO DestScreen;
  1481. } FSVIDEO_COPY_FRAME_BUFFER, *PFSVIDEO_COPY_FRAME_BUFFER;
  1482. //
  1483. // IOCTL_FSVIDEO_WRITE_TO_FRAME_BUFFER - Write to the frame buffer.
  1484. //
  1485. typedef struct _FSVIDEO_WRITE_TO_FRAME_BUFFER {
  1486. PCHAR_IMAGE_INFO SrcBuffer;
  1487. FSCNTL_SCREEN_INFO DestScreen;
  1488. } FSVIDEO_WRITE_TO_FRAME_BUFFER, *PFSVIDEO_WRITE_TO_FRAME_BUFFER;
  1489. //
  1490. // IOCTL_FSVIDEO_REVERSE_MOUSE_POINTER - Reverse to the frame buffer for mouse pointer.
  1491. //
  1492. // dwType as follows:
  1493. // CHAR_TYPE_SBCS 0 // Displayed SBCS character
  1494. // CHAR_TYPE_LEADING 2 // Displayed leading byte of DBCS
  1495. // CHAR_TYPE_TRAILING 3 // Displayed trailing byte of DBCS
  1496. //
  1497. typedef struct _FSVIDEO_REVERSE_MOUSE_POINTER {
  1498. FSCNTL_SCREEN_INFO Screen;
  1499. ULONG dwType;
  1500. } FSVIDEO_REVERSE_MOUSE_POINTER, *PFSVIDEO_REVERSE_MOUSE_POINTER;
  1501. //
  1502. // IOCTL_FSVIDEO_SET_CURRENT_MODE - Set the information for the current
  1503. // video mode.
  1504. //
  1505. // Information used by this function is passed using the following structure:
  1506. //
  1507. typedef struct _FSVIDEO_MODE_INFORMATION {
  1508. VIDEO_MODE_INFORMATION VideoMode;
  1509. VIDEO_MEMORY_INFORMATION VideoMemory;
  1510. } FSVIDEO_MODE_INFORMATION, *PFSVIDEO_MODE_INFORMATION;
  1511. //
  1512. // IOCTL_FSVIDEO_SET_SCREEN_INFORMATION - Set the information for current console screen
  1513. //
  1514. typedef struct _FSVIDEO_SCREEN_INFORMATION {
  1515. COORD ScreenSize;
  1516. COORD FontSize;
  1517. } FSVIDEO_SCREEN_INFORMATION, *PFSVIDEO_SCREEN_INFORMATION;
  1518. //
  1519. // IOCTL_FSVIDEO_SET_CURSOR_POSITION - Set the information for cursor position
  1520. //
  1521. // dwType as follows:
  1522. // CHAR_TYPE_SBCS 0 // Displayed SBCS character
  1523. // CHAR_TYPE_LEADING 2 // Displayed leading byte of DBCS
  1524. // CHAR_TYPE_TRAILING 3 // Displayed trailing byte of DBCS
  1525. //
  1526. typedef struct _FSVIDEO_CURSOR_POSITION {
  1527. VIDEO_CURSOR_POSITION Coord;
  1528. ULONG dwType;
  1529. } FSVIDEO_CURSOR_POSITION, *PFSVIDEO_CURSOR_POSITION;
  1530. #ifdef __cplusplus
  1531. }
  1532. #endif
  1533. #endif // _NTDDVDEO_