IPrintCoreHelper::EnumConstrainedOptions method (prcomoem.h)

The IPrintCoreHelper::EnumConstrainedOptions method provides a list of all of the options that are constrained in a particular feature, based on current settings.

Syntax

HRESULT EnumConstrainedOptions(
  [in, optional] IN const DEVMODE *pDevmode,
  [in]           IN DWORD         cbSize,
  [in]           IN PCSTR         pszFeatureKeyword,
  [out]          OUT PCSTR * []   pConstrainedOptionList,
  [out]          OUT DWORD        *pdwNumOptions
);

Parameters

[in, optional] pDevmode

A pointer to a DEVMODEW structure. If this pointer is provided, IPrintCoreHelper::EnumConstrainedOptions 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 or IPrintOemUni::DevMode or from a print ticket provider, 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] pszFeatureKeyword

A string of ANSI characters that contain the feature name.

[out] pConstrainedOptionList

A pointer to an array of ANSI character strings. When IPrintCoreHelper::EnumConstrainedOptions returns, these strings will contain the names of all of the options that are constrained within the specified feature. The caller is not responsible for freeing the array or the individual strings in the array.

[out] pdwNumOptions

A pointer to a variable that receives the number of constrained options in the array that is pointed to by the pConstrainedOptionList parameter.

Return value

IPrintCoreHelper::EnumConstrainedOptions should return one of the following values.

Return code Description
S_OK The constrained options were set for the specified feature.
E_FAIL The caller provided information that resulted in an invalid request, such as a request for a feature that does not exist.
E_INVALIDARG One or more of the arguments were invalid. This value might mean that the feature is not supported.
E_OUTOFMEMORY There was not enough memory to create the options array or the core driver could not service the request because of lack of memory.
E_UNEXPECTED, or other failures not explicitly listed here An unexpected condition occurred. The core driver is probably in an invalid state. The caller should exit with a failure code.

Requirements

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

See also

IPrintCoreHelper

IPrintCoreHelper::EnumOptions

IPrintCoreHelper::WhyConstrained