Bewerken

Delen via


EnumPrintProcessorDatatypesA function (winspool.h)

A print processor's EnumPrintProcessorDatatypes function enumerates the data types that the print processor supports.

Syntax

BOOL EnumPrintProcessorDatatypesA(
  [in, optional]  LPSTR   pName,
  [in]            LPSTR   pPrintProcessorName,
                  DWORD   Level,
  [out, optional] LPBYTE  pDatatypes,
                  DWORD   cbBuf,
  [out]           LPDWORD pcbNeeded,
  [out]           LPDWORD pcReturned
);

Parameters

[in, optional] pName

Caller-supplied pointer to a string representing name of the server on which the print processor is installed. If NULL, the server is the local system.

[in] pPrintProcessorName

Caller-supplied pointer to a string representing the print processor name.

Level

Caller-supplied value indicating the type of the structures to be returned in the buffer pointed to by pDatatypes. This value must be 1, indicating that the structure is DATATYPES_INFO_1.

[out, optional] pDatatypes

Caller-supplied pointer to a buffer to receive an array of DATATYPES_INFO_1 structures, followed by a set of character strings representing data type names. The DATATYPES_INFO_1 structure is described in the Microsoft Windows SDK documentation. The structure member pName must be of type LPWSTR.

cbBuf

Caller-supplied value representing the size, in bytes, of the buffer pointed to by pDatatypes.

[out] pcbNeeded

Caller-supplied pointer to a location to receive the minimum required size for the buffer pointed to by pDatatypes.

[out] pcReturned

Caller-supplied pointer to a location to receive the number of DATATYPES_INFO_1 structures returned in the buffer pointed to by pDatatypes.

Return value

If the operation succeeds, the function should return TRUE. If the operation fails, the function should call SetLastError to set an error code, and then return FALSE.

Remarks

Print processors are required to export an EnumPrintProcessorDatatypes function. The local print provider calls the function during initialization. The function is also called when an application calls the spooler's version of the same function.

The function must return an array of DATATYPES_INFO_1 structures, with each structure pointing to a string that represents a data type. The actual strings must also be included in the buffer, after the structure array. See Sample Print Processor for an example.

The function should return the number of DATATYPES_INFO_1 structures returned (that is, the number of data types supported) in the location pointed to by pcReturned.

The function should return the minimum required buffer size in the location pointed to by pcbNeeded. If the supplied buffer is too small, the function should specify a value for pcbNeeded, set the error code to ERROR_INSUFFICIENT_BUFFER, and return FALSE.

Requirements

Requirement Value
Target Platform Desktop
Header winspool.h (include Winspool.h)