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.

306 lines
7.6 KiB

  1. /*==========================================================================;
  2. *
  3. * Copyright (C) Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: ddkernel.h
  6. * Content: APIs for accessing kernel mode support.
  7. *@@BEGIN_MSINTERNAL
  8. * History:
  9. * Date By Reason
  10. * ==== == ======
  11. * 09-jan-97 scottm initial implementation
  12. *@@END_MSINTERNAL
  13. *
  14. ***************************************************************************/
  15. #ifndef __DDKM_INCLUDED__
  16. #define __DDKM_INCLUDED__
  17. #if defined( _WIN32 ) && !defined( _NO_COM )
  18. #define COM_NO_WINDOWS_H
  19. #include <objbase.h>
  20. #else
  21. #define IUnknown void
  22. #undef CO_E_NOTINITIALIZED
  23. #define CO_E_NOTINITIALIZED 0x800401F0L
  24. #endif
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. /*
  29. * GUIDS used by to get kernel interfaces
  30. */
  31. #if defined( _WIN32 ) && !defined( _NO_COM )
  32. DEFINE_GUID( IID_IDirectDrawKernel, 0x8D56C120,0x6A08,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 );
  33. DEFINE_GUID( IID_IDirectDrawSurfaceKernel, 0x60755DA0,0x6A40,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 );
  34. #endif
  35. /*============================================================================
  36. *
  37. * DirectDraw Structures
  38. *
  39. * Various structures used to invoke the kernel API functions.
  40. *
  41. *==========================================================================*/
  42. typedef struct IDirectDrawKernel FAR *LPDIRECTDRAWKERNEL;
  43. typedef struct IDirectDrawSurfaceKernel FAR *LPDIRECTDRAWSURFACEKERNEL;
  44. typedef struct _DDKERNELCAPS FAR *LPDDKERNELCAPS;
  45. /*
  46. * INTERACES FOLLOW:
  47. * IDirectDrawKernel
  48. * IVideoPort
  49. */
  50. /*
  51. * IDirectDrawKernel
  52. */
  53. #if defined( _WIN32 ) && !defined( _NO_COM )
  54. #undef INTERFACE
  55. #define INTERFACE IDirectDrawKernel
  56. DECLARE_INTERFACE_( IDirectDrawKernel, IUnknown )
  57. {
  58. /*** IUnknown methods ***/
  59. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  60. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  61. STDMETHOD_(ULONG,Release) (THIS) PURE;
  62. /*** IDirectDraw methods ***/
  63. STDMETHOD(GetCaps)(THIS_ LPDDKERNELCAPS) PURE;
  64. STDMETHOD(GetKernelHandle)(THIS_ PULONG_PTR) PURE;
  65. STDMETHOD(ReleaseKernelHandle)(THIS) PURE;
  66. };
  67. #if !defined(__cplusplus) || defined(CINTERFACE)
  68. #define IDirectDrawKernel_GetCaps(p, a) (p)->lpVtbl->GetCaps(p, a)
  69. #define IDirectDrawKernel_GetKernelHandle(p, a) (p)->lpVtbl->GetKernelHandle(p, a)
  70. #define IDirectDrawKernel_ReleaseKernelHandle(p) (p)->lpVtbl->ReleaseKernelHandle(p)
  71. #endif
  72. #endif
  73. /*
  74. * IDirectDrawSurfaceKernel
  75. */
  76. #if defined( _WIN32 ) && !defined( _NO_COM )
  77. #undef INTERFACE
  78. #define INTERFACE IDirectDrawSurfaceKernel
  79. DECLARE_INTERFACE_( IDirectDrawSurfaceKernel, IUnknown )
  80. {
  81. /*** IUnknown methods ***/
  82. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  83. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  84. STDMETHOD_(ULONG,Release) (THIS) PURE;
  85. /*** IDirectDraw methods ***/
  86. STDMETHOD(GetKernelHandle)(THIS_ PULONG_PTR) PURE;
  87. STDMETHOD(ReleaseKernelHandle)(THIS) PURE;
  88. };
  89. #if !defined(__cplusplus) || defined(CINTERFACE)
  90. #define IDirectDrawSurfaceKernel_GetKernelHandle(p, a) (p)->lpVtbl->GetKernelHandle(p, a)
  91. #define IDirectDrawSurfaceKernel_ReleaseKernelHandle(p) (p)->lpVtbl->ReleaseKernelHandle(p)
  92. #endif
  93. #endif
  94. /*
  95. * DDKERNELCAPS
  96. */
  97. typedef struct _DDKERNELCAPS
  98. {
  99. DWORD dwSize; // size of the DDKERNELCAPS structure
  100. DWORD dwCaps; // Contains the DDKERNELCAPS_XXX flags
  101. DWORD dwIRQCaps; // Contains the DDIRQ_XXX flags
  102. } DDKERNELCAPS, FAR *LPDDKERNELCAPS;
  103. /****************************************************************************
  104. *
  105. * DDKERNELCAPS CAPS
  106. *
  107. ****************************************************************************/
  108. /*
  109. * Indicates that the device supports field skipping.
  110. */
  111. #define DDKERNELCAPS_SKIPFIELDS 0x00000001l
  112. /*
  113. * Indicates that the device can support software autoflipping.
  114. */
  115. #define DDKERNELCAPS_AUTOFLIP 0x00000002l
  116. /*
  117. * Indicates that the device can switch between bob and weave.
  118. */
  119. #define DDKERNELCAPS_SETSTATE 0x00000004l
  120. /*
  121. * Indicates that a client can gain direct access to the frame buffer.
  122. */
  123. #define DDKERNELCAPS_LOCK 0x00000008l
  124. /*
  125. * Indicates that a client can manually flip the video port.
  126. */
  127. #define DDKERNELCAPS_FLIPVIDEOPORT 0x00000010l
  128. /*
  129. * Indicates that a client can manually flip the overlay.
  130. */
  131. #define DDKERNELCAPS_FLIPOVERLAY 0x00000020l
  132. /*
  133. * Indicates that the device supports a video port capture interface
  134. * capable of transfering data to system memory.
  135. */
  136. #define DDKERNELCAPS_CAPTURE_SYSMEM 0x00000040l
  137. /*
  138. * Indicates that the device supports a video port capture interface
  139. * capable of transfering data to non-local video memory.
  140. */
  141. #define DDKERNELCAPS_CAPTURE_NONLOCALVIDMEM 0x00000080l
  142. /*
  143. * Indicates that the device can report the polarity (even/odd) of
  144. * the curent video field.
  145. */
  146. #define DDKERNELCAPS_FIELDPOLARITY 0x00000100l
  147. /*
  148. * Indicates that the device supports inverting the DIBs while capturing
  149. * the data.
  150. */
  151. #define DDKERNELCAPS_CAPTURE_INVERTED 0x00000200l
  152. /****************************************************************************
  153. *
  154. * DDKERNELCAPS IRQ CAPS
  155. *
  156. ****************************************************************************/
  157. /*
  158. * The device can generate display VSYNC IRQs
  159. */
  160. #define DDIRQ_DISPLAY_VSYNC 0x00000001l
  161. /*
  162. * Reserved
  163. */
  164. #define DDIRQ_RESERVED1 0x00000002l
  165. /*
  166. * The device can generate video ports VSYNC IRQs using video port 0
  167. */
  168. #define DDIRQ_VPORT0_VSYNC 0x00000004l
  169. /*
  170. * The device can generate video ports line IRQs using video port 0
  171. */
  172. #define DDIRQ_VPORT0_LINE 0x00000008l
  173. /*
  174. * The device can generate video ports VSYNC IRQs using video port 1
  175. */
  176. #define DDIRQ_VPORT1_VSYNC 0x00000010l
  177. /*
  178. * The device can generate video ports line IRQs using video port 1
  179. */
  180. #define DDIRQ_VPORT1_LINE 0x00000020l
  181. /*
  182. * The device can generate video ports VSYNC IRQs using video port 2
  183. */
  184. #define DDIRQ_VPORT2_VSYNC 0x00000040l
  185. /*
  186. * The device can generate video ports line IRQs using video port 2
  187. */
  188. #define DDIRQ_VPORT2_LINE 0x00000080l
  189. /*
  190. * The device can generate video ports VSYNC IRQs using video port 3
  191. */
  192. #define DDIRQ_VPORT3_VSYNC 0x00000100l
  193. /*
  194. * The device can generate video ports line IRQs using video port 3
  195. */
  196. #define DDIRQ_VPORT3_LINE 0x00000200l
  197. /*
  198. * The device can generate video ports VSYNC IRQs using video port 4
  199. */
  200. #define DDIRQ_VPORT4_VSYNC 0x00000400l
  201. /*
  202. * The device can generate video ports line IRQs using video port 4
  203. */
  204. #define DDIRQ_VPORT4_LINE 0x00000800l
  205. /*
  206. * The device can generate video ports VSYNC IRQs using video port 5
  207. */
  208. #define DDIRQ_VPORT5_VSYNC 0x00001000l
  209. /*
  210. * The device can generate video ports line IRQs using video port 5
  211. */
  212. #define DDIRQ_VPORT5_LINE 0x00002000l
  213. /*
  214. * The device can generate video ports VSYNC IRQs using video port 6
  215. */
  216. #define DDIRQ_VPORT6_VSYNC 0x00004000l
  217. /*
  218. * The device can generate video ports line IRQs using video port 6
  219. */
  220. #define DDIRQ_VPORT6_LINE 0x00008000l
  221. /*
  222. * The device can generate video ports VSYNC IRQs using video port 7
  223. */
  224. #define DDIRQ_VPORT7_VSYNC 0x00010000l
  225. /*
  226. * The device can generate video ports line IRQs using video port 7
  227. */
  228. #define DDIRQ_VPORT7_LINE 0x00020000l
  229. /*
  230. * The device can generate video ports VSYNC IRQs using video port 8
  231. */
  232. #define DDIRQ_VPORT8_VSYNC 0x00040000l
  233. /*
  234. * The device can generate video ports line IRQs using video port 8
  235. */
  236. #define DDIRQ_VPORT8_LINE 0x00080000l
  237. /*
  238. * The device can generate video ports VSYNC IRQs using video port 9
  239. */
  240. #define DDIRQ_VPORT9_VSYNC 0x00010000l
  241. /*
  242. * The device can generate video ports line IRQs using video port 9
  243. */
  244. #define DDIRQ_VPORT9_LINE 0x00020000l
  245. #ifdef __cplusplus
  246. };
  247. #endif
  248. #endif