Platform SDK: Network Management

NetReplExportDirLock

The NetReplExportDirLock function locks a replicated export directory so that replication from 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 Account Operators local group can successfully execute the NetReplExportDirLock function.

NET_API_STATUS NetReplExportDirLock(
  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 export directory 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.

Remarks

The NetReplExportDirLock function locks a directory so that replication from it can be suspended. To remove the registration of an export directory for replication, call the NetReplExportDirDel function.

The rped2_lockcount and rped2_locktime members of the REPL_EDIR_INFO_2 structure contain lock status information. The rped2_locktime member is automatically set to 0 when the rped2_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, NetReplExportDirUnlock