COM-Based Rendering Plug-Ins

Important

We recommend that you use Microsoft's IPP inbox class driver, along with Print Support Apps (PSA), to customize the print experience in Windows 10 and 11 for printer device development.

For more information, see the Print support app design guide.

To provide customized hooking functions, your COM-based rendering plug-in must implement the IPrintOemUni::EnableDriver or IPrintOemPS::EnableDriver method, which fills in a DRVENABLEDATA structure with the address of each hooking function.

A COM-based rendering plug-in can hook out a graphics DDI function only if the Unidrv or Pscript5 driver defines the function. For a list of such functions, see IPrintOemUni::EnableDriver or IPrintOemPS::EnableDriver.

If you provide a particular customized hooking function, that function preempts the driver's equivalent graphics DDI function. When you design a customized hooking function, you have the following options:

  • The hooking function can completely handle the graphics DDI operation internally.

  • The hooking function can call back to the printer driver's equivalent graphics DDI function.

By calling back to the driver's graphics DDI function, the hooking function can perform preprocessing or postprocessing of function arguments, but still allow the driver to actually perform the graphics DDI operation. One of the input arguments to a rendering plug-in's IPrintOemUni::EnablePDEV or IPrintOemPS::EnablePDEV method is a DRVENABLEDATA structure that contains pointers to the driver's graphics DDI functions. If you want to call back to these functions, you should save the contents of this structure.

It might be necessary for you to provide a customized PDEV structure. You can reference this structure from within a graphics DDI hooking function, through the SURFOBJ structure pointer that each hooking function receives as input. Specifically, the SURFOBJ structure's dhpdev member points to a DEVOBJ structure, and the DEVOBJ structure's pdevOEM member points to your customized PDEV structure.