Platform SDK: Network Management

NetDfsSetClientInfo

The NetDfsSetClientInfo function associates information with a Distributed File System (Dfs) link in the named Dfs root. The information represents the current computer's cached copy of the information about the Dfs link. Only the cached information is changed. The link time-out, active machine/share, and machine/share availability may be set.

Note  This function is currently being evaluated and may or may not be supported in future versions.

Security Requirements

Administrator privileges are required to successfully execute the NetDfsSetClientInfo function.

NET_API_STATUS NET_API_FUNCTION NetDfsSetClientInfo(
  LPWSTR DfsEntryPath,  // Dfs entry path for the junction point  
  LPWSTR ServerName,    // name of server exporting the storage 
  LPWSTR ShareName,     // name of share exporting the storage 
  DWORD Level,          // level of information to set 
  LPBYTE Buffer         // buffer holding information
);  

Parameters

DfsEntryPath
[in] Pointer to a null-terminated Unicode character string that specifies the Universal Naming Convention path of a Dfs link. The string must be in one of two forms. The first form is as follows:
\\Dfsname\sharename\path_to_link 

where Dfsname is the name of a Windows NT/Windows 2000 server that hosts the root of a stand-alone Dfs implementation; sharename is the name of a share published on the Dfs host server; and path_to_link specifies the path on the physical share.

The second form is as follows:

\\DomainName\DomDfsname\path_to_link 

where DomainName is the name of a Windows NT/Windows 2000 domain that hosts the Dfs root; DomDfsname is the name of the root of a domain-based Dfs implementation published in the domain's directory service; and path_to_link specifies the path on the physical share.

Windows 95/98: The DomDfsname must be identical to the name of the share that hosts the root of the domain-based Dfs.

ServerName
[in] Pointer to a null-terminated Unicode character string that specifies the name of the host server that the Dfs link references. The string must begin with \\. This parameter is optional. For additional information, see the following Remarks section.
ShareName
[in] Pointer to a null-terminated Unicode character string that specifies the name of the share on the host server that the Dfs link references. This parameter is optional. For additional information, see the following Remarks section.
Level
[in] Specifies the information level of the request. This parameter can be one of the following values.
Value Meaning
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
[in] Pointer to a buffer that specifies the data. The format of this data depends on the value of the Level parameter.

Return Values

If the function succeeds, the return value is NERR_Success.

If the function fails, the return value is a Win32 API error code. For a list of error codes, see Error Codes.

Remarks

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 machine/share.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Unsupported.
  Header: Declared in Lmdfs.h; include Lm.h.
  Library: Use Netapi32.lib.

See Also

Network Management Overview, Network Management Functions, Distributed File System (Dfs) Functions, DFS_INFO_101, DFS_INFO_102, NetDfsGetClientInfo