网站首页  词典首页

请输入您要查询的函数:

 

术语 getoverlappedresult
释义 GetOverlappedResult
语法:
C++
BOOL WINAPI GetOverlappedResult(
__in HANDLE hFile,
__in LPOVERLAPPED lpOverlapped,
__out LPDWORD lpNumberOfBytesTransferred,
__in BOOL bWait
);
GetOverlappedResult函数
检索结果在指定的文件重叠操作,命名管道或通信设备。
参数
hFile [in]
阿处理该文件,命名管道,通信设备。这是相同的句柄时指定的重叠操作是由一对了ReadFile,WriteFile,ConnectNamedPipe,TransactNamedPipe,的DeviceIoControl,或WaitCommEvent函数调用开始。
lpOverlapped [in]
对一个OVERLAPPED结构时所指定的重叠操作启动的指针。
lpNumberOfBytesTransferred [out]
一个变量,它接收的是,实际上是由一读或写操作传输的字节数的指针。对于TransactNamedPipe行动,这是那些从管道中读取的字节数。对于操作的DeviceIoControl,这是由设备驱动程序返回的输出数据的字节数。对于ConnectNamedPipe或WaitCommEvent操作,该值是不确定的。
?是维基 [in]
如果此参数为TRUE,该函数不返回,直到操作已经完成。如果此参数为FALSE,操作仍悬而未决,函数返回FALSE和GetLastError函数返回ERROR_IO_INCOMPLETE。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
结果由GetOverlappedResult函数报告是指定处理的最后重叠操作指明哪些是OVERLAPPED结构提供的,以及这些行动的结果悬而未决。一个悬而未决的操作显示功能时,开始操作返回FALSE和GetLastError函数返回ERROR_IO_PENDING。当一个I / O操作是等待的功能,重置开始运作的OVERLAPPED结构hEvent成员,无信号状态。那么当挂起操作已经完成,系统设置事件对象的信号状态。
指定一个OVERLAPPED结构中的手动重置事件对象。如果一个自动重置事件对象是使用事件句柄不能指明的任何其他等待操作之间开始重叠操作和对GetOverlappedResult呼叫间隔。例如,有时事件对象中指定的等待函数等待操作的完成之一。当等待函数返回时,系统设置自动重置事件的状态,无信号,并设置功能被无限阻塞导致?是维基真参数和后续调用GetOverlappedResult。
如果?是维基参数为true,GetOverlappedResult确定是否挂起操作已为事件对象等待完成,以在信号状态。
如果OVERLAPPED结构hEvent成员是NULL,系统使用的hFile状态时发出信号处理操作已经完成。使用的文件,命名管道,通信设备句柄为此目的是鼓励。它使用更安全,因为混乱时可能出现的多个同时重叠操作都是相同的文件,命名管道,通信设备的事件对象。在这种情况下,有没有办法知道哪些行动所引起的对象的状态被信号。
实例
举一个例子,它使用GetOverlappedResult,见文件末尾测试。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
CancelIo
ConnectNamedPipe
CreateEvent
的DeviceIoControl
GetLastError函数
的OVERLAPPED
重叠的输入和输出
ReadFile
同步功能
TransactNamedPipe
WaitCommEvent
WriteFile
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==GetOverlappedResult Function
Retrieves the results of an overlapped operation on the specified file, named pipe, or communications device.
Syntax
C++
BOOL WINAPI GetOverlappedResult(
__in HANDLE hFile,
__in LPOVERLAPPED lpOverlapped,
__out LPDWORD lpNumberOfBytesTransferred,
__in BOOL bWait
);
Parameters
hFile [in]
A handle to the file, named pipe, or communications device. This is the same handle that was specified when the overlapped operation was started by a call to the ReadFile , WriteFile , ConnectNamedPipe , TransactNamedPipe , DeviceIoControl , or WaitCommEvent function.
lpOverlapped [in]
A pointer to an OVERLAPPED structure that was specified when the overlapped operation was started.
lpNumberOfBytesTransferred [out]
A pointer to a variable that receives the number of bytes that were actually transferred by a read or write operation. For a TransactNamedPipe operation, this is the number of bytes that were read from the pipe. For a DeviceIoControl operation, this is the number of bytes of output data returned by the device driver. For a ConnectNamedPipe or WaitCommEvent operation, this value is undefined.
bWait [in]
If this parameter is TRUE, the function does not return until the operation has been completed. If this parameter is FALSE and the operation is still pending, the function returns FALSE and the GetLastError function returns ERROR_IO_INCOMPLETE.
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
The results reported by the GetOverlappedResult function are those of the specified handle's last overlapped operation to which the specified OVERLAPPED structure was provided, and for which the operation's results were pending. A pending operation is indicated when the function that started the operation returns FALSE, and the GetLastError function returns ERROR_IO_PENDING. When an I/O operation is pending, the function that started the operation resets the hEvent member of the OVERLAPPED structure to the nonsignaled state. Then when the pending operation has been completed, the system sets the event object to the signaled state.
Specify a manual-reset event object in the OVERLAPPED structure. If an auto-reset event object is used, the event handle must not be specified in any other wait operation in the interval between starting the overlapped operation and the call to GetOverlappedResult. For example, the event object is sometimes specified in one of the wait functions to wait for the operation's completion. When the wait function returns, the system sets an auto-reset event's state to nonsignaled, and a subsequent call to GetOverlappedResult with the bWait parameter set to TRUE causes the function to be blocked indefinitely.
If the bWait parameter is TRUE, GetOverlappedResult determines whether the pending operation has been completed by waiting for the event object to be in the signaled state.
If the hEvent member of the OVERLAPPED structure is NULL, the system uses the state of the hFile handle to signal when the operation has been completed. Use of file, named pipe, or communications-device handles for this purpose is discouraged. It is safer to use an event object because of the confusion that can occur when multiple simultaneous overlapped operations are performed on the same file, named pipe, or communications device. In this situation, there is no way to know which operation caused the object's state to be signaled.
Examples
For an example that uses GetOverlappedResult, see Testing for the End of a File .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
CancelIo
ConnectNamedPipe
CreateEvent
DeviceIoControl
GetLastError
OVERLAPPED
Overlapped Input and Output
ReadFile
Synchronization Functions
TransactNamedPipe
WaitCommEvent
WriteFile
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms683209(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 11:23:05