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.

143 lines
4.0 KiB

  1. ///////////////////////////////////////////////////////////////////
  2. // Copyright (c) 1999-2001 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. //Module Name:
  6. //
  7. // glcommon.cpp
  8. //
  9. //Abstract:
  10. //
  11. // This file contains function implementations common to both
  12. // user and kernel mode DLLs.
  13. //
  14. //Environment:
  15. //
  16. // Windows 2000/Whistler
  17. //
  18. /////////////////////////////////////////////////////////////
  19. #include "hpgl2col.h" //Precompiled header file
  20. //
  21. // If this is an NT 5.0 user-mode render module then include
  22. // winspool.h so that GetPrinterData will be defined.
  23. //
  24. #if defined(KERNEL_MODE) && defined(USERMODE_DRIVER)
  25. #include <winspool.h>
  26. #endif
  27. ////////////////////////////////////////////////////////
  28. // Function Prototypes
  29. ////////////////////////////////////////////////////////
  30. #ifdef KERNEL_MODE
  31. /////////////////////////////////////////////////////////////////////////
  32. //
  33. // Function Name:
  34. //
  35. // HPGLDriverDMS
  36. //
  37. // Description:
  38. //
  39. // Informs the unidrv host module that this plug in module is a Device
  40. // Managed Surface (DMS) and defines the features that will be hooked
  41. // through the HOOK_* constants.
  42. //
  43. // Notes:
  44. //
  45. // Don't hook out LINETO since HOOK_STROKEANDFILLPATH will draw
  46. // the lines.
  47. //
  48. // Input:
  49. //
  50. // PVOID pdevobj - The DEVOBJ
  51. // PVOID pvBuffer - buffer to place HOOK constant into
  52. // DWORD cbSize - probably the size of pvBuffer
  53. // PDWORD pcbNeeded - used to tell the caller more mem is needed
  54. //
  55. // Modifies:
  56. //
  57. // None.
  58. //
  59. // Returns:
  60. //
  61. // BOOL : TRUE if successful, FALSE otherwise
  62. //
  63. /////////////////////////////////////////////////////////////////////////
  64. BOOL
  65. HPGLDriverDMS(
  66. PVOID pdevobj,
  67. PVOID pvBuffer,
  68. DWORD cbSize,
  69. PDWORD pcbNeeded)
  70. {
  71. POEMDEVMODE pOEMDM = NULL;
  72. PDEVOBJ pDevObj = NULL;
  73. TERSE(("HPGLDriverDMS\n"));
  74. REQUIRE_VALID_DATA( pdevobj, return FALSE );
  75. pDevObj = (PDEVOBJ)pdevobj;
  76. #if 0
  77. //TEMP
  78. POEMPDEV poempdev = NULL;
  79. poempdev = POEMPDEV((PDEV *) pVectorPDEV)->pdevOEM;
  80. REQUIRE_VALID_DATA( poempdev, return FALSE );
  81. pOEMDM = (POEMDEVMODE)pDevObj->pOEMDM;
  82. /*/
  83. ASSERT(pOEMDM);
  84. /*/
  85. REQUIRE_VALID_DATA( pOEMDM, return FALSE );
  86. //*/
  87. REQUIRE_VALID_DATA( pvBuffer, return FALSE );
  88. // REQUIRE( cbSize >= sizeof( DWORD ), ERROR_INVALID_DATA, return FALSE );
  89. #endif
  90. // MONOCHROME. I cant figure out how to get poempdev here. Initially it was the OEM Devmode
  91. // but it is no longer used in monochrome version of driver. so we have to use poempdev
  92. // and i am trying to figure out how to get it. Till then lets just use if (1)
  93. // I think we can use if (TRUE) because the very fact that this function is called indicates
  94. // that HPGL has been chosen as the Graphics Language in the Advanced menu. Had it not
  95. // been chosen HPGLInitVectorProcTable would have returned NULL and this function would not have
  96. // been called.
  97. // So now the question is. Why to put a condition if the condition is to be hardcoded to
  98. // to TRUE. Well, cos eventually I want to have a condition here so that the structure is
  99. // same as Color driver, but cannot figure out what kind of condition will be appropriate here.
  100. //
  101. // if (poempdev->UIGraphicsMode == HPGL2)
  102. if (TRUE)
  103. {
  104. VERBOSE(("\nPrivate Devmode is HP-GL/2\n"));
  105. *(PDWORD)pvBuffer =
  106. HOOK_TEXTOUT |
  107. HOOK_COPYBITS |
  108. HOOK_BITBLT |
  109. HOOK_STRETCHBLT |
  110. HOOK_PAINT |
  111. #ifndef WINNT_40
  112. HOOK_PLGBLT |
  113. HOOK_STRETCHBLTROP |
  114. HOOK_TRANSPARENTBLT |
  115. HOOK_ALPHABLEND |
  116. HOOK_GRADIENTFILL |
  117. #endif
  118. HOOK_STROKEPATH |
  119. HOOK_FILLPATH |
  120. HOOK_STROKEANDFILLPATH;
  121. }
  122. else
  123. {
  124. VERBOSE(("\nPrivate Devmode is Raster\n"));
  125. *(PDWORD)pvBuffer = 0;
  126. }
  127. return TRUE;
  128. }
  129. #endif // #ifdef KERNEL_MODE