网站首页  词典首页

请输入您要查询的函数:

 

术语 netdfsgetinfo
释义 NetDfsGetInfo
语法:
C++
NET_API_STATUS NetDfsGetInfo(
__in LPWSTR DfsEntryPath,
__in_opt LPWSTR ServerName,
__in_opt LPWSTR ShareName,
__in DWORD Level,
__out LPBYTE *Buffer
);
NetDfsGetInfo功能
检索有关指定分布式文件系统(DFS)根或链接的DFS名称空间。
参数
DfsEntryPath [in]
一个字符串指针,指定通用命名约定(UNC)的DFS根或链接的路径。
对于一个链接,该字符串可以两种形式之一。第一种形式如下:
\\ \\服务器\\ DfsName \\ link_path
其中ServerName是根目标服务器承载独立的DFS命名空间的名称; DfsName是DFS名称空间的名称和link_path是DFS链接。
第二种形式是如下:
\\ \\域名\\ DomDfsname \\ link_path
其中DomainName是域的承载基于域的DFS命名空间的名称; DomDfsname是DFS名称空间的名称和link_path是DFS链接。
对于一个根,该字符串可以两种形式之一:
\\ \\服务器\\ DfsName

\\ \\域名\\ DomDfsname
那里的名称的值为前面所述相同。
此参数是必需的。
服务器名[中,可选]
目前此参数被忽略,应为NULL。
共享名[中,可选]
目前此参数被忽略,应为NULL。
Level [in]
指定请求的信息化Level。此参数可以是下列值之一。
ValueMeaning
1Return DFS根目录或DFS链接的名称。缓冲区参数指向DFS_INFO_1结构。
2Return DFS根目录或DFS链接的名称,状态,以及DFS的一系列目标。缓冲区参数指向DFS_INFO_2结构。
3Return DFS根目录或DFS链接的名称,状态和目标信息。缓冲区参数指向DFS_INFO_3结构。
4Return DFS根目录或DFS链接的名称,状态,GUID,请超时,和目标信息。缓冲区参数指向DFS_INFO_4结构。
5Return的名称,状态,GUID,请超时,财产旗帜,数据大小和数量指标的DFS根目录和根目录下的所有链接。缓冲区参数指向一个DFS_INFO_5结构的数组。
注意此值是原生支持只有在DFS链接驻留在一个服务器上运行Windows Server 2003 SP1或更高版本。
Windows Server 2003和Windows XP SP2中:KB 898900。请注意,此行为已与Windows Server 2003 SP1的变化。
Windows 2000中:此值不支持。
6Return的名称,状态,GUID,请超时,财产旗帜,元数据的大小,为的DFS根目录或链接目标的信息,以及DFS目标的清单。是缓冲区参数指向一个DFS_INFO_6结构的数组。
注意此值是原生支持只有在DFS链接驻留在一个服务器上运行Windows Server 2003 SP1或更高版本。
Windows Server 2003和Windows XP SP2中:KB 898900是必需的。请注意,此行为已与Windows Server 2003 SP1的变化。
Windows 2000中:此值不支持。
7Return版本号的DFS的GUID数据。缓冲区参数指向一个DFS_INFO_7结构的数组。
注意此值是原生支持只有在DFS链接驻留在一个服务器上运行Windows Server 2003 SP1或更高版本。
Windows Server 2003和Windows XP SP2中:KB 898900是必需的。请注意,此行为已与Windows Server 2003 SP1的变化。
Windows 2000中:此值不支持。
8Return的名称,状态,GUID,请超时,财产旗帜,数据大小,数量指标和链接分析点的DFS根目录和根目录下的各个环节的安全描述符。缓冲区参数指向一个DFS_INFO_8结构的数组。
Windows Vista中的Windows Server 2003,和Windows XP/2000:此值,直到装有SP1和Windows Server 2008 Vista的支持。
9Return的名称,状态,GUID,请超时,财产旗帜,数据大小,DFS的目标信息,链接分析点安全描述符,和指标的DFS根或链接的列表。缓冲区参数指向一个DFS_INFO_9结构的数组。
Windows Vista中的Windows Server 2003,和Windows XP/2000:此值,直到装有SP1和Windows Server 2008 Vista的支持。
50Return的DFS数据版本和一个命名现有的DFS能力。缓冲区参数指向DFS_INFO_50结构。
Windows Vista中的Windows Server 2003,和Windows XP/2000:此值不支持。
100Return一个关于DFS根目录或DFS链接的评注。缓冲区参数指向DFS_INFO_100结构。
150Return为DFS链接的分析点的安全描述符。缓冲区参数指向DFS_INFO_150结构。
注意此值是原生支持只有在DFS链接驻留在一个服务器上运行Windows Server 2008或更高版本。
缓冲区[out]
指向一个缓冲区,接收所要求的资料结构的地址。这些数据的格式取决于该级别的参数值。此缓冲区分配制度,必须使用NetApiBufferFree释放功能。有关更多信息,请参阅网络管理功能,缓冲器和网络管理功能缓冲区长度。
返回值
如果函数成功,返回值是NERR_Success。
如果函数失败,返回值是一个系统错误代码。对于一个错误代码的列表,请参见系统错误代码。
备注
没有特殊组成员都需要使用NetDfsGetInfo功能。
实例
下面的代码示例演示如何检索有关信息的链接的DFS使用调用NetDfsGetInfo功能。该范例调用NetDfsGetInfo,指定信息第3级(DFS_INFO_3)。如果调用成功,样本打印有关DFS链接,包括名称和联系所引用的每个目标的状态信息。最后,代码示例释放的信息缓冲区分配的内存。
#define UNICODE
#include
#include
#include
#include
#pragma comment(lib, "Netapi32.lib")
void wmain(int argc, wchar_t *argv[ ])
{
PDFS_INFO_3 pData;
PDFS_STORAGE_INFO ps;
DWORD er = 0, tr = 0, res, j;
//
// Check command line arguments.
//
if (argc<2)
wprintf(L"Syntax: %s DfsEntryPath\\n", argv[0]);
else
{
//
// Call the NetDfsGetInfo function, specifying level 3.
//
res = NetDfsGetInfo(argv[1], NULL, NULL, 3, (LPBYTE *) &pData);
//
// If the call succeeds, print the data.
//
if(res==0)
{
printf("%-30S Storages: %u\\nComment: %S\\n", pData->EntryPath, pData->NumberOfStorages, pData->Comment);
ps = pData->Storage;
//
// Loop through each target.
//
for(j = 1; j <= pData->NumberOfStorages;j++)
{
//
// Print the status (Offline/Online) and the name
// of each target referenced by the DFS link.
//
printf(" %S ", (ps->State == DFS_STORAGE_STATE_OFFLINE) ? TEXT("Offline"): TEXT("Online "));
printf("\\\\\\\\%S\\\\%S\\n", ps->ServerName, ps->ShareName);
ps++;
}
//
// Free the allocated memory.
//
NetApiBufferFree(pData);
}
else
printf("Error: %u\\n", res);
}
return;
}
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderLmDfs.h(包括LmDfs.h或Lm.h)
LibraryNetapi32.lib
DLLNetapi32.dll
参见
网络管理概述
网络管理功能
分布式文件系统(DFS)功能
DFS_INFO_1
DFS_INFO_2
DFS_INFO_3
DFS_INFO_4
DFS_INFO_5
DFS_INFO_6
DFS_INFO_7
DFS_INFO_100
NetDfsEnum
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==NetDfsGetInfo Function
Retrieves information about a specified Distributed File System (DFS) root or link in a DFS namespace.
Syntax
C++
NET_API_STATUS NetDfsGetInfo(
__in LPWSTR DfsEntryPath,
__in_opt LPWSTR ServerName,
__in_opt LPWSTR ShareName,
__in DWORD Level,
__out LPBYTE *Buffer
);
Parameters
DfsEntryPath [in]
Pointer to a string that specifies the Universal Naming Convention (UNC) path of a DFS root or link.
For a link, the string can be in one of two forms. The first form is as follows:
\\\\ServerName\\DfsName\\link_path
where ServerName is the name of the root target server that hosts the stand-alone DFS namespace; DfsName is the name of the DFS namespace; and link_path is a DFS link.
The second form is as follows:
\\\\DomainName\\DomDfsname\\link_path
where DomainName is the name of the domain that hosts the domain-based DFS namespace; DomDfsname is the name of the DFS namespace; and link_path is a DFS link.
For a root, the string can be in one of two forms:
\\\\ServerName\\DfsName
or
\\\\DomainName\\DomDfsname
where the values of the names are the same as those described previously.
This parameter is required.
ServerName [in, optional]
This parameter is currently ignored and should be NULL.
ShareName [in, optional]
This parameter is currently ignored and should be NULL.
Level [in]
Specifies the information level of the request. This parameter can be one of the following values.
ValueMeaning
1Return the DFS root or DFS link name. The Buffer parameter points to a DFS_INFO_1 structure.
2Return the DFS root or DFS link name, status, and the number of DFS targets. The Buffer parameter points to a DFS_INFO_2 structure.
3Return the DFS root or DFS link name, status, and target information. The Buffer parameter points to a DFS_INFO_3 structure.
4Return the DFS root or DFS link name, status, GUID, time-out, and target information. The Buffer parameter points to a DFS_INFO_4 structure.
5Return the name, status, GUID, time-out, property flags, metadata size, and number of targets for a DFS root and all links under the root. The Buffer parameter points to an array of DFS_INFO_5 structures.
Note This value is natively supported only if the DFS link resides on a server that is running Windows Server 2003 with SP1 or later.
Windows Server 2003 and Windows XP with SP2: KB 898900 . Note that this behavior has changed with Windows Server 2003 with SP1.
Windows 2000: This value is not supported.
6Return the name, status, GUID, time-out, property flags, metadata size, DFS target information for a root or link, and a list of DFS targets. The Buffer parameter points to an array of DFS_INFO_6 structures.
Note This value is natively supported only if the DFS link resides on a server that is running Windows Server 2003 with SP1 or later.
Windows Server 2003 and Windows XP with SP2: KB 898900 is required. Note that this behavior has changed with Windows Server 2003 with SP1.
Windows 2000: This value is not supported.
7Return the version number GUID of the DFS metadata. The Buffer parameter points to an array of DFS_INFO_7 structures.
Note This value is natively supported only if the DFS link resides on a server that is running Windows Server 2003 with SP1 or later.
Windows Server 2003 and Windows XP with SP2: KB 898900 is required. Note that this behavior has changed with Windows Server 2003 with SP1.
Windows 2000: This value is not supported.
8Return the name, status, GUID, time-out, property flags, metadata size, number of targets, and link reparse point security descriptors for a DFS root and all links under the root. The Buffer parameter points to an array of DFS_INFO_8 structures.
Windows Vista, Windows Server 2003, and Windows XP/2000: This value is not supported until Windows Vista with SP1 and Windows Server 2008.
9Return the name, status, GUID, time-out, property flags, metadata size, DFS target information, link reparse point security descriptors, and a list of DFS targets for a root or link. The Buffer parameter points to an array of DFS_INFO_9 structures.
Windows Vista, Windows Server 2003, and Windows XP/2000: This value is not supported until Windows Vista with SP1 and Windows Server 2008.
50Return the DFS metadata version and capabilities of an existing DFS namespace. The Buffer parameter points to a DFS_INFO_50 structure.
Windows Vista, Windows Server 2003, and Windows XP/2000: This value is not supported.
100Return a comment about the DFS root or DFS link. The Buffer parameter points to a DFS_INFO_100 structure.
150Return the security descriptor for the DFS link's reparse point. The Buffer parameter points to a DFS_INFO_150 structure.
Note This value is natively supported only if the DFS link resides on a server that is running Windows Server 2008 or later.

Buffer [out]
Pointer to the address of a buffer that receives the requested information structures. The format of this data depends on the value of the Level parameter. This buffer is allocated by the system and must be freed using the NetApiBufferFree function. For more information, see Network Management Function Buffers and Network Management Function Buffer Lengths .
Return Value
If the function succeeds, the return value is NERR_Success.
If the function fails, the return value is a system error code. For a list of error codes, see System Error Codes .
Remarks
No special group membership is required for using the NetDfsGetInfo function.
Examples
The following code sample demonstrates how to retrieve information about a DFS link using a call to the NetDfsGetInfo function. The sample calls NetDfsGetInfo, specifying information level 3 ( DFS_INFO_3 ). If the call succeeds, the sample prints information about the DFS link, including the name and status of each target referenced by the link. Finally, the code sample frees the memory allocated for the information buffer.
#define UNICODE
#include
#include
#include
#include
#pragma comment(lib, "Netapi32.lib")
void wmain(int argc, wchar_t *argv[ ])
{
PDFS_INFO_3 pData;
PDFS_STORAGE_INFO ps;
DWORD er = 0, tr = 0, res, j;
//
// Check command line arguments.
//
if (argc<2)
wprintf(L"Syntax: %s DfsEntryPath\\n", argv[0]);
else
{
//
// Call the NetDfsGetInfo function, specifying level 3.
//
res = NetDfsGetInfo(argv[1], NULL, NULL, 3, (LPBYTE *) &pData);
//
// If the call succeeds, print the data.
//
if(res==0)
{
printf("%-30S Storages: %u\\nComment: %S\\n", pData->EntryPath, pData->NumberOfStorages, pData->Comment);
ps = pData->Storage;
//
// Loop through each target.
//
for(j = 1; j <= pData->NumberOfStorages;j++)
{
//
// Print the status (Offline/Online) and the name
// of each target referenced by the DFS link.
//
printf(" %S ", (ps->State == DFS_STORAGE_STATE_OFFLINE) ? TEXT("Offline"): TEXT("Online "));
printf("\\\\\\\\%S\\\\%S\\n", ps->ServerName, ps->ShareName);
ps++;
}
//
// Free the allocated memory.
//
NetApiBufferFree(pData);
}
else
printf("Error: %u\\n", res);
}
return;
}
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderLmDfs.h (include LmDfs.h or Lm.h)
LibraryNetapi32.lib
DLLNetapi32.dll
See Also
Network Management Overview
Network Management Functions
Distributed File System (DFS) Functions
DFS_INFO_1
DFS_INFO_2
DFS_INFO_3
DFS_INFO_4
DFS_INFO_5
DFS_INFO_6
DFS_INFO_7
DFS_INFO_100
NetDfsEnum
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/bb524812(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 13:24:07