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.

370 lines
9.4 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1994-1995 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: ddsblto.c
  6. * Content: DirectDraw surface object blt order suport
  7. * History:
  8. * Date By Reason
  9. * ==== == ======
  10. * 27-jan-95 craige split out of ddsurf.c
  11. * 31-jan-95 craige and even more ongoing work...
  12. * 27-feb-95 craige new sync. macros
  13. * 08-mar-95 craige new API: AddSurfaceDependency
  14. * 19-mar-95 craige use HRESULTs
  15. * 01-apr-95 craige happy fun joy updated header file
  16. * 06-may-95 craige use driver-level csects only
  17. * 16-jun-95 craige new surface structure
  18. * 21-jun-95 craige tweaks for new surface structs
  19. * 25-jun-95 craige one ddraw mutex
  20. * 26-jun-95 craige reorganized surface structure
  21. * 28-jun-95 craige commented out
  22. *
  23. ***************************************************************************/
  24. #include "ddrawpr.h"
  25. #ifdef COMPOSITION
  26. /*
  27. * DD_SurfaceComposition_GetCompositionOrder
  28. */
  29. HRESULT DDAPI DD_SurfaceComposition_GetCompositionOrder(
  30. LPDIRECTDRAWSURFACECOMPOSITION lpDDSurface,
  31. LPDWORD lpdwCompositionOrder )
  32. {
  33. LPDDRAWI_DDRAWSURFACE_LCL thisx;
  34. LPDDRAWI_DDRAWSURFACE_GBL this;
  35. DPF(2,A,"ENTERAPI: DD_SurfaceComposition_GetCompositionOrder");
  36. thisx = (LPDDRAWI_DDRAWSURFACE_LCL) lpDDSurface;
  37. if( !VALID_DIRECTDRAWSURFACE_PTR( thisx ) )
  38. {
  39. return DDERR_INVALIDOBJECT;
  40. }
  41. if( !VALID_DWORD_PTR( lpdwCompositionOrder ) )
  42. {
  43. return DDERR_INVALIDPARAMS;
  44. }
  45. this = thisx->lpGbl;
  46. ENTER_DDRAW();
  47. if( SURFACE_LOST( thisx ) )
  48. {
  49. LEAVE_DDRAW();
  50. return DDERR_SURFACELOST;
  51. }
  52. // *lpdwCompositionOrder = this->dwCompositionOrder;
  53. LEAVE_DDRAW();
  54. return DDERR_UNSUPPORTED;
  55. } /* DD_SurfaceComposition_GetCompositionOrder */
  56. /*
  57. * DD_SurfaceComposition_SetCompositionOrder
  58. */
  59. HRESULT DDAPI DD_SurfaceComposition_SetCompositionOrder(
  60. LPDIRECTDRAWSURFACECOMPOSITION lpDDSurface,
  61. DWORD dwCompositionOrder )
  62. {
  63. LPDDRAWI_DDRAWSURFACE_LCL thisx;
  64. LPDDRAWI_DDRAWSURFACE_GBL this;
  65. DPF(2,A,"ENTERAPI: DD_SurfaceComposition_SetCompositionOrder");
  66. thisx = (LPDDRAWI_DDRAWSURFACE_LCL) lpDDSurface;
  67. if( !VALID_DIRECTDRAWSURFACE_PTR( thisx ) )
  68. {
  69. return DDERR_INVALIDOBJECT;
  70. }
  71. this = thisx->lpGbl;
  72. ENTER_DDRAW();
  73. if( SURFACE_LOST( thisx ) )
  74. {
  75. LEAVE_DDRAW();
  76. return DDERR_SURFACELOST;
  77. }
  78. // this->dwCompositionOrder = dwCompositionOrder;
  79. LEAVE_DDRAW();
  80. return DDERR_UNSUPPORTED;
  81. } /* DD_SurfaceComposition_SetCompositionOrder */
  82. /*
  83. * DD_SurfaceComposition_DeleteSurfaceDependency
  84. */
  85. HRESULT DDAPI DD_SurfaceComposition_DeleteSurfaceDependency(
  86. LPDIRECTDRAWSURFACECOMPOSITION lpDDSurface,
  87. DWORD dwFlagsForNoGoodReason,
  88. LPDIRECTDRAWSURFACE lpDDSurface2 )
  89. {
  90. LPDDRAWI_DDRAWSURFACE_LCL thisx;
  91. LPDDRAWI_DDRAWSURFACE_GBL this;
  92. LPDDRAWI_DDRAWSURFACE_LCL this2x;
  93. LPDDRAWI_DDRAWSURFACE_GBL this2;
  94. DPF(2,A,"ENTERAPI: DD_SurfaceComposition_DeleteSurfaceDependency");
  95. thisx = (LPDDRAWI_DDRAWSURFACE_LCL) lpDDSurface;
  96. if( !VALID_DIRECTDRAWSURFACE_PTR( thisx ) )
  97. {
  98. return DDERR_INVALIDOBJECT;
  99. }
  100. this2x = (LPDDRAWI_DDRAWSURFACE_LCL) lpDDSurface2;
  101. if( !VALID_DIRECTDRAWSURFACE_PTR( this2x ) )
  102. {
  103. return DDERR_INVALIDOBJECT;
  104. }
  105. this = thisx->lpGbl;
  106. this2 = this2x->lpGbl;
  107. ENTER_DDRAW();
  108. if( SURFACE_LOST( thisx ) )
  109. {
  110. LEAVE_DDRAW();
  111. return DDERR_SURFACELOST;
  112. }
  113. if( SURFACE_LOST( this2x ) )
  114. {
  115. LEAVE_DDRAW();
  116. return DDERR_SURFACELOST;
  117. }
  118. LEAVE_DDRAW();
  119. return DDERR_UNSUPPORTED;
  120. } /* DD_SurfaceComposition_DeleteSurfaceDependency */
  121. /*
  122. * DD_SurfaceComposition_DestLock
  123. */
  124. HRESULT DDAPI DD_SurfaceComposition_DestLock(
  125. LPDIRECTDRAWSURFACECOMPOSITION lpDDSurface )
  126. {
  127. LPDDRAWI_DDRAWSURFACE_LCL thisx;
  128. LPDDRAWI_DDRAWSURFACE_GBL this;
  129. DPF(2,A,"ENTERAPI: DD_SurfaceComposition_DestLock");
  130. thisx = (LPDDRAWI_DDRAWSURFACE_LCL) lpDDSurface;
  131. if( !VALID_DIRECTDRAWSURFACE_PTR( thisx ) )
  132. {
  133. return DDERR_INVALIDOBJECT;
  134. }
  135. this = thisx->lpGbl;
  136. ENTER_DDRAW();
  137. if( SURFACE_LOST( thisx ) )
  138. {
  139. LEAVE_DDRAW();
  140. return DDERR_SURFACELOST;
  141. }
  142. LEAVE_DDRAW();
  143. return DDERR_UNSUPPORTED;
  144. } /* DD_SurfaceComposition_DestLock */
  145. /*
  146. * DD_SurfaceComposition_DestUnlock
  147. */
  148. HRESULT DDAPI DD_SurfaceComposition_DestUnlock(
  149. LPDIRECTDRAWSURFACECOMPOSITION lpDDSurface )
  150. {
  151. LPDDRAWI_DDRAWSURFACE_LCL thisx;
  152. LPDDRAWI_DDRAWSURFACE_GBL this;
  153. DPF(2,A,"ENTERAPI: DD_SurfaceComposition_DestUnlock");
  154. thisx = (LPDDRAWI_DDRAWSURFACE_LCL) lpDDSurface;
  155. if( !VALID_DIRECTDRAWSURFACE_PTR( thisx ) )
  156. {
  157. return DDERR_INVALIDOBJECT;
  158. }
  159. this = thisx->lpGbl;
  160. ENTER_DDRAW();
  161. if( SURFACE_LOST( thisx ) )
  162. {
  163. LEAVE_DDRAW();
  164. return DDERR_SURFACELOST;
  165. }
  166. LEAVE_DDRAW();
  167. return DDERR_UNSUPPORTED;
  168. } /* DD_SurfaceComposition_DestUnlock */
  169. /*
  170. * DD_SurfaceComposition_EnumSurfaceDependencies
  171. */
  172. HRESULT DDAPI DD_SurfaceComposition_EnumSurfaceDependencies(
  173. LPDIRECTDRAWSURFACECOMPOSITION lpDDSurface,
  174. LPVOID lpContext,
  175. LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback )
  176. {
  177. LPDDRAWI_DDRAWSURFACE_LCL thisx;
  178. LPDDRAWI_DDRAWSURFACE_GBL this;
  179. DPF(2,A,"ENTERAPI: DD_SurfaceComposition_EnumSurfaceDependencies");
  180. thisx = (LPDDRAWI_DDRAWSURFACE_LCL) lpDDSurface;
  181. if( !VALID_DIRECTDRAWSURFACE_PTR( thisx ) )
  182. {
  183. return DDERR_INVALIDOBJECT;
  184. }
  185. if( !VALID_CODE_PTR( lpEnumSurfacesCallback ) )
  186. {
  187. return DDERR_INVALIDPARAMS;
  188. }
  189. this = thisx->lpGbl;
  190. ENTER_DDRAW();
  191. if( SURFACE_LOST( thisx ) )
  192. {
  193. LEAVE_DDRAW();
  194. return DDERR_SURFACELOST;
  195. }
  196. LEAVE_DDRAW();
  197. return DDERR_UNSUPPORTED;
  198. } /* DD_SurfaceComposition_EnumSurfaceDependencies */
  199. /*
  200. * DD_SurfaceComposition_SetSurfaceDependency
  201. */
  202. HRESULT DDAPI DD_SurfaceComposition_SetSurfaceDependency(
  203. LPDIRECTDRAWSURFACECOMPOSITION lpDDSurface,
  204. LPDIRECTDRAWSURFACE lpDDSurface2 )
  205. {
  206. LPDDRAWI_DDRAWSURFACE_LCL thisx;
  207. LPDDRAWI_DDRAWSURFACE_GBL this;
  208. LPDDRAWI_DDRAWSURFACE_LCL this2x;
  209. LPDDRAWI_DDRAWSURFACE_GBL this2;
  210. DPF(2,A,"ENTERAPI: DD_SurfaceComposition_SetSurfaceDependency");
  211. thisx = (LPDDRAWI_DDRAWSURFACE_LCL) lpDDSurface;
  212. if( !VALID_DIRECTDRAWSURFACE_PTR( thisx ) )
  213. {
  214. return DDERR_INVALIDOBJECT;
  215. }
  216. this2x = (LPDDRAWI_DDRAWSURFACE_LCL) lpDDSurface2;
  217. if( !VALID_DIRECTDRAWSURFACE_PTR( this2x ) )
  218. {
  219. return DDERR_INVALIDOBJECT;
  220. }
  221. this = thisx->lpGbl;
  222. ENTER_DDRAW();
  223. if( SURFACE_LOST( thisx ) )
  224. {
  225. LEAVE_DDRAW();
  226. return DDERR_SURFACELOST;
  227. }
  228. this2 = this2x->lpGbl;
  229. if( SURFACE_LOST( this2x ) )
  230. {
  231. LEAVE_DDRAW();
  232. return DDERR_SURFACELOST;
  233. }
  234. LEAVE_DDRAW();
  235. return DDERR_UNSUPPORTED;
  236. } /* DD_SurfaceComposition_SetSurfaceDependency */
  237. /*
  238. * DD_SurfaceComposition_AddSurfaceDependency
  239. */
  240. HRESULT DDAPI DD_SurfaceComposition_AddSurfaceDependency(
  241. LPDIRECTDRAWSURFACECOMPOSITION lpDDSurface,
  242. LPDIRECTDRAWSURFACE lpDDSurfaceDep )
  243. {
  244. LPDDRAWI_DDRAWSURFACE_LCL thisx;
  245. LPDDRAWI_DDRAWSURFACE_LCL this_depx;
  246. LPDDRAWI_DDRAWSURFACE_GBL this;
  247. LPDDRAWI_DDRAWSURFACE_GBL this_dep;
  248. DPF(2,A,"ENTERAPI: DD_SurfaceComposition_AddSurfaceDependency");
  249. thisx = (LPDDRAWI_DDRAWSURFACE_LCL) lpDDSurface;
  250. this_depx = (LPDDRAWI_DDRAWSURFACE_LCL) lpDDSurfaceDep;
  251. if( !VALID_DIRECTDRAWSURFACE_PTR( thisx ) )
  252. {
  253. return DDERR_INVALIDOBJECT;
  254. }
  255. if( !VALID_DIRECTDRAWSURFACE_PTR( this_depx ) )
  256. {
  257. return DDERR_INVALIDOBJECT;
  258. }
  259. this = thisx->lpGbl;
  260. this_dep = this_depx->lpGbl;
  261. ENTER_DDRAW();
  262. if( SURFACE_LOST( thisx ) )
  263. {
  264. LEAVE_DDRAW();
  265. return DDERR_SURFACELOST;
  266. }
  267. if( SURFACE_LOST( this_depx ) )
  268. {
  269. LEAVE_DDRAW();
  270. return DDERR_SURFACELOST;
  271. }
  272. LEAVE_DDRAW();
  273. return DDERR_UNSUPPORTED;
  274. } /* DD_SurfaceComposition_AddSurfaceDependency */
  275. #undef DPF_MODNAME
  276. #define DPF_MODNAME "Compose"
  277. /*
  278. * DD_SurfaceComposition_Compose
  279. */
  280. HRESULT DDAPI DD_SurfaceComposition_Compose(
  281. LPDIRECTDRAWSURFACECOMPOSITION lpDDDestSurface,
  282. LPRECT lpDestRect,
  283. LPDIRECTDRAWSURFACE lpDDSrcSurface,
  284. LPRECT lpSrcRect,
  285. DWORD dwFlags,
  286. LPDDCOMPOSEFX lpDDComposeFX )
  287. {
  288. LPDDRAWI_DIRECTDRAW pdrv;
  289. LPDDRAWI_DDRAWSURFACE_LCL this_srcx;
  290. LPDDRAWI_DDRAWSURFACE_LCL this_destx;
  291. LPDDRAWI_DDRAWSURFACE_GBL this_src;
  292. LPDDRAWI_DDRAWSURFACE_GBL this_dest;
  293. DPF(2,A,"ENTERAPI: DD_SurfaceComposition_Compose");
  294. this_destx = (LPDDRAWI_DDRAWSURFACE_LCL) lpDDDestSurface;
  295. this_srcx = (LPDDRAWI_DDRAWSURFACE_LCL) lpDDSrcSurface;
  296. if( !VALID_DIRECTDRAWSURFACE_PTR( this_destx ) )
  297. {
  298. DPF_ERR( "invalid dest specified") ;
  299. return DDERR_INVALIDOBJECT;
  300. }
  301. this_dest = this_destx->lpGbl;
  302. pdrv = this_dest->lpDD;
  303. ENTER_DDRAW();
  304. if( this_srcx != NULL )
  305. {
  306. if( !VALID_DIRECTDRAWSURFACE_PTR( this_srcx ) )
  307. {
  308. DPF_ERR( "Invalid source specified" );
  309. LEAVE_DDRAW();
  310. return DDERR_INVALIDOBJECT;
  311. }
  312. this_src = this_srcx->lpGbl;
  313. if( SURFACE_LOST( this_srcx ) )
  314. {
  315. LEAVE_DDRAW();
  316. return DDERR_SURFACELOST;
  317. }
  318. }
  319. else
  320. {
  321. this_src = NULL;
  322. }
  323. LEAVE_DDRAW();
  324. return DDERR_UNSUPPORTED;
  325. } /* DD_SurfaceComposition_Compose */
  326. #endif