网站首页  词典首页

请输入您要查询的函数:

 

术语 enumports
释义 EnumPorts
语法:
BOOL EnumPorts(
__in LPTSTR pName,
__in DWORD Level,
__out LPBYTE pPorts,
__in DWORD cbBuf,
__out LPDWORD pcbNeeded,
__out LPDWORD pcReturned
);
EnumPorts功能
该EnumPorts函数枚举端口,可用于打印指定的服务器上。
参数
pName [in]
一个指向 null 结尾的字符串指针,指定服务器的打印机端口要枚举的名称。
如果pName为NULL,则函数枚举本地计算机的打印机端口。
Level [in]
在缓冲区的pPorts返回的信息类型。如果是1级,pPorts收到的PORT_INFO_1结构的数组。如果是2级,pPorts收到的PORT_INFO_2结构的数组。
pPorts [out]
A到接收缓冲区的PORT_INFO_1或PORT_INFO_2结构数组的指针。每个结构包含的数据描述了可用的打印机端口。该缓冲区必须足够大,存储字符串指向的结构的成员。
要确定所需的缓冲区大小,设置为0 cbBuf呼吁EnumPorts。 EnumPorts失败,GetLastError返回ERROR_INSUFFICIENT_BUFFER和pcbNeeded参数返回的大小,以字节为单位须持有的结构及其数据数组中的缓冲区。
cbBuf [in]
大小,指出以字节为缓冲区的pPorts。
pcbNeeded [out]
一个变量,它接收的复制到pPorts缓冲区的字节数的指针。如果缓冲区太小,功能失败和变量接收到所需的字节数。
pcReturned [out]
一个变量,它接收在pPorts缓冲区返回PORT_INFO_1或PORT_INFO_2物的数目指针。这是打印机端口,可以在指定的服务器数量。
返回值
如果函数成功,返回值是一个非零值。
如果函数失败,返回值是零。
备注
该EnumPorts功能,即使能够成功通过pName量没有打印机服务器上定义的。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinspool.h(头文件:winuser.h)
LibraryWinspool.lib
DLLSpoolss.dll
Unicode和ANSI namesEnumPortsW(Unicode)和EnumPortsA(ANSI)的
参见
Printing and Print Spooler Overview
Printing and Print Spooler 函数
AddPort
DeletePort
PORT_INFO_1
PORT_INFO_2
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==EnumPorts Function
The EnumPorts function enumerates the ports that are available for printing on a specified server.
Syntax
BOOL EnumPorts(
__in LPTSTR pName,
__in DWORD Level,
__out LPBYTE pPorts,
__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 whose printer ports you want to enumerate.
If pName is NULL, the function enumerates the local machine's printer ports.
Level [in]
The type of information returned in the pPorts buffer. If Level is 1, pPorts receives an array of PORT_INFO_1 structures. If Level is 2, pPorts receives an array of PORT_INFO_2 structures.
pPorts [out]
A pointer to a buffer that receives an array of PORT_INFO_1 or PORT_INFO_2 structures. Each structure contains data that describes an available printer port. The buffer must be large enough to store the strings pointed to by the structure members.
To determine the required buffer size, call EnumPorts with cbBuf set to zero. EnumPorts 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 pPorts.
pcbNeeded [out]
A pointer to a variable that receives the number of bytes copied to the pPorts buffer. 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 PORT_INFO_1 or PORT_INFO_2 structures returned in the pPorts buffer. This is the number of printer ports that are available on the specified server.
Return Value
If the function succeeds, the return value is a nonzero value.
If the function fails, the return value is zero.
Remarks
The EnumPorts function can succeed even if the server specified by pName does not have a printer defined.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinspool.h (include Windows.h)
LibraryWinspool.lib
DLLSpoolss.dll
Unicode and ANSI namesEnumPortsW (Unicode) and EnumPortsA (ANSI)
See Also
Printing and Print Spooler Overview
Printing and Print Spooler Functions
AddPort
DeletePort
PORT_INFO_1
PORT_INFO_2
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd162687(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:15:54