术语 | disconnectnamedpipe |
释义 | DisconnectNamedPipe 语法: C++ BOOL WINAPI DisconnectNamedPipe( __in HANDLE hNamedPipe ); DisconnectNamedPipe功能 从一个客户端进程断开一个命名管道实例服务器端。 参数 hNamedPipe [in] 一个句柄,的一个命名管道实例。这种处理必须由CreateNamedPipe函数创建。 返回值 如果函数成功,返回值为非零。 如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。 备注 如果命名管道客户端打开时,DisconnectNamedPipe功能势力的命名管道年底关闭。客户端收到一个错误在下一次尝试访问管道。客户端是被迫离开由DisconnectNamedPipe管道仍然必须使用CloseHandle函数关闭其在管的末端。 管道存在如服务器或客户端进程的长期有一个打开句柄的管道。 当服务器进程断开管道例如,在管道任何未读取的数据被丢弃。前断开,服务器可以确保数据不被调用FlushFileBuffers函数,它不会返回,直到客户端进程失去了所有的数据读取。 服务器进程必须调用DisconnectNamedPipe断开管道从以前的客户端在处理前处理可连接使用ConnectNamedPipe函数另一个客户端。 实例 有关示例,请参见多线程管道服务器。 要求: 最低支持:client-Windows 2000专业版 最低支持server-Windows 2000服务器 HeaderWinbase.h(头文件:winuser.h) LibraryKernel32.lib DLLKernel32.dll 参见 CloseHandle ConnectNamedPipe CreateNamedPipe FlushFileBuffers 管功能 管概述 如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com) 生成日期:2009年7月30日 ==英文原文==DisconnectNamedPipe Function Disconnects the server end of a named pipe instance from a client process. Syntax C++ BOOL WINAPI DisconnectNamedPipe( __in HANDLE hNamedPipe ); Parameters hNamedPipe [in] A handle to an instance of a named pipe. This handle must be created by the CreateNamedPipe function. 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 If the client end of the named pipe is open, the DisconnectNamedPipe function forces that end of the named pipe closed. The client receives an error the next time it attempts to access the pipe. A client that is forced off a pipe by DisconnectNamedPipe must still use the CloseHandle function to close its end of the pipe. The pipe exists as long as a server or client process has an open handle to the pipe. When the server process disconnects a pipe instance, any unread data in the pipe is discarded. Before disconnecting, the server can make sure data is not lost by calling the FlushFileBuffers function, which does not return until the client process has read all the data. The server process must call DisconnectNamedPipe to disconnect a pipe handle from its previous client before the handle can be connected to another client by using the ConnectNamedPipe function. Examples For an example, see Multithreaded Pipe Server . Requirements Minimum supported clientWindows 2000 Professional Minimum supported serverWindows 2000 Server HeaderWinbase.h (include Windows.h) LibraryKernel32.lib DLLKernel32.dll See Also CloseHandle ConnectNamedPipe CreateNamedPipe FlushFileBuffers Pipe Functions Pipes Overview Send comments about this topic to Microsoft Build date: 7/30/2009 ==原始网址==http://msdn.microsoft.com/en-us/library/aa365166(VS.85).aspx\n |
随便看 |
|
windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。