网站首页  词典首页

请输入您要查询的函数:

 

术语 waitnamedpipe
释义 WaitNamedPipe
语法:
C++
BOOL WINAPI WaitNamedPipe(
__in LPCTSTR lpNamedPipeName,
__in DWORD nTimeOut
);
WaitNamedPipe功能
一直等到1超时间隔经过的或者指定的命名管道实例,可用于连接(即,管道的服务器进程挂起ConnectNamedPipe的管道操作)。
参数
lpNamedPipeName [in]
在命名管道名称。该字符串必须包括在计算机上的服务器进程执行的名称。阿期限可用于服务器名如果管道是本地的。下面的管道名称格式的方法有:
\\ \\服务器\\管\\ pipename
nTimeOut [in]
的毫秒数,函数会等待一个命名管道实例可用。您可以使用了,而不是指定的毫秒数下列值之一。
ValueMeaning
NMPWAIT_USE_DEFAULT_WAIT
0x00000000The超时时间间隔是默认值在CreateNamedPipe功能服务器进程中指定。
NMPWAIT_WAIT_FOREVER
0xffffffffThe函数不返回到一个命名管道实例可用。
返回值
如果管道的实例可在超时之前经过的时间间隔,,则返回值为非零。
如果管道的实例之前没有间隔的时间内经过的,,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
如果没有指定命名管道的实例存在,WaitNamedPipe函数立即返回,不管超时值。
如果超时时间间隔到期时,WaitNamedPipe函数将失败并出现错误ERROR_SEM_TIMEOUT。
如果函数成功,该进程应使用CreateFile函数打开的句柄命名管道。返回值为TRUE表明,至少有一个管道的可用实例。随后的CreateFile调用管道可能会失败,因为该实例被关闭的服务器或另一个客户端打开。
实例
有关示例,请参见命名管道客户。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesWaitNamedPipeW(Unicode)和WaitNamedPipeA(ANSI)的
参见
CallNamedPipe
ConnectNamedPipe
CreateFile
CreateNamedPipe
管功能
管概述
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009/5/7
==英文原文==WaitNamedPipe Function
Waits until either a time-out interval elapses or an instance of the specified named pipe is available for connection (that is, the pipe's server process has a pending ConnectNamedPipe operation on the pipe).
Syntax
C++
BOOL WINAPI WaitNamedPipe(
__in LPCTSTR lpNamedPipeName,
__in DWORD nTimeOut
);
Parameters
lpNamedPipeName [in]
The name of the named pipe. The string must include the name of the computer on which the server process is executing. A period may be used for the servername if the pipe is local. The following pipe name format is used:
\\\\servername\\pipe\\pipename
nTimeOut [in]
The number of milliseconds that the function will wait for an instance of the named pipe to be available. You can used one of the following values instead of specifying a number of milliseconds.
ValueMeaning
NMPWAIT_USE_DEFAULT_WAIT
0x00000000The time-out interval is the default value specified by the server process in the CreateNamedPipe function.
NMPWAIT_WAIT_FOREVER
0xffffffffThe function does not return until an instance of the named pipe is available.

Return Value
If an instance of the pipe is available before the time-out interval elapses, the return value is nonzero.
If an instance of the pipe is not available before the time-out interval elapses, the return value is zero. To get extended error information, call GetLastError .
Remarks
If no instances of the specified named pipe exist, the WaitNamedPipe function returns immediately, regardless of the time-out value.
If the time-out interval expires, the WaitNamedPipe function will fail with the error ERROR_SEM_TIMEOUT.
If the function succeeds, the process should use the CreateFile function to open a handle to the named pipe. A return value of TRUE indicates that there is at least one instance of the pipe available. A subsequent CreateFile call to the pipe can fail, because the instance was closed by the server or opened by another client.
Examples
For an example, see Named Pipe Client .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesWaitNamedPipeW (Unicode) and WaitNamedPipeA (ANSI)
See Also
CallNamedPipe
ConnectNamedPipe
CreateFile
CreateNamedPipe
Pipe Functions
Pipes Overview
Send comments about this topic to Microsoft
Build date: 5/7/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa365800(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:35