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.

895 lines
24 KiB

  1. /*++
  2. Copyright (c) 1996-1999 Microsoft Corporation
  3. Module Name:
  4. intfuni.cpp
  5. Abstract:
  6. Interface implementation of Windows NT unidriver OEM rendering plugins
  7. Environment:
  8. Windows NT Unidriver.
  9. Revision History:
  10. 01/18/98 -ganeshp-
  11. Initial framework.
  12. --*/
  13. #define INITGUID
  14. #include "unidrv.h"
  15. #ifdef WINNT_40
  16. #include "cppfunc.h"
  17. #undef InterlockedIncrement
  18. #undef InterlockedDecrement
  19. #define InterlockedIncrement(x) DrvInterlockedIncrement(x)
  20. #define InterlockedDecrement(x) DrvInterlockedDecrement(x)
  21. int __cdecl _purecall (void)
  22. {
  23. return FALSE;
  24. }
  25. #endif // WINNT_40
  26. #pragma hdrstop("unidrv.h")
  27. #include "prcomoem.h"
  28. //
  29. // List all of the supported OEM plugin interface IIDs from the
  30. // latest to the oldest, that's the order our driver will QI OEM
  31. // plugin for its supported interface.
  32. //
  33. // DON"T remove the last NULL terminator.
  34. //
  35. static const GUID *PrintOemUni_IIDs[] = {
  36. &IID_IPrintOemUni2,
  37. &IID_IPrintOemUni,
  38. NULL
  39. };
  40. //
  41. // Component
  42. //
  43. class CPrintOemDriver : public IPrintOemDriverUni
  44. {
  45. //
  46. // IUnknown implementation
  47. //
  48. STDMETHODIMP QueryInterface(const IID& iid, void** ppv);
  49. STDMETHODIMP_(ULONG) AddRef();
  50. STDMETHODIMP_(ULONG) Release();
  51. //
  52. // Interface IPrintOemDriverUni implementation
  53. //
  54. STDMETHODIMP DrvGetDriverSetting(PVOID pdriverobj,
  55. PCSTR Feature,
  56. PVOID pOutput,
  57. DWORD cbSize,
  58. PDWORD pcbNeeded,
  59. PDWORD pdwOptionsReturned);
  60. STDMETHODIMP DrvWriteSpoolBuf(PDEVOBJ pdevobj,
  61. PVOID pBuffer,
  62. DWORD cbSize,
  63. OUT DWORD *pdwResult);
  64. //
  65. // Cursor movement helper functions.
  66. //
  67. STDMETHODIMP DrvXMoveTo(PDEVOBJ pdevobj,
  68. INT x,
  69. DWORD dwFlags,
  70. OUT INT *piResult);
  71. STDMETHODIMP DrvYMoveTo(PDEVOBJ pdevobj,
  72. INT y,
  73. DWORD dwFlags,
  74. OUT INT *piResult);
  75. //
  76. // Unidrv specific. To get the standard variable value.
  77. //
  78. STDMETHODIMP DrvGetStandardVariable(PDEVOBJ pdevobj,
  79. DWORD dwIndex,
  80. PVOID pBuffer,
  81. DWORD cbSize,
  82. PDWORD pcbNeeded);
  83. //
  84. // Unidrv specific. To Provide OEM plugins access to GPD data.
  85. //
  86. STDMETHODIMP DrvGetGPDData(PDEVOBJ pdevobj,
  87. DWORD dwType, // Type of the data
  88. PVOID pInputData, // reserved. Should be set to 0
  89. PVOID pBuffer, // Caller allocated Buffer to be copied
  90. DWORD cbSize, // Size of the buffer
  91. PDWORD pcbNeeded // New Size of the buffer if needed.
  92. );
  93. //
  94. // Unidrv specific. To do the TextOut.
  95. //
  96. STDMETHODIMP DrvUniTextOut(SURFOBJ *pso,
  97. STROBJ *pstro,
  98. FONTOBJ *pfo,
  99. CLIPOBJ *pco,
  100. RECTL *prclExtra,
  101. RECTL *prclOpaque,
  102. BRUSHOBJ *pboFore,
  103. BRUSHOBJ *pboOpaque,
  104. POINTL *pptlBrushOrg,
  105. MIX mix);
  106. STDMETHODIMP DrvWriteAbortBuf(PDEVOBJ pdevobj,
  107. PVOID pBuffer,
  108. DWORD cbSize,
  109. DWORD dwWait);
  110. public:
  111. //
  112. // Constructor
  113. //
  114. CPrintOemDriver() : m_cRef(0) {}
  115. private:
  116. long m_cRef;
  117. };
  118. STDMETHODIMP CPrintOemDriver::QueryInterface(const IID& iid, void** ppv)
  119. {
  120. if (iid == IID_IUnknown || iid == IID_IPrintOemDriverUni)
  121. {
  122. *ppv = static_cast<IPrintOemDriverUni *>(this);
  123. }
  124. else
  125. {
  126. *ppv = NULL;
  127. return E_NOINTERFACE;
  128. }
  129. reinterpret_cast<IUnknown*>(*ppv)->AddRef();
  130. return S_OK;
  131. }
  132. STDMETHODIMP_(ULONG) CPrintOemDriver::AddRef()
  133. {
  134. return InterlockedIncrement(&m_cRef);
  135. }
  136. STDMETHODIMP_(ULONG) CPrintOemDriver::Release()
  137. {
  138. if (InterlockedDecrement(&m_cRef) == 0)
  139. {
  140. delete this;
  141. return 0;
  142. }
  143. return m_cRef;
  144. }
  145. STDMETHODIMP CPrintOemDriver::DrvGetDriverSetting(PVOID pdriverobj,
  146. PCSTR Feature,
  147. PVOID pOutput,
  148. DWORD cbSize,
  149. PDWORD pcbNeeded,
  150. PDWORD pdwOptionsReturned)
  151. {
  152. if (BGetDriverSettingForOEM((PDEV *)pdriverobj,
  153. Feature,
  154. pOutput,
  155. cbSize,
  156. pcbNeeded,
  157. pdwOptionsReturned))
  158. return S_OK;
  159. return E_FAIL;
  160. }
  161. STDMETHODIMP CPrintOemDriver::DrvWriteSpoolBuf(PDEVOBJ pdevobj,
  162. PVOID pBuffer,
  163. DWORD cbSize,
  164. OUT DWORD *pdwResult)
  165. {
  166. DWORD dwI;
  167. POEM_PLUGIN_ENTRY pOemEntry;
  168. //
  169. // OEM plug-ins may not call back to DrvWriteSpoolBuf during the
  170. // WritePrinter hook.
  171. //
  172. if (((PDEV*)pdevobj)->fMode2 & PF2_CALLING_OEM_WRITE_PRINTER)
  173. return E_FAIL;
  174. if (*pdwResult = WriteSpoolBuf((PDEV *)pdevobj, (PBYTE)pBuffer, cbSize))
  175. {
  176. return S_OK;
  177. }
  178. *pdwResult = 0;
  179. return E_FAIL;
  180. }
  181. STDMETHODIMP CPrintOemDriver::DrvWriteAbortBuf(PDEVOBJ pdevobj,
  182. PVOID pBuffer,
  183. DWORD cbSize,
  184. DWORD dwWait)
  185. {
  186. DWORD dwI;
  187. POEM_PLUGIN_ENTRY pOemEntry;
  188. //
  189. // OEM Plug-ins may not call back to DrvWriteAbortBuf during the
  190. // WritePrinter hook.
  191. //
  192. if (((PDEV*)pdevobj)->fMode2 & PF2_CALLING_OEM_WRITE_PRINTER)
  193. return E_FAIL;
  194. WriteAbortBuf((PDEV *)pdevobj, (PBYTE)pBuffer, cbSize, dwWait) ;
  195. return S_OK; // no failure condition
  196. }
  197. //
  198. // Cursor movement helper functions.
  199. //
  200. STDMETHODIMP CPrintOemDriver::DrvXMoveTo(PDEVOBJ pdevobj,
  201. INT x,
  202. DWORD dwFlags,
  203. OUT INT *piResult)
  204. {
  205. *piResult = XMoveTo((PDEV *)pdevobj, x, dwFlags);
  206. return S_OK;
  207. }
  208. STDMETHODIMP CPrintOemDriver::DrvYMoveTo(PDEVOBJ pdevobj,
  209. INT y,
  210. DWORD dwFlags,
  211. OUT INT *piResult)
  212. {
  213. *piResult = YMoveTo((PDEV *)pdevobj, y, dwFlags);
  214. return S_OK;
  215. }
  216. //
  217. // Unidrv specific. To get the standard variable value.
  218. //
  219. STDMETHODIMP CPrintOemDriver::DrvGetStandardVariable(PDEVOBJ pdevobj,
  220. DWORD dwIndex,
  221. PVOID pBuffer,
  222. DWORD cbSize,
  223. PDWORD pcbNeeded)
  224. {
  225. if (BGetStandardVariable((PDEV *)pdevobj, dwIndex, pBuffer,
  226. cbSize, pcbNeeded))
  227. return S_OK;
  228. return E_FAIL;
  229. }
  230. //
  231. // Unidrv specific. To Provide OEM plugins access to GPD data.
  232. //
  233. STDMETHODIMP CPrintOemDriver::DrvGetGPDData(PDEVOBJ pdevobj,
  234. DWORD dwType, // Type of the data
  235. PVOID pInputData, // reserved. Should be set to 0
  236. PVOID pBuffer, // Caller allocated Buffer to be copied
  237. DWORD cbSize, // Size of the buffer
  238. PDWORD pcbNeeded // New Size of the buffer if needed.
  239. )
  240. {
  241. if (BGetGPDData((PDEV *)pdevobj, dwType,
  242. pInputData, pBuffer, cbSize, pcbNeeded ))
  243. return S_OK;
  244. return E_FAIL;
  245. }
  246. //
  247. // Unidrv specific. To do the TextOut.
  248. //
  249. STDMETHODIMP CPrintOemDriver::DrvUniTextOut(SURFOBJ *pso,
  250. STROBJ *pstro,
  251. FONTOBJ *pfo,
  252. CLIPOBJ *pco,
  253. RECTL *prclExtra,
  254. RECTL *prclOpaque,
  255. BRUSHOBJ *pboFore,
  256. BRUSHOBJ *pboOpaque,
  257. POINTL *pptlBrushOrg,
  258. MIX mix)
  259. {
  260. if (FMTextOut(pso, pstro, pfo,pco, prclExtra, prclOpaque,
  261. pboFore, pboOpaque, pptlBrushOrg, mix))
  262. {
  263. return S_OK;
  264. }
  265. return E_FAIL;
  266. }
  267. //
  268. // Creation function
  269. //
  270. extern "C" IUnknown* DriverCreateInstance()
  271. {
  272. IUnknown* pI = static_cast<IPrintOemDriverUni *>(new CPrintOemDriver);
  273. if (pI != NULL)
  274. pI->AddRef();
  275. return pI;
  276. }
  277. extern "C" HRESULT HDriver_CoCreateInstance(
  278. IN REFCLSID rclsid,
  279. IN LPUNKNOWN pUnknownOuter,
  280. IN DWORD dwClsContext,
  281. IN REFIID riid,
  282. IN LPVOID *ppv,
  283. IN HANDLE hInstance
  284. );
  285. //
  286. // Get OEM plugin interface and publish driver helper interface
  287. //
  288. extern "C" BOOL BGetOemInterface(POEM_PLUGIN_ENTRY pOemEntry)
  289. {
  290. IUnknown *pIDriverHelper = NULL;
  291. HRESULT hr;
  292. //
  293. // QI to retrieve the latest interface OEM plugin supports
  294. //
  295. if (!BQILatestOemInterface(pOemEntry->hInstance,
  296. CLSID_OEMRENDER,
  297. PrintOemUni_IIDs,
  298. &(pOemEntry->pIntfOem),
  299. &(pOemEntry->iidIntfOem)))
  300. {
  301. ERR(("BQILatestOemInterface failed\n"));
  302. return FALSE;
  303. }
  304. //
  305. // If QI succeeded, pOemEntry->pIntfOem will have the OEM plugin
  306. // interface pointer with ref count 1.
  307. //
  308. //
  309. // Publish driver's helper function interface
  310. //
  311. if ((pIDriverHelper = DriverCreateInstance()) == NULL)
  312. {
  313. ERR(("DriverCreateInstance failed\n"));
  314. goto fail_cleanup;
  315. }
  316. //
  317. // As long as we define new OEM plugin interface by inheriting old ones,
  318. // we can always cast pIntfOem into pointer of the oldest plugin interface
  319. // (the base class) and call PublishDriverInterface method.
  320. //
  321. // Otherwise, this code needs to be modified when new interface is added.
  322. //
  323. hr = ((IPrintOemUni *)(pOemEntry->pIntfOem))->PublishDriverInterface(pIDriverHelper);
  324. //
  325. // OEM plugin should do QI in their PublishDriverInterface, so we need to release
  326. // our ref count of pIDriverHelper.
  327. //
  328. pIDriverHelper->Release();
  329. if (FAILED(hr))
  330. {
  331. ERR(("PublishDriverInterface failed\n"));
  332. goto fail_cleanup;
  333. }
  334. return TRUE;
  335. fail_cleanup:
  336. //
  337. // If failed, we need to release the ref count we hold on pOemEntry->pIntfOem,
  338. // and set pIntfOem to NULL to indicate no COM interface is available.
  339. //
  340. ((IUnknown *)(pOemEntry->pIntfOem))->Release();
  341. pOemEntry->pIntfOem = NULL;
  342. return FALSE;
  343. }
  344. //
  345. // CALL_INTRFACE macros
  346. //
  347. #define CALL_INTRFACE(MethodName, pOemEntry, args) \
  348. if (IsEqualGUID(&(pOemEntry)->iidIntfOem, &IID_IPrintOemUni)) \
  349. { \
  350. return ((IPrintOemUni *)(pOemEntry)->pIntfOem)->MethodName args; \
  351. } \
  352. else if (IsEqualGUID(&(pOemEntry)->iidIntfOem, &IID_IPrintOemUni2)) \
  353. { \
  354. return ((IPrintOemUni2 *)(pOemEntry)->pIntfOem)->MethodName args; \
  355. } \
  356. return E_NOINTERFACE;
  357. #define CALL_INTRFACE2(MethodName, pOemEntry, args) \
  358. if (IsEqualGUID(&(pOemEntry)->iidIntfOem, &IID_IPrintOemUni2)) \
  359. { \
  360. return ((IPrintOemUni2 *)(pOemEntry)->pIntfOem)->MethodName args; \
  361. } \
  362. return E_NOINTERFACE;
  363. // add additional else if (IsEqualGUID(&pOemEntry->iidIntfOem, &IID_IPrintOemUni2))\
  364. // sections as needed as more interfaces are defined to CALL_INTRFACE macro.
  365. extern "C" HRESULT HComOEMGetInfo(POEM_PLUGIN_ENTRY pOemEntry,
  366. DWORD dwMode,
  367. PVOID pBuffer,
  368. DWORD cbSize,
  369. PDWORD pcbNeeded)
  370. {
  371. CALL_INTRFACE(GetInfo, pOemEntry, (dwMode, pBuffer, cbSize, pcbNeeded));
  372. }
  373. extern "C" HRESULT HComOEMDevMode(POEM_PLUGIN_ENTRY pOemEntry,
  374. DWORD dwMode,
  375. POEMDMPARAM pOemDMParam)
  376. {
  377. CALL_INTRFACE(DevMode, pOemEntry, (dwMode, pOemDMParam));
  378. }
  379. extern "C" HRESULT HComOEMEnableDriver(POEM_PLUGIN_ENTRY pOemEntry,
  380. DWORD DriverVersion,
  381. DWORD cbSize,
  382. PDRVENABLEDATA pded)
  383. {
  384. CALL_INTRFACE(EnableDriver, pOemEntry, (DriverVersion, cbSize, pded));
  385. }
  386. extern "C" HRESULT HComOEMDisableDriver(POEM_PLUGIN_ENTRY pOemEntry)
  387. {
  388. CALL_INTRFACE(DisableDriver, pOemEntry, ());
  389. }
  390. extern "C" HRESULT HComOEMEnablePDEV(POEM_PLUGIN_ENTRY pOemEntry,
  391. PDEVOBJ pdevobj,
  392. PWSTR pPrinterName,
  393. ULONG cPatterns,
  394. HSURF *phsurfPatterns,
  395. ULONG cjGdiInfo,
  396. GDIINFO *pGdiInfo,
  397. ULONG cjDevInfo,
  398. DEVINFO *pDevInfo,
  399. DRVENABLEDATA *pded,
  400. PDEVOEM *pDevOem)
  401. {
  402. CALL_INTRFACE(EnablePDEV, pOemEntry, (pdevobj,
  403. pPrinterName,
  404. cPatterns,
  405. phsurfPatterns,
  406. cjGdiInfo,
  407. pGdiInfo,
  408. cjDevInfo,
  409. pDevInfo,
  410. pded,
  411. pDevOem));
  412. }
  413. extern "C" HRESULT HComOEMDisablePDEV(
  414. POEM_PLUGIN_ENTRY pOemEntry,
  415. PDEVOBJ pdevobj
  416. )
  417. {
  418. CALL_INTRFACE(DisablePDEV, pOemEntry, (pdevobj));
  419. }
  420. extern "C" HRESULT HComOEMResetPDEV(
  421. POEM_PLUGIN_ENTRY pOemEntry,
  422. PDEVOBJ pdevobjOld,
  423. PDEVOBJ pdevobjNew
  424. )
  425. {
  426. CALL_INTRFACE(ResetPDEV, pOemEntry, (pdevobjOld, pdevobjNew));
  427. }
  428. extern "C" HRESULT HComGetImplementedMethod(
  429. POEM_PLUGIN_ENTRY pOemEntry,
  430. PSTR pMethodName
  431. )
  432. {
  433. CALL_INTRFACE(GetImplementedMethod, pOemEntry, (pMethodName));
  434. }
  435. //
  436. // OEMDriverDMS - UNIDRV only,
  437. //
  438. extern "C" HRESULT HComDriverDMS(
  439. POEM_PLUGIN_ENTRY pOemEntry,
  440. PVOID pDevObj,
  441. PVOID pBuffer,
  442. WORD cbSize,
  443. PDWORD pcbNeeded
  444. )
  445. {
  446. CALL_INTRFACE(DriverDMS, pOemEntry, (pDevObj, pBuffer, cbSize, pcbNeeded));
  447. }
  448. //
  449. // OEMCommandCallback - UNIDRV only,
  450. //
  451. extern "C" HRESULT HComCommandCallback(
  452. POEM_PLUGIN_ENTRY pOemEntry,
  453. PDEVOBJ pdevobj,
  454. DWORD dwCallbackID,
  455. DWORD dwCount,
  456. PDWORD pdwParams,
  457. OUT INT *piResult
  458. )
  459. {
  460. CALL_INTRFACE(CommandCallback, pOemEntry, (pdevobj,
  461. dwCallbackID,
  462. dwCount,
  463. pdwParams,
  464. piResult));
  465. }
  466. //
  467. // OEMImageProcessing - UNIDRV only,
  468. //
  469. extern "C" HRESULT HComImageProcessing(
  470. POEM_PLUGIN_ENTRY pOemEntry,
  471. PDEVOBJ pdevobj,
  472. PBYTE pSrcBitmap,
  473. PBITMAPINFOHEADER pBitmapInfoHeader,
  474. PBYTE pColorTable,
  475. DWORD dwCallbackID,
  476. PIPPARAMS pIPParams,
  477. OUT PBYTE *ppbResult
  478. )
  479. {
  480. CALL_INTRFACE(ImageProcessing, pOemEntry,
  481. (pdevobj,
  482. pSrcBitmap,
  483. pBitmapInfoHeader,
  484. pColorTable,
  485. dwCallbackID,
  486. pIPParams,
  487. ppbResult));
  488. }
  489. //
  490. // OEMFilterGraphics - UNIDRV only,
  491. //
  492. extern "C" HRESULT HComFilterGraphics(
  493. POEM_PLUGIN_ENTRY pOemEntry,
  494. PDEVOBJ pdevobj,
  495. PBYTE pBuf,
  496. DWORD dwLen
  497. )
  498. {
  499. CALL_INTRFACE(FilterGraphics, pOemEntry,
  500. (pdevobj,
  501. pBuf,
  502. dwLen));
  503. }
  504. //
  505. // OEMCompression - UNIDRV only,
  506. //
  507. extern "C" HRESULT HComCompression(
  508. POEM_PLUGIN_ENTRY pOemEntry,
  509. PDEVOBJ pdevobj,
  510. PBYTE pInBuf,
  511. PBYTE pOutBuf,
  512. DWORD dwInLen,
  513. DWORD dwOutLen,
  514. OUT INT *piResult
  515. )
  516. {
  517. CALL_INTRFACE(Compression, pOemEntry,
  518. (pdevobj,
  519. pInBuf,
  520. pOutBuf,
  521. dwInLen,
  522. dwOutLen,
  523. piResult));
  524. }
  525. //
  526. // OEMHalftone - UNIDRV only
  527. //
  528. extern "C" HRESULT HComHalftonePattern(
  529. POEM_PLUGIN_ENTRY pOemEntry,
  530. PDEVOBJ pdevobj,
  531. PBYTE pHTPattern,
  532. DWORD dwHTPatternX,
  533. DWORD dwHTPatternY,
  534. DWORD dwHTNumPatterns,
  535. DWORD dwCallbackID,
  536. PBYTE pResource,
  537. DWORD dwResourceSize
  538. )
  539. {
  540. CALL_INTRFACE(HalftonePattern, pOemEntry,
  541. (pdevobj,
  542. pHTPattern,
  543. dwHTPatternX,
  544. dwHTPatternY,
  545. dwHTNumPatterns,
  546. dwCallbackID,
  547. pResource,
  548. dwResourceSize));
  549. }
  550. //
  551. // OEMMemoryUsage - UNIDRV only,
  552. //
  553. extern "C" HRESULT HComMemoryUsage(
  554. POEM_PLUGIN_ENTRY pOemEntry,
  555. PDEVOBJ pdevobj,
  556. POEMMEMORYUSAGE pMemoryUsage
  557. )
  558. {
  559. CALL_INTRFACE(MemoryUsage, pOemEntry,
  560. (pdevobj,
  561. pMemoryUsage));
  562. }
  563. //
  564. // OEMTTYGetInfo - UNIDRV only
  565. //
  566. extern "C" HRESULT HComTTYGetInfo(
  567. POEM_PLUGIN_ENTRY pOemEntry,
  568. PDEVOBJ pdevobj,
  569. DWORD dwInfoIndex,
  570. PVOID pOutputBuf,
  571. DWORD dwSize,
  572. DWORD *pcbcNeeded
  573. )
  574. {
  575. CALL_INTRFACE(TTYGetInfo, pOemEntry,
  576. (pdevobj,
  577. dwInfoIndex,
  578. pOutputBuf,
  579. dwSize,
  580. pcbcNeeded));
  581. }
  582. //
  583. // OEMDownloadFontheader - UNIDRV only
  584. //
  585. extern "C" HRESULT HComDownloadFontHeader(
  586. POEM_PLUGIN_ENTRY pOemEntry,
  587. PDEVOBJ pdevobj,
  588. PUNIFONTOBJ pUFObj,
  589. OUT DWORD *pdwResult
  590. )
  591. {
  592. CALL_INTRFACE(DownloadFontHeader, pOemEntry,
  593. (pdevobj,
  594. pUFObj,
  595. pdwResult));
  596. }
  597. //
  598. // OEMDownloadCharGlyph - UNIDRV only
  599. //
  600. extern "C" HRESULT HComDownloadCharGlyph(
  601. POEM_PLUGIN_ENTRY pOemEntry,
  602. PDEVOBJ pdevobj,
  603. PUNIFONTOBJ pUFObj,
  604. HGLYPH hGlyph,
  605. PDWORD pdwWidth,
  606. OUT DWORD *pdwResult
  607. )
  608. {
  609. CALL_INTRFACE(DownloadCharGlyph, pOemEntry,
  610. (pdevobj,
  611. pUFObj,
  612. hGlyph,
  613. pdwWidth,
  614. pdwResult));
  615. }
  616. //
  617. // OEMTTDownloadMethod - UNIDRV only
  618. //
  619. extern "C"HRESULT HComTTDownloadMethod(
  620. POEM_PLUGIN_ENTRY pOemEntry,
  621. PDEVOBJ pdevobj,
  622. PUNIFONTOBJ pUFObj,
  623. OUT DWORD *pdwResult
  624. )
  625. {
  626. CALL_INTRFACE(TTDownloadMethod, pOemEntry,
  627. (pdevobj,
  628. pUFObj,
  629. pdwResult));
  630. }
  631. //
  632. // OEMOutputCharStr - UNIDRV only
  633. //
  634. extern "C" HRESULT HComOutputCharStr(
  635. POEM_PLUGIN_ENTRY pOemEntry,
  636. PDEVOBJ pdevobj,
  637. PUNIFONTOBJ pUFObj,
  638. DWORD dwType,
  639. DWORD dwCount,
  640. PVOID pGlyph
  641. )
  642. {
  643. CALL_INTRFACE(OutputCharStr, pOemEntry,
  644. (pdevobj,
  645. pUFObj,
  646. dwType,
  647. dwCount,
  648. pGlyph));
  649. }
  650. //
  651. // OEMSendFontCmd - UNIDRV only
  652. //
  653. extern "C" HRESULT HComSendFontCmd(
  654. POEM_PLUGIN_ENTRY pOemEntry,
  655. PDEVOBJ pdevobj,
  656. PUNIFONTOBJ pUFObj,
  657. PFINVOCATION pFInv
  658. )
  659. {
  660. CALL_INTRFACE(SendFontCmd, pOemEntry,
  661. (pdevobj,
  662. pUFObj,
  663. pFInv));
  664. }
  665. //
  666. // OEMTextOutAsBitmap - UNIDRV only
  667. //
  668. HRESULT HComTextOutAsBitmap(
  669. POEM_PLUGIN_ENTRY pOemEntry,
  670. SURFOBJ *pso,
  671. STROBJ *pstro,
  672. FONTOBJ *pfo,
  673. CLIPOBJ *pco,
  674. RECTL *prclExtra,
  675. RECTL *prclOpaque,
  676. BRUSHOBJ *pboFore,
  677. BRUSHOBJ *pboOpaque,
  678. POINTL *pptlOrg,
  679. MIX mix
  680. )
  681. {
  682. CALL_INTRFACE(TextOutAsBitmap, pOemEntry,
  683. (pso,
  684. pstro,
  685. pfo,
  686. pco,
  687. prclExtra,
  688. prclOpaque,
  689. pboFore,
  690. pboOpaque,
  691. pptlOrg,
  692. mix
  693. ));
  694. }
  695. extern "C" HRESULT HComWritePrinter(POEM_PLUGIN_ENTRY pOemEntry,
  696. PDEVOBJ pdevobj,
  697. PVOID pBuf,
  698. DWORD cbBuffer,
  699. PDWORD pcbWritten)
  700. {
  701. CALL_INTRFACE2(WritePrinter, pOemEntry,
  702. (pdevobj,
  703. pBuf,
  704. cbBuffer,
  705. pcbWritten));
  706. }
  707. extern "C" ULONG ReleaseOemInterface(POEM_PLUGIN_ENTRY pOemEntry)
  708. {
  709. #ifdef WINNT_40
  710. HRESULT hr;
  711. if (IsEqualGUID(&pOemEntry->iidIntfOem, &IID_IPrintOemUni)) \
  712. {
  713. hr = ((IPrintOemUni *)(pOemEntry)->pIntfOem)->Release();
  714. }
  715. #else // WINNT_40
  716. CALL_INTRFACE(Release, pOemEntry,
  717. ());
  718. #endif // WINNT_40
  719. return 0;
  720. }
  721. #if CODE_COMPLETE
  722. #endif