网站首页  词典首页

请输入您要查询的函数:

 

术语 wnetgetresourceinformation
释义 WNetGetResourceInformation
语法:
C++
DWORD WNetGetResourceInformation(
__in LPNETRESOURCE lpNetResource,
__out LPVOID lpBuffer,
__inout LPDWORD lpcbBuffer,
__out LPTSTR *lplpSystem
);
WNetGetResourceInformation功能
当与远程路径到网络资源的规定外,WNetGetResourceInformation功能可识别的网络供应商,拥有的资源和获取有关的资源的类型信息。该功能通常用于与WNetGetResourceParent功能一起分析和解释网络路径键入的用户英寸
参数
lpNetResource [in]
指针NETRESOURCE结构,指定网络资源的信息是必需的。
结构的lpRemoteName成员应指定资源的远程路径名称,通常一个由用户输入英寸却提示的lpProvider和成员国也应填写,如果知道,因为此操作可能会占用大量内存,特别是如果您不指定却提示成员。如果您不知道这些成员的值,您应该将它们设置为空。在NETRESOURCE结构的所有其他成员将被忽略。
lpBuffer [out]
缓冲区指针接受的结果。在成功返回,缓冲区的第一个部分是NETRESOURCE结构,表示该资源的输入路径是通过WNet函数访问,而不是通过系统的一部分功能,输入特定的资源类型。 (缓冲区的其余部分包含可变长度字符串哪些NETRESOURCE结构点的成员。)
例如,如果输入远程资源的路径是\\ \\服务器\\共享\\ dir1 \\ dir2,那么输出NETRESOURCE结构包含有关资源信息\\ \\服务器\\共享。在\\ dir1 \\ dir2路径的部分是通过文件访问管理功能。该lpRemoteName,lpProvider,却提示,dwDisplayType和NETRESOURCE dwUsage成员是如何产生,设置为NULL的所有其他成员。
该lpRemoteName成员返回像来自一个由WNetEnumResource枚举函数返回一个相同的语法。这使得呼叫者执行字符串比较,以确定是否对WNetGetResourceInformation通过资源是由一个单独的调用WNetEnumResource返回的资源相同。
lpcbBuffer [ in , out ]
指针的位置,入境,指定lpBuffer缓冲区的大小,以字节。您分配的缓冲区必须足够大举行NETRESOURCE结构,加上字符串其成员点。如果缓冲区过小的结果,此位置获得所需的缓冲区大小,该函数返回ERROR_MORE_DATA。
lplpSystem [out]
如果该函数返回成功,在输出缓冲区中,指定的是系统功能的访问,通过资源的一部分字符串此参数点。 (此功能仅适用于特定类型的资源,而不是WNet功能。)
例如,如果输入远程资源的名称是\\ \\服务器\\共享\\ dir1 \\ dir2,输出NETRESOURCE结构点lpRemoteName成员\\ \\服务器\\共享。此外,lplpSystem参数指向\\ dir1 \\ dir2。这两个字符串存储在缓冲区中指出的lpBuffer参数的。
返回值
如果函数成功,返回值为NO_ERROR。
如果函数失败,返回值是一个系统错误代码,如下列值之一。
返回codeDescription
ERROR_BAD_NET_NAMEThe输入lpRemoteName成员不是任何网络现有的网络资源。
ERROR_BAD_DEV_TYPEThe输入却提示成员不匹配由lpRemoteName成员中指定的资源类型。
ERROR_EXTENDED_ERRORA网络特定的错误。呼叫WNetGetLastError获得错误的描述。
ERROR_MORE_DATAThe所指向的缓冲区lpBuffer参数的是太小了。
ERROR_NO_NETWORKThe网络不可用。
实例
有关代码示例,演示如何使用WNetGetResourceInformation功能,请参阅检索有关网络资源信息。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinnetwk.h
LibraryMpr.lib
DLLMpr.dll
Unicode和ANSI namesWNetGetResourceInformationW(Unicode)和WNetGetResourceInformationA(ANSI)的
参见
Windows网络(WNet)概述
Windows网络函数
WNetGetResourceParent
WNetGetProviderName
WNetGetNetworkInformation
WNetGetUniversalName
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月6日
==英文原文==WNetGetResourceInformation Function
When provided with a remote path to a network resource, the WNetGetResourceInformation function identifies the network provider that owns the resource and obtains information about the type of the resource. The function is typically used in conjunction with the WNetGetResourceParent function to parse and interpret a network path typed in by a user.
Syntax
C++
DWORD WNetGetResourceInformation(
__in LPNETRESOURCE lpNetResource,
__out LPVOID lpBuffer,
__inout LPDWORD lpcbBuffer,
__out LPTSTR *lplpSystem
);
Parameters
lpNetResource [in]
Pointer to a NETRESOURCE structure that specifies the network resource for which information is required.
The lpRemoteName member of the structure should specify the remote path name of the resource, typically one typed in by a user. The lpProvider and dwType members should also be filled in if known, because this operation can be memory intensive, especially if you do not specify the dwType member. If you do not know the values for these members, you should set them to NULL. All other members of the NETRESOURCE structure are ignored.
lpBuffer [out]
Pointer to the buffer to receive the result. On successful return, the first portion of the buffer is a NETRESOURCE structure representing that portion of the input resource path that is accessed through the WNet functions, rather than through system functions specific to the input resource type. (The remainder of the buffer contains the variable-length strings to which the members of the NETRESOURCE structure point.)
For example, if the input remote resource path is \\\\server\\share\\dir1\\dir2, then the output NETRESOURCE structure contains information about the resource \\\\server\\share. The \\dir1\\dir2 portion of the path is accessed through the file management functions . The lpRemoteName, lpProvider, dwType, dwDisplayType, and dwUsage members of NETRESOURCE are returned, with all other members set to NULL.
The lpRemoteName member is returned in the same syntax as the one returned from an enumeration by the WNetEnumResource function. This allows the caller to perform a string comparison to determine whether the resource passed to WNetGetResourceInformation is the same as the resource returned by a separate call to WNetEnumResource.
lpcbBuffer [in, out]
Pointer to a location that, on entry, specifies the size of the lpBuffer buffer, in bytes. The buffer you allocate must be large enough to hold the NETRESOURCE structure, plus the strings to which its members point. If the buffer is too small for the result, this location receives the required buffer size, and the function returns ERROR_MORE_DATA.
lplpSystem [out]
If the function returns successfully, this parameter points to a string in the output buffer that specifies the part of the resource that is accessed through system functions. (This applies only to functions specific to the resource type rather than the WNet functions.)
For example, if the input remote resource name is \\\\server\\share\\dir1\\dir2, the lpRemoteName member of the output NETRESOURCE structure points to \\\\server\\share. Also, the lplpSystem parameter points to \\dir1\\dir2. Both strings are stored in the buffer pointed to by the lpBuffer parameter.
Return Value
If the function succeeds, the return value is NO_ERROR.
If the function fails, the return value is a system error code , such as one of the following values.
Return codeDescription
ERROR_BAD_NET_NAMEThe input lpRemoteName member is not an existing network resource for any network.
ERROR_BAD_DEV_TYPEThe input dwType member does not match the type of resource specified by the lpRemoteName member.
ERROR_EXTENDED_ERRORA network-specific error occurred. Call WNetGetLastError to obtain a description of the error.
ERROR_MORE_DATAThe buffer pointed to by the lpBuffer parameter is too small.
ERROR_NO_NETWORKThe network is unavailable.

Examples
For a code sample that illustrates how to use the WNetGetResourceInformation function, see Retrieving Information About a Network Resource .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinnetwk.h
LibraryMpr.lib
DLLMpr.dll
Unicode and ANSI namesWNetGetResourceInformationW (Unicode) and WNetGetResourceInformationA (ANSI)
See Also
Windows Networking (WNet) Overview
Windows Networking Functions
WNetGetResourceParent
WNetGetProviderName
WNetGetNetworkInformation
WNetGetUniversalName
Send comments about this topic to Microsoft
Build date: 8/6/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa385469(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:25:26