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.

307 lines
9.7 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: ddraw.c
  3. *
  4. * Client side stubs for the private DirectDraw VPE system APIs.
  5. *
  6. * Created: 2-Oct-1996
  7. * Author: Lingyun Wang [LingyunW]
  8. *
  9. * Copyright (c) 1995-1999 Microsoft Corporation
  10. \**************************************************************************/
  11. #include "precomp.h"
  12. #pragma hdrstop
  13. #include <ddrawi.h>
  14. #include <dvpp.h>
  15. /*****************************Private*Routine******************************\
  16. * CanCreateVideoPort
  17. *
  18. * History:
  19. * 2-Oct-1996 -by- Lingyun Wang [lingyunw]
  20. * Wrote it.
  21. \**************************************************************************/
  22. DWORD
  23. WINAPI
  24. DvpCanCreateVideoPort(
  25. LPDDHAL_CANCREATEVPORTDATA pCanCreateVideoPort
  26. )
  27. {
  28. return(NtGdiDvpCanCreateVideoPort((HANDLE) pCanCreateVideoPort->lpDD->lpGbl->hDD,
  29. (PDD_CANCREATEVPORTDATA)pCanCreateVideoPort));
  30. }
  31. /*****************************Private*Routine******************************\
  32. * CanCreateVideoPort
  33. *
  34. * History:
  35. * 2-Oct-1996 -by- Lingyun Wang [lingyunw]
  36. * Wrote it.
  37. \**************************************************************************/
  38. DWORD
  39. WINAPI
  40. DvpColorControl (
  41. LPDDHAL_VPORTCOLORDATA pColorControl
  42. )
  43. {
  44. return(NtGdiDvpColorControl((HANDLE) pColorControl->lpDD->lpGbl->hDD,
  45. (PDD_VPORTCOLORDATA)pColorControl));
  46. }
  47. /*****************************Private*Routine******************************\
  48. * CreateVideoPort
  49. *
  50. * History:
  51. * 2-Oct-1996 -by- Lingyun Wang [lingyunw]
  52. * Wrote it.
  53. \**************************************************************************/
  54. DWORD
  55. WINAPI
  56. DvpCreateVideoPort (
  57. LPDDHAL_CREATEVPORTDATA pCreateVideoPort
  58. )
  59. {
  60. return(NtGdiDvpCreateVideoPort((HANDLE) pCreateVideoPort->lpDD->lpGbl->hDD,
  61. (PDD_CREATEVPORTDATA)pCreateVideoPort));
  62. }
  63. /*****************************Private*Routine******************************\
  64. * DestroyVideoPort
  65. *
  66. * History:
  67. * 2-Oct-1996 -by- Lingyun Wang [lingyunw]
  68. * Wrote it.
  69. \**************************************************************************/
  70. DWORD
  71. WINAPI
  72. DvpDestroyVideoPort (
  73. LPDDHAL_DESTROYVPORTDATA pDestroyVideoPort
  74. )
  75. {
  76. return(NtGdiDvpDestroyVideoPort((HANDLE) pDestroyVideoPort->lpDD->lpGbl->hDD,
  77. (PDD_DESTROYVPORTDATA)pDestroyVideoPort));
  78. }
  79. /*****************************Private*Routine******************************\
  80. * FlipVideoPort
  81. *
  82. * History:
  83. * 2-Oct-1996 -by- Lingyun Wang [lingyunw]
  84. * Wrote it.
  85. \**************************************************************************/
  86. DWORD
  87. WINAPI
  88. DvpFlipVideoPort (
  89. LPDDHAL_FLIPVPORTDATA pFlipVideoPort
  90. )
  91. {
  92. return(NtGdiDvpFlipVideoPort((HANDLE) pFlipVideoPort->lpDD->lpGbl->hDD,
  93. (HANDLE) pFlipVideoPort->lpSurfCurr->hDDSurface,
  94. (HANDLE) pFlipVideoPort->lpSurfTarg->hDDSurface,
  95. (PDD_FLIPVPORTDATA)pFlipVideoPort));
  96. }
  97. /*****************************Private*Routine******************************\
  98. * GetCurrentAutoflipSurface
  99. *
  100. * History:
  101. * 2-Oct-1996 -by- Lingyun Wang [lingyunw]
  102. * Wrote it.
  103. \**************************************************************************/
  104. DWORD
  105. WINAPI
  106. DvpGetCurrentAutoflipSurface (
  107. LPDDHAL_GETVPORTAUTOFLIPSURFACEDATA pGetCurrentflipSurface)
  108. {
  109. return(NtGdiDvpGetCurrentAutoflipSurface((HANDLE) pGetCurrentflipSurface->lpDD->lpGbl->hDD,
  110. (PDD_GETVPORTAUTOFLIPSURFACEDATA)pGetCurrentflipSurface));
  111. }
  112. /*****************************Private*Routine******************************\
  113. * GetVideoPortBandwidthInfo
  114. *
  115. * History:
  116. * 2-Oct-1996 -by- Lingyun Wang [lingyunw]
  117. * Wrote it.
  118. \**************************************************************************/
  119. DWORD
  120. WINAPI
  121. DvpGetVideoPortBandwidthInfo (
  122. LPDDHAL_GETVPORTBANDWIDTHDATA pGetVPortBandwidthInfo)
  123. {
  124. return(NtGdiDvpGetVideoPortBandwidthInfo((HANDLE) pGetVPortBandwidthInfo->lpDD->lpGbl->hDD,
  125. (PDD_GETVPORTBANDWIDTHDATA)pGetVPortBandwidthInfo));
  126. }
  127. /*****************************Private*Routine******************************\
  128. * GetVideoPortField
  129. *
  130. * History:
  131. * 2-Oct-1996 -by- Lingyun Wang [lingyunw]
  132. * Wrote it.
  133. \**************************************************************************/
  134. DWORD
  135. WINAPI
  136. DvpGetVideoPortField (
  137. LPDDHAL_GETVPORTFIELDDATA pGetVideoPortField)
  138. {
  139. return(NtGdiDvpGetVideoPortField((HANDLE) pGetVideoPortField->lpDD->lpGbl->hDD,
  140. (PDD_GETVPORTFIELDDATA)pGetVideoPortField));
  141. }
  142. /*****************************Private*Routine******************************\
  143. * GetVideoPortFlipStatus
  144. *
  145. * History:
  146. * 2-Oct-1996 -by- Lingyun Wang [lingyunw]
  147. * Wrote it.
  148. \**************************************************************************/
  149. DWORD
  150. WINAPI
  151. DvpGetVideoPortFlipStatus (
  152. LPDDHAL_GETVPORTFLIPSTATUSDATA pGetVPortFlipStatus)
  153. {
  154. return(NtGdiDvpGetVideoPortFlipStatus((HANDLE) pGetVPortFlipStatus->lpDD->lpGbl->hDD,
  155. (PDD_GETVPORTFLIPSTATUSDATA)pGetVPortFlipStatus));
  156. }
  157. /*****************************Private*Routine******************************\
  158. * GetVideoPortInputFormats
  159. *
  160. * History:
  161. * 2-Oct-1996 -by- Lingyun Wang [lingyunw]
  162. * Wrote it.
  163. \**************************************************************************/
  164. DWORD
  165. WINAPI
  166. DvpGetVideoPortInputFormats (
  167. LPDDHAL_GETVPORTINPUTFORMATDATA pGetVPortInputFormats)
  168. {
  169. return(NtGdiDvpGetVideoPortInputFormats((HANDLE) pGetVPortInputFormats->lpDD->lpGbl->hDD,
  170. (PDD_GETVPORTINPUTFORMATDATA)pGetVPortInputFormats));
  171. }
  172. /*****************************Private*Routine******************************\
  173. * GetVideoPortLine
  174. *
  175. * History:
  176. * 2-Oct-1996 -by- Lingyun Wang [lingyunw]
  177. * Wrote it.
  178. \**************************************************************************/
  179. DWORD
  180. WINAPI
  181. DvpGetVideoPortLine (
  182. LPDDHAL_GETVPORTLINEDATA pGetVideoPortLine)
  183. {
  184. return(NtGdiDvpGetVideoPortLine((HANDLE) pGetVideoPortLine->lpDD->lpGbl->hDD,
  185. (PDD_GETVPORTLINEDATA)pGetVideoPortLine));
  186. }
  187. /*****************************Private*Routine******************************\
  188. * GetVideoPortOutputFormats
  189. *
  190. * History:
  191. * 2-Oct-1996 -by- Lingyun Wang [lingyunw]
  192. * Wrote it.
  193. \**************************************************************************/
  194. DWORD
  195. WINAPI
  196. DvpGetVideoPortOutputFormats (
  197. LPDDHAL_GETVPORTOUTPUTFORMATDATA pGetVPortOutputFormats)
  198. {
  199. return(NtGdiDvpGetVideoPortOutputFormats((HANDLE) pGetVPortOutputFormats->lpDD->lpGbl->hDD,
  200. (PDD_GETVPORTOUTPUTFORMATDATA)pGetVPortOutputFormats));
  201. }
  202. /*****************************Private*Routine******************************\
  203. * GetVideoPortConnectInfo
  204. *
  205. * History:
  206. * 2-Oct-1996 -by- Lingyun Wang [lingyunw]
  207. * Wrote it.
  208. \**************************************************************************/
  209. DWORD
  210. WINAPI
  211. DvpGetVideoPortConnectInfo (
  212. LPDDHAL_GETVPORTCONNECTDATA pGetVPortConnectInfo)
  213. {
  214. return(NtGdiDvpGetVideoPortConnectInfo((HANDLE) pGetVPortConnectInfo->lpDD->lpGbl->hDD,
  215. (PDD_GETVPORTCONNECTDATA)pGetVPortConnectInfo));
  216. }
  217. /*****************************Private*Routine******************************\
  218. * GetVideoSignalStatus
  219. *
  220. * History:
  221. * 2-Oct-1996 -by- Lingyun Wang [lingyunw]
  222. * Wrote it.
  223. \**************************************************************************/
  224. DWORD
  225. WINAPI
  226. DvpGetVideoSignalStatus (
  227. LPDDHAL_GETVPORTSIGNALDATA pGetVideoSignalStatus)
  228. {
  229. return(NtGdiDvpVideoSignalStatus((HANDLE) pGetVideoSignalStatus->lpDD->lpGbl->hDD,
  230. (PDD_GETVPORTSIGNALDATA)pGetVideoSignalStatus));
  231. }
  232. /*****************************Private*Routine******************************\
  233. * UpdateVideoPort
  234. *
  235. * History:
  236. * 2-Oct-1996 -by- Lingyun Wang [lingyunw]
  237. * Wrote it.
  238. \**************************************************************************/
  239. DWORD
  240. WINAPI
  241. DvpUpdateVideoPort (
  242. LPDDHAL_UPDATEVPORTDATA pUpdateVideoPort)
  243. {
  244. // WINBUG #82842 2-7-2000 bhouse Code cleanup in DvpUpdateVideoPort
  245. // Instead of 100, we should declare (if one does not already exist) a
  246. // constant for the maximum number of autoflip surfaces. This value should
  247. // be checked when pUpdateVideoPort->dwNumAutoflip is set. An assertion
  248. // should perhaps be made here to ensure we will not walk pass the end
  249. // of the stack based arrary.
  250. HANDLE phDDSurface[100];
  251. DWORD i;
  252. // WINBUG #82844 2-7-2000 bhouse Investigate question in old comment
  253. // Old Comment
  254. // - seems the driver only use lplpDDSurface, why lplpBBVBSurface there?
  255. for (i=0; i< pUpdateVideoPort->dwNumAutoflip; i++)
  256. {
  257. phDDSurface[i] = (HANDLE)(pUpdateVideoPort->lplpDDSurface[i]->lpLcl->hDDSurface);
  258. }
  259. return(NtGdiDvpUpdateVideoPort((HANDLE) pUpdateVideoPort->lpDD->lpGbl->hDD,
  260. (HANDLE *)phDDSurface,
  261. (PDD_UPDATEVPORTDATA)pUpdateVideoPort));
  262. }
  263. /*****************************Private*Routine******************************\
  264. * WaitForVideoPortSync
  265. *
  266. * History:
  267. * 2-Oct-1996 -by- Lingyun Wang [lingyunw]
  268. * Wrote it.
  269. \**************************************************************************/
  270. DWORD
  271. WINAPI
  272. DvpWaitForVideoPortSync (
  273. LPDDHAL_WAITFORVPORTSYNCDATA pWaitForVideoPortSync)
  274. {
  275. return(NtGdiDvpWaitForVideoPortSync((HANDLE) pWaitForVideoPortSync->lpDD->lpGbl->hDD,
  276. (PDD_WAITFORVPORTSYNCDATA)pWaitForVideoPortSync));
  277. }