Bewerken

Delen via


Functions defined by printer graphics DLLs

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.

Like all graphics drivers, printer graphics DLLs are responsible for defining the following graphics DDI functions. Following DrvEnableDriver, the initial driver entry point, the remaining functions are listed in alphabetical order. Note that because GDI calls DrvEnableDriver by name, its name appears in bold. GDI calls all other display driver functions by way of an array of function pointers that DrvEnableDriver returns.

Function name Description
DrvEnableDriver Allows the driver to initialize itself and return pointers to supported graphics DDI functions.
DrvCompletePDEV Provides the driver with a GDI handle to a device instance.
DrvDisableDriver (Optional) Allows the driver to perform cleanup operations before being unloaded.
DrvDisablePDEV Allows the driver to remove device instance-specific information.
DrvDisableSurface Allows the driver to remove a drawing surface.
DrvEnablePDEV Allows the driver to provide GDI with physical device characteristics and to initialize device instance-specific information.
DrvEnableSurface Allows the driver to create a drawing surface.
DrvQueryDeviceSupport (Optional) Returns requested device-specific information.
DrvQueryDriverInfo (Optional) Returns requested driver-specific information.

Printer graphics DLLs are also responsible for defining the following print-specific graphics DDI functions, which are called at certain points during the rendering of a print job.

Function When called
DrvEndDoc When GDI has finished sending a document to the driver for rendering.
DrvNextBand (Optional) When GDI has finished drawing a band for a physical page, so the driver can send the band to the printer.
DrvQueryPerBandInfo (Optional) Before GDI begins drawing a band for a physical page, so the driver can supply GDI with band-specific information.
DrvSendPage When GDI has finished drawing a physical page, so the driver can send the page to the printer.
DrvStartBanding (Optional) When GDI is ready to start sending bands of a physical page to the driver for rendering.
DrvStartDoc When GDI is ready to start sending a document to the driver for rendering.
DrvStartPage When GDI is ready to start sending a document page to the driver for rendering.

Typically, a printer graphics DLL also defines whatever additional graphics DDI functions are necessary to accomplish print job rendering. The number and type of functions defined depends on:

  • Whether the driver supports use of GDI-managed or device-managed drawing surfaces (or both). For more information, see Surface Types.

  • The extent to which drawing operations can be handled by GDI instead of being performed by the driver itself. For more information, see Using the Graphics DDI.

All functions defined by printer graphics DLLs are called by GDI's kernel-mode graphics rendering engine (GRE).

The DrvEnableDriver and DrvQueryDriverInfo functions are exported by the graphics DLL. The addresses of all other supported graphics DDI functions are placed in a table that is returned by the DrvEnableDriver function.