NetDfsSetClientInfo function

Modifies information about a Distributed File System (DFS) root or link in the cache maintained by the DFS client.

Syntax

NET_API_STATUS NET_API_FUNCTION NetDfsSetClientInfo(
  LPWSTR DfsEntryPath,
  LPWSTR ServerName,
  LPWSTR ShareName,
  DWORD  Level,
  LPBYTE Buffer
);

Parameters

DfsEntryPath

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<i>DfsName<i>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<i>DomDfsname<i>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<i>DfsName

or

\DomainName<i>DomDfsname

where the values of the names are the same as those described previously.

This parameter is required.

ServerName

Pointer to a string that specifies the DFS link target server name. This parameter is optional. For more information, see the Remarks section.

ShareName

Pointer to a string that specifies the DFS link target share name. This parameter is optional. For additional information, see the following Remarks section.

Level

Specifies the information level of the request. This parameter can be one of the following values.

101

Set the local DFS link's storage status. The Buffer parameter points to a DFS_INFO_101 structure.

102

Set the local DFS link time-out. The Buffer parameter points to a DFS_INFO_102 structure. For more information, see the following Remarks section.

Buffer

Pointer to a buffer that contains the information to be set. The format of this information 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.

Setting the time-out to zero may not immediately delete the local cached copy of the DFS link, because threads may be referencing the entry.

Because there is only one time-out on a DFS link, the ServerName and ShareName parameters are ignored for level 102.

The DFS_STORAGE_STATE_ONLINE and DFS_STORAGE_STATE_OFFLINE bits will be ignored. The DFS_STORAGE_STATE_ACTIVE bit is valid only if no files are open to the active computer.

Requirements

   
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header lmdfs.h (include LmDfs.h, Lm.h)
Library Netapi32.lib
DLL Netapi32.dll

See also

DFS_INFO_101

DFS_INFO_102

Distributed File System (DFS) Functions

NetDfsGetClientInfo

Network Management Functions

Network Management Overview