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.

144 lines
3.5 KiB

  1. /*==========================================================================
  2. * Copyright (C) 1995 Microsoft Corporation. All Rights Reserved.
  3. *
  4. * File: ddsstrm.c
  5. * Content: DirectDraw surface streaming methods
  6. * History:
  7. * Date By Reason
  8. * ==== == ======
  9. * 19-jun-95 craige split out of ddsurf; fleshed out
  10. * 21-jun-95 craige added lock/unlock; split out clipping
  11. * 25-jun-95 craige one ddraw mutex
  12. * 26-jun-95 craige reorganized surface structure
  13. *
  14. ***************************************************************************/
  15. #include "ddrawpr.h"
  16. #if 0
  17. #undef DPF_MODNAME
  18. #define DPF_MODNAME "SetNotificationCallback"
  19. /*
  20. * DD_Surface_SetNotificationCallback
  21. */
  22. HRESULT DDAPI DD_SurfaceStreaming_SetNotificationCallback(
  23. LPDIRECTDRAWSURFACESTREAMING lpDDSurface,
  24. DWORD dwFlags,
  25. LPSURFACESTREAMINGCALLBACK lpCallback )
  26. {
  27. LPDDRAWI_DDRAWSURFACE_GBLSTREAMING thiss;
  28. LPDDRAWI_DDRAWSURFACE_LCL thisx;
  29. LPDDRAWI_DDRAWSURFACE_GBL this;
  30. LPDDRAWI_DIRECTDRAW pdrv;
  31. DPF(2,A,"ENTERAPI: DD_SurfaceStreaming_SetNotificationCallback");
  32. thisx = (LPDDRAWI_DDRAWSURFACE_LCL) lpDDSurface;
  33. if( !VALID_DIRECTDRAWSURFACE_PTR( thisx ) )
  34. {
  35. return DDERR_INVALIDOBJECT;
  36. }
  37. if( lpCallback != NULL )
  38. {
  39. if( !VALID_CODE_PTR( lpCallback ) )
  40. {
  41. DPF_ERR( "Invalid Streaming callback ptr" );
  42. return DDERR_INVALIDPARAMS;
  43. }
  44. }
  45. thiss = (LPDDRAWI_DDRAWSURFACE_GBLSTREAMING) thisx;
  46. this = thisx->lpGbl;
  47. pdrv = this->lpDD;
  48. ENTER_DDRAW();
  49. if( SURFACE_LOST( this ) )
  50. {
  51. LEAVE_DDRAW();
  52. return DDERR_SURFACELOST;
  53. }
  54. thiss->lpCallback = lpCallback;
  55. LEAVE_DDRAW();
  56. return DDERR_UNSUPPORTED;
  57. } /* DD_SurfaceStreaming_SetNotificationCallback */
  58. /*
  59. * DD_SurfaceStreaming_Lock
  60. *
  61. * Allows streaming access to a surface.
  62. */
  63. HRESULT DDAPI DD_SurfaceStreaming_Lock(
  64. LPDIRECTDRAWSURFACESTREAMING lpDDSurface,
  65. LPRECT lpDestRect,
  66. LPDDSURFACEDESC lpDDSurfaceDesc,
  67. DWORD dwFlagsForNoGoodReason,
  68. HANDLE hEvent )
  69. {
  70. LPDDRAWI_DIRECTDRAW pdrv;
  71. LPDDRAWI_DDRAWSURFACE_LCL thisx;
  72. LPDDRAWI_DDRAWSURFACE_GBL this;
  73. DPF(2,A,"ENTERAPI: DD_SurfaceStreaming_Lock");
  74. thisx = (LPDDRAWI_DDRAWSURFACE_LCL) lpDDSurface;
  75. if( !VALID_DIRECTDRAWSURFACE_PTR( thisx ) )
  76. {
  77. return DDERR_INVALIDOBJECT;
  78. }
  79. this = thisx->lpGbl;
  80. if( SURFACE_LOST( this ) )
  81. {
  82. return DDERR_SURFACELOST;
  83. }
  84. if( !VALID_DDSURFACEDESC_PTR( lpDDSurfaceDesc ) )
  85. {
  86. return DDERR_INVALIDPARAMS;
  87. }
  88. pdrv = this->lpDD;
  89. ENTER_DDRAW();
  90. LEAVE_DDRAW();
  91. return DDERR_UNSUPPORTED;
  92. } /* DD_SurfaceStreaming_Lock */
  93. #undef DPF_MODNAME
  94. #define DPF_MODNAME "Unlock"
  95. /*
  96. * DD_SurfaceStreaming_Unlock
  97. *
  98. * Done accessing a streaming surface.
  99. */
  100. HRESULT DDAPI DD_SurfaceStreaming_Unlock(
  101. LPDIRECTDRAWSURFACESTREAMING lpDDSurface,
  102. LPVOID lpSurfaceData )
  103. {
  104. LPDDRAWI_DDRAWSURFACE_LCL thisx;
  105. LPDDRAWI_DDRAWSURFACE_GBL this;
  106. LPDDRAWI_DIRECTDRAW pdrv;
  107. DPF(2,A,"ENTERAPI: DD_SurfaceStreaming_Unlock");
  108. thisx = (LPDDRAWI_DDRAWSURFACE_LCL) lpDDSurface;
  109. if( !VALID_DIRECTDRAWSURFACE_PTR( thisx ) )
  110. {
  111. return DDERR_INVALIDOBJECT;
  112. }
  113. this = thisx->lpGbl;
  114. if( SURFACE_LOST( this ) )
  115. {
  116. return DDERR_SURFACELOST;
  117. }
  118. /*
  119. * take driver lock
  120. */
  121. pdrv = this->lpDD;
  122. ENTER_DDRAW();
  123. LEAVE_DDRAW();
  124. return DDERR_UNSUPPORTED;
  125. } /* DD_SurfaceStreaming_Unlock */
  126. #endif