网站首页  词典首页

请输入您要查询的函数:

 

术语 wnetgetresourceparent
释义 WNetGetResourceParent
语法:
C++
DWORD WNetGetResourceParent(
__in LPNETRESOURCE lpNetResource,
__out LPVOID lpBuffer,
__inout LPDWORD lpcbBuffer
);
WNetGetResourceParent功能
该WNetGetResourceParent函数返回一个在网络浏览网络资源的母公司层次。浏览开始在指定的网络资源的位置。
调用WNetGetResourceInformation和WNetGetResourceParent职能提出了网络的层次结构。调用WNetOpenEnum函数下移层次结构。
参数
lpNetResource [in]
指针NETRESOURCE结构,指定的网络资源,而家长的名称是必需的。
指定的输入NETRESOURCE结构的成员如下。调用者通常知道的价值观,为lpProvider对WNetGetResourceInformation后或WNetGetResourceParent以往的呼吁,却提示成员。
MemberMeaning
dwTypeThis成员应填写如果知道,否则,应设置为NULL。
lpRemoteNameThis成员应指定网络资源,其父母必须远程名称。
lpProviderThis成员应指定网络供应商,拥有的资源。这需要成员,否则,该函数可以产生不正确的结果。
在NETRESOURCE结构的所有其他成员将被忽略。
lpBuffer [out]
缓冲区指针接受一个单一的NETRESOURCE结构,代表了家长资源。该函数返回lpRemoteName,lpProvider,却提示,dwDisplayType和结构dwUsage成员,所有其他成员设置为NULL。
在lpRemoteName成员指向远程名称为家长资源。使用这个名字从一所WNetEnumResource枚举函数返回一个相同的语法。调用者可以执行字符串比较,以确定是否WNetGetResourceParent资源是相同的WNetEnumResource返回。如果输入的资源并没有对网络的任何父母,lpRemoteName成员返回为空。
对在dwUsage成员RESOURCEUSAGE_CONNECTABLE位的存在表明,您可以连接到家长资源,但只有当它在网络上可用。
lpcbBuffer [ in , out ]
指针的位置,入境,指定lpBuffer缓冲区的大小,以字节。如果缓冲区太小,不能容纳的结果,此位置获得所需的缓冲区大小,该函数返回ERROR_MORE_DATA。
返回值
如果函数成功,返回值为NO_ERROR。
如果函数失败,返回值是一个系统错误代码,如下列值之一。
返回codeDescription
ERROR_ACCESS_DENIEDThe调用方不具有访问网络资源。
ERROR_BAD_NET_NAMEThe输入lpRemoteName成员不是任何网络现有的网络资源。
ERROR_BAD_PROVIDERThe输入lpProvider成员不匹配任何已安装的网络提供商。
ERROR_MORE_DATAThe所指向的缓冲区lpBuffer参数的是太小了。
ERROR_NOT_AUTHENTICATEDThe调用方没有必要的权限,以获取父的名字。
备注
该WNetGetResourceParent函数通常用于与WNetGetResourceInformation功能一起分析和解释网络路径键入的用户英寸
不像WNetGetResourceInformation功能,如果资源包括在它的语法母公司WNetGetResourceParent函数返回的父母,不论是否实际存在的资源。 WNetGetResourceParent通常应仅由应用程序显示网络资源,用户在一个分层的方式。在Windows资源管理器和文件打开对话框中有两个这种类型的应用众所周知的例子。请注意,任何假设应关注的资源将返回类型的。
您可以调用WNetEnumResource,WNetGetResourceInformation,或WNetGetResourceParent函数返回从NETRESOURCE结构的信息。您还可以建设网络信息资源利用的NETRESOURCE结构的成员。
一个发展中的WNetGetResourceParent使用不当的例子是确定的域指定的服务器所属的名称。该函数返回可能会发生某些网络在上述领域出现在浏览层次服务器直接正确的域名。该函数将返回不正确的结果其他网络。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinnetwk.h
LibraryMpr.lib
DLLMpr.dll
Unicode和ANSI namesWNetGetResourceParentW(Unicode)和WNetGetResourceParentA(ANSI)的
参见
Windows网络(WNet)概述
Windows网络函数
WNetGetResourceInformation
WNetGetProviderName
WNetGetNetworkInformation
WNetGetUniversalName
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月6日
==英文原文==WNetGetResourceParent Function
The WNetGetResourceParent function returns the parent of a network resource in the network browse hierarchy. Browsing begins at the location of the specified network resource.
Call the WNetGetResourceInformation and WNetGetResourceParent functions to move up the network hierarchy. Call the WNetOpenEnum function to move down the hierarchy.
Syntax
C++
DWORD WNetGetResourceParent(
__in LPNETRESOURCE lpNetResource,
__out LPVOID lpBuffer,
__inout LPDWORD lpcbBuffer
);
Parameters
lpNetResource [in]
Pointer to a NETRESOURCE structure that specifies the network resource for which the parent name is required.
Specify the members of the input NETRESOURCE structure as follows. The caller typically knows the values to provide for the lpProvider and dwType members after previous calls to WNetGetResourceInformation or WNetGetResourceParent.
MemberMeaning
dwTypeThis member should be filled in if known; otherwise, it should be set to NULL.
lpRemoteNameThis member should specify the remote name of the network resource whose parent is required.
lpProviderThis member should specify the network provider that owns the resource. This member is required; otherwise, the function could produce incorrect results.

All other members of the NETRESOURCE structure are ignored.
lpBuffer [out]
Pointer to a buffer to receive a single NETRESOURCE structure that represents the parent resource. The function returns the lpRemoteName, lpProvider, dwType, dwDisplayType, and dwUsage members of the structure; all other members are set to NULL.
The lpRemoteName member points to the remote name for the parent resource. This name uses the same syntax as the one returned from an enumeration by the WNetEnumResource function. The caller can perform a string comparison to determine whether the WNetGetResourceParent resource is the same as that returned by WNetEnumResource. If the input resource has no parent on any of the networks, the lpRemoteName member is returned as NULL.
The presence of the RESOURCEUSAGE_CONNECTABLE bit in the dwUsage member indicates that you can connect to the parent resource, but only when it is available on the network.
lpcbBuffer [in, out]
Pointer to a location that, on entry, specifies the size of the lpBuffer buffer, in bytes. If the buffer is too small to hold the result, this location receives the required buffer size, and the function returns ERROR_MORE_DATA.
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_ACCESS_DENIEDThe caller does not have access to the network resource.
ERROR_BAD_NET_NAMEThe input lpRemoteName member is not an existing network resource for any network.
ERROR_BAD_PROVIDERThe input lpProvider member does not match any installed network provider.
ERROR_MORE_DATAThe buffer pointed to by the lpBuffer parameter is too small.
ERROR_NOT_AUTHENTICATEDThe caller does not have the necessary permissions to obtain the name of the parent.

Remarks
The WNetGetResourceParent function is typically used in conjunction with the WNetGetResourceInformation function to parse and interpret a network path typed in by a user.
Unlike the WNetGetResourceInformation function, if the resource includes a parent in its syntax, the WNetGetResourceParent function returns the parent, whether or not the resource actually exists. WNetGetResourceParent should typically be used only by applications that display network resources to the user in a hierarchical fashion. The Windows Explorer and the File Open dialog box are two well-known examples of this type of application. Note that no assumptions should be made about the type of resource that will be returned.
You can call the WNetEnumResource , WNetGetResourceInformation , or WNetGetResourceParent function to return information from the NETRESOURCE structure. You can also construct network resource information using the members of the NETRESOURCE structure.
An example of an inappropriate use of WNetGetResourceParent is to determine the name of the domain to which a specified server belongs. The function may happen to return the correct domain name for some networks in which domains appear directly above servers in the browse hierarchy. The function will return incorrect results for other networks.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinnetwk.h
LibraryMpr.lib
DLLMpr.dll
Unicode and ANSI namesWNetGetResourceParentW (Unicode) and WNetGetResourceParentA (ANSI)
See Also
Windows Networking (WNet) Overview
Windows Networking Functions
WNetGetResourceInformation
WNetGetProviderName
WNetGetNetworkInformation
WNetGetUniversalName
Send comments about this topic to Microsoft
Build date: 8/6/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa385470(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:23:24