IPrintCoreHelper::GetOption method

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

Syntax

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

Parameters

pDevmode

A pointer to a DEVMODEW structure. If this pointer is provided, IPrintCoreHelper::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 either IPrintOemPS::DevMode or IPrintOemUni::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.

cbSize

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

pszFeatureRequested

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

ppszOption

A pointer to a variable that contains the address of an ANSI string. When IPrintCoreHelper::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

IPrintCoreHelper::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

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

Feature keywords are as defined in the GPD and PPD files. In addition, the Unidrv and Pscript5 drivers support several reserved keywords for options that are stored in their private DEVMODEW structures.

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

Requirements

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

See Also

IPrintCoreHelper

IPrintCoreHelper::EnumOptions

IPrintCoreHelper::SetOptions