IPrintCoreHelperPS::GetOption method (prcomoem.h)

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

Syntax

HRESULT GetOption(
  [in, optional] const DEVMODE *pDevmode,
  [in]           DWORD         cbSize,
  [in]           PCSTR         pszFeatureRequested,
  [out]          PCSTR         *ppszOption
);

Parameters

[in, optional] pDevmode

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.

[in] cbSize

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

[in] pszFeatureRequested

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

[out] ppszOption

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
S_OK
The method read the option for the specified feature.
E_FAIL
The caller provided information that resulted in an invalid request. For example, the feature that was requested does not exist.
E_INVALIDARG
The arguments were invalid. This value might mean that the feature is not supported or that too many options were requested for the feature.
E_OUTOFMEMORY
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.

Remarks

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.

Requirements

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

See also

IPrintCoreHelperPS

IPrintCoreHelperPS::EnumOptions

IPrintCoreHelperPS::SetOptions