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.

65 lines
1.4 KiB

  1. /*==========================================================================;
  2. *
  3. * Copyright (C) 1995 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: halbuf.c
  6. * Content: Direct3D HAL buffer management
  7. *@@BEGIN_MSINTERNAL
  8. *
  9. * $Id: halbuf.c,v 1.1 1995/11/21 15:12:30 sjl Exp $
  10. *
  11. * History:
  12. * Date By Reason
  13. * ==== == ======
  14. * 06/11/95 stevela Initial rev.
  15. * 07/11/95 stevela stuff.
  16. * 17/02/96 colinmc Fixed build problem.
  17. *@@END_MSINTERNAL
  18. *
  19. ***************************************************************************/
  20. #include "pch.cpp"
  21. #pragma hdrstop
  22. #ifndef USE_SURFACE_LOCK
  23. HRESULT D3DHAL_LockDibEngine(LPDIRECT3DDEVICEI lpDevI)
  24. {
  25. #ifndef WIN95
  26. return D3D_OK;
  27. #else
  28. HRESULT ret;
  29. LPDDRAWI_DIRECTDRAW_GBL pdrv = lpDevI->lpDDGbl;
  30. LPWORD pdflags;
  31. BOOL isbusy;
  32. pdflags = pdrv->lpwPDeviceFlags;
  33. isbusy = 0;
  34. _asm
  35. {
  36. mov eax, pdflags
  37. bts word ptr [eax], BUSY_BIT
  38. adc isbusy,0
  39. }
  40. if (isbusy) {
  41. D3D_WARN(2, "LOCK_DIBENGINE, dibengine is busy");
  42. ret = DDERR_SURFACEBUSY;
  43. } else
  44. ret = DD_OK;
  45. return ret;
  46. #endif
  47. }
  48. void D3DHAL_UnlockDibEngine(LPDIRECT3DDEVICEI lpDevI)
  49. {
  50. #ifndef WIN95
  51. return;
  52. #else
  53. LPDDRAWI_DIRECTDRAW_GBL pdrv = lpDevI->lpDDGbl;
  54. *pdrv->lpwPDeviceFlags &= ~BUSY;
  55. #endif
  56. }
  57. #endif