EnumPrintProcessors function

来源:互联网 发布:淘宝教育怎么入驻 编辑:程序博客网 时间:2024/06/08 20:06

EnumPrintProcessors function

The EnumPrintProcessors function enumerates the print processors installed on the specified server.

Syntax

C++
BOOL EnumPrintProcessors(  _In_   LPTSTR pName,  _In_   LPTSTR pEnvironment,  _In_   DWORD Level,  _Out_  LPBYTE pPrintProcessorInfo,  _In_   DWORD cbBuf,  _Out_  LPDWORD pcbNeeded,  _Out_  LPDWORD pcReturned);

Parameters

pName [in]

A pointer to a null-terminated string that specifies the name of the server on which the print processors reside. If this parameter is NULL, the local print processors are enumerated.

pEnvironment [in]

A pointer to a null-terminated string that specifies the environment (for example, Windows x86, Windows IA64, or Windows x64). If this parameter is NULL, the current environment of the calling application and client machine (not of the destination application and print server) is used.

Level [in]

The type of information returned in the pPrintProcessorInfo buffer. This parameter must be 1.

pPrintProcessorInfo [out]

A pointer to a buffer that receives an array of PRINTPROCESSOR_INFO_1 structures. Each structure describes an available print processor. The buffer must be large enough to receive the array of structures and any strings to which the structure members point.

To determine the required buffer size, call EnumPrintProcessors with cbBuf set to zero.EnumPrintProcessors fails, GetLastError returns ERROR_INSUFFICIENT_BUFFER, and the pcbNeeded parameter returns the size, in bytes, of the buffer required to hold the array of structures and their data.

cbBuf [in]

The size, in bytes, of the buffer pointed to by pPrintProcessorInfo.

pcbNeeded [out]

A pointer to a variable that receives the number of bytes copied to the pPrintProcessorInfobuffer if the function succeeds. If the buffer is too small, the function fails and the variable receives the number of bytes required.

pcReturned [out]

A pointer to a variable that receives the number of structures returned in thepPrintProcessorInfo buffer.

Return value

If the function succeeds, the return value is a nonzero value.

If the function fails, the return value is zero.

Remarks

Note  This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation—factors that are difficult to predict when writing an application. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.

0 0
原创粉丝点击