Accessing Printer Driver Interfaces from Plug-Ins

Important

The modern print platform is Windows' preferred means of communicating with printers. 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 Modern print platform and the Print support app design guide.

If a plug-in calls methods that belong to the driver-supplied IPrintOemDriverUI, IPrintCoreHelperPS, IPrintCoreHelperUni, IPrintCoreUI2, IPrintOemDriverUni, IPrintOemDriverPS, or IPrintCorePS2 COM interfaces, it must obtain an interface pointer from the driver as follows:

  1. The plug-in must implement the IPrintOemUI, IPrintOemUI2, IPrintOemUni, IPrintOemUni2, IPrintOemPS, or IPrintOemPS2 interface's PublishDriverInterface method.

  2. When the driver (Unidrv or Pscript5) calls the plug-in's PublishDriverInterface method, it supplies a pointer to the IPrintOemDriverUI, IPrintCoreUI2, IPrintOemDriverUni, IPrintOemDriverPS, or IPrintCorePS2 instance's IUnknown interface.

  3. The plug-in must use the IUnknown interface pointer to call IUnknown::QueryInterface, specifying the interface identifier that represents the desired version of the IPrintOemDriverUI, IPrintCoreUI2, IPrintOemDriverUni, IPrintOemDriverPS, or IPrintCorePS2 interface. (For more information, see Interface Identifiers for Printer Drivers.)

  4. If the plug-in specifies an interface identifier representing an interface version supported by the driver, QueryInterface returns a pointer to the IPrintOemDriverUI, IPrintCoreUI2, IPrintOemDriverUni, IPrintOemDriverPS, or IPrintCorePS2 interface. Note that the driver calls the interface's AddRef method (described in the Windows SDK documentation) before it returns the interface pointer to the plug-in. The plug-in should save this pointer to use it later to call interface methods.

  5. When the IPrintOemDriverUI, IPrintCoreUI2, IPrintOemDriverUni, IPrintOemDriverPS, or IPrintCorePS2 interface pointer is no longer needed, the plug-in must call the interface's Release method (described in the Windows SDK documentation).

For plug-ins to use the new Windows Vista IPrintCoreHelperPS or IPrintCoreHelperUni interface, the plug-in needs to add support for OEMGI_GETREQUESTEDHELPERINTERFACES in its IPrintOemUI::GetInfo, IPrintOemPS::GetInfo, or IPrintOemUni::GetInfo method.