The IPrintCoreHelper::WhyConstrained method provides a list of options that are constraining the specified feature-option pair in the current configuration.
HRESULT WhyConstrained( const DEVMODE *pDevmode, DWORD cbSize, PCSTR pszFeatureKeyword, PCSTR pszOptionKeyword, const PRINT_FEATURE_OPTION **ppFOConstraints, DWORD *pdwNumOptions );
A pointer to a DEVMODEW structure. If this pointer is provided, IPrintCoreHelper::WhyConstrained 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.
The size, in bytes, of the DEVMODEW structure that is pointed to by the pDevmode parameter.
A pointer to an ANSI string that contains the name of the feature. The feature name should correspond to the keyword that is used in the GPD or PPD file.
A pointer to an ANSI string that contains the name of the option. The option name should correspond to the keyword that is used in the GPD or PPD file.
A pointer to an array of PRINT_FEATURE_OPTION elements. When IPrintCoreHelper::WhyConstrained returns, the array contains a list of feature-element pairs of the options that constrain the options that are specified in the pszOptionKeyword parameter.
A pointer to a variable that receives the number of feature-option pairs in the array that is pointed to by the ppFOConstraints parameter.
IPrintCoreHelper::WhyConstrained should return one of the following values.
||The operation succeeded.|
||One or more of the arguments is invalid, or the feature was not supported.|
||Memory for the result array could not be allocated.|
If the specified feature-option pair is not constrained, IPrintCoreHelper::WhyConstrained will return S_OK but will return with *pdwFOPairs set to 0 and with *ppFOConstraints set to NULL.
Note that the results from this method might not contain all of the options that affect the currently selected option. For Unidrv drivers, this list will include at least one option from each set of constraints that is active. If there are invalid combinations that list more than two feature-option pairs, however, only one option from the combination will be included in the list.
|Header||prcomoem.h (include Prcomoem.h)|