Platform SDK: Network Management

NetReplExportDirAdd

The NetReplExportDirAdd function registers an existing directory in the export path for replication.

Security Requirements

Only members of the Administrators local group or the Account Operators local group can successfully execute the NetReplExportDirAdd function.

NET_API_STATUS NetReplExportDirAdd(
  LPCWSTR servername, 
  DWORD level,       
  const LPBYTE buf,  
  LPDWORD parm_err   
);

Parameters

servername
[in] Pointer to a constant null-terminated Unicode string specifying the name of the remote server on which the function is to execute. The string must begin with \\. If this parameter is NULL, the local computer is used.
level
[in] Specifies the information level of the data. This parameter can be the following value.
Value Meaning
1 Specifies an export subdirectory and its attributes. The buf parameter points to a REPL_EDIR_INFO_1 structure.

buf
[in] Pointer to the buffer that specifies the data. The format of this data depends on the value of the level parameter.
parm_err
[out] Pointer to a DWORD value that receives the index of the first parameter that causes the ERROR_INVALID_PARAMETER error. If this parameter is NULL, the index is not returned on error.

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

When you add a directory to the export path using a call to the NetReplExportDirAdd function, you must specify the settings for the integrity and extent replication controls. To do this, use the rpedX_integrity and rpedX_extent members of the appropriate REPL_EDIR_INFO structure. The integrity control determines when a master updates a client. The extent control specifies the selection of files for replication within the main export directory. For more information, see replicator export directory functions and REPL_EDIR_INFO_1.

The file replicator service automatically registers a new directory for replication when a user creates it under the master directory's export path. In this case, the file replicator service gives the directory the REPL_INTEGRITY_FILE and REPL_EXTENT_TREE settings for the integrity and extent replication controls.

The default values for locktime and lockcount are both 0. For more information about these values, see REPL_EDIR_INFO_2.

Requirements

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

See Also

Network Management Overview, Network Management Functions, Replicator Functions, NetReplExportDirDel, REPL_EDIR_INFO_1