|
Replicator Functions
The replicator functions control how the Windows NT replicator service updates
selective directories from an export server to one or more clients. In
addition to providing compatible LAN Manager 2.x functionality in a well-defined manner, this new set of LAN Manager functions
allow for specific API (operation) security checking. There are three
categories of replicator functions:
If you are unable to replicate files, before using the replicator functions,
check the Control Panel Services application to make sure the replicator service
is configured to log on using a specific user account. This user account must
be a member of the Replicator local group, and it must not be disabled or
lacking permission to access the import and export trees on the respective servers.
Failure specify the user account is the most common error in configuring the
Replicator service.
The Windows NT Replicator service is intended 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.
The change from the file system based control on LAN Manager 2.x to replicator function control on Windows NT has the following implications:
- Applications can no longer delete a directory in the import path of a client
to stop receiving updates from its master.
- Applications can no longer use the REPL.INI file in each replicated directory
on a master to control the method of replication.
- Applications can no longer lock or unlock a directory on a master from being
replicated by creating or deleting the USERLOCK.* file(s).
- Applications can no longer lock or unlock a directory on a client from
receiving updates from its master by creating or deleting USERLOCK.* files.
- Applications that depend on the LAN Manager 2.x behavior of ignoring locks for file integrity trees will need to be modified.
(Windows NT policy differs from LAN Manager 2.x policy; under Windows NT the locks are always respected.)
Each of the intended operations listed preceding can be specified to the
Windows NT replicator service through an appropriate function.
Any user or application logged on as a member of the administration group or
the server operator group on a local or remote export server can modify the
parameters that control the replication service.
Replicator Configuration Functions
The configuration parameters of the replicator service can be examined and
modified using the replicator configuration functions. The replicator
configuration functions are:
NetReplGetInfo
NetReplSetInfo
The configuration parameters of the replictor can be examined using NetReplGetInfo. They can be modified using NetReplSetInfo.
The replicator configuration information structures are:
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. The replicator export directory functions are:
NetReplExportDirAdd
NetReplExportDirDel
NetReplExportDirEnum
NetReplExportDirGetInfo
NetReplExportDirLock
NetReplExportDirSetInfo
NetReplExportDirUnlock
A user can create a new directory under the export path and the Replicator
service will automatically replicate that directory. Or, a directory under the
export path can be registered using NetReplExportDirAdd. When adding a directory to be replicated using these functions, the
replication controls (integrity and extent) are specified using the NetReplExportDirAdd function. If the directory is created in the file system and no replicator
functions are called, then the directory is treated as having file integrity and
tree extent.
The integrity control determines when a master updates a client. When integrity is REPL_INTEGRITY_FILE, the client gets a replica of a file within the
directory when it is not in use (being changed or replicated). When integrity is set to REPL_INTEGRITY_TREE, every file and directory within the replicated
directory must be stable for the amount of time specified by the guardtime parameter before the client is updated. The extent control determines whether the entire tree within the directory is replicated
(REPL_EXTENT_TREE) or only the files in the first-level directory is
replicated (REPL_EXTENT_FILE).
The replication controls of each replicated directory can be examined using NetReplExportDirGetInfo, and dynamically modified using NetReplExportDirSetInfo. These control fields used to be specified in the REPL.INI file within each
replicated directory on LAN Manager 2.x, and they could not be dynamically set. On Windows NT, the REPL.INI file is
not used and will be ignored in the replication process.
The NetReplExportDirEnum function returns a list of directories that are currently replicated. The NetReplExportDirDel function unregisters a directory so that it is no longer replicated.
The lock status information is returned in two fields: lockcount and locktime. The lockcount field indicates the number of outstanding locks on a directory. The locktime field indicates the time (in seconds since 1970, GMT) when the directory was
first locked, or is 0 if the directory is not locked at the present time.
The NetReplExportDirLock function locks a directory so that it is not replicated, by incrementing a
lock reference count for the directory. A lock on a directory can be unlocked
using NetReplExportDirUnlock. The replication does not resume unless all outstanding locks on that
directory are released, and the lock reference count is returned to 0. (The locktime field is automatically set to 0 when lockcount is 0.)
The replicator export directory functions can be called regardless of whether
the Replicator service is running. If the Replicator service is running as a
master, any modification to the directory controls takes effect immediately, and
is persistent after the Replicator service has been stopped. If the Replicator
service is not started, the controls for the directory is stored as persistent
information and will take effect when the Replicator service starts up.
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
Replicator Import Directory Functions
The replicator import directory functions designate the top-level directories
under the import path to receive updates on. They also return status
information about a replicated directory on the client. On LAN Manager 2.x, a user must create a directory under the import path and the Replicator
service automatically replicates to it. The replicator import directory functions
are:
NetReplImportDirAdd
NetReplImportDirDel
NetReplImportDirEnum
NetReplImportDirGetInfo
NetReplImportDirLock
NetReplImportDirUnlock
On Windows NT, import directories are automatically added if they are exported
by an export server from which importer is importing. Another way to register
a directory in advance of it being exported, is to use the NetReplImportDirAdd functions. This function does not create the directory itself. This is useful
if you wish to modify some of the properties of the import directory (for
example, to lock it) prior to it first beginning to import this directory.
The NetReplImportDirDel function unregisters a directory. This is used to clean up a directory that
is no longer being exported. It will not stop replication if there is an active
exporter, since it will be re-registered the next time the exporter tells the
importer what directories it is exporting. If you wish to prevent importing of
an actively exported directory, use NetReplImportDirLock.
The NetReplImportDirEnum function lists all the directories that are replicated to a client, and NetReplImportDirGetInfo returns the status of a specified directory.
The status information of a directory consists of the replication state, the UNC computer name of the master (mastername), and the time (in seconds since 1970, GMT) when the directory was last
updated (last_update_time). If the state is REPL_STATE_OK, the directory currently has a master, and is receiving
regular update notices from it. If the state is REPL_STATE_NO_MASTER, the directory is not supported by any master, and it
is typically empty. If the state is REPL_STATE_NO_SYNC, the directory has a master, but the master has not
sent any update notices within the interval time period. This may be due to a communication failure, the master crashing,
the directory being locked, files in the client directory being opened at
update time, or an unstable REPL_INTEGRITY_TREE integrity directory on the master. If the client Replicator service is not started, the state is REPL_STATE_NEVER_REPLICATED, mastername is a NULL string, and last_update_time is 0. The NetReplImportDirLock function locks a directory so that it does not receive updates, by
incrementing a lock reference count for the directory. A lock on a directory can be
unlocked using NetReplImportDirUnlock. The directory is not updated unless all outstanding locks on that directory
are released, and the lock reference count is returned to 0.
The lock status information is returned in two fields: lockcount and locktime. The lockcount field indicates the number of outstanding locks on a directory. The locktime field indicates the time (in seconds since 1970, GMT) when the directory was
first locked. (locktime is set to 0 whenever lockcount goes to 0.)
The replicator import directory functions can be called whether the Replicator
service is running or not. If the Replicator service is running as a client,
directory adds or deletes take effect immediately, and is persistent after the
Replicator service has been stopped. If the Replicator service is not started,
any added directory will receive updates when the Replicator service starts up
(if there exists a master that exports the directory).
The replicator import directory function are available at the following
information levels:
REPL_IDIR_INFO_0
REPL_IDIR_INFO_1
| Last news from Greatis Software |
 |
|
Nostalgia .Net |
|
.Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes. More » |
| Recommended software for developers |
 |
|
Ultimate Pack |
|
Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price. More » |
 |
|
Form Designer .Net |
|
Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro! More » |
 |
|
Print Suite .Net |
|
Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available More » |
 |
|
Gradient Controls .Net |
|
Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available More » |
 |
|
Greatis iGrid |
|
iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors. More » |
All the contacts and projectsDmitry Vasiliev (just.dmitry)
Related LinksSoftware for Visual Studio .NET developers Software for Delphi and C++ Builder developers Software for Visual Basic 6 developers Delphi Tips&Tricks MegaDetailed.NET More Online Helps Win32 Programmer's Reference Win32 Multimedia Programmer's Reference OLE Programmer's Reference Microsoft Windows Pen API Programmer's Reference Microsoft Windows Sockets 2 Reference Microsoft Windows Telephony API (TAPI) Programmer's Reference Unix Manual Pages
|