网站首页  词典首页

请输入您要查询的函数:

 

术语 purgecomm
释义 PurgeComm
语法:
C++
BOOL WINAPI PurgeComm(
__in HANDLE hFile,
__in DWORD dwFlags
);
PurgeComm函数
丢弃所有字符的输出或输入特定的通信资源的缓冲区。它也可以终止待读或写操作的资源。
参数
hFile [in]
一个句柄,通信资源。 CreateFile函数返回此句柄。
dwFlags [in]
此参数可以是一个或多个下列值。
ValueMeaning
PURGE_RXABORT
0x0002Terminates所有悬而未决的重叠读操作并立即返回,即使读取操作尚未完成。
PURGE_RXCLEAR
0x0008Clears输入缓冲区(如果有一个设备驱动程序)。
PURGE_TXABORT
0x0001Terminates所有悬而未决的重叠写操作并立即返回,即使写操作尚未完成。
PURGE_TXCLEAR
0x0004Clears输出缓冲区(如果有一个设备驱动程序)。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
如果一个线程使用PurgeComm刷新输出缓冲区,已删除的字符不传染。要清空输出缓冲区,同时确保内容的传输,调用FlushFileBuffers函数(同步操作)。但是请注意,这FlushFileBuffers是受流量控制,但不写超时,也不会等待,直到所有写操作返回已转交。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
通讯功能
通信资源
CreateFile
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==PurgeComm Function
Discards all characters from the output or input buffer of a specified communications resource. It can also terminate pending read or write operations on the resource.
Syntax
C++
BOOL WINAPI PurgeComm(
__in HANDLE hFile,
__in DWORD dwFlags
);
Parameters
hFile [in]
A handle to the communications resource. The CreateFile function returns this handle.
dwFlags [in]
This parameter can be one or more of the following values.
ValueMeaning
PURGE_RXABORT
0x0002Terminates all outstanding overlapped read operations and returns immediately, even if the read operations have not been completed.
PURGE_RXCLEAR
0x0008Clears the input buffer (if the device driver has one).
PURGE_TXABORT
0x0001Terminates all outstanding overlapped write operations and returns immediately, even if the write operations have not been completed.
PURGE_TXCLEAR
0x0004Clears the output buffer (if the device driver has one).

Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError .
Remarks
If a thread uses PurgeComm to flush an output buffer, the deleted characters are not transmitted. To empty the output buffer while ensuring that the contents are transmitted, call the FlushFileBuffers function (a synchronous operation). Note, however, that FlushFileBuffers is subject to flow control but not to write time-outs, and it will not return until all pending write operations have been transmitted.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
Communications Functions
Communications Resources
CreateFile
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa363428(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:20:39