IPrintOemUni::EnablePDEV method

The IPrintOemUni::EnablePDEV method allows a rendering plug-in for Unidrv to create its own PDEV structure.


  PDEVOBJ       pdevobj,
  PWSTR         pPrinterName,
  ULONG         cPatterns,
  HSURF         *phsurfPatterns,
  ULONG         cjGdiInfo,
  GDIINFO       *pGdiInfo,
  ULONG         cjDevInfo,
  DEVINFO       *pDevInfo,
  OUT PDEVOEM   *pDevOem



Caller-supplied pointer to a DEVOBJ structure.


Caller-supplied pointer to a text string representing the logical address of the printer.


Caller-supplied value representing the number of HSURF-typed surface handles contained in the buffer pointed to by phsurfPatterns.


Caller-supplied pointer to a buffer that is large enough to contain cPatterns number of HSURF-typed surface handles. The handles represent surface fill patterns.


Caller-supplied value representing the size of the structure pointed to by pGdiInfo.


Caller-supplied pointer to a GDIINFO structure.


Caller-supplied value representing the size of the structure pointed to by pDevInfo.


Caller-supplied pointer to a DEVINFO structure.


Caller-supplied pointer to a DRVENABLEDATA structure containing the addresses of the printer driver's graphics DDI hooking functions. For more information, see the following Remarks section.


Receives a method-supplied pointer to a private PDEV structure. (For more information, see the following Remarks section.)

Return Value

The method must return one of the following values.

Return code Description
The operation succeeded.
The operation failed

If the operation fails, the method should call SetLastError to set an error code.


A rendering plug-in for Unidrv must implement the IPrintOemUni::EnablePDEV method.

The IPrintOemUni::EnablePDEV method performs the same types of operations as the DrvEnablePDEV function that is exported by a printer graphics DLL. Its purpose is to allow a rendering plug-in to create its own PDEV structure. (For more information about PDEV structures, see Customized PDEV Structures.)

If you provide a rendering plug-in that exports the IPrintOemUni::EnablePDEV method, Undrv's printer graphics DLL calls the method from within its DrvEnablePDEV function.

The IPrintOemUni::EnablePDEV method should allocate an instance of its private PDEV structure, initialize it, and return its address as the method's pDevOem parameter. Other plug-in methods receive the address as the pdevOEM member of the DEVOBJ structure.

The pdevOEM member of the DEVOBJ structure is not used with the IPrintOemUni::EnablePDEV method.

The structures pointed to by the phsurfPatterns, pGdiInfo, and pDevInfo parameter values are the same ones that Unidrv's DrvEnablePDEV function receives. The rendering plug-in can modify the structure contents as necessary. It can supply surface fill patterns by obtaining HSURF-typed surface handles and placing them in the buffer pointed to by phsurfPatterns. Fill pattern types and handle order are listed in the description of DrvEnablePDEV.

The DRVENABLEDATA structure pointed to by pded contains the addresses of graphics DDI functions provided Unidrv's printer graphics DLL. You are allowed to provide customized hooking functions in your plug-in for these graphics DDI functions. The DRVENABLEDATA structure's contents enable your customized hooking functions to call back to the driver's graphics DDI functions. For more information, see Customized Graphics DDI Functions.


Target Platform Desktop
Header prcomoem.h (include Prcomoem.h)