网站首页  词典首页

请输入您要查询的函数:

 

术语 callnamedpipe
释义 CallNamedPipe
语法:
C++
BOOL WINAPI CallNamedPipe(
__in LPCTSTR lpNamedPipeName,
__in LPVOID lpInBuffer,
__in DWORD nInBufferSize,
__out LPVOID lpOutBuffer,
__in DWORD nOutBufferSize,
__out LPDWORD lpBytesRead,
__in DWORD nTimeOut
);
CallNamedPipe功能
连接到一个信息型管(并等待,如果管道的实例是不可用),写入和读取的管道,然后关闭管道。
参数
lpNamedPipeName [in]
管道名称。
lpInBuffer [in]
这些数据被写入到管道。
nInBufferSize [in]
在写字节的缓冲区大小。
lpOutBuffer [out]
一个缓冲区,接收数据的指针从管道中读取。
nOutBufferSize [in]
在读取缓冲区大小,以字节。
lpBytesRead [out]
一个变量,它接收从管道读取的字节数的指针。
nTimeOut [in]
的毫秒数等待命名管道可用。除了数值,下面的特殊值可以指定。
ValueMeaning
NMPWAIT_NOWAIT
0x00000001Does不会等待命名管道。如果命名管道不可用,该函数返回一个错误。
NMPWAIT_WAIT_FOREVER
0xffffffffWaits下去。
NMPWAIT_USE_DEFAULT_WAIT
0x00000000Uses的默认超时指定调用的CreateNamedPipe功能。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
如果邮件服务器的书面过程管道的长度超过nOutBufferSize,CallNamedPipe返回FALSE,并GetLastError返回ERROR_MORE_DATA。该邮件的其余部分将被丢弃,因为CallNamedPipe关闭处理,然后再返回管道。
备注
调用CallNamedPipe相当于调用CreateFile(或WaitNamedPipe,如果CreateFile无法打开管道立即),TransactNamedPipe,和CloseHandle函数。调用CreateFile是一个GENERIC_READ访问标志| GENERIC_WRITE和一个继承处理假标志。
CallNamedPipe失败如果管道是一个字节型管。
实例
有关示例,请参见命名管道交易。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesCallNamedPipeW(Unicode)和CallNamedPipeA(ANSI)的
参见
CloseHandle
CreateFile
CreateNamedPipe
管功能
管概述
TransactNamedPipe
WaitNamedPipe
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==CallNamedPipe Function
Connects to a message-type pipe (and waits if an instance of the pipe is not available), writes to and reads from the pipe, and then closes the pipe.
Syntax
C++
BOOL WINAPI CallNamedPipe(
__in LPCTSTR lpNamedPipeName,
__in LPVOID lpInBuffer,
__in DWORD nInBufferSize,
__out LPVOID lpOutBuffer,
__in DWORD nOutBufferSize,
__out LPDWORD lpBytesRead,
__in DWORD nTimeOut
);
Parameters
lpNamedPipeName [in]
The pipe name.
lpInBuffer [in]
The data to be written to the pipe.
nInBufferSize [in]
The size of the write buffer, in bytes.
lpOutBuffer [out]
A pointer to the buffer that receives the data read from the pipe.
nOutBufferSize [in]
The size of the read buffer, in bytes.
lpBytesRead [out]
A pointer to a variable that receives the number of bytes read from the pipe.
nTimeOut [in]
The number of milliseconds to wait for the named pipe to be available. In addition to numeric values, the following special values can be specified.
ValueMeaning
NMPWAIT_NOWAIT
0x00000001Does not wait for the named pipe. If the named pipe is not available, the function returns an error.
NMPWAIT_WAIT_FOREVER
0xffffffffWaits indefinitely.
NMPWAIT_USE_DEFAULT_WAIT
0x00000000Uses the default time-out specified in a call to 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 .
If the message written to the pipe by the server process is longer than nOutBufferSize, CallNamedPipe returns FALSE, and GetLastError returns ERROR_MORE_DATA. The remainder of the message is discarded, because CallNamedPipe closes the handle to the pipe before returning.
Remarks
Calling CallNamedPipe is equivalent to calling the CreateFile (or WaitNamedPipe , if CreateFile cannot open the pipe immediately), TransactNamedPipe , and CloseHandle functions. CreateFile is called with an access flag of GENERIC_READ | GENERIC_WRITE, and an inherit handle flag of FALSE.
CallNamedPipe fails if the pipe is a byte-type pipe.
Examples
For an example, see Transactions on Named Pipes .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesCallNamedPipeW (Unicode) and CallNamedPipeA (ANSI)
See Also
CloseHandle
CreateFile
CreateNamedPipe
Pipe Functions
Pipes Overview
TransactNamedPipe
WaitNamedPipe
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa365144(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:32:32