Platform SDK: Network Management

Replicator Functions

Windows NT: The Windows NT replicator service maintains identical sets of files and directories on different servers and workstations running Windows NT 4.0 or earlier. When you update files on one server, the file replicator service replaces the corresponding files on other servers and workstations with the updated files. The replication process simplifies the task of updating and coordinating files, and maintains the integrity of the replicated data. For more information about replication, see the following topics:

Replication is controlled by options you set in the LANMAN.INI file using the following categories of network management replicator functions:

About Export and Import Servers

To replicate a set of files and directories on several computers, you must create a master set of files and directories on a server that you designate as an export server. Export servers maintain the master files in an export directory tree with a maximum of 32 levels. Each directory can contain as many as 1000 files.

Import servers are servers and workstations that receive replicated files. Import servers and workstations have import directories that correspond to the export directories. When a file changes in the export directory, the file replicator service copies the changes to the corresponding import directories on all designated import servers and workstations. The service replicates all directory and file additions and deletions to the import servers.

A network can have any number of export and import servers. A server can be designated as both an export and an import server. You can configure workstations only as import servers.

About the File Replicator Service

Before using the replicator functions, check the Control Panel Services application to make sure the file replicator service is configured to log on using a specific user account. The user account must be a member of the Replicator local group, the account must not be disabled, and the account must have permission to access the import and export trees on the respective servers.

Changing from file system replication control in LAN Manager 2.x to replicator function control in Windows NT has the following implications:

Each of the options listed preceding can be specified to the file replicator service by calling the appropriate network management replicator function.

Any user or application logged on as a member of either the administration group or the server operator group can modify the parameters that control the file replicator service. (This applies to both local and remote export servers.)

You can use the Windows NT file replicator service to copy relatively small directory trees. If you are attempting to replicate multimegabyte directory trees or trees containing thousands of directories and files, you should consider some other means of doing so.

Replicator Configuration Functions

You can use the replicator configuration functions to examine and modify the configuration parameters for the file replicator service. The replicator configuration functions are listed following.

Function Description
NetReplGetInfo Returns configuration information for the file replicator service.
NetReplSetInfo Modifies configuration information for the file replicator service.

Configuration information for the file replicator service is available at the following levels:

REPL_INFO_0
REPL_INFO_1000
REPL_INFO_1001
REPL_INFO_1002
REPL_INFO_1003

Replicator Export Directory Functions

The replicator export directory functions control top-level directories under the export path on the master directory.

The replicator export directory functions are listed following.

Function Description
NetReplExportDirAdd Registers an existing directory in the export path for replication.
NetReplExportDirDel Removes the registration of a replicated directory.
NetReplExportDirEnum Lists the replicated directories in the export path.
NetReplExportDirGetInfo Returns the control information for a replicated directory.
NetReplExportDirLock Locks a directory so that replication of it can be suspended.
NetReplExportDirSetInfo Modifies the control information for a replicated directory.
NetReplExportDirUnlock Unlocks a directory so that replication of it can resume.

A master directory can be registered for replication in one of the following ways:

The integrity control determines when a master updates a client. The control can be one of the following values.

Value Meaning
REPL_INTEGRITY_FILE The client receives a replica of a file within the directory when the directory isn't being modified or replicated.
REPL_INTEGRITY_TREE Before the file replicator service updates the client, each file and directory within the replicated directory must be stable for a specific period of time. This time is specified by the rp0_guardtime member of the REPL_INFO_0 structure. (Call the NetReplGetInfo function to retrieve this type of configuration information for the file replicator service.)

The extent control specifies the selection of files for replication within the main export directory. The control can be one of the following values.

Value Meaning
REPL_EXTENT_TREE The file replicator service replicates the entire tree within the directory.
REPL_EXTENT_FILE The file replicator service replicates only the files in the first-level directory.

For additional information about these replication controls, see REPL_EDIR_INFO_1.

On systems running LAN Manager 2.x, the replication controls used to be specified in the REPL.INI file in each replicated directory. The controls could not be dynamically set. To examine the replication controls of a directory on Windows NT/Windows 2000, call the NetReplExportDirGetInfo function; to modify them, call NetReplExportDirSetInfo. Windows NT/Windows 2000 ignores the REPL.INI file.

You can call the replicator export directory functions whether or not the file replicator service is running. If the service is running on a master, modifications to the directory controls take effect immediately, and the changes persist after the file replicator service stops. If the service has not started, the changes to the directory controls are stored as persistent information and take effect when the file replicator service starts.

The replicator export directory functions are available at the following information levels:

REPL_EDIR_INFO_0
REPL_EDIR_INFO_1
REPL_EDIR_INFO_2
REPL_EDIR_INFO_1000
REPL_EDIR_INFO_1001

The rped2_lockcount and rped2_locktime members of the REPL_EDIR_INFO_2 structure contain lock status information.

Replicator Import Directory Functions

The replicator import directory functions designate the top-level directories in the client's import path that should receive updates from the master. The functions also return status information about a replicated directory on the client. (On LAN Manager 2.x, after a user creates a directory under the import path, the file replicator service automatically replicates to it.)

The replicator import directory functions are listed following.

Function Description
NetReplImportDirAdd Registers an existing directory in the import path to receive replication from a master.
NetReplImportDirDel Removes the registration of a directory in the import path so that it no longer receives updates from the master; the function does not delete the directory from the file system.
NetReplImportDirEnum Lists the client directories that are registered for replication.
NetReplImportDirGetInfo Returns status information for a replicated directory on an import server.
NetReplImportDirLock Locks a directory so that replication to it can be suspended.
NetReplImportDirUnlock Unlocks a directory so that replication to it can resume.

You can register a client directory for replication in one of the following ways:

You can call the replicator import directory functions whether or not the file replicator service is running. If the service is running on a client, directory additions and deletions take effect immediately, and the changes persist after the file replicator service stops. If the service has not started, and if there is a master that exports the directory, directory additions receive updates when the file replicator service starts.

The replicator import directory functions are available at the following information levels:

REPL_IDIR_INFO_0
REPL_IDIR_INFO_1