IPrintCorePS2::GetOptionAttribute method (prcomoem.h)

The IPrintCorePS2::GetOptionAttribute method retrieves the option attribute list or the value of a specific option attribute.

Syntax

HRESULT GetOptionAttribute(
  [in]  PDEVOBJ pdevobj,
  [in]  DWORD   dwFlags,
  [in]  PCSTR   pszFeatureKeyword,
  [in]  PCSTR   pszOptionKeyword,
  [in]  PCSTR   pszAttribute,
  [out] PDWORD  pdwDataType,
  [out] PBYTE   pbData,
  [in]  DWORD   cbSize,
  [out] PDWORD  pcbNeeded
);

Parameters

[in] pdevobj

Pointer to a DEVOBJ structure.

[in] dwFlags

Is reserved and must be set to zero.

[in] pszFeatureKeyword

Pointer to a caller-supplied buffer containing an ASCII string specifying the single feature keyword to query for.

[in] pszOptionKeyword

Pointer to a caller-supplied buffer containing an ASCII string specifying the single option keyword to query for. This value can be obtained from a prior call to IPrintCorePS2::EnumOptions.

[in] pszAttribute

Pointer to a caller-supplied buffer containing an ASCII string specifying the single attribute requested. If this parameter is NULL, the caller is requesting a list of all supported attribute names for the option, as opposed to specifying a specific attribute name for the option.

[out] pdwDataType

Pointer to a memory location that receives a value specifying the data type of the requested attribute. This value is an enumerator of the EATTRIBUTE_DATATYPE enumeration, which is defined in printoem.h.

[out] pbData

Pointer to a caller-supplied buffer that receives the requested data. To simply query for the number of bytes needed to fulfill a request, set this parameter to NULL.

[in] cbSize

Specifies the size, in bytes of the buffer pointed to by pbData.

[out] pcbNeeded

Pointer to a memory location that receives the actual size, in bytes, of the requested data.

Return value

This method must return one of the following values.

Return code Description
S_OK
The method succeeded.
E_OUTOFMEMORY
The value in cbSize was smaller than the number of bytes to be written to the output buffer (the buffer pointed to by pbData).

The method was called with pbData set to NULL.

E_INVALIDARG
The method attempted to query for a nonexistent attribute.

The feature keyword name or option keyword name were not recognized.

The pdevobj parameter pointed to an invalid driver context object.

E_FAIL
The method failed.

Remarks

If this method is called with its pszAttribute and pbData parameters set to NULL, the method returns with *pcbNeeded set to the number of bytes needed for the list of all supported attribute names for the option. If the method is called a second time, with pszAttribute set to NULL and pbData pointing to a buffer of the size specified in *pcbNeeded in the previous call, the method returns with *pdwDataType set to kADT_ASCII (an enumerator of the EATTRIBUTE_DATATYPE enumerated type) and pbData pointing to a null-delimited list of all the supported attribute names for the option. This list is terminated with two null characters.

To reduce the need to make two calls per data access, pass the method an output buffer of a fixed size (1 KB, for example), and then check the function return value. If the method returns S_OK, the buffer already contains the data of interest. If the method returns E_OUTOFMEMORY, the value in *pcbNeeded is the buffer size needed to hold the data of interest. The caller should then allocate a buffer of that larger size and proceed with a second call to the method.

This method is supported for any Pscript5 render plug-in.

For more information, see Using GetOptionAttribute.

Requirements

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

See also

DEVOBJ

IPrintCorePS2

IPrintCorePS2::EnumOptions

IPrintCorePS2::GetFeatureAttribute

IPrintCorePS2::GetGlobalAttribute