IPrintOemUni::EnableDriver method allows a rendering plug-in for Unidrv to hook out some graphics DDI functions.
Caller-supplied interface version number. This value is defined by PRINTER_OEMINTF_VERSION, in printoem.h.
Caller-supplied size, in bytes, of the structure pointed to by pded.
Caller-supplied pointer to a DRVENABLEDATA structure.
The method must return one of the following values.
The operation succeeded.
The operation failed
A rendering plug-in for Unidrv must implement the
IPrintOemUni::EnableDriver method allows a rendering plug-in to perform the same types of operations as the DrvEnableDriver function that is exported by printer graphics DLLs.
Like the DrvEnableDriver function, the
IPrintOemUni::EnableDriver method is responsible for providing addresses of internally supported graphics DDI functions, known as hooking functions. It can also perform other one-time initialization operations. Unlike the DrvEnableDriver function, implementation of
IPrintOemUni::EnableDriver is optional.
IPrintOemUni::EnableDriver, you must also implement IPrintOemUni::DisableDriver. Actions begun in the former method might need to be completed in the latter method. For example, if a large buffer is allocated in
IPrintOemUni::EnableDriver, but not deallocated in IPrintOemUni::DisableDriver, a memory leak can occur.
The method should fill the supplied DRVENABLEDATA structure and allocate an array of DRVFN structures. It should fill the array with pointers to hooking functions, along with winddi.h-defined index values that identify the hooked out graphics DDI functions.
A rendering plug-in for Unidrv can hook out a graphics DDI function only if the Unidrv driver defines the function. The following graphics DDI functions are defined in Unidrv and/or Pscript5 and can therefore be hooked out:
- DrvDitherColor (Unidrv only)
- DrvIcmCreateColorTransform (Pscript only)
- DrvIcmDeleteColorTransform (Pscript only)
- DrvLineTo (Unidrv only)
- DrvNextBand (Unidrv only)
- DrvQueryDeviceSupport (Pscript only)
- DrvStartBanding (Unidrv only)
If you provide a customized hooking function, it preempts the driver's equivalent graphics DDI function. Hooking functions can also call back into the driver's graphics DDI functions. For more information see Customized Graphics DDI Functions.
Customized hooking functions have the same input and output parameters as the equivalent graphics DDI function, with one exception - where graphics DDI functions receive PDEV pointers, customized hooking functions receive DEVOBJ pointers. There are two ways for graphics DDI functions to receive PDEV pointers:
As the contents of the dhpdev member of a SURFOBJ structure for the destination surface.
For the equivalent customized hooking function, the destination SURFOBJ structure's dhpdev member points to a DEVOBJ structure, and must be cast to type PDEVOBJ when referenced. An example graphics DDI function is DrvBitBlt.
As an input argument for a dhpdev parameter.
The equivalent customized hooking function must cast this input parameter to type PDEVOBJ when referencing it. An example graphics DDI function is DrvDitherColor.
Note that while a printer graphics DLL includes the addresses of its DrvEnablePDEV, DrvDisablePDEV, and DrvResetPDEV functions in the DRVENABLEDATA structure, a rendering plug-in explicitly exports EnablePDEV, DisablePDEV, and ResetPDEV as methods of the IPrintOemUni interface and does not place their addresses in the DRVENABLEDATA structure.
IPrintOemUni::EnableDriver methods are exported by multiple rendering plug-ins, the methods are called in the order that the plug-ins are specified for installation.
For more information about creating and installing rendering plug-ins, see Customizing Microsoft's Printer Drivers.