现在的位置: 首页 > 综合 > 正文

GetQueuedCompletionStatus的返回值(翻译自msdn)

2013年03月04日 ⁄ 综合 ⁄ 共 6984字 ⁄ 字号 评论关闭
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 thelpNumberOfBytesTransferred,lpCompletionKey,
and
lpOverlapped parameters. 
 
如果该函数从完成端口中出列(从队列里取出)一个成功的IO操作的完成包,其返回值非零,在 lpNumberOfBytesTransferred, lpCompletionKey, and lpOverlapped这些指针指向的变量中记录了完成包的相关信息。

如果这个函数从完成端口的完成队列中,取出一个IO成功完成的完成包,返回非零值。
这个函数在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 andlpCompletionKeyparameters.
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为NULL, 且函数没能从完成端口出列一个完成包,返回值则为0
该函数不会在lpNumberOfBytes andlpCompletionKey指针中指向的变量中中存储相关信息。
调用GetLastError,得到一个扩展错误信息。
如果是因为等待超时,而未能出列一个完成包,GetLastError返回值为WAIT_TIMEOUT.  

如果lpOverlapped为NULL,并且函数没有从一个完成端口的队列中取得一个完成包。返回值为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 lpNumberOfByteslpCompletionKey, andlpOverlapped. To get extended error information, call GetLastError
. 
 
如果 *lpOverlapped返回的是非NULL, 而且该函数从完成端口出列一个失败的I/O操作的完成包,该函数返回值为0
函数在指向lpNumberOfBytesTransferred, lpCompletionKey, and lpOverlapped的参数指针中存储相关信息。
调用GetLastError可以得到扩展错误信息 
 
If a socket handle associated with a completion port is closed, GetQueuedCompletionStatus returns ERROR_SUCCESS, withlpNumberOfBytes equal zero.  
 
如果与完成端口相关联的一个套接字句柄被关闭,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. TheCreateIoCompletionPort 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在同一个完成端口上
一个Input操作完成,操作系统把排好队的完成包交给完成端口。
如果线程正在等待这个函数返回,则被激发。
他们的调用请求也会被排队完成。更多信息请查看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
调用返回。
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 thelpNumberOfBytesTransferred,lpCompletionKey,
and
lpOverlapped parameters. 
 
如果该函数从完成端口中出列(从队列里取出)一个成功的IO操作的完成包,其返回值非零,在 lpNumberOfBytesTransferred, lpCompletionKey, and lpOverlapped这些指针指向的变量中记录了完成包的相关信息。

如果这个函数从完成端口的完成队列中,取出一个IO成功完成的完成包,返回非零值。
这个函数在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 andlpCompletionKeyparameters.
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为NULL, 且函数没能从完成端口出列一个完成包,返回值则为0
该函数不会在lpNumberOfBytes andlpCompletionKey指针中指向的变量中中存储相关信息。
调用GetLastError,得到一个扩展错误信息。
如果是因为等待超时,而未能出列一个完成包,GetLastError返回值为WAIT_TIMEOUT.  

如果lpOverlapped为NULL,并且函数没有从一个完成端口的队列中取得一个完成包。返回值为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 lpNumberOfByteslpCompletionKey, andlpOverlapped. To get extended error information, call GetLastError
. 
 
如果 *lpOverlapped返回的是非NULL, 而且该函数从完成端口出列一个失败的I/O操作的完成包,该函数返回值为0
函数在指向lpNumberOfBytesTransferred, lpCompletionKey, and lpOverlapped的参数指针中存储相关信息。
调用GetLastError可以得到扩展错误信息 
 
If a socket handle associated with a completion port is closed, GetQueuedCompletionStatus returns ERROR_SUCCESS, withlpNumberOfBytes equal zero.  
 
如果与完成端口相关联的一个套接字句柄被关闭,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. TheCreateIoCompletionPort 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在同一个完成端口上
一个Input操作完成,操作系统把排好队的完成包交给完成端口。
如果线程正在等待这个函数返回,则被激发。
他们的调用请求也会被排队完成。更多信息请查看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
调用返回。

抱歉!评论已关闭.