A print processor's GetPrintProcessorCapabilities function returns capabilities associated with a specified input data type.
DWORD GetPrintProcessorCapabilities( _In_ LPTSTR pValueName, _In_ DWORD dwAttributes, _Out_ LPBYTE pData, _In_ DWORD nSize, _Out_ LPDWORD pcbNeeded );
- pValueName [in]
Caller-supplied pointer to a string that represents a data type that is supported by the print processor. The string pointer must be of type LPWSTR.
- dwAttributes [in]
Caller-supplied attributes flags. Refer to the Attributes member of PRINTER_INFO_x structures (described in the Microsoft Windows SDK documentation).
- pData [out]
Caller-supplied pointer to a PRINTPROCESSOR_CAPS_1 or PRINTPROCESSOR_CAPS_2 structure (described in the Windows SDK documentation).
- nSize [in]
Caller-supplied value that represents the size of the buffer pointed to by pData.
If the value is less than sizeof(PRINTPROCESSOR_CAPS_1), this function should supply a value that is equal to sizeof(PRINTPROCESSOR_CAPS_1) or sizeof(PRINTPROCESSOR_CAPS_2), depending on which structure is supported by the print processor.
Note If the value is less than sizeof(PRINTPROCESSOR_CAPS_1), the winprint print processor will supply a value of sizeof(PRINTPROCESSOR_CAPS_2) for Windows Vista operating systems, or sizeof(PRINTPROCESSOR_CAPS_1) for earlier operating system versions.
- pcbNeeded [out]
Caller-supplied pointer to a location to receive the minimum required size for the buffer pointed to by pData.
If the operation succeeds, the function should return ERROR_SUCCESS. Otherwise, it should return a Win32 error code.
Print processors can optionally export a GetPrintProcessorCapabilities function. The function's purpose is to return a filled-in PRINTPROCESSOR_CAPS_1 or PRINTPROCESSOR_CAPS_2 structure for every input data type that the print processor supports.
The spooler calls a print processor's GetPrintProcessorCapabilities function when an application calls GetPrinterData (described in the Windows SDK documentation), specifying a value name with a format of PrintProcCaps_datatype, where datatype is the name of an input data type. Before calling GetPrintProcessorCapabilities, the spooler removes the PrintProcCaps_ prefix from the value name string.
The function should determine if the received buffer is large enough and, if it is, should fill in either the PRINTPROCESSOR_CAPS_1 or PRINTPROCESSOR_CAPS_2 structure (defined in the Windows SDK documentation) and return. The value of nSize determines whether PRINTPROCESSOR_CAPS_1 or PRINTPROCESSOR_CAPS_2 will be used.
The function should always use the location pointed to by pcbNeeded to return the required buffer size, whether or not the actual buffer is large enough.
The specified return value becomes the return value that the spooler provides for GetPrinterData.