网站首页  词典首页

请输入您要查询的函数:

 

术语 cancelioex
释义 CancelIoEx
语法:
C++
BOOL WINAPI CancelIoEx(
__in HANDLE hFile,
__in_opt LPOVERLAPPED lpOverlapped
);
CancelIoEx功能
商标的任何未完成的I / O操作指定的文件句柄。该函数只取消当前进程的I / O操作,无论哪个线程创建的I / O操作。
参数
hFile [in]
阿处理该文件。
lpOverlapped [中,可选]
一个一个OVERLAPPED数据结构,它包含异步I所使用的数据指针/澳
如果该参数为NULL,所有I / O的hFile参数的要求被取消。
如果这个参数不为NULL,只有那些特定的I / O,这些都是具有指定lpOverlapped重叠结构的文件发出请求的取消标记,这意味着您可以取消一个或更多的请求,而CancelIo功能取消所有未完成的请求一个文件句柄。
返回值
如果函数成功,返回值为非零。所有待我取消操作/输出由指定的文件句柄调用线程发出的行动是成功的要求。应用程序必须不自由或重用OVERLAPPED结构与取消I / O操作有关,直到他们完成。该线程可以使用GetOverlappedResult函数来确定何时在I / O自己已经完成业务。
如果函数失败,返回值为0(零)。为了获得更多错误信息,调用GetLastError函数。
如果这个功能无法找到要求取消,则返回值为0(零),GetLastError返回ERROR_NOT_FOUND。
备注
该CancelIoEx函数可以取消多线程调用的线程的其他要求。该CancelIo函数只取消在同一个线程调用该CancelIo功能要求。 CancelIOEx取消/ O的句柄唯一悬而未决的我,它不会改变处理国家,这意味着您不能依靠的投诉,因为您不知道手术是否成功完成或取消状态。
如果有任何悬而未决的I / O为指定的文件句柄进步行动,CancelIoEx功能马克他们注销。大部分的业务类型可以立即取消,其他操作可以继续之前,完成对他们实际上取消了,来电通知。该CancelIoEx函数不会等待所有取消操作完成。
如果该文件句柄是与一个完成端口,一个I / O完成包没有排队的端口,如果操作成功同步取消。异步操作仍然悬而未决,取消操作会排队一个I / O完成包。
该行动被取消与三个状态之一,您必须检查完成状态,以确定的完成情况完成。这三个状态是:
该操作完成正常。可能发生这种情况,即使操作被取消,因为取消请求可能没有及时提交取消操作。
该操作被取消。 GetLastError函数返回ERROR_OPERATION_ABORTED。
经营失败的另一个错误。 GetLastError函数返回有关的错误代码。
要求:
client最低支持Vista
server最低支持 Windows Server 2008
HeaderWinBase.h
LibraryKernel32.lib
DLLKernel32.dll
参见
CancelIo
CancelSynchronousIo
取消挂起的I / O操作
文件管理函数
同步和异步I / O
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年9月3日
==英文原文==CancelIoEx Function
Marks any outstanding I/O operations for the specified file handle. The function only cancels I/O operations in the current process, regardless of which thread created the I/O operation.
Syntax
C++
BOOL WINAPI CancelIoEx(
__in HANDLE hFile,
__in_opt LPOVERLAPPED lpOverlapped
);
Parameters
hFile [in]
A handle to the file.
lpOverlapped [in, optional]
A pointer to an OVERLAPPED data structure that contains the data used for asynchronous I/O.
If this parameter is NULL, all I/O requests for the hFile parameter are canceled.
If this parameter is not NULL, only those specific I/O requests that were issued for the file with the specified lpOverlapped overlapped structure are marked as canceled, meaning that you can cancel one or more requests, while the CancelIo function cancels all outstanding requests on a file handle.
Return Value
If the function succeeds, the return value is nonzero. The cancel operation for all pending I/O operations issued by the calling thread for the specified file handle was successfully requested. The application must not free or reuse the OVERLAPPED structure associated with the cancelled I/O operations until they have completed. The thread can use the GetOverlappedResult function to determine when the I/O operations themselves have been completed.
If the function fails, the return value is 0 (zero). To get extended error information, call the GetLastError function.
If this function cannot find a request to cancel, the return value is 0 (zero), and GetLastError returns ERROR_NOT_FOUND.
Remarks
The CancelIoEx function allows you to cancel requests in threads other than the calling thread. The CancelIo function only cancels requests in the same thread that called the CancelIo function. CancelIOEx cancels only outstanding I/O on the handle, it does not change the state of the handle; this means that you cannot rely on the state of the handle because you cannot know whether the operation was completed successfully or canceled.
If there are any pending I/O operations in progress for the specified file handle, the CancelIoEx function marks them for cancellation. Most types of operations can be canceled immediately; other operations can continue toward completion before they are actually canceled and the caller is notified. The CancelIoEx function does not wait for all canceled operations to complete.
If the file handle is associated with a completion port, an I/O completion packet is not queued to the port if a synchronous operation is successfully canceled. For asynchronous operations still pending, the cancel operation will queue an I/O completion packet.
The operation being canceled is completed with one of three statuses; you must check the completion status to determine the completion state. The three statuses are:
The operation completed normally. This can occur even if the operation was canceled, because the cancel request might not have been submitted in time to cancel the operation.
The operation was canceled. The GetLastError function returns ERROR_OPERATION_ABORTED.
The operation failed with another error. The GetLastError function returns the relevant error code.
Requirements
Minimum supported clientWindows Vista
Minimum supported serverWindows Server 2008
HeaderWinBase.h
LibraryKernel32.lib
DLLKernel32.dll
See Also
CancelIo
CancelSynchronousIo
Canceling Pending I/O Operations
File Management Functions
Synchronous and Asynchronous I/O
Send comments about this topic to Microsoft
Build date: 9/3/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa363792(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:31:35