网站首页  词典首页

请输入您要查询的函数:

 

术语 bindiocompletioncallback
释义 BindIoCompletionCallback
语法:
C++
BOOL WINAPI BindIoCompletionCallback(
__in HANDLE FileHandle,
__in LPOVERLAPPED_COMPLETION_ROUTINE Function,
__in ULONG Flags
);
BindIoCompletionCallback功能
联营公司的I / O完成端口上与指定的文件句柄线程池拥有。在一个I / O请求涉及此文件,非I / O工作线程将执行指定的回调函数完成。
参数
文件句柄 [in]
阿处理该文件开放重叠I / O完成。此句柄是由CreateFile函数返回与FILE_FLAG_OVERLAPPED标志。
功能 [in]
一个回调函数指针在执行非I / O工作线程时,I / O操作完成。此回调函数不能调用TerminateThread函数。
如需有关完成例程信息,请参阅FileIOCompletionRoutine。
标志 [in]
此参数必须为零。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError函数。返回值是一个NTSTATUS错误代码。要获取相应的系统错误代码,使用RtlNtStatusToDosError功能。
备注
回调函数可能不会被处决,如果这一进程问题上的一个文件句柄参数,并显示错误代码比ERROR_IO_PENDING其他要求立即返回指定的文件异步请求。
要确保启动的线程异步I / O请求不会终止请求之前完成。此外,如果在一个DLL函数排队的工作线程,请确保在DLL函数完成之前执行的DLL卸载。
线程池的维持一个I / O完成端口。当您调用BindIoCompletionCallback,它赞成与线程池的I / O完成端口指定的文件。该文件对象异步请求完成张贴到完成端口,在那里他们将拾起线程池工作线程了。回调的,必须发出I / O请求,作为一个异步过程调用完成后,线程池提供了一个I / O工作池。的I / O工作线程不会等待完成端口,他们睡在一个可报警等待状态,这样I / O请求数据包,完全可以唤醒。工作线程的两种类型检查是否有是I / O等待他们,如果有,他们不退出。有关更多信息,请参阅异步过程调用。
要编译的应用程序使用此功能,定义_WIN32_WINNT为0x0500或更高版本。有关详细信息,请参阅使用Windows头。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
FileIOCompletionRoutine
进程和线程函数
线程池
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==BindIoCompletionCallback Function
Associates the I/O completion port owned by the thread pool with the specified file handle. On completion of an I/O request involving this file, a non-I/O worker thread will execute the specified callback function.
Syntax
C++
BOOL WINAPI BindIoCompletionCallback(
__in HANDLE FileHandle,
__in LPOVERLAPPED_COMPLETION_ROUTINE Function,
__in ULONG Flags
);
Parameters
FileHandle [in]
A handle to the file opened for overlapped I/O completion. This handle is returned by the CreateFile function, with the FILE_FLAG_OVERLAPPED flag.
Function [in]
A pointer to the callback function to be executed in a non-I/O worker thread when the I/O operation is complete. This callback function must not call the TerminateThread function.
For more information about the completion routine, see FileIOCompletionRoutine .
Flags [in]
This parameter must be zero.
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 the GetLastError function. The value returned is an NTSTATUS error code. To retrieve the corresponding system error code, use the RtlNtStatusToDosError function.
Remarks
The callback function might not be executed if the process issues an asynchronous request on the file specified by the FileHandle parameter but the request returns immediately with an error code other than ERROR_IO_PENDING.
Be sure that the thread that initiates the asynchronous I/O request does not terminate before the request is completed. Also, if a function in a DLL is queued to a worker thread, be sure that the function in the DLL has completed execution before the DLL is unloaded.
The thread pool maintains an I/O completion port. When you call BindIoCompletionCallback, it associates the specified file with the thread pool's I/O completion port. Asynchronous requests on that file object will complete by posting to the completion port, where they will be picked up by thread pool worker threads. For callbacks that must issue an I/O request that completes as an asynchronous procedure call, the thread pool provides an I/O worker pool. The I/O worker threads do not wait on the completion port; they sleep in an alertable wait state so that I/O request packets that complete can wake them up. Both types of worker threads check whether there is I/O pending on them and if there is, they do not exit. For more information, see Asynchronous Procedure Calls .
To compile an application that uses this function, define _WIN32_WINNT as 0x0500 or later. For more information, see Using the Windows Headers .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
FileIOCompletionRoutine
Process and Thread Functions
Thread Pooling
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa363484(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:30:51