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.

266 lines
8.5 KiB

  1. /*++
  2. Copyright (c) 1996-2003 Microsoft Corporation
  3. Module Name:
  4. comoem.cpp
  5. Abstract:
  6. Implementation of OEMGetInfo and OEMDevMode.
  7. Shared by all Unidrv OEM test dll's.
  8. Environment:
  9. Windows 2000, Windows XP, Windows Server 2003 Unidrv driver
  10. Revision History:
  11. Created it.
  12. --*/
  13. ////////////////////////////////////////////////////////////////////////////////
  14. //
  15. // IOemCB
  16. //
  17. class IOemCB:public IPrintOemUni2
  18. {
  19. public:
  20. // *** IUnknown methods ***
  21. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj);
  22. STDMETHOD_(ULONG,AddRef) (THIS);
  23. STDMETHOD_(ULONG,Release) (THIS);
  24. //
  25. // Method for publishing Driver interface.
  26. //
  27. STDMETHOD(PublishDriverInterface)(THIS_ IUnknown *pIUnknown);
  28. //
  29. // Method for getting the implemented methods.
  30. // Returns S_OK if the given method is implemneted.
  31. // Returns S_FALSE if the given method is notimplemneted.
  32. //
  33. STDMETHOD(GetImplementedMethod)(THIS_ PSTR pMethodName);
  34. //
  35. // Method for OEM to specify DDI hook out
  36. //
  37. STDMETHOD(EnableDriver) (THIS_ DWORD DriverVersion,
  38. DWORD cbSize,
  39. PDRVENABLEDATA pded);
  40. //
  41. // Method to notify OEM plugin that it is no longer required
  42. //
  43. STDMETHOD(DisableDriver) (THIS);
  44. //
  45. // Method for OEM to contruct its own PDEV
  46. //
  47. STDMETHOD(EnablePDEV) (THIS_ PDEVOBJ pdevobj,
  48. PWSTR pPrinterName,
  49. ULONG cPatterns,
  50. HSURF *phsurfPatterns,
  51. ULONG cjGdiInfo,
  52. GDIINFO *pGdiInfo,
  53. ULONG cjDevInfo,
  54. DEVINFO *pDevInfo,
  55. DRVENABLEDATA *pded,
  56. OUT PDEVOEM *pDevOem);
  57. //
  58. // Method for OEM to free any resource associated with its PDEV
  59. //
  60. STDMETHOD(DisablePDEV) (THIS_ PDEVOBJ pdevobj);
  61. //
  62. // Method for OEM to transfer from old PDEV to new PDEV
  63. //
  64. STDMETHOD(ResetPDEV) (THIS_ PDEVOBJ pdevobjOld,
  65. PDEVOBJ pdevobjNew);
  66. //
  67. // Get OEM dll related information
  68. //
  69. STDMETHOD(GetInfo) (THIS_ DWORD dwMode,
  70. PVOID pBuffer,
  71. DWORD cbSize,
  72. PDWORD pcbNeeded);
  73. //
  74. // OEMDriverDMS - UNIDRV only, return E_NOTIMPL on Pscript
  75. //
  76. STDMETHOD(DriverDMS)(THIS_ PVOID pDevObj,
  77. PVOID pBuffer,
  78. DWORD cbSize,
  79. PDWORD pcbNeeded);
  80. //
  81. // OEMDevMode
  82. //
  83. STDMETHOD(DevMode) (THIS_ DWORD dwMode,
  84. POEMDMPARAM pOemDMParam);
  85. //
  86. // OEMCommandCallback - UNIDRV only, return E_NOTIMPL on Pscript
  87. //
  88. STDMETHOD(CommandCallback)(THIS_ PDEVOBJ pdevobj,
  89. DWORD dwCallbackID,
  90. DWORD dwCount,
  91. PDWORD pdwParams,
  92. OUT INT *piResult);
  93. //
  94. // OEMImageProcessing - UNIDRV only, return E_NOTIMPL on Pscript
  95. //
  96. STDMETHOD(ImageProcessing)(THIS_ PDEVOBJ pdevobj,
  97. PBYTE pSrcBitmap,
  98. PBITMAPINFOHEADER pBitmapInfoHeader,
  99. PBYTE pColorTable,
  100. DWORD dwCallbackID,
  101. PIPPARAMS pIPParams,
  102. OUT PBYTE *ppbResult);
  103. //
  104. // OEMFilterGraphics - UNIDRV only, return E_NOTIMPL on Pscript
  105. //
  106. STDMETHOD(FilterGraphics) (THIS_ PDEVOBJ pdevobj,
  107. PBYTE pBuf,
  108. DWORD dwLen);
  109. //
  110. // OEMCompression - UNIDRV only, return E_NOTIMPL on Pscript
  111. //
  112. STDMETHOD(Compression)(THIS_ PDEVOBJ pdevobj,
  113. PBYTE pInBuf,
  114. PBYTE pOutBuf,
  115. DWORD dwInLen,
  116. DWORD dwOutLen,
  117. OUT INT *piResult);
  118. //
  119. // OEMHalftone - UNIDRV only, return E_NOTIMPL on Pscript
  120. //
  121. STDMETHOD(HalftonePattern) (THIS_ PDEVOBJ pdevobj,
  122. PBYTE pHTPattern,
  123. DWORD dwHTPatternX,
  124. DWORD dwHTPatternY,
  125. DWORD dwHTNumPatterns,
  126. DWORD dwCallbackID,
  127. PBYTE pResource,
  128. DWORD dwResourceSize);
  129. //
  130. // OEMMemoryUsage - UNIDRV only, return E_NOTIMPL on Pscript
  131. //
  132. STDMETHOD(MemoryUsage) (THIS_ PDEVOBJ pdevobj,
  133. POEMMEMORYUSAGE pMemoryUsage);
  134. //
  135. // OEMTTYGetInfo - UNIDRV only, return E_NOTIMPL on Pscript
  136. //
  137. STDMETHOD(TTYGetInfo)(THIS_ PDEVOBJ pdevobj,
  138. DWORD dwInfoIndex,
  139. PVOID pOutputBuf,
  140. DWORD dwSize,
  141. DWORD *pcbcNeeded);
  142. //
  143. // OEMDownloadFontheader - UNIDRV only
  144. //
  145. STDMETHOD(DownloadFontHeader)(THIS_ PDEVOBJ pdevobj,
  146. PUNIFONTOBJ pUFObj,
  147. OUT DWORD *pdwResult);
  148. //
  149. // OEMDownloadCharGlyph - UNIDRV only
  150. //
  151. STDMETHOD(DownloadCharGlyph)(THIS_ PDEVOBJ pdevobj,
  152. PUNIFONTOBJ pUFObj,
  153. HGLYPH hGlyph,
  154. PDWORD pdwWidth,
  155. OUT DWORD *pdwResult);
  156. //
  157. // OEMTTDownloadMethod - UNIDRV only
  158. //
  159. STDMETHOD(TTDownloadMethod)(THIS_ PDEVOBJ pdevobj,
  160. PUNIFONTOBJ pUFObj,
  161. OUT DWORD *pdwResult);
  162. //
  163. // OEMOutputCharStr - UNIDRV only
  164. //
  165. STDMETHOD(OutputCharStr)(THIS_ PDEVOBJ pdevobj,
  166. PUNIFONTOBJ pUFObj,
  167. DWORD dwType,
  168. DWORD dwCount,
  169. PVOID pGlyph);
  170. //
  171. // OEMSendFontCmd - UNIDRV only
  172. //
  173. STDMETHOD(SendFontCmd)(THIS_ PDEVOBJ pdevobj,
  174. PUNIFONTOBJ pUFObj,
  175. PFINVOCATION pFInv);
  176. //
  177. // OEMTextOutAsBitmap - UNIDRV only
  178. //
  179. STDMETHOD(TextOutAsBitmap)(THIS_ SURFOBJ *pso,
  180. STROBJ *pstro,
  181. FONTOBJ *pfo,
  182. CLIPOBJ *pco,
  183. RECTL *prclExtra,
  184. RECTL *prclOpaque,
  185. BRUSHOBJ *pboFore,
  186. BRUSHOBJ *pboOpaque,
  187. POINTL *pptlOrg,
  188. MIX mix);
  189. //
  190. // OEMWritePrinter - UNIDRV only
  191. //
  192. STDMETHOD(WritePrinter) (THIS_ PDEVOBJ pdevobj,
  193. PVOID pBuf,
  194. DWORD cbBuffer,
  195. PDWORD pcbWritten);
  196. IOemCB() { m_cRef = 1; pOEMHelp = NULL; };
  197. ~IOemCB();
  198. protected:
  199. IPrintOemDriverUni* pOEMHelp;
  200. LONG m_cRef;
  201. };