IPrintOemPS2::GetPDEVAdjustment method

The IPrintOemPS2::GetPDEVAdjustment method enables a plug-in to override specific PDEV settings.


HRESULT GetPDEVAdjustment(
  PDEVOBJ  pdevobj,
  DWORD    dwAdjustType,
  PVOID    pBuf,
  DWORD    cbBuffer,
  OUT BOOL *pbAdjustmentDone



Pointer to a DEVOBJ structure.


Specifies the type of adjustment asked for. The following flags are currently supported:

Flag Meaning
PDEV_ADJUST_PAPER_MARGIN_TYPE Adjust the paper margin setting that is reported in the PDEV. See the PDEV_ADJUST_PAPER_MARGIN structure.
PDEV_HOSTFONT_ENABLED_TYPE Enable or disable the Hostfont support feature. See the PDEV_HOSTFONT_ENABLED structure.
PDEV_USE_TRUE_COLOR_TYPE Enable or disable color output for monochrome and color printers. See the PDEV_USE_TRUE_COLOR structure.


Pointer to a structure that contains the planned settings that are used if there is no change. These structures are listed in the preceding table. The plug-in can overwrite the settings in the relevant structure.


Specifies the size, in bytes, of the structure pointed to by pBuf.


Pointer to a memory location that the plug-in sets to TRUE when it actually changes a value in the buffer. This may be used by the driver for optimizations.

Return Value

The IPrintOemPS2::GetPDEVAdjustment method should return S_OK if it recognizes the adjustment type, and S_FALSE if it does not. If the method fails, it should return E_FAIL. The chain of plug-ins is called until either S_OK or a failure code other than E_NOTIMPL is returned. That is, the chain of plug-ins is called until the first plug-in that is capable of handling the adjustment is found.


This function is available in Windows XP and later.

Currently, the Pscript5 driver calls IPrintOemPS2::GetPDEVAdjustment to adjust the paper margin setting, as reported in the PDEV, to enable or disable the Hostfont feature, or to turn PostScript color output on or off.


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

See Also