网站首页  词典首页

请输入您要查询的函数:

 

术语 getqueuedcompletionstatus
释义 GetQueuedCompletionStatus
语法:
C++
BOOL WINAPI GetQueuedCompletionStatus(
__in HANDLE CompletionPort,
__out LPDWORD lpNumberOfBytes,
__out PULONG_PTR lpCompletionKey,
__out LPOVERLAPPED *lpOverlapped,
__in DWORD dwMilliseconds
);
GetQueuedCompletionStatus函数
尝试出列的I / O从指定的完工包/ O完成端口。如果没有完成分组排队,等待函数挂起的I / O操作的完成端口来完成相关的。
出列一次多个I / O完成包,使用GetQueuedCompletionStatusEx功能。
参数
CompletionPort [in]
一个句柄,完成端口。要创建一个完成端口,使用CreateIoCompletionPort函数。
lpNumberOfBytes [out]
一个变量,它接收期间一/ O操作已完成后,我传输的字节数的指针。
lpCompletionKey [out]
一个变量,它接收完成键值与文件处理的I / O操作已完成相关的指针。甲完成的关键是每个文件的关键是在给CreateIoCompletionPort调用中指定。
lpOverlapped [out]
一个变量,它接收的OVERLAPPED结构时指定完成的I / O操作地址指针已启动。
即使您通过了一个文件句柄函数的完成端口和一个有效的OVERLAPPED结构相关的,应用程序可以防止完成端口通知。这是通过指定一个有效的事件处理的OVERLAPPED结构hEvent成员,并确定其低序位。一个有效的事件处理的低序位设置保留的I / O完成从被排队的完成端口。
dwMilliseconds的 [in]
的毫秒数,来电者愿意为一个完成数据包等待出现在完成端口。如果一个完成数据包没有出现在指定时间内,该函数超时,返回FALSE,并设置* lpOverlapped为NULL。
如果dwMilliseconds的是无限的,该函数将永远不会超时。如果dwMilliseconds的是零,没有I / O操作出列,函数将时间立即进行。
返回值
如果函数出列成功我从完成端口/ O操作一个完成数据包,则返回值为非零。函数存储在变量的信息指向的lpNumberOfBytes,lpCompletionKey和lpOverlapped参数。
如果* lpOverlapped为NULL,函数不出列从完成端口一个完成数据包,返回值是零。该函数不存储在变量的信息指向的lpNumberOfBytes和lpCompletionKey参数。为了获得更多错误信息,调用GetLastError。如果该函数没有一个完成数据包出列,因为等待超时,GetLastError返回WAIT_TIMEOUT。
如果* lpOverlapped不为NULL,函数出列一个完成数据包失败的I / O完成端口的操作,返回值是零。函数存储在变量的信息指向lpNumberOfBytes,lpCompletionKey和lpOverlapped。为了获得更多错误信息,调用GetLastError。
备注
此函数相关联与指定的完成端口线程。一个线程可以联系最多的端口之一完成。
这个函数返回TRUE时,至少有一个悬而未决的I / O完成。
这个函数返回FALSE时,没有I / O操作出列。这通常意味着发生了错误处理的参数时对这一呼吁,或者说,CompletionPort处理被关闭或以其他方式无效。 GetLastError函数提供了扩展的错误信息。
从Windows Vista中,如果以GetQueuedCompletionStatus调用失败,因为处理与此相关的关闭,该函数返回FALSE,而且GetLastError将返回ERROR_ABANDONED_WAIT_0。
欲了解更多的I / O完成端口的理论,使用信息和相关职能,看到的I / O完成端口。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinBase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
专题概述
文件管理函数
I / O完成端口
使用Windows头

函数
ConnectNamedPipe
CreateIoCompletionPort
的DeviceIoControl
GetQueuedCompletionStatusEx
LockFileEx
ReadFile
PostQueuedCompletionStatus
TransactNamedPipe
WaitCommEvent
WriteFile
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年9月3日
==英文原文==GetQueuedCompletionStatus Function
Attempts to dequeue an I/O completion packet from the specified I/O completion port. If there is no completion packet queued, the function waits for a pending I/O operation associated with the completion port to complete.
To dequeue multiple I/O completion packets at once, use the GetQueuedCompletionStatusEx function.
Syntax
C++
BOOL WINAPI GetQueuedCompletionStatus(
__in HANDLE CompletionPort,
__out LPDWORD lpNumberOfBytes,
__out PULONG_PTR lpCompletionKey,
__out LPOVERLAPPED *lpOverlapped,
__in DWORD dwMilliseconds
);
Parameters
CompletionPort [in]
A handle to the completion port. To create a completion port, use the CreateIoCompletionPort function.
lpNumberOfBytes [out]
A pointer to a variable that receives the number of bytes transferred during an I/O operation that has completed.
lpCompletionKey [out]
A pointer to a variable that receives the completion key value associated with the file handle whose I/O operation has completed. A completion key is a per-file key that is specified in a call to CreateIoCompletionPort .
lpOverlapped [out]
A pointer to a variable that receives the address of the OVERLAPPED structure that was specified when the completed I/O operation was started.
Even if you have passed the function a file handle associated with a completion port and a valid OVERLAPPED structure, an application can prevent completion port notification. This is done by specifying a valid event handle for the hEvent member of the OVERLAPPED structure, and setting its low-order bit. A valid event handle whose low-order bit is set keeps I/O completion from being queued to the completion port.
dwMilliseconds [in]
The number of milliseconds that the caller is willing to wait for a completion packet to appear at the completion port. If a completion packet does not appear within the specified time, the function times out, returns FALSE, and sets *lpOverlapped to NULL.
If dwMilliseconds is INFINITE, the function will never time out. If dwMilliseconds is zero and there is no I/O operation to dequeue, the function will time out immediately.
Return Value
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 lpNumberOfBytes, lpCompletionKey, and lpOverlapped parameters.
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.
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.
Remarks
This function associates a thread with the specified completion port. A thread can be associated with at most one completion port.
This function returns TRUE when at least one pending I/O is completed.
This function returns FALSE when no I/O operation was dequeued. This typically means that an error occurred while processing the parameters to this call, or that the CompletionPort handle was closed or is otherwise invalid. The GetLastError function provides extended error information.
Starting with Windows Vista, if a call to GetQueuedCompletionStatus fails because the handle associated with it is closed, the function returns FALSE and GetLastError will return ERROR_ABANDONED_WAIT_0.
For more information on I/O completion port theory, usage, and associated functions, see I/O Completion Ports .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinBase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
Overview Topics
File Management Functions
I/O Completion Ports
Using the Windows Headers

Functions
ConnectNamedPipe
CreateIoCompletionPort
DeviceIoControl
GetQueuedCompletionStatusEx
LockFileEx
ReadFile
PostQueuedCompletionStatus
TransactNamedPipe
WaitCommEvent
WriteFile
Send comments about this topic to Microsoft
Build date: 9/3/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa364986(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:19