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.

1385 lines
34 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1995 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: w95hal.c
  6. * Content: routines to invoke HAL on Win95
  7. * These routines redirect the callbacks from the 32-bit
  8. * side to the driver
  9. * History:
  10. * Date By Reason
  11. * ==== == ======
  12. * 20-jan-95 craige initial implementation
  13. * 03-feb-95 craige performance tuning, ongoing work
  14. * 11-mar-95 craige palette stuff
  15. * 01-apr-95 craige happy fun joy updated header file
  16. * 07-apr-95 craige check src surface ptrs for NULL in blt
  17. * 13-apr-95 craige thunk pointer for WaitForVerticalBlank flip test
  18. * 15-apr-95 craige more flags for pointer thunking in WaitForVerticalBlank
  19. * 14-may-95 craige cleaned out obsolete junk
  20. * 22-may-95 craige 16:16 ptrs always avail. for surfaces/palettes
  21. * 28-may-95 craige cleaned up HAL: added GetBltStatus; GetFlipStatus;
  22. * GetScanLine
  23. * 19-jun-95 craige removed _DDHAL_EnumAllSurfacesCallback
  24. * 26-jun-95 craige reorganized surface structure
  25. * 27-jun-95 craige duplicate surfaces caused crash
  26. * 29-jun-95 craige fully alias CreateSurface
  27. * 10-jul-95 craige support SetOverlayPosition
  28. * 10-aug-95 toddla Blt, Lock, Flip need to not trash the driver data
  29. * because it might get reused if the DDXXX_WAIT flag
  30. * is used, or if a clipper is attached.
  31. * 10-dec-95 colinmc added dummy _DDHAL_ entry points for the execute
  32. * buffer HAL.
  33. * 13-apr-95 colinmc Bug 17736: No driver notfication of flip to GDI
  34. * 01-oct-96 ketand added GetAvailDriverMemory
  35. * 20-jan-97 colinmc AGP support
  36. *
  37. ***************************************************************************/
  38. #include "ddrawpr.h"
  39. #ifdef WIN95
  40. #define GETSURFALIAS( psurf_lcl ) \
  41. GetPtr16( psurf_lcl )
  42. #define GETDATAALIAS( psx, sv ) \
  43. if( !(psx->dwFlags & DDRAWISURF_DATAISALIASED) ) \
  44. { \
  45. sv = psx->lpGbl; \
  46. psx->lpGbl = GetPtr16( psx->lpGbl ); \
  47. psx->dwFlags |= DDRAWISURF_DATAISALIASED; \
  48. } \
  49. else \
  50. { \
  51. sv = (LPVOID) 0xffffffff; \
  52. }
  53. #define RESTOREDATAALIAS( psx, sv ) \
  54. if( sv != (LPVOID) 0xffffffff ) \
  55. { \
  56. psx->lpGbl = sv; \
  57. psx->dwFlags &= ~DDRAWISURF_DATAISALIASED; \
  58. }
  59. /****************************************************************************
  60. *
  61. * DRIVER CALLBACK HELPER FNS
  62. *
  63. ***************************************************************************/
  64. /*
  65. * _DDHAL_CreatePalette
  66. */
  67. DWORD DDAPI _DDHAL_CreatePalette( LPDDHAL_CREATEPALETTEDATA pcpd )
  68. {
  69. DWORD rc;
  70. /*
  71. * get 16:16 ptrs
  72. */
  73. pcpd->lpDD = pcpd->lpDD->lp16DD;
  74. /*
  75. * make the CreatePalette call in the driver
  76. */
  77. rc = DDThunk16_CreatePalette( pcpd );
  78. /*
  79. * clean up any 16:16 ptrs
  80. */
  81. return rc;
  82. } /* _DDHAL_CreatePalette */
  83. /*
  84. * _DDHAL_CreateSurface
  85. */
  86. DWORD DDAPI _DDHAL_CreateSurface( LPDDHAL_CREATESURFACEDATA pcsd )
  87. {
  88. DWORD rc;
  89. int i;
  90. LPVOID FAR *ppslist;
  91. LPVOID FAR *psave;
  92. LPDDRAWI_DDRAWSURFACE_LCL FAR *slistx;
  93. DWORD lplp16slist;
  94. /*
  95. * alias pointers to surfaces in new array...
  96. */
  97. pcsd->lpDDSurfaceDesc = (LPVOID) MapLS( pcsd->lpDDSurfaceDesc );
  98. if( pcsd->lpDDSurfaceDesc == NULL )
  99. {
  100. pcsd->ddRVal = DDERR_OUTOFMEMORY;
  101. return DDHAL_DRIVER_HANDLED;
  102. }
  103. ppslist = MemAlloc( pcsd->dwSCnt * sizeof( DWORD ) );
  104. if( ppslist == NULL )
  105. {
  106. UnMapLS( (DWORD) pcsd->lpDDSurfaceDesc );
  107. pcsd->ddRVal = DDERR_OUTOFMEMORY;
  108. return DDHAL_DRIVER_HANDLED;
  109. }
  110. psave = MemAlloc( pcsd->dwSCnt * sizeof( DWORD ) );
  111. if( psave == NULL )
  112. {
  113. MemFree( ppslist );
  114. UnMapLS( (DWORD) pcsd->lpDDSurfaceDesc );
  115. pcsd->ddRVal = DDERR_OUTOFMEMORY;
  116. return DDHAL_DRIVER_HANDLED;
  117. }
  118. lplp16slist = MapLS( ppslist );
  119. if( lplp16slist == 0 )
  120. {
  121. MemFree( ppslist );
  122. MemFree( psave );
  123. UnMapLS( (DWORD) pcsd->lpDDSurfaceDesc );
  124. pcsd->ddRVal = DDERR_OUTOFMEMORY;
  125. return DDHAL_DRIVER_HANDLED;
  126. }
  127. slistx = pcsd->lplpSList;
  128. for( i=0;i<(int)pcsd->dwSCnt;i++ )
  129. {
  130. ppslist[i] = GETSURFALIAS( slistx[i] );
  131. GETDATAALIAS( slistx[i], psave[i] );
  132. }
  133. /*
  134. * fix up structure with aliased ptrs
  135. */
  136. pcsd->lplpSList = (LPDDRAWI_DDRAWSURFACE_LCL FAR *)lplp16slist;
  137. pcsd->lpDD = (LPDDRAWI_DIRECTDRAW_GBL) pcsd->lpDD->lp16DD;
  138. /*
  139. * make the CreateSurface call in the driver
  140. */
  141. rc = DDThunk16_CreateSurface( pcsd );
  142. /*
  143. * clean up any 16:16 ptrs
  144. */
  145. UnMapLS( lplp16slist );
  146. UnMapLS( (DWORD) pcsd->lpDDSurfaceDesc );
  147. for( i=0;i<(int)pcsd->dwSCnt;i++ )
  148. {
  149. RESTOREDATAALIAS( slistx[i], psave[i] );
  150. }
  151. MemFree( psave );
  152. MemFree( ppslist );
  153. return rc;
  154. } /* _DDHAL_CreateSurface */
  155. /*
  156. * _DDHAL_CanCreateSurface
  157. */
  158. DWORD DDAPI _DDHAL_CanCreateSurface( LPDDHAL_CANCREATESURFACEDATA pccsd )
  159. {
  160. DWORD rc;
  161. pccsd->lpDD = (LPDDRAWI_DIRECTDRAW_GBL) pccsd->lpDD->lp16DD;
  162. pccsd->lpDDSurfaceDesc = (LPVOID) MapLS( pccsd->lpDDSurfaceDesc );
  163. if( pccsd->lpDDSurfaceDesc == NULL )
  164. {
  165. pccsd->ddRVal = DDERR_OUTOFMEMORY;
  166. return DDHAL_DRIVER_HANDLED;
  167. }
  168. /*
  169. * make the CanCreateSurface call in the driver
  170. */
  171. rc = DDThunk16_CanCreateSurface( pccsd );
  172. UnMapLS( (DWORD) pccsd->lpDDSurfaceDesc );
  173. return rc;
  174. } /* _DDHAL_CanCreateSurface */
  175. /*
  176. * _DDHAL_WaitForVerticalBlank
  177. */
  178. DWORD DDAPI _DDHAL_WaitForVerticalBlank( LPDDHAL_WAITFORVERTICALBLANKDATA pwfvbd )
  179. {
  180. DWORD rc;
  181. pwfvbd->lpDD = (LPDDRAWI_DIRECTDRAW_GBL) pwfvbd->lpDD->lp16DD;
  182. /*
  183. * make the WaitForVerticalBlank call in the driver
  184. */
  185. rc = DDThunk16_WaitForVerticalBlank( pwfvbd );
  186. return rc;
  187. } /* _DDHAL_WaitForVerticalBlank */
  188. /*
  189. * _DDHAL_DestroyDriver
  190. */
  191. DWORD DDAPI _DDHAL_DestroyDriver( LPDDHAL_DESTROYDRIVERDATA pddd )
  192. {
  193. DWORD rc;
  194. pddd->lpDD = (LPDDRAWI_DIRECTDRAW_GBL) pddd->lpDD->lp16DD;
  195. /*
  196. * make the DestroyDriver call in the driver
  197. */
  198. rc = DDThunk16_DestroyDriver( pddd );
  199. return rc;
  200. } /* _DDHAL_DestroyDriver */
  201. /*
  202. * _DDHAL_SetMode
  203. */
  204. DWORD DDAPI _DDHAL_SetMode( LPDDHAL_SETMODEDATA psmd )
  205. {
  206. DWORD rc;
  207. psmd->lpDD = (LPDDRAWI_DIRECTDRAW_GBL) psmd->lpDD->lp16DD;
  208. /*
  209. * make the SetMode call in the driver
  210. */
  211. rc = DDThunk16_SetMode( psmd );
  212. return rc;
  213. } /* _DDHAL_SetMode */
  214. /*
  215. * _DDHAL_GetScanLine
  216. */
  217. DWORD DDAPI _DDHAL_GetScanLine( LPDDHAL_GETSCANLINEDATA pgsld )
  218. {
  219. DWORD rc;
  220. pgsld->lpDD = (LPDDRAWI_DIRECTDRAW_GBL) pgsld->lpDD->lp16DD;
  221. /*
  222. * make the GetScanLine call in the driver
  223. */
  224. rc = DDThunk16_GetScanLine( pgsld );
  225. return rc;
  226. } /* _DDHAL_GetScanLine */
  227. /*
  228. * _DDHAL_SetExclusiveMode
  229. */
  230. DWORD DDAPI _DDHAL_SetExclusiveMode( LPDDHAL_SETEXCLUSIVEMODEDATA psemd )
  231. {
  232. DWORD rc;
  233. psemd->lpDD = (LPDDRAWI_DIRECTDRAW_GBL) psemd->lpDD->lp16DD;
  234. /*
  235. * make the SetExclusiveMode call in the driver
  236. */
  237. rc = DDThunk16_SetExclusiveMode( psemd );
  238. return rc;
  239. } /* _DDHAL_SetExclusiveMode */
  240. /*
  241. * _DDHAL_FlipToGDISurface
  242. */
  243. DWORD DDAPI _DDHAL_FlipToGDISurface( LPDDHAL_FLIPTOGDISURFACEDATA pftgsd )
  244. {
  245. DWORD rc;
  246. pftgsd->lpDD = (LPDDRAWI_DIRECTDRAW_GBL) pftgsd->lpDD->lp16DD;
  247. /*
  248. * make the SetExclusiveMode call in the driver
  249. */
  250. rc = DDThunk16_FlipToGDISurface( pftgsd );
  251. return rc;
  252. } /* _DDHAL_FlipToGDISurface */
  253. /*
  254. * _DDHAL_GetAvailDriverMemory
  255. */
  256. DWORD DDAPI _DDHAL_GetAvailDriverMemory( LPDDHAL_GETAVAILDRIVERMEMORYDATA pgadmd )
  257. {
  258. DWORD rc;
  259. pgadmd->lpDD = (LPDDRAWI_DIRECTDRAW_GBL) pgadmd->lpDD->lp16DD;
  260. rc = DDThunk16_GetAvailDriverMemory( pgadmd );
  261. return rc;
  262. }
  263. /*
  264. * _DDHAL_UpdateNonLocalHeap
  265. */
  266. DWORD DDAPI _DDHAL_UpdateNonLocalHeap( LPDDHAL_UPDATENONLOCALHEAPDATA unlhd )
  267. {
  268. DWORD rc;
  269. unlhd->lpDD = (LPDDRAWI_DIRECTDRAW_GBL) unlhd->lpDD->lp16DD;
  270. rc = DDThunk16_UpdateNonLocalHeap( unlhd );
  271. return rc;
  272. }
  273. /*
  274. * unmapSurfaceDescArray
  275. *
  276. * free an array of 16:16 ptrs
  277. */
  278. static void unmapSurfaceDescArray( DWORD cnt, DWORD FAR *lp16sdlist )
  279. {
  280. int i;
  281. if( cnt == 0 )
  282. {
  283. return;
  284. }
  285. for( i=0;i<(int)cnt;i++ )
  286. {
  287. UnMapLS( lp16sdlist[i] );
  288. }
  289. MemFree( lp16sdlist );
  290. } /* unmapSurfaceDescArray */
  291. /*
  292. * mapSurfaceDescArray
  293. *
  294. * make 16:16 pointers for an array of surface descriptions
  295. */
  296. static DWORD FAR *mapSurfaceDescArray( DWORD cnt, LPDDSURFACEDESC FAR *sdlist )
  297. {
  298. DWORD FAR *lp16sdlist;
  299. int i;
  300. if( cnt == 0 || sdlist == NULL )
  301. {
  302. return NULL;
  303. }
  304. lp16sdlist = MemAlloc( cnt * sizeof( DWORD ) );
  305. if( lp16sdlist == NULL )
  306. {
  307. return NULL;
  308. }
  309. for( i=0;i<(int)cnt;i++ )
  310. {
  311. lp16sdlist[i] = MapLS( sdlist[i] );
  312. if( lp16sdlist[i] == 0 )
  313. {
  314. unmapSurfaceDescArray( i, lp16sdlist );
  315. return NULL;
  316. }
  317. }
  318. return lp16sdlist;
  319. } /* mapSurfaceDescArray */
  320. /****************************************************************************
  321. *
  322. * SURFACE CALLBACK HELPER FNS
  323. *
  324. ***************************************************************************/
  325. /*
  326. * _DDHAL_DestroySurface
  327. */
  328. DWORD DDAPI _DDHAL_DestroySurface( LPDDHAL_DESTROYSURFACEDATA pdsd )
  329. {
  330. LPDDRAWI_DDRAWSURFACE_LCL psurf_lcl;
  331. DWORD rc;
  332. LPVOID save;
  333. pdsd->lpDD = pdsd->lpDD->lp16DD;
  334. psurf_lcl = pdsd->lpDDSurface;
  335. pdsd->lpDDSurface = GETSURFALIAS( psurf_lcl );
  336. GETDATAALIAS( psurf_lcl, save );
  337. rc = DDThunk16_DestroySurface( pdsd );
  338. RESTOREDATAALIAS( psurf_lcl, save );
  339. return rc;
  340. } /* _DDHAL_DestroySurface */
  341. /*
  342. * _DDHAL_Flip
  343. */
  344. DWORD DDAPI _DDHAL_Flip( LPDDHAL_FLIPDATA pfd )
  345. {
  346. LPDDRAWI_DIRECTDRAW_GBL lp32DD;
  347. LPDDRAWI_DDRAWSURFACE_LCL psurfcurrx;
  348. LPDDRAWI_DDRAWSURFACE_LCL psurftargx;
  349. DWORD rc;
  350. LPVOID save1;
  351. LPVOID save2;
  352. /*
  353. * get 16:16 ptrs to original and target surface
  354. */
  355. lp32DD = pfd->lpDD;
  356. pfd->lpDD = pfd->lpDD->lp16DD;
  357. psurfcurrx = pfd->lpSurfCurr;
  358. pfd->lpSurfCurr = GETSURFALIAS( psurfcurrx );
  359. GETDATAALIAS( psurfcurrx, save1 );
  360. if( pfd->lpSurfTarg != NULL )
  361. {
  362. psurftargx = pfd->lpSurfTarg;
  363. pfd->lpSurfTarg = GETSURFALIAS( psurftargx );
  364. GETDATAALIAS( psurftargx, save2 );
  365. }
  366. else
  367. {
  368. psurftargx = NULL;
  369. }
  370. /*
  371. * make the Flip call in the driver
  372. */
  373. rc = DDThunk16_Flip( pfd );
  374. /*
  375. * restore original ptrs
  376. */
  377. RESTOREDATAALIAS( psurfcurrx, save1 );
  378. if( psurftargx != NULL )
  379. {
  380. RESTOREDATAALIAS( psurftargx, save2 );
  381. }
  382. pfd->lpDD = lp32DD;
  383. pfd->lpSurfCurr = psurfcurrx;
  384. pfd->lpSurfTarg = psurftargx;
  385. return rc;
  386. } /* _DDHAL_Flip */
  387. /*
  388. * _DDHAL_Blt
  389. */
  390. DWORD DDAPI _DDHAL_Blt( LPDDHAL_BLTDATA pbd )
  391. {
  392. DWORD flags;
  393. DWORD rc;
  394. LPDDRAWI_DIRECTDRAW_GBL lp32DD;
  395. LPDDRAWI_DDRAWSURFACE_LCL psurfsrcx;
  396. LPDDRAWI_DDRAWSURFACE_LCL psurfdestx;
  397. LPDDRAWI_DDRAWSURFACE_LCL ppatternsurf_lcl;
  398. LPDDRAWI_DDRAWSURFACE_LCL pzsrcsurf_lcl;
  399. LPDDRAWI_DDRAWSURFACE_LCL pzdestsurf_lcl;
  400. #ifdef USE_ALPHA
  401. LPDDRAWI_DDRAWSURFACE_LCL pasrcsurf_lcl;
  402. LPDDRAWI_DDRAWSURFACE_LCL padestsurf_lcl;
  403. LPVOID saveasrc;
  404. LPVOID saveadest;
  405. #endif
  406. LPVOID savesrc;
  407. LPVOID savedest;
  408. LPVOID savepattern;
  409. LPVOID savezsrc;
  410. LPVOID savezdest;
  411. /*
  412. * get 16:16 ptrs to source and destination surfaces
  413. */
  414. lp32DD = pbd->lpDD;
  415. pbd->lpDD = pbd->lpDD->lp16DD;
  416. psurfsrcx = pbd->lpDDSrcSurface;
  417. if( psurfsrcx != NULL )
  418. {
  419. pbd->lpDDSrcSurface = GETSURFALIAS( psurfsrcx );
  420. GETDATAALIAS( psurfsrcx, savesrc );
  421. }
  422. psurfdestx = pbd->lpDDDestSurface;
  423. pbd->lpDDDestSurface = GETSURFALIAS( psurfdestx );
  424. GETDATAALIAS( psurfdestx, savedest );
  425. /*
  426. * see if we need to do any other surface aliases
  427. */
  428. flags = pbd->dwFlags;
  429. if( flags & (DDBLT_ALPHASRCSURFACEOVERRIDE|
  430. DDBLT_ALPHADESTSURFACEOVERRIDE|
  431. DDBLT_PRIVATE_ALIASPATTERN |
  432. DDBLT_ZBUFFERDESTOVERRIDE |
  433. DDBLT_ZBUFFERSRCOVERRIDE ) )
  434. {
  435. #ifdef USE_ALPHA
  436. /*
  437. * set up 16:16 ptr for alpha src
  438. */
  439. if( flags & DDBLT_ALPHASRCSURFACEOVERRIDE )
  440. {
  441. pasrcsurf_lcl = (LPDDRAWI_DDRAWSURFACE_LCL) pbd->bltFX.lpDDSAlphaSrc;
  442. pbd->bltFX.lpDDSAlphaSrc = GETSURFALIAS( pasrcsurf_lcl );
  443. GETDATAALIAS( pasrcsurf_lcl, saveasrc );
  444. }
  445. /*
  446. * set up 16:16 ptr for alpha dest
  447. */
  448. if( flags & DDBLT_ALPHADESTSURFACEOVERRIDE )
  449. {
  450. padestsurf_lcl = (LPDDRAWI_DDRAWSURFACE_LCL) pbd->bltFX.lpDDSAlphaDest;
  451. pbd->bltFX.lpDDSAlphaDest = GETSURFALIAS( padestsurf_lcl );
  452. GETDATAALIAS( padestsurf_lcl, saveadest );
  453. }
  454. #endif
  455. /*
  456. * set up 16:16 ptr for pattern
  457. */
  458. if( flags & DDBLT_PRIVATE_ALIASPATTERN )
  459. {
  460. ppatternsurf_lcl = (LPDDRAWI_DDRAWSURFACE_LCL) pbd->bltFX.lpDDSPattern;
  461. pbd->bltFX.lpDDSPattern = GETSURFALIAS( ppatternsurf_lcl );
  462. GETDATAALIAS( ppatternsurf_lcl, savepattern );
  463. }
  464. /*
  465. * set up 16:16 ptr for Z Buffer src
  466. */
  467. if( flags & DDBLT_ZBUFFERSRCOVERRIDE )
  468. {
  469. pzsrcsurf_lcl = (LPDDRAWI_DDRAWSURFACE_LCL) pbd->bltFX.lpDDSZBufferSrc;
  470. pbd->bltFX.lpDDSZBufferSrc = GETSURFALIAS( pzsrcsurf_lcl );
  471. GETDATAALIAS( pzsrcsurf_lcl, savezsrc );
  472. }
  473. /*
  474. * set up 16:16 ptr for Z Buffer dest
  475. */
  476. if( flags & DDBLT_ZBUFFERDESTOVERRIDE )
  477. {
  478. pzdestsurf_lcl = (LPDDRAWI_DDRAWSURFACE_LCL) pbd->bltFX.lpDDSZBufferDest;
  479. pbd->bltFX.lpDDSZBufferDest = GETSURFALIAS( pzdestsurf_lcl );
  480. GETDATAALIAS( pzdestsurf_lcl, savezdest );
  481. }
  482. }
  483. /*
  484. * make the Blt call in the driver
  485. */
  486. rc = DDThunk16_Blt( pbd );
  487. /*
  488. * see if we need to restore any surface ptrs
  489. */
  490. if( flags & (DDBLT_ALPHASRCSURFACEOVERRIDE|
  491. DDBLT_ALPHADESTSURFACEOVERRIDE|
  492. DDBLT_PRIVATE_ALIASPATTERN |
  493. DDBLT_ZBUFFERDESTOVERRIDE |
  494. DDBLT_ZBUFFERSRCOVERRIDE ) )
  495. {
  496. #ifdef USE_ALPHA
  497. if( flags & DDBLT_ALPHASRCSURFACEOVERRIDE )
  498. {
  499. pbd->bltFX.lpDDSAlphaSrc = (LPDIRECTDRAWSURFACE) pasrcsurf_lcl;
  500. RESTOREDATAALIAS( pasrcsurf_lcl, saveasrc );
  501. }
  502. if( flags & DDBLT_ALPHADESTSURFACEOVERRIDE )
  503. {
  504. pbd->bltFX.lpDDSAlphaDest = (LPDIRECTDRAWSURFACE) padestsurf_lcl;
  505. RESTOREDATAALIAS( padestsurf_lcl, saveadest );
  506. }
  507. #endif
  508. if( flags & DDBLT_PRIVATE_ALIASPATTERN )
  509. {
  510. pbd->bltFX.lpDDSPattern = (LPDIRECTDRAWSURFACE) ppatternsurf_lcl;
  511. RESTOREDATAALIAS( ppatternsurf_lcl, savepattern );
  512. }
  513. if( flags & DDBLT_ZBUFFERSRCOVERRIDE )
  514. {
  515. pbd->bltFX.lpDDSZBufferSrc = (LPDIRECTDRAWSURFACE) pzsrcsurf_lcl;
  516. RESTOREDATAALIAS( pzsrcsurf_lcl, savezsrc );
  517. }
  518. if( flags & DDBLT_ZBUFFERDESTOVERRIDE )
  519. {
  520. pbd->bltFX.lpDDSZBufferDest = (LPDIRECTDRAWSURFACE) pzdestsurf_lcl;
  521. RESTOREDATAALIAS( pzdestsurf_lcl, savezdest );
  522. }
  523. }
  524. if( psurfsrcx != NULL )
  525. {
  526. RESTOREDATAALIAS( psurfsrcx, savesrc );
  527. }
  528. RESTOREDATAALIAS( psurfdestx, savedest );
  529. pbd->lpDD = lp32DD;
  530. pbd->lpDDSrcSurface = psurfsrcx;
  531. pbd->lpDDDestSurface = psurfdestx;
  532. return rc;
  533. } /* _DDHAL_Blt */
  534. /*
  535. * _DDHAL_Lock
  536. */
  537. DWORD DDAPI _DDHAL_Lock( LPDDHAL_LOCKDATA pld )
  538. {
  539. LPDDRAWI_DIRECTDRAW_GBL lp32DD;
  540. LPDDRAWI_DDRAWSURFACE_LCL psurf_lcl;
  541. DWORD rc;
  542. LPVOID save;
  543. lp32DD = pld->lpDD;
  544. pld->lpDD = pld->lpDD->lp16DD;
  545. psurf_lcl = pld->lpDDSurface;
  546. pld->lpDDSurface = GETSURFALIAS( psurf_lcl );
  547. GETDATAALIAS( psurf_lcl, save );
  548. rc = DDThunk16_Lock( pld );
  549. RESTOREDATAALIAS( psurf_lcl, save );
  550. pld->lpDD = lp32DD;
  551. pld->lpDDSurface = psurf_lcl;
  552. return rc;
  553. } /* _DDHAL_Lock */
  554. /*
  555. * _DDHAL_Unlock
  556. */
  557. DWORD DDAPI _DDHAL_Unlock( LPDDHAL_UNLOCKDATA puld )
  558. {
  559. LPDDRAWI_DDRAWSURFACE_LCL psurf_lcl;
  560. DWORD rc;
  561. LPVOID save;
  562. puld->lpDD = puld->lpDD->lp16DD;
  563. psurf_lcl = puld->lpDDSurface;
  564. puld->lpDDSurface = GETSURFALIAS( psurf_lcl );
  565. GETDATAALIAS( psurf_lcl, save );
  566. rc = DDThunk16_Unlock( puld );
  567. RESTOREDATAALIAS( psurf_lcl, save );
  568. return rc;
  569. } /* _DDHAL_UnLock */
  570. /*
  571. * _DDHAL_AddAttachedSurface
  572. */
  573. DWORD DDAPI _DDHAL_AddAttachedSurface( LPDDHAL_ADDATTACHEDSURFACEDATA paasd )
  574. {
  575. LPDDRAWI_DDRAWSURFACE_LCL psurf_lcl;
  576. LPDDRAWI_DDRAWSURFACE_LCL psurfattachedx;
  577. DWORD rc;
  578. LPVOID save;
  579. LPVOID saveattached;
  580. /*
  581. * get 16:16 ptrs to surface and surface to become attached
  582. */
  583. paasd->lpDD = paasd->lpDD->lp16DD;
  584. psurf_lcl = paasd->lpDDSurface;
  585. paasd->lpDDSurface = GETSURFALIAS( psurf_lcl );
  586. GETDATAALIAS( psurf_lcl, save );
  587. psurfattachedx = paasd->lpSurfAttached;
  588. paasd->lpSurfAttached = GETSURFALIAS( psurfattachedx );
  589. GETDATAALIAS( psurfattachedx, saveattached );
  590. /*
  591. * make the AddAttachedSurface call in the driver
  592. */
  593. rc = DDThunk16_AddAttachedSurface( paasd );
  594. /*
  595. * restore any ptrs
  596. */
  597. RESTOREDATAALIAS( psurf_lcl, save );
  598. RESTOREDATAALIAS( psurfattachedx, saveattached );
  599. return rc;
  600. } /* _DDHAL_AddAttachedSurface */
  601. /*
  602. * _DDHAL_SetColorKey
  603. */
  604. DWORD DDAPI _DDHAL_SetColorKey( LPDDHAL_SETCOLORKEYDATA psckd )
  605. {
  606. LPDDRAWI_DDRAWSURFACE_LCL psurf_lcl;
  607. DWORD rc;
  608. LPVOID save;
  609. psckd->lpDD = psckd->lpDD->lp16DD;
  610. psurf_lcl = psckd->lpDDSurface;
  611. psckd->lpDDSurface = GETSURFALIAS( psurf_lcl );
  612. GETDATAALIAS( psurf_lcl, save );
  613. rc = DDThunk16_SetColorKey( psckd );
  614. RESTOREDATAALIAS( psurf_lcl, save );
  615. return rc;
  616. } /* _DDHAL_SetColorKey */
  617. /*
  618. * _DDHAL_SetClipList
  619. */
  620. DWORD DDAPI _DDHAL_SetClipList( LPDDHAL_SETCLIPLISTDATA pscld )
  621. {
  622. LPDDRAWI_DDRAWSURFACE_LCL psurf_lcl;
  623. DWORD rc;
  624. LPVOID save;
  625. pscld->lpDD = pscld->lpDD->lp16DD;
  626. psurf_lcl = pscld->lpDDSurface;
  627. pscld->lpDDSurface = GETSURFALIAS( psurf_lcl );
  628. GETDATAALIAS( psurf_lcl, save );
  629. rc = DDThunk16_SetClipList( pscld );
  630. RESTOREDATAALIAS( psurf_lcl, save );
  631. return rc;
  632. } /* _DDHAL_SetClipList */
  633. /*
  634. * _DDHAL_UpdateOverlay
  635. */
  636. DWORD DDAPI _DDHAL_UpdateOverlay( LPDDHAL_UPDATEOVERLAYDATA puod )
  637. {
  638. DWORD rc;
  639. LPDDRAWI_DDRAWSURFACE_LCL psurfdestx;
  640. LPDDRAWI_DDRAWSURFACE_LCL psurfsrcx;
  641. #ifdef USE_ALPHA
  642. LPDDRAWI_DDRAWSURFACE_LCL psurfalphadestx;
  643. LPDDRAWI_DDRAWSURFACE_LCL psurfalphasrcx;
  644. LPVOID savealphadest;
  645. LPVOID savealphasrc;
  646. #endif
  647. LPVOID savedest;
  648. LPVOID savesrc;
  649. /*
  650. * get 16:16 ptrs to the dest surface and the overlay surface
  651. */
  652. puod->lpDD = puod->lpDD->lp16DD;
  653. psurfsrcx = puod->lpDDSrcSurface;
  654. puod->lpDDSrcSurface = GETSURFALIAS( psurfsrcx );
  655. psurfdestx = puod->lpDDDestSurface;
  656. puod->lpDDDestSurface = GETSURFALIAS( psurfdestx );
  657. GETDATAALIAS( psurfsrcx, savesrc );
  658. GETDATAALIAS( psurfdestx, savedest );
  659. #ifdef USE_ALPHA
  660. /*
  661. * set up 16:16 ptr for alpha
  662. */
  663. if( puod->dwFlags & DDOVER_ALPHASRCSURFACEOVERRIDE )
  664. {
  665. psurfalphasrcx = (LPDDRAWI_DDRAWSURFACE_LCL) puod->overlayFX.lpDDSAlphaSrc;
  666. puod->overlayFX.lpDDSAlphaSrc = GETSURFALIAS( psurfalphasrcx );
  667. GETDATAALIAS( psurfalphasrcx, savealphasrc );
  668. }
  669. if( puod->dwFlags & DDOVER_ALPHADESTSURFACEOVERRIDE )
  670. {
  671. psurfalphadestx = (LPDDRAWI_DDRAWSURFACE_LCL) puod->overlayFX.lpDDSAlphaDest;
  672. puod->overlayFX.lpDDSAlphaDest = GETSURFALIAS( psurfalphadestx );
  673. GETDATAALIAS( psurfalphadestx, savealphadest );
  674. }
  675. #endif
  676. /*
  677. * make the UpdateOverlay call in the driver
  678. */
  679. rc = DDThunk16_UpdateOverlay( puod );
  680. /*
  681. * restore any surfaces
  682. */
  683. #ifdef USE_ALPHA
  684. if( puod->dwFlags & DDOVER_ALPHASRCSURFACEOVERRIDE )
  685. {
  686. puod->overlayFX.lpDDSAlphaSrc = (LPDIRECTDRAWSURFACE) psurfalphasrcx;
  687. RESTOREDATAALIAS( psurfalphasrcx, savealphasrc );
  688. }
  689. if( puod->dwFlags & DDOVER_ALPHADESTSURFACEOVERRIDE )
  690. {
  691. puod->overlayFX.lpDDSAlphaDest = (LPDIRECTDRAWSURFACE) psurfalphadestx;
  692. RESTOREDATAALIAS( psurfalphadestx, savealphadest );
  693. }
  694. #endif
  695. RESTOREDATAALIAS( psurfsrcx, savesrc );
  696. RESTOREDATAALIAS( psurfdestx, savedest );
  697. return rc;
  698. } /* _DDHAL_UpdateOverlay */
  699. /*
  700. * _DDHAL_SetOverlayPosition
  701. */
  702. DWORD DDAPI _DDHAL_SetOverlayPosition( LPDDHAL_SETOVERLAYPOSITIONDATA psopd )
  703. {
  704. LPDDRAWI_DDRAWSURFACE_LCL psurfdestx;
  705. LPDDRAWI_DDRAWSURFACE_LCL psurfsrcx;
  706. DWORD rc;
  707. LPVOID savedest;
  708. LPVOID savesrc;
  709. /*
  710. * get 16:16 ptrs to the dest surface and the overlay surface
  711. */
  712. psopd->lpDD = psopd->lpDD->lp16DD;
  713. psurfsrcx = psopd->lpDDSrcSurface;
  714. psopd->lpDDSrcSurface = GETSURFALIAS( psurfsrcx );
  715. psurfdestx = psopd->lpDDDestSurface;
  716. psopd->lpDDDestSurface = GETSURFALIAS( psurfdestx );
  717. GETDATAALIAS( psurfsrcx, savesrc );
  718. GETDATAALIAS( psurfdestx, savedest );
  719. /*
  720. * make the SetOverlayPosition call in the driver
  721. */
  722. rc = DDThunk16_SetOverlayPosition( psopd );
  723. /*
  724. * restore any surfaces
  725. */
  726. RESTOREDATAALIAS( psurfsrcx, savesrc );
  727. RESTOREDATAALIAS( psurfdestx, savedest );
  728. return rc;
  729. } /* _DDHAL_SetOverlayPosition */
  730. /*
  731. * _DDHAL_SetPalette
  732. */
  733. DWORD DDAPI _DDHAL_SetPalette( LPDDHAL_SETPALETTEDATA pspd )
  734. {
  735. LPDDRAWI_DDRAWSURFACE_LCL psurf_lcl;
  736. DWORD rc;
  737. LPVOID save;
  738. /*
  739. * get 16:16 ptrs
  740. */
  741. pspd->lpDD = pspd->lpDD->lp16DD;
  742. psurf_lcl = pspd->lpDDSurface;
  743. pspd->lpDDSurface = GETSURFALIAS( psurf_lcl );
  744. pspd->lpDDPalette = (LPDDRAWI_DDRAWPALETTE_GBL) MapLS( pspd->lpDDPalette );
  745. if( pspd->lpDDPalette == NULL )
  746. {
  747. pspd->ddRVal = DDERR_OUTOFMEMORY;
  748. return DDHAL_DRIVER_HANDLED;
  749. }
  750. GETDATAALIAS( psurf_lcl, save );
  751. /*
  752. * make the SetPalette call in the driver
  753. */
  754. rc = DDThunk16_SetPalette( pspd );
  755. /*
  756. * clean up any 16:16 ptrs
  757. */
  758. UnMapLS( (DWORD) pspd->lpDDPalette );
  759. RESTOREDATAALIAS( psurf_lcl, save );
  760. return rc;
  761. } /* _DDHAL_SetPalette */
  762. /*
  763. * _DDHAL_GetBltStatus
  764. */
  765. DWORD DDAPI _DDHAL_GetBltStatus( LPDDHAL_GETBLTSTATUSDATA pgbsd )
  766. {
  767. LPDDRAWI_DDRAWSURFACE_LCL psurf_lcl;
  768. DWORD rc;
  769. LPVOID save;
  770. pgbsd->lpDD = pgbsd->lpDD->lp16DD;
  771. psurf_lcl = pgbsd->lpDDSurface;
  772. pgbsd->lpDDSurface = GETSURFALIAS( psurf_lcl );
  773. GETDATAALIAS( psurf_lcl, save );
  774. rc = DDThunk16_GetBltStatus( pgbsd );
  775. RESTOREDATAALIAS( psurf_lcl, save );
  776. return rc;
  777. } /* _DDHAL_GetBltStatus */
  778. /*
  779. * _DDHAL_GetFlipStatus
  780. */
  781. DWORD DDAPI _DDHAL_GetFlipStatus( LPDDHAL_GETFLIPSTATUSDATA pgfsd )
  782. {
  783. LPDDRAWI_DDRAWSURFACE_LCL psurf_lcl;
  784. DWORD rc;
  785. LPVOID save;
  786. pgfsd->lpDD = pgfsd->lpDD->lp16DD;
  787. psurf_lcl = pgfsd->lpDDSurface;
  788. pgfsd->lpDDSurface = GETSURFALIAS( psurf_lcl );
  789. GETDATAALIAS( psurf_lcl, save );
  790. rc = DDThunk16_GetFlipStatus( pgfsd );
  791. RESTOREDATAALIAS( psurf_lcl, save );
  792. return rc;
  793. } /* _DDHAL_GetFlipStatus */
  794. /****************************************************************************
  795. *
  796. * EXECUTE BUFFER CALLBACK HELPER FNS
  797. *
  798. ***************************************************************************/
  799. /*
  800. * _DDHAL_CanCreateExecuteBuffer
  801. *
  802. * NOTE: Dummy entry point just to keep DOHALCALL happy. Execute buffer
  803. * entry points must be 32-bit, no thunking support is provided.
  804. */
  805. DWORD DDAPI _DDHAL_CanCreateExecuteBuffer( LPDDHAL_CANCREATESURFACEDATA pccsd )
  806. {
  807. pccsd->ddRVal = DDERR_UNSUPPORTED;
  808. return DDHAL_DRIVER_NOTHANDLED;
  809. } /* _DDHAL_CanCreateExecuteBuffer */
  810. /*
  811. * _DDHAL_CreateExecuteBuffer
  812. *
  813. * NOTE: Dummy entry point just to keep DOHALCALL happy. Execute buffer
  814. * entry points must be 32-bit, no thunking support is provided.
  815. */
  816. DWORD DDAPI _DDHAL_CreateExecuteBuffer( LPDDHAL_CREATESURFACEDATA pcsd )
  817. {
  818. pcsd->ddRVal = DDERR_UNSUPPORTED;
  819. return DDHAL_DRIVER_NOTHANDLED;
  820. } /* _DDHAL_CreateExecuteBuffer */
  821. /*
  822. * NOTE: All these babies are dummy entry points. They are only here to keep
  823. * DOHALCALL happy. Execute buffer HAL functions must be true 32-bit code.
  824. * No thunking support is offered.
  825. */
  826. /*
  827. * _DDHAL_DestroyExecuteBuffer
  828. */
  829. DWORD DDAPI _DDHAL_DestroyExecuteBuffer( LPDDHAL_DESTROYSURFACEDATA pdsd )
  830. {
  831. pdsd->ddRVal = DDERR_UNSUPPORTED;
  832. return DDHAL_DRIVER_NOTHANDLED;
  833. } /* _DDHAL_DestroySurface */
  834. /*
  835. * _DDHAL_LockExecuteBuffer
  836. */
  837. DWORD DDAPI _DDHAL_LockExecuteBuffer( LPDDHAL_LOCKDATA pld )
  838. {
  839. pld->ddRVal = DDERR_UNSUPPORTED;
  840. return DDHAL_DRIVER_NOTHANDLED;
  841. } /* _DDHAL_Lock */
  842. /*
  843. * _DDHAL_UnlockExecuteBuffer
  844. */
  845. DWORD DDAPI _DDHAL_UnlockExecuteBuffer( LPDDHAL_UNLOCKDATA puld )
  846. {
  847. puld->ddRVal = DDERR_UNSUPPORTED;
  848. return DDHAL_DRIVER_NOTHANDLED;
  849. } /* _DDHAL_UnlockExecuteBuffer */
  850. /****************************************************************************
  851. *
  852. * VIDEO PORT CALLBACK HELPER FNS
  853. *
  854. ***************************************************************************/
  855. /*
  856. * _DDHAL_GetVideoPortConnectionGUID
  857. *
  858. * NOTE: Dummy entry point just to keep DOHALCALL happy. Video Port
  859. * entry points must be 32-bit, no thunking support is provided.
  860. */
  861. DWORD DDAPI _DDHAL_GetVideoPortConnectInfo( LPDDHAL_GETVPORTCONNECTDATA lpGetTypeData )
  862. {
  863. lpGetTypeData->ddRVal = DDERR_UNSUPPORTED;
  864. return DDHAL_DRIVER_NOTHANDLED;
  865. } /* _DDHAL_GetVideoPortTypeGUID */
  866. /*
  867. * _DDHAL_CanCreateVideoPort
  868. */
  869. DWORD DDAPI _DDHAL_CanCreateVideoPort( LPDDHAL_CANCREATEVPORTDATA lpCanCreateData )
  870. {
  871. lpCanCreateData->ddRVal = DDERR_UNSUPPORTED;
  872. return DDHAL_DRIVER_NOTHANDLED;
  873. } /* _DDHAL_CanCreateVideoPort */
  874. /*
  875. * _DDHAL_CreateVideoPort
  876. */
  877. DWORD DDAPI _DDHAL_CreateVideoPort( LPDDHAL_CREATEVPORTDATA lpCreateData )
  878. {
  879. lpCreateData->ddRVal = DDERR_UNSUPPORTED;
  880. return DDHAL_DRIVER_NOTHANDLED;
  881. } /* _DDHAL_CreateVideoPort */
  882. /*
  883. * _DDHAL_DestroyVideoPort
  884. */
  885. DWORD DDAPI _DDHAL_DestroyVideoPort( LPDDHAL_DESTROYVPORTDATA lpDestroyData )
  886. {
  887. lpDestroyData->ddRVal = DDERR_UNSUPPORTED;
  888. return DDHAL_DRIVER_NOTHANDLED;
  889. } /* _DDHAL_DestroyVideoPort */
  890. /*
  891. * _DDHAL_GetVideoPortInputFormats
  892. */
  893. DWORD DDAPI _DDHAL_GetVideoPortInputFormats( LPDDHAL_GETVPORTINPUTFORMATDATA lpGetFormatData )
  894. {
  895. lpGetFormatData->ddRVal = DDERR_UNSUPPORTED;
  896. return DDHAL_DRIVER_NOTHANDLED;
  897. } /* _DDHAL_GetVideoPortInputFormats */
  898. /*
  899. * _DDHAL_GetVideoPortOutputFormats
  900. */
  901. DWORD DDAPI _DDHAL_GetVideoPortOutputFormats( LPDDHAL_GETVPORTOUTPUTFORMATDATA lpGetFormatData )
  902. {
  903. lpGetFormatData->ddRVal = DDERR_UNSUPPORTED;
  904. return DDHAL_DRIVER_NOTHANDLED;
  905. } /* _DDHAL_GetVideoPortOutputFormats */
  906. /*
  907. * _DDHAL_GetVideoPortBandwidthInfo
  908. */
  909. DWORD DDAPI _DDHAL_GetVideoPortBandwidthInfo( LPDDHAL_GETVPORTBANDWIDTHDATA lpGetBandwidthData )
  910. {
  911. lpGetBandwidthData->ddRVal = DDERR_UNSUPPORTED;
  912. return DDHAL_DRIVER_NOTHANDLED;
  913. } /* _DDHAL_GetVideoPortBandwidthInfo */
  914. /*
  915. * _DDHAL_UpdateVideoPort
  916. */
  917. DWORD DDAPI _DDHAL_UpdateVideoPort( LPDDHAL_UPDATEVPORTDATA lpUpdateData )
  918. {
  919. lpUpdateData->ddRVal = DDERR_UNSUPPORTED;
  920. return DDHAL_DRIVER_NOTHANDLED;
  921. } /* _DDHAL_UpdateVideoPort */
  922. /*
  923. * _DDHAL_GetVideoPortField
  924. */
  925. DWORD DDAPI _DDHAL_GetVideoPortField( LPDDHAL_GETVPORTFIELDDATA lpGetFieldData )
  926. {
  927. lpGetFieldData->ddRVal = DDERR_UNSUPPORTED;
  928. return DDHAL_DRIVER_NOTHANDLED;
  929. } /* _DDHAL_GetVideoPortField */
  930. /*
  931. * _DDHAL_GetVideoPortLine
  932. */
  933. DWORD DDAPI _DDHAL_GetVideoPortLine( LPDDHAL_GETVPORTLINEDATA lpGetLineData )
  934. {
  935. lpGetLineData->ddRVal = DDERR_UNSUPPORTED;
  936. return DDHAL_DRIVER_NOTHANDLED;
  937. } /* _DDHAL_GetVideoPortLine */
  938. /*
  939. * _DDHAL_WaitForVideoPortSync
  940. */
  941. DWORD DDAPI _DDHAL_WaitForVideoPortSync( LPDDHAL_WAITFORVPORTSYNCDATA lpWaitSyncData )
  942. {
  943. lpWaitSyncData->ddRVal = DDERR_UNSUPPORTED;
  944. return DDHAL_DRIVER_NOTHANDLED;
  945. } /* _DDHAL_WaitForVideoPortSync */
  946. /*
  947. * _DDHAL_FlipVideoPort
  948. */
  949. DWORD DDAPI _DDHAL_FlipVideoPort( LPDDHAL_FLIPVPORTDATA lpFlipData )
  950. {
  951. lpFlipData->ddRVal = DDERR_UNSUPPORTED;
  952. return DDHAL_DRIVER_NOTHANDLED;
  953. } /* _DDHAL_FlipVideoPort */
  954. /*
  955. * _DDHAL_GetVideoPortFlipStatus
  956. */
  957. DWORD DDAPI _DDHAL_GetVideoPortFlipStatus( LPDDHAL_GETVPORTFLIPSTATUSDATA lpFlipData )
  958. {
  959. lpFlipData->ddRVal = DDERR_UNSUPPORTED;
  960. return DDHAL_DRIVER_NOTHANDLED;
  961. } /* _DDHAL_GetVideoPortFlipStatus */
  962. /*
  963. * _DDHAL_GetVideoSignalStatus
  964. */
  965. DWORD DDAPI _DDHAL_GetVideoSignalStatus( LPDDHAL_GETVPORTSIGNALDATA lpData )
  966. {
  967. lpData->ddRVal = DDERR_UNSUPPORTED;
  968. return DDHAL_DRIVER_NOTHANDLED;
  969. } /* _DDHAL_GetVideoSignalStatus */
  970. /*
  971. * _DDHAL_VideoColorControl
  972. */
  973. DWORD DDAPI _DDHAL_VideoColorControl( LPDDHAL_VPORTCOLORDATA lpData )
  974. {
  975. lpData->ddRVal = DDERR_UNSUPPORTED;
  976. return DDHAL_DRIVER_NOTHANDLED;
  977. } /* _DDHAL_VideoColorControl */
  978. /****************************************************************************
  979. *
  980. * COLORCONTROL CALLBACK HELPER FNS
  981. *
  982. ***************************************************************************/
  983. /*
  984. * _DDHAL_ColorControl
  985. */
  986. DWORD DDAPI _DDHAL_ColorControl( LPDDHAL_COLORCONTROLDATA pccd )
  987. {
  988. LPDDRAWI_DIRECTDRAW_GBL lp32DD;
  989. LPDDRAWI_DDRAWSURFACE_LCL psurf;
  990. LPVOID save1;
  991. DWORD rc;
  992. /*
  993. * get 16:16 ptr to surface
  994. */
  995. lp32DD = pccd->lpDD;
  996. pccd->lpDD = pccd->lpDD->lp16DD;
  997. psurf = pccd->lpDDSurface;
  998. pccd->lpDDSurface = GETSURFALIAS( psurf );
  999. GETDATAALIAS( psurf, save1 );
  1000. /*
  1001. * make the ColorControl call in the driver
  1002. */
  1003. rc = DDThunk16_ColorControl( pccd );
  1004. /*
  1005. * restore original ptrs
  1006. */
  1007. RESTOREDATAALIAS( psurf, save1 );
  1008. pccd->lpDD = lp32DD;
  1009. pccd->lpDDSurface = psurf;
  1010. return rc;
  1011. } /* _DDHAL_ColorControl */
  1012. /****************************************************************************
  1013. *
  1014. * KERNEL CALLBACK HELPER FNS
  1015. *
  1016. ***************************************************************************/
  1017. /*
  1018. * _DDHAL_SyncSurfaceData
  1019. */
  1020. DWORD DDAPI _DDHAL_SyncSurfaceData( LPDDHAL_SYNCSURFACEDATA lpData )
  1021. {
  1022. lpData->ddRVal = DDERR_UNSUPPORTED;
  1023. return DDHAL_DRIVER_NOTHANDLED;
  1024. } /* _DDHAL_SyncSurfaceData */
  1025. /*
  1026. * _DDHAL_SyncVideoPortData
  1027. */
  1028. DWORD DDAPI _DDHAL_SyncVideoPortData( LPDDHAL_SYNCVIDEOPORTDATA lpData )
  1029. {
  1030. lpData->ddRVal = DDERR_UNSUPPORTED;
  1031. return DDHAL_DRIVER_NOTHANDLED;
  1032. } /* _DDHAL_SyncVideoPortData */
  1033. /****************************************************************************
  1034. *
  1035. * MOTION COMP CALLBACK HELPER FNS
  1036. *
  1037. ***************************************************************************/
  1038. /*
  1039. * _DDHAL_GetMoCompGuids
  1040. */
  1041. DWORD DDAPI _DDHAL_GetMoCompGuids( LPDDHAL_GETMOCOMPGUIDSDATA lpData )
  1042. {
  1043. lpData->ddRVal = DDERR_UNSUPPORTED;
  1044. return DDHAL_DRIVER_NOTHANDLED;
  1045. } /* _DDHAL_GetVideoGuids */
  1046. /*
  1047. * _DDHAL_GetMoCompFormats
  1048. */
  1049. DWORD DDAPI _DDHAL_GetMoCompFormats( LPDDHAL_GETMOCOMPFORMATSDATA lpData )
  1050. {
  1051. lpData->ddRVal = DDERR_UNSUPPORTED;
  1052. return DDHAL_DRIVER_NOTHANDLED;
  1053. } /* _DDHAL_GetMoCompFormats */
  1054. /*
  1055. * _DDHAL_CreateMoComp
  1056. */
  1057. DWORD DDAPI _DDHAL_CreateMoComp( LPDDHAL_CREATEMOCOMPDATA lpData )
  1058. {
  1059. lpData->ddRVal = DDERR_UNSUPPORTED;
  1060. return DDHAL_DRIVER_NOTHANDLED;
  1061. } /* _DDHAL_CreateMoComp */
  1062. /*
  1063. * _DDHAL_GetMoCompBuffInfo
  1064. */
  1065. DWORD DDAPI _DDHAL_GetMoCompBuffInfo( LPDDHAL_GETMOCOMPCOMPBUFFDATA lpData )
  1066. {
  1067. lpData->ddRVal = DDERR_UNSUPPORTED;
  1068. return DDHAL_DRIVER_NOTHANDLED;
  1069. } /* _DDHAL_GetMoCompBuffInfo */
  1070. /*
  1071. * _DDHAL_GetInternalMoCompInfo
  1072. */
  1073. DWORD DDAPI _DDHAL_GetInternalMoCompInfo( LPDDHAL_GETINTERNALMOCOMPDATA lpData )
  1074. {
  1075. lpData->ddRVal = DDERR_UNSUPPORTED;
  1076. return DDHAL_DRIVER_NOTHANDLED;
  1077. } /* _DDHAL_GetInternalMoCompInfo */
  1078. /*
  1079. * _DDHAL_DestroyMoComp
  1080. */
  1081. DWORD DDAPI _DDHAL_DestroyMoComp( LPDDHAL_DESTROYMOCOMPDATA lpData )
  1082. {
  1083. lpData->ddRVal = DDERR_UNSUPPORTED;
  1084. return DDHAL_DRIVER_NOTHANDLED;
  1085. } /* _DDHAL_DestroyMoComp */
  1086. /*
  1087. * _DDHAL_BeginMoCompFrame
  1088. */
  1089. DWORD DDAPI _DDHAL_BeginMoCompFrame( LPDDHAL_BEGINMOCOMPFRAMEDATA lpData )
  1090. {
  1091. lpData->ddRVal = DDERR_UNSUPPORTED;
  1092. return DDHAL_DRIVER_NOTHANDLED;
  1093. } /* _DDHAL_BeginMoCompFrame */
  1094. /*
  1095. * _DDHAL_EndMoCompFrame
  1096. */
  1097. DWORD DDAPI _DDHAL_EndMoCompFrame( LPDDHAL_ENDMOCOMPFRAMEDATA lpData )
  1098. {
  1099. lpData->ddRVal = DDERR_UNSUPPORTED;
  1100. return DDHAL_DRIVER_NOTHANDLED;
  1101. } /* _DDHAL_EndMoCompFrame */
  1102. /*
  1103. * _DDHAL_RenderMoComp
  1104. */
  1105. DWORD DDAPI _DDHAL_RenderMoComp( LPDDHAL_RENDERMOCOMPDATA lpData )
  1106. {
  1107. lpData->ddRVal = DDERR_UNSUPPORTED;
  1108. return DDHAL_DRIVER_NOTHANDLED;
  1109. } /* _DDHAL_RenderMoComp */
  1110. /*
  1111. * _DDHAL_QueryMoCompStatus
  1112. */
  1113. DWORD DDAPI _DDHAL_QueryMoCompStatus( LPDDHAL_QUERYMOCOMPSTATUSDATA lpData )
  1114. {
  1115. lpData->ddRVal = DDERR_UNSUPPORTED;
  1116. return DDHAL_DRIVER_NOTHANDLED;
  1117. } /* _DDHAL_QueryMoCompStatus */
  1118. /****************************************************************************
  1119. *
  1120. * PALETTE CALLBACK HELPER FNS
  1121. *
  1122. ***************************************************************************/
  1123. /*
  1124. * _DDHAL_DestroyPalette
  1125. */
  1126. DWORD DDAPI _DDHAL_DestroyPalette( LPDDHAL_DESTROYPALETTEDATA pdpd )
  1127. {
  1128. DWORD rc;
  1129. /*
  1130. * get 16:16 ptrs
  1131. */
  1132. pdpd->lpDD = pdpd->lpDD->lp16DD;
  1133. pdpd->lpDDPalette = (LPDDRAWI_DDRAWPALETTE_GBL) MapLS( pdpd->lpDDPalette );
  1134. if( pdpd->lpDDPalette == NULL )
  1135. {
  1136. pdpd->ddRVal = DDERR_OUTOFMEMORY;
  1137. return DDHAL_DRIVER_HANDLED;
  1138. }
  1139. /*
  1140. * make the DestroyPalette call in the driver
  1141. */
  1142. rc = DDThunk16_DestroyPalette( pdpd );
  1143. /*
  1144. * clean up any 16:16 ptrs
  1145. */
  1146. UnMapLS( (DWORD) pdpd->lpDDPalette );
  1147. return rc;
  1148. } /* _DDHAL_DestroyPalette */
  1149. /*
  1150. * _DDHAL_SetEntries
  1151. */
  1152. DWORD DDAPI _DDHAL_SetEntries( LPDDHAL_SETENTRIESDATA psed )
  1153. {
  1154. DWORD rc;
  1155. /*
  1156. * get 16:16 ptrs
  1157. */
  1158. psed->lpDD = psed->lpDD->lp16DD;
  1159. psed->lpDDPalette = (LPDDRAWI_DDRAWPALETTE_GBL) MapLS( psed->lpDDPalette );
  1160. if( psed->lpDDPalette == NULL )
  1161. {
  1162. psed->ddRVal = DDERR_OUTOFMEMORY;
  1163. return DDHAL_DRIVER_HANDLED;
  1164. }
  1165. /*
  1166. * make the DestroyPalette call in the driver
  1167. */
  1168. rc = DDThunk16_SetEntries( psed );
  1169. /*
  1170. * clean up any 16:16 ptrs
  1171. */
  1172. UnMapLS( (DWORD) psed->lpDDPalette );
  1173. return rc;
  1174. } /* _DDHAL_SetEntries */
  1175. #endif