IPrintCoreHelperPS::GetOption method

The IPrintCoreHelperPS::GetOption method gets a specified option for a given feature.


HRESULT GetOption(
  const DEVMODE *pDevmode,
  DWORD         cbSize,
  PCSTR         pszFeatureRequested,
  PCSTR         *ppszOption



A pointer to a DEVMODEWstructure. If this pointer is provided, IPrintCoreHelperPS::GetOption should use the DEVMODEW structure that is pointed to by pDevmode instead of the default or current DEVMODEW structure. If this method is called from the plug-in provider or from IPrintOemPS::DevMode, this parameter is required. In most other situations, the parameter should be NULL. When the core driver sets pDevmode to NULL, it modifies its internal state rather than that of the passed-in DEVMODEW structure. This is required during operations such as full UI replacement, where the DEVMODEW structure returned by a DDI, such as DrvDocumentPropertySheets, is being serviced by the core driver's UI module.


The size, in bytes, of the DEVMODEW structure that is pointed to by the pDevmode parameter.


A pointer to the ANSI string that contains the name of the feature as it appears in the PPD file.


A pointer to a variable that contains the address of an ANSI string. When IPrintCoreHelperPS::GetOption returns, the string should contain the keyword for the currently selected option as it appears in the configuration file. The caller should not modify this string and should not free the memory that is associated with this string.

Return Value

IPrintCoreHelperPS::GetOption should return one of the following values.

Return code Description
The method read the option for the specified feature.
The caller provided information that resulted in an invalid request. For example, the feature that was requested does not exist.
The arguments were invalid. This value might mean that the feature is not supported or that too many options were requested for the feature.
The core driver was not able to service the request because there was insufficient memory.
E_UNEXPECTED, or other return codes not listed here
The core driver seems to be in an invalid state. The caller should return a failure code.


IPrintCoreHelperPS::GetOption cannot be used for features that allow multiple options to be set simultaneously.

Feature keywords are as defined in the PPD file. In addition, the Pscript5 driver supports several reserved keywords for options that are stored in its private DEVMODEWstructure. For the list of Pscript5 features, see Keyword Mapping.

The caller should not free the string that is pointed to by ppszOption and should not modify the string in any way.


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

See Also