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.

131 lines
3.8 KiB

  1. #define HOOK_BitBlt HOOK_BITBLT
  2. #define HOOK_StretchBlt HOOK_STRETCHBLT
  3. #define HOOK_PlgBlt HOOK_PLGBLT
  4. #define HOOK_TextOut HOOK_TEXTOUT
  5. #define HOOK_Paint HOOK_PAINT
  6. #define HOOK_StrokePath HOOK_STROKEPATH
  7. #define HOOK_FillPath HOOK_FILLPATH
  8. #define HOOK_StrokeAndFillPath HOOK_STROKEANDFILLPATH
  9. #define HOOK_CopyBits HOOK_COPYBITS
  10. #define HOOK_LineTo HOOK_LINETO
  11. #define HOOK_StretchBltROP HOOK_STRETCHBLTROP
  12. #define HOOK_TransparentBlt HOOK_TRANSPARENTBLT
  13. #define HOOK_AlphaBlend HOOK_ALPHABLEND
  14. #define HOOK_GradientFill HOOK_GRADIENTFILL
  15. #define PPFNGET(po,name,flag) ((flag & HOOK_##name) ? ((PFN_Drv##name) (po).ppfn(INDEX_Drv##name)) : ((PFN_Drv##name) Eng##name))
  16. #define PPFNDRV(po,name) ((PFN_Drv##name) (po).ppfn(INDEX_Drv##name))
  17. #define PPFNVALID(po,name) (PPFNDRV(po,name) != ((PFN_Drv##name) NULL))
  18. #define PPFNTABLE(apfn,name) ((PFN_Drv##name) apfn[INDEX_Drv##name])
  19. class PDEVOBJ
  20. {
  21. private:
  22. HDEV _hdev;
  23. public:
  24. VOID vInit(HDEV hdev) {_hdev = hdev;}
  25. PDEVOBJ(HDEV hdev) {vInit(hdev);}
  26. PDEVOBJ() {vInit(NULL);}
  27. ~PDEVOBJ() {}
  28. BOOL bDeleted()
  29. {
  30. return ((BOOL)(DxEngGetHdevData(_hdev,HDEV_DELETED)));
  31. }
  32. BOOL bDisabled()
  33. {
  34. return ((BOOL)(DxEngGetHdevData(_hdev,HDEV_DISABLED)));
  35. }
  36. BOOL bDisplayPDEV()
  37. {
  38. return ((BOOL)(DxEngGetHdevData(_hdev,HDEV_DISPLAY)));
  39. }
  40. BOOL bIsPalManaged()
  41. {
  42. return ((BOOL)(DxEngGetHdevData(_hdev,HDEV_PALMANAGED)));
  43. }
  44. BOOL bMetaDriver()
  45. {
  46. return ((BOOL)(DxEngGetHdevData(_hdev,HDEV_DDML)));
  47. }
  48. BOOL bValid()
  49. {
  50. return (_hdev != NULL);
  51. }
  52. ULONG cDirectDrawDisableLocks()
  53. {
  54. return ((ULONG)(DxEngGetHdevData(_hdev,HDEV_DXLOCKS)));
  55. }
  56. VOID cDirectDrawDisableLocks(ULONG c)
  57. {
  58. DxEngSetHdevData(_hdev,HDEV_DXLOCKS,(ULONG_PTR)c);
  59. }
  60. HDEV hdevParent()
  61. {
  62. return ((HDEV)(DxEngGetHdevData(_hdev,HDEV_PARENTHDEV)));
  63. }
  64. DHPDEV dhpdev()
  65. {
  66. return ((DHPDEV)(DxEngGetHdevData(_hdev,HDEV_DHPDEV)));
  67. }
  68. DWORD dwDriverCapableOverride()
  69. {
  70. return ((DWORD)(DxEngGetHdevData(_hdev,HDEV_CAPSOVERRIDE)));
  71. }
  72. HDEV hdev()
  73. {
  74. return _hdev;
  75. }
  76. HSURF hsurf()
  77. {
  78. return ((HSURF)(DxEngGetHdevData(_hdev,HDEV_SURFACEHANDLE)));
  79. }
  80. DWORD flGraphicsCaps()
  81. {
  82. return ((DWORD)(DxEngGetHdevData(_hdev,HDEV_GCAPS)));
  83. }
  84. DWORD flGraphicsCaps2()
  85. {
  86. return ((DWORD)(DxEngGetHdevData(_hdev,HDEV_GCAPS2)));
  87. }
  88. HANDLE hScreen()
  89. {
  90. return ((HANDLE)(DxEngGetHdevData(_hdev,HDEV_MINIPORTHANDLE)));
  91. }
  92. DWORD iDitherFormat()
  93. {
  94. return ((ULONG)(DxEngGetHdevData(_hdev,HDEV_DITHERFORMAT)));
  95. }
  96. EDD_DIRECTDRAW_GLOBAL* peDirectDrawGlobal()
  97. {
  98. return ((EDD_DIRECTDRAW_GLOBAL*)(DxEngGetHdevData(_hdev,HDEV_DXDATA)));
  99. }
  100. VOID peDirectDrawGlobal(EDD_DIRECTDRAW_GLOBAL *p)
  101. {
  102. DxEngSetHdevData(_hdev,HDEV_DXDATA,(ULONG_PTR)p);
  103. }
  104. PFN ppfn(ULONG i)
  105. {
  106. PFN *apfn = (PFN*)DxEngGetHdevData(_hdev,HDEV_FUNCTIONTABLE);
  107. return (apfn[i]);
  108. }
  109. VOID vReferencePdev()
  110. {
  111. DxEngReferenceHdev(_hdev);
  112. }
  113. VOID vUnreferencePdev()
  114. {
  115. DxEngUnreferenceHdev(_hdev);
  116. }
  117. ULONG_PTR pldev()
  118. {
  119. return ((ULONG_PTR)(DxEngGetHdevData(_hdev,HDEV_LDEV)));
  120. }
  121. ULONG_PTR pGraphicsDevice()
  122. {
  123. return ((ULONG_PTR)(DxEngGetHdevData(_hdev,HDEV_GRAPHICSDEVICE)));
  124. }
  125. };