网站首页  词典首页

请输入您要查询的函数:

 

术语 netdfssetinfo
释义 NetDfsSetInfo
语法:
C++
NET_API_STATUS NetDfsSetInfo(
__in LPWSTR DfsEntryPath,
__in_opt LPWSTR ServerName,
__in_opt LPWSTR ShareName,
__in DWORD Level,
__in LPBYTE Buffer
);
NetDfsSetInfo功能
设置或修改有关具体分布式文件系统(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
那里的名称的值为前面所述相同。
服务器名[中,可选]
一个字符串指针,指定DFS链接目标服务器的名称。此参数是可选的。有关详细信息,请参见备注部分。
共享名[中,可选]
一个字符串指针,指定DFS链接的目标共享名称。这也可能是共享的名称与路径相对于共享。例如,share1 \\ mydir1 \\ mydir2。此参数是可选的。有关详细信息,请参见备注部分。
Level [in]
指定的数据信息的Level。此参数可以是下列值之一。
ValueMeaning
100Set与DFS根目录或链接在DfsEntryPath参数中指定相关评论。缓冲区参数指向DFS_INFO_100结构。
101Set的存储状态与DFS根或链接的DfsEntryPath参数中指定相关。缓冲区参数指向DFS_INFO_101结构。
102Set超时与DFS根或链接的DfsEntryPath参数指定的关联值。缓冲区参数指向DFS_INFO_102结构。
103Set为标志的DFS根目录或财产中的链接DfsEntryPath参数中指定。缓冲区参数指向DFS_INFO_103结构。
注意此值是原生支持只有在DFS根目录或链接驻留在一个服务器上运行Windows Server 2003 SP1或更高版本。
Windows Server 2003和Windows XP SP2中:KB 898900是必需的。请注意,此行为已与Windows Server 2003 SP1的变化。
Windows 2000中:此值不支持。
104Set目标的优先级和类的根目标或链接的目标在DfsEntryPath参数中指定。缓冲区参数指向DFS_INFO_104结构。
注意此值是原生支持只有在DFS根目录或链接驻留在一个服务器上运行Windows Server 2003 SP1或更高版本。
Windows Server 2003和Windows XP SP2中:KB 898900是必需的。请注意,此行为已与Windows Server 2003 SP1的变化。
Windows 2000中:此值不支持。
105Set的评论,州和超时的信息,以及财产为标志的DFS根或链接的DfsEntryPath参数中指定。缓冲区参数指向DFS_INFO_105结构。
注意此值是原生支持只有在DFS根目录或链接驻留在一个服务器上运行Windows Server 2003 SP1或更高版本。
Windows Server 2003和Windows XP SP2中:KB 898900是必需的。请注意,此行为已与Windows Server 2003 SP1的变化。
Windows 2000中:此值不支持。
106Set国家的目标和优先目标的根或链接的目标在DfsEntryPath参数中指定。这些信息可以不设DFS命名空间的根或链接,只在根目标或链接的目标。缓冲区参数指向DFS_INFO_106结构。
注意此值是原生支持只有在DFS根目录或链接驻留在一个服务器上运行Windows Server 2003 SP1或更高版本。
Windows Server 2003和Windows XP SP2中:KB 898900是必需的。请注意,此行为已与Windows Server 2003 SP1的变化。
Windows 2000中:此值不支持。
107Set的评论,州,超时的信息,以及财产的DFS根或链接旗帜在DfsEntryPath参数中指定。对于DFS链接,您还可以设置为链接的分析点的安全描述符。缓冲区参数指向DFS_INFO_107结构。
注意此值只有在支持DFS根或链接驻留在一个服务器上运行Windows Server 2008或更高版本。
150Set为DFS链接的分析点安全描述符。缓冲区参数指向DFS_INFO_150结构。
注意此值仅支持DFS链接,如果驻留在一个服务器上运行Windows Server 2008或更高版本。
缓冲区 [in]
缓冲区指针指定的数据。这些数据的格式取决于该级别的参数值。有关更多信息,请参阅网络管理功能的缓冲器。
返回值
如果函数成功,返回值是NERR_Success。
如果函数失败,返回值是一个系统错误代码。对于一个错误代码的列表,请参见系统错误代码。
备注
调用者必须具有在DFS服务器的管理员特权。如需有关通话功能,需要管理员权限的信息,请运行特权。
如果您同时指定服务器名和共享名参数,NetDfsSetInfo功能设置或修改具体信息,根目标或链接的目标。如果参数是NULL,函数设置或修改信息,具体到DFS名称空间根或DFS链接而不是一个特定的DFS根目标或链接的目标。
因为只有一个评论和一个超时可DFS根目录或链接的服务器名和共享名被忽略的参数设置信息Level100和102。这些参数是所必需的Level101。
对于信息化Level101,DFS_VOLUME_STATE_RESYNCHRONIZE和DFS_VOLUME_STATE_STANDBY状态值可以设置为以下特定域的DFS根当有一个以上的DFS根目录的DFS名称空间目标:
Windows Server 2003中:在DfsEntryPath参数应指定DFS根目标服务器的名称,而不是Active Directory域名承载DFS名称空间。因此,应UNC路径
\\ \\ RootTargetServer \\ DomDfsName
而不是
\\ \\域名\\ DomDfsName
,其中RootTargetServer是DFS根目标服务器上的设置信息,操作要执行。
Windows Vista和Windows服务器2008年:DfsEntryPath参数指定基于域的DFS命名空间和ServerName和合计指定DFS根目标上的设置信息,行动的目的是执行共享名参数。
实例
下面的代码示例演示如何关联一个评论链接的DFS使用调用NetDfsSetInfo功能。示例指定信息化Level100(DFS_INFO_100)。
#define UNICODE
#include
#include
#include
#include
#pragma comment(lib, "Netapi32.lib")
void wmain(int argc, wchar_t *argv[])
{
DFS_INFO_100 dfsData;
DWORD res;
//
// Check command line arguments.
//
if (argc<2)
wprintf(L"Syntax: %s DfsEntryPath [\\"Comment\\"]\\n", argv[0]);
else
{
//
// Fill in DFS_INFO_100 structure member.
//
dfsData.Comment = argc < 3 ? NULL : argv[2];
//
// Call the NetDfsSetInfo function, specifying level 100.
//
res = NetDfsSetInfo(argv[1], NULL, NULL, 100, (LPBYTE) &dfsData);
//
// Display the result of the call.
//
if(res == 0)
printf("Comment set.\\n");
else
printf("Error: %u", res);
}
return;
}

要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderLmDfs.h(包括LmDfs.h或Lm.h)
LibraryNetapi32.lib
DLLNetapi32.dll
参见
网络管理概述
网络管理功能
分布式文件系统(DFS)功能
DFS_INFO_100
DFS_INFO_101
DFS_INFO_102
DFS_INFO_103
DFS_INFO_104
DFS_INFO_105
DFS_INFO_106
DFS_INFO_107
DFS_INFO_150
NetDfsEnum
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==NetDfsSetInfo Function
Sets or modifies information about a specific Distributed File System (DFS) root, root target, link, or link target.
Syntax
C++
NET_API_STATUS NetDfsSetInfo(
__in LPWSTR DfsEntryPath,
__in_opt LPWSTR ServerName,
__in_opt LPWSTR ShareName,
__in DWORD Level,
__in 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.
ServerName [in, optional]
Pointer to a string that specifies the DFS link target server name. This parameter is optional. For more information, see the Remarks section.
ShareName [in, optional]
Pointer to a string that specifies the DFS link target share name. This may also be a share name with a path relative to the share. For example, share1\\mydir1\\mydir2. This parameter is optional. For more information, see the Remarks section.
Level [in]
Specifies the information level of the data. This parameter can be one of the following values.
ValueMeaning
100Set the comment associated with the DFS root or link specified in the DfsEntryPath parameter. The Buffer parameter points to a DFS_INFO_100 structure.
101Set the storage state associated with the DFS root or link specified in the DfsEntryPath parameter. The Buffer parameter points to a DFS_INFO_101 structure.
102Set the time-out value associated with the DFS root or link specified in the DfsEntryPath parameter. The Buffer parameter points to a DFS_INFO_102 structure.
103Set the property flags for the DFS root or link specified in the DfsEntryPath parameter. The Buffer parameter points to a DFS_INFO_103 structure.
Note This value is natively supported only if the DFS root or 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.
104Set the target priority rank and class for the root target or link target specified in the DfsEntryPath parameter. The Buffer parameter points to a DFS_INFO_104 structure.
Note This value is natively supported only if the DFS root or 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.
105Set the comment, state, and time-out information, as well as property flags, for the DFS root or link specified in the DfsEntryPath parameter. The Buffer parameter points to a DFS_INFO_105 structure.
Note This value is natively supported only if the DFS root or 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.
106Set the target state and priority for the root target or link target specified in the DfsEntryPath parameter. This information cannot be set for a DFS namespace root or link, only for a root target or link target. The Buffer parameter points to a DFS_INFO_106 structure.
Note This value is natively supported only if the DFS root or 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.
107Set the comment, state, time-out information, and property flags for the DFS root or link specified in the DfsEntryPath parameter. For DFS links, you can also set the security descriptor for the link's reparse point. The Buffer parameter points to a DFS_INFO_107 structure.
Note This value is supported only if the DFS root or link resides on a server that is running Windows Server 2008 or later.
150Set the security descriptor for a DFS link's reparse point. The Buffer parameter points to a DFS_INFO_150 structure.
Note This value is supported only if the DFS link resides on a server that is running Windows Server 2008 or later.

Buffer [in]
Pointer to a buffer that specifies the data. The format of this data depends on the value of the Level parameter. For more information, see Network Management Function Buffers .
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
The caller must have Administrator privilege on the DFS server. For more information about calling functions that require administrator privileges, see Running with Special Privileges .
If you specify both the ServerName and ShareName parameters, the NetDfsSetInfo function sets or modifies information specific to that root target or link target. If the parameters are NULL, the function sets or modifies information that is specific to the DFS namespace root or the DFS link instead of a specific DFS root target or link target.
Because only one comment and one time-out can be set for a DFS root or link, the ServerName and ShareName parameters are ignored for information levels 100 and 102. These parameters are required for level 101.
For information level 101, the DFS_VOLUME_STATE_RESYNCHRONIZE and DFS_VOLUME_STATE_STANDBY state values can be set as follows for a specific domain-based DFS root when there is more than one DFS root target for the DFS namespace:
Windows Server 2003: The DfsEntryPath parameter should specify the DFS root target server name instead of the Active Directory domain name that hosts the DFS namespace. Thus, the UNC path should be
\\\\RootTargetServer\\DomDfsName
instead of
\\\\DomainName\\DomDfsName
, where RootTargetServer is the DFS root target server on which the set-information operation is to be performed.
Windows Vista and Windows Server 2008: The DfsEntryPath parameter specifies the domain-based DFS namespace, and the ServerName and ShareName parameters taken together specify the DFS root target on which the set-information operation is to be performed.
Examples
The following code sample demonstrates how to associate a comment with a DFS link using a call to the NetDfsSetInfo function. The sample specifies information level 100 ( DFS_INFO_100 ).
#define UNICODE
#include
#include
#include
#include
#pragma comment(lib, "Netapi32.lib")
void wmain(int argc, wchar_t *argv[])
{
DFS_INFO_100 dfsData;
DWORD res;
//
// Check command line arguments.
//
if (argc<2)
wprintf(L"Syntax: %s DfsEntryPath [\\"Comment\\"]\\n", argv[0]);
else
{
//
// Fill in DFS_INFO_100 structure member.
//
dfsData.Comment = argc < 3 ? NULL : argv[2];
//
// Call the NetDfsSetInfo function, specifying level 100.
//
res = NetDfsSetInfo(argv[1], NULL, NULL, 100, (LPBYTE) &dfsData);
//
// Display the result of the call.
//
if(res == 0)
printf("Comment set.\\n");
else
printf("Error: %u", 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_100
DFS_INFO_101
DFS_INFO_102
DFS_INFO_103
DFS_INFO_104
DFS_INFO_105
DFS_INFO_106
DFS_INFO_107
DFS_INFO_150
NetDfsEnum
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/bb524823(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:41