IPrintOemPS::EnableDriver method allows a rendering plug-in for Pscript to hook out some graphics DDI functions.
HRESULT EnableDriver( DWORD DriverVersion, DWORD cbSize, PDRVENABLEDATA pded );
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|
||The method is not implemented.|
IPrintOemPS::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
IPrintOemPS::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 the
IPrintOemPS::EnableDriver method is optional.
IPrintOemPS::EnableDriver, you must also implement IPrintOemPS::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
IPrintOemPS::EnableDriver, but not deallocated in IPrintOemPS::DisableDriver, a memory leak can occur.
A rendering plug-in for Pscript5 can hook out a graphics DDI function only if the Pscript5 driver defines the function. The following graphics DDI functions are defined in Pscript5 and or Unidrv and can therefore be hooked out:
DrvAlphaBlend DrvBitBlt DrvCopyBits DrvDitherColor DrvEndDoc DrvEscape DrvFillPath DrvFontManagement DrvGetGlyphMode DrvGradientFill DrvIcmCreateColorTransform DrvIcmDeleteColorTransform DrvLineTo DrvNextBand DrvPlgBlt DrvQueryDeviceSupport DrvQueryAdvanceWidths DrvQueryFont DrvQueryFontData DrvQueryFontTree DrvRealizeBrush DrvSendPage DrvStartBanding DrvStartDoc DrvStartPage DrvStretchBlt DrvStretchBltROP DrvStrokeAndFillPath DrvStrokePath DrvTextOut DrvTransparentBlt 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 these 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.
IPrintOemPS::EnableDriver methods are exported by multiple rendering plug-ins, the methods are called in the order that the plug-ins are specified for installation.
|Header||prcomoem.h (include Prcomoem.h)|