网站首页  词典首页

请输入您要查询的函数:

 

术语 getnamedpipehandlestate
释义 GetNamedPipeHandleState
语法:
C++
BOOL WINAPI GetNamedPipeHandleState(
__in HANDLE hNamedPipe,
__out_opt LPDWORD lpState,
__out_opt LPDWORD lpCurInstances,
__out_opt LPDWORD lpMaxCollectionCount,
__out_opt LPDWORD lpCollectDataTimeout,
__out_opt LPTSTR lpUserName,
__in DWORD nMaxUserNameSize
);
GetNamedPipeHandleState功能
检索有关指定命名管道。返回的信息可以在不同的一个命名管道实例的生存期。
参数
hNamedPipe [in]
句柄到命名管道有资料通缉。句柄必须GENERIC_READ的读访问只读或读/写管道,或者必须有GENERIC_WRITE和FILE_READ_ATTRIBUTES一个只写管访问。
此参数也可以是一个处理一个匿名管道,由CreatePipe函数返回。
lpState [指出,可选]
一个变量,指示当前状态的句柄指针。此参数可以为NULL,如果这一信息是没有必要的。无论或下面的值都可以被指定。
ValueMeaning
PIPE_NOWAIT
0x00000001The管道句柄是非阻塞模式。如果此标志没有被指定的管道句柄处于阻塞模式。
PIPE_READMODE_MESSAGE
0x00000002The管道句柄是在信息读取模式。如果此标志没有被指定的管道句柄是字节读模式。
lpCurInstances [指出,可选]
一个变量,它接收当前管道实例数的指针。此参数可以为NULL,如果这个信息是不是必需的。
lpMaxCollectionCount [指出,可选]
一个变量,它接收的最大字节数,以在客户端的计算机传输之前收集到服务器的指针。此参数必须为NULL如果指定的管道句柄是一个命名管道服务器端或客户端和服务器进程在同一台计算机上。此参数可以为NULL,如果这个信息是不是必需的。
lpCollectDataTimeout [指出,可选]
一个变量,它接收的最大时间的指针,以毫秒为单位,可以前通过远程命名管道在网络上传输的信息。此参数必须为NULL如果指定的管道句柄是一个命名管道服务器端或客户端和服务器进程在同一台计算机上。此参数可以为NULL,如果这个信息是不是必需的。
lpUserName [指出,可选]
阿一个缓冲区,它接收用户名字符串的客户端应用程序相关的指针。服务器只能检索此信息,如果客户端打开与SECURITY_IMPERSONATION访问管道。
此参数必须为NULL如果指定的管道句柄是一个命名管道客户端。此参数可以为NULL,如果这个信息是不是必需的。
nMaxUserNameSize [in]
至于由lpUserName参数指定的缓冲区大小,在TCHARs。此参数被忽略,如果lpUserName为NULL。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
该GetNamedPipeHandleState函数返回成功,即使传递给它的指针都是空。
要设置管道处理国家,使用SetNamedPipeHandleState功能。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesGetNamedPipeHandleStateW(Unicode)和GetNamedPipeHandleStateA(ANSI)的
参见
管功能
管概述
SetNamedPipeHandleState
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==GetNamedPipeHandleState Function
Retrieves information about a specified named pipe. The information returned can vary during the lifetime of an instance of the named pipe.
Syntax
C++
BOOL WINAPI GetNamedPipeHandleState(
__in HANDLE hNamedPipe,
__out_opt LPDWORD lpState,
__out_opt LPDWORD lpCurInstances,
__out_opt LPDWORD lpMaxCollectionCount,
__out_opt LPDWORD lpCollectDataTimeout,
__out_opt LPTSTR lpUserName,
__in DWORD nMaxUserNameSize
);
Parameters
hNamedPipe [in]
A handle to the named pipe for which information is wanted. The handle must have GENERIC_READ access for a read-only or read/write pipe, or it must have GENERIC_WRITE and FILE_READ_ATTRIBUTES access for a write-only pipe.
This parameter can also be a handle to an anonymous pipe, as returned by the CreatePipe function.
lpState [out, optional]
A pointer to a variable that indicates the current state of the handle. This parameter can be NULL if this information is not needed. Either or both of the following values can be specified.
ValueMeaning
PIPE_NOWAIT
0x00000001The pipe handle is in nonblocking mode. If this flag is not specified, the pipe handle is in blocking mode.
PIPE_READMODE_MESSAGE
0x00000002The pipe handle is in message-read mode. If this flag is not specified, the pipe handle is in byte-read mode.

lpCurInstances [out, optional]
A pointer to a variable that receives the number of current pipe instances. This parameter can be NULL if this information is not required.
lpMaxCollectionCount [out, optional]
A pointer to a variable that receives the maximum number of bytes to be collected on the client's computer before transmission to the server. This parameter must be NULL if the specified pipe handle is to the server end of a named pipe or if client and server processes are on the same computer. This parameter can be NULL if this information is not required.
lpCollectDataTimeout [out, optional]
A pointer to a variable that receives the maximum time, in milliseconds, that can pass before a remote named pipe transfers information over the network. This parameter must be NULL if the specified pipe handle is to the server end of a named pipe or if client and server processes are on the same computer. This parameter can be NULL if this information is not required.
lpUserName [out, optional]
A pointer to a buffer that receives the user name string associated with the client application. The server can only retrieve this information if the client opened the pipe with SECURITY_IMPERSONATION access.
This parameter must be NULL if the specified pipe handle is to the client end of a named pipe. This parameter can be NULL if this information is not required.
nMaxUserNameSize [in]
The size of the buffer specified by the lpUserName parameter, in TCHARs. This parameter is ignored if lpUserName is NULL.
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
The GetNamedPipeHandleState function returns successfully even if all of the pointers passed to it are NULL.
To set the pipe handle state, use the SetNamedPipeHandleState function.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesGetNamedPipeHandleStateW (Unicode) and GetNamedPipeHandleStateA (ANSI)
See Also
Pipe Functions
Pipes Overview
SetNamedPipeHandleState
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa365443(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:28:02