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.

98 lines
3.1 KiB

  1. /*==========================================================================;
  2. *
  3. * Copyright (C) 1995-2000 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: d3dpr.h
  6. * Content: Direct3D private include file
  7. *@@BEGIN_MSINTERNAL
  8. *
  9. * History:
  10. * Date By Reason
  11. * ==== == ======
  12. * 05/11/95 stevela Initial rev with this header.
  13. * 23/11/95 colinmc Made various Direct3D interfaces queryable off
  14. * DirectDraw.
  15. * 07/12/95 stevela Merged Colin's changes.
  16. * 10/12/95 stevela Removed AGGREGATE_D3D.
  17. * 17/04/96 colinmc Bug 17008: DirectDraw/Direct3D deadlock
  18. *@@END_MSINTERNAL
  19. *
  20. ***************************************************************************/
  21. #ifndef _D3DPR_H_
  22. #define _D3DPR_H_
  23. #include "d3di.hpp"
  24. #include "dpf.h"
  25. #if 0
  26. extern "C" {
  27. #define this _this
  28. #include "ddrawpr.h"
  29. #undef this
  30. };
  31. #endif
  32. /*
  33. * Macros for validating parameters.
  34. * Only implement those not available in ddrawpr.h.
  35. */
  36. #define VALID_OUTPTR(x) ((x) && VALID_PTR_PTR(x))
  37. // FAST_CHECKING macro is defined in ddrawpr.h
  38. // so in make sure that ddrawpr.h is always included
  39. // before this header.
  40. #ifndef FAST_CHECKING
  41. #define VALID_DIRECT3DBASETEXTURE8_PTR( ptr ) \
  42. (!IsBadWritePtr( ptr, sizeof( LPVOID )))
  43. #define VALID_DDSURF_PTR( ptr ) \
  44. (!IsBadWritePtr( ptr, sizeof( DDRAWI_DDRAWSURFACE_INT )))
  45. #define VALID_DIRECT3DVERTEXBUFFER_PTR( ptr ) \
  46. (!IsBadWritePtr( ptr, sizeof( CDirect3DVertexBuffer )))
  47. #define VALID_D3DVERTEXBUFFERDESC_PTR( ptr ) \
  48. (!IsBadWritePtr( ptr, sizeof( D3DVERTEXBUFFERDESC8 ) ))
  49. #define VALID_D3DCAPS8_PTR( ptr ) \
  50. (! IsBadWritePtr(ptr, sizeof( D3DCAPS8)) )
  51. #define VALID_D3DRECT_PTR( ptr ) \
  52. (!IsBadWritePtr( ptr, sizeof( D3DRECT ) ))
  53. #define VALID_GDIRECT_PTR( ptr ) \
  54. (!IsBadWritePtr( ptr, sizeof( RECT ) ))
  55. #define VALID_GDIPOINT_PTR( ptr ) \
  56. (!IsBadWritePtr( ptr, sizeof( POINT ) ))
  57. #define VALID_D3DTEXTUREHANDLE_PTR( ptr ) \
  58. (!IsBadWritePtr( ptr, sizeof( D3DTEXTUREHANDLE ) ) )
  59. #define VALID_D3DDEVINFOSTRUCT_PTR( ptr, size ) \
  60. (!IsBadWritePtr( ptr, size ) )
  61. // Note: these macros are replacements for the VALID_DIRECTDRAWSURFACE_PTR ddraw macros
  62. // because those macros need access to the ddCallbacks ddraw globals.
  63. // At some point these could be replaced with a ddraw exported fn that actually
  64. // verifies the callback table type
  65. #define VALID_D3D_DIRECTDRAWSURFACE8_PTR(ptr) (!IsBadWritePtr(ptr, sizeof(VOID*)))
  66. #else /* !FAST_CHECKING */
  67. #define VALID_DIRECT3DBASETEXTURE8_PTR( ptr ) (ptr)
  68. #define VALID_DIRECT3DDEVICE_PTR( ptr ) (ptr)
  69. #define VALID_DDSURF_PTR( ptr ) (ptr)
  70. #define VALID_DIRECT3DVERTEXBUFFER_PTR( ptr ) (ptr)
  71. #define VALID_D3DVERTEXBUFFERDESC_PTR( ptr ) (ptr)
  72. #define VALID_D3DCAPS8_PTR( ptr ) (ptr)
  73. #define VALID_D3DRECT_PTR( ptr ) (ptr)
  74. #define VALID_GDIRECT_PTR( ptr ) (ptr)
  75. #define VALID_GDIPOINT_PTR( ptr ) (ptr)
  76. #define VALID_D3DTEXTUREHANDLE_PTR( ptr ) (ptr)
  77. #define VALID_D3D_DIRECTDRAWSURFACE8_PTR(ptr) (ptr)
  78. #define VALID_D3DDEVINFOSTRUCT_PTR( ptr, size ) (ptr)
  79. #endif /* !FAST_CHECKING */
  80. #endif /* _D3DPR_H_ */