Bewerken

Delen via


IPrintOemUni::EnablePDEV method (prcomoem.h)

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

Syntax

HRESULT EnablePDEV(
        PDEVOBJ       pdevobj,
        PWSTR         pPrinterName,
        ULONG         cPatterns,
        HSURF         *phsurfPatterns,
        ULONG         cjGdiInfo,
        GDIINFO       *pGdiInfo,
        ULONG         cjDevInfo,
        DEVINFO       *pDevInfo,
        DRVENABLEDATA *pded,
  [out] OUT PDEVOEM   *pDevOem
);

Parameters

pdevobj

Caller-supplied pointer to a DEVOBJ structure.

pPrinterName

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

cPatterns

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

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.

cjGdiInfo

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

pGdiInfo

Caller-supplied pointer to a GDIINFO structure.

cjDevInfo

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

pDevInfo

Caller-supplied pointer to a DEVINFO structure.

pded

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.

[out] pDevOem

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
S_OK
The operation succeeded.
E_FAIL
The operation failed
 

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

Remarks

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.

Requirements

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