GetQueuedCompletionStatus的返回值
来源:互联网 发布:2015中国进出口数据 编辑:程序博客网 时间:2024/05/17 01:53
GetQueuedCompletionStatus的返回值
2009-06-24 18:52
BOOL WINAPI GetQueuedCompletionStatus(
__in HANDLE CompletionPort,
__out LPDWORD lpNumberOfBytes,
__out PULONG_PTR lpCompletionKey,
__out LPOVERLAPPED *lpOverlapped,
__in DWORD dwMilliseconds
);
Return Value
1、非0值:
I/O操作成功,并且从完成端口队列中获取到一个完成包。
I/O的信息被保存到lpNumberOfBytes, lpCompletionKey, and lpOverlapped这几个参数中。
2、0
分两种情况:
*lpOverlapped ==NULL
I/O操作失败,并且没有得到完成包,也没有获得额外的信息。如果想要知道详细信息,需要调用GetLastError函数。其中,等待时间太久会导致WAIT_TIMEOUT错误,是这种情况。
*lpOverlapped != NULL
I/O操作失败,得到了完成包,相应的单端口数据和单I/O数据已经保存,可以用来识别是哪个I/O操作出错。大部分的错误操作是这种情况。
=============================================================
GetQueuedCompletionStatus的返回值(本人翻译自msdn) 收藏
Return Values
If the function dequeues a completion packet for a successful I/O operation from the completion port, the return value is nonzero. The function stores information in the variables pointed to by the lpNumberOfBytesTransferred, lpCompletionKey, and lpOverlapped parameters.
如果函数从完成端口出列一个成功I/O操作的完成包,返回值为非0。函数在指向lpNumberOfBytesTransferred, lpCompletionKey, and lpOverlapped的参数中存储相关信息。
If *lpOverlapped is NULL and the function does not dequeue a completion packet from the completion port, the return value is zero. The function does not store information in the variables pointed to by the lpNumberOfBytes and lpCompletionKey parameters. To get extended error information, call GetLastError. If the function did not dequeue a completion packet because the wait timed out, GetLastError returns WAIT_TIMEOUT.
如果 *lpOverlapped为空并且函数没有从完成端口出列完成包,返回值则为0。函数则不会在lpNumberOfBytes and lpCompletionKey所指向的参数中存储信息。调用GetLastError可以得到一个扩展错误信息。如果函数由于等待超时而未能出列完成包,GetLastError返回WAIT_TIMEOUT.
If *lpOverlapped is not NULL and the function dequeues a completion packet for a failed I/O operation from the completion port, the return value is zero. The function stores information in the variables pointed to by lpNumberOfBytes, lpCompletionKey, and lpOverlapped. To get extended error information, call GetLastError.
如果 *lpOverlapped不为空并且函数从完成端口出列一个失败I/O操作的完成包,返回值为0。函数在指向lpNumberOfBytesTransferred, lpCompletionKey, and lpOverlapped的参数指针中存储相关信息。调用GetLastError可以得到扩展错误信息
If a socket handle associated with a completion port is closed, GetQueuedCompletionStatus returns ERROR_SUCCESS, with lpNumberOfBytes equal zero.
如果关联到一个完成端口的一个socket句柄被关闭了,则GetQueuedCompletionStatus返回ERROR_SUCCESS,并且lpNumberOfBytes等于0
Remarks(注意)
This function associates a thread with the specified completion port. A thread can be associated with at most one completion port.
这个函数关联到指定的完成端口的一个线程,一个线程可以关联到最多一个完成端口(一个线程只能为一个完成端口提供服务)
The I/O system can be instructed to send completion notification packets to completion ports, where they are queued. The CreateIoCompletionPort function provides a mechanism for this.
I/O系统能够发送完成消息包到完成端口,并使之队列化,CreateIoCompletionPort函数提供这样的机制
When you perform an input/output operation with a file handle that has an associated input/output completion port, the I/O system sends a completion notification packet to the completion port when the I/O operation comple tes. The completion port places the completion packet in a first-in-first-out queue. The GetQueuedCompletionStatus function retrieves these queued completion packets.
当在一个与完成端口关联的文件句柄上执行一个输入/输出操作,I/O操作完成的时候,I/O系统发送一个完成通知包到完成端口。完成端口把这个完成通知包放入到一个先进先出的队列中。GetQueuedCompletionStatus 函数可以得到这些队列化的完成包
A server application may have several threads calling GetQueuedCompletionStatus for the same completion port. As input operations complete, the operating system queues completion packets to the completion port. If threads are actively waiting in a call to this function, queued requests complete their call. For more information, see I/O Completion Ports.
一个应用服务可以有多个线程调用GetQueuedCompletionStatus为同一个完成端口服务。输入操作完成,操作系统把排好队的完成包交给完成端口。如果线程正在调用这个函数的等待被激发。他们的调用请求也会被排队完成。更多信息请查看 I/O Completion Ports.
You can call the PostQueuedCompletionStatus function to post an completion packet to an completion port. The completion packet will satisfy an outstanding call to the GetQueuedCompletionStatus function.
你能够调用PostQueuedCompletionStatus函数投递一个完成包到一个完成端口,完成包将确保一个可以退出的调用GetQueuedCompletionStatus 函数
- GetQueuedCompletionStatus的返回值
- GetQueuedCompletionStatus的返回值
- GetQueuedCompletionStatus的返回值
- GetQueuedCompletionStatus的返回值
- GetQueuedCompletionStatus的返回值
- 关于GetQueuedCompletionStatus的返回值
- GetQueuedCompletionStatus函数的返回值
- 完成端口GetQueuedCompletionStatus返回值的问题
- GetQueuedCompletionStatus的返回值(翻译自msdn)
- GetQueuedCompletionStatus返回值的处理顺序
- IOCP GetQueuedCompletionStatus 返回值处理
- GetQueuedCompletionStatus的返回值(本人翻译自msdn)
- GetQueuedCompletionStatus后不同返回值的通用处理流程
- GetQueuedCompletionStatus返回ERROR_SEM_TIMEOUT
- 完成端口GetQueuedCompletionStatus()返回错误,怎样获得真正的错误代码
- 完成端口GetQueuedCompletionStatus()返回错误,怎样获得真正的错误代码
- 完成端口GetQueuedCompletionStatus()返回错误,怎样获得真正的错误代码
- 完成端口GetQueuedCompletionStatus()返回错误,怎样获得真正的错误代码,错误返回64解决办法
- 英语缩语手册C (转载)
- 毒龙、闪龙、速龙、炫龙、皓龙、羿龙各代表什么意思
- 为什么要对数字信息进行编码
- Kconfig文件的作用(转)
- 核导弹压轴30个装备方队 90%装备首次参阅
- GetQueuedCompletionStatus的返回值
- JQuery获取和设置Select选项方法
- HSDPA之总结
- 存储的用户名和密码
- .NET Framework中的委托和事件
- 一点关于UART (转载)
- HSUPA之总结
- javascript解析json
- string和byte[]的转换 (C#)