Leaked source code of windows server 2003
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.

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