Platform SDK: Network Management

NetReplImportDirLock

The NetReplImportDirLock function locks a replicated import directory so that replication to it can be suspended. The function increments the lock reference count for the specified directory.

Security Requirements

Only members of the Administrators local group or the Replicator group can successfully execute the NetReplImportDirLock function.

NET_API_STATUS NetReplImportDirLock(
  LPCWSTR servername,  
  LPCWSTR dirname      
);

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.
dirname
[in] Pointer to a constant null-terminated Unicode string specifying the import directory name to lock.

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.

Return Values

The NetReplImportDirLock function locks a directory so that updates to it are suspended. The function does this by incrementing a lock reference count for the directory. To unlock a directory so that replication to it can resume, call the NetReplImportDirUnlock function. Updates to an import directory occur only when all outstanding locks on the directory are released, and the lock reference count is returned to 0.

To remove the registration of an import directory so that it no longer receives updates from the master, call the NetReplImportDirDel function.

The rpid1_lockcount and rpid1_locktime members of the REPL_IDIR_INFO_1 structure contain lock status information. The rpid1_locktime member is automatically set to 0 when the rpid1_lockcount member is 0.

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, NetReplImportDirUnlock