Bewerken

Delen via


IPrintCoreHelperUni::GetOption method (prcomoem.h)

The IPrintCoreHelperUni::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 DEVMODEW structure. If this pointer is provided, IPrintCoreHelperUni::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 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.

[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 GPD file.

[out] ppszOption

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

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

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

Feature keywords are as defined in the GPD file. In addition, the Unidrv driver supports several reserved keywords for options that are stored in its private DEVMODEW structure. For the list of Unidrv 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

IPrintCoreHelperUni

IPrintCoreHelperUni::SetOptions