Platform SDK: Network Management

NetReplExportDirUnlock

The NetReplExportDirUnlock function unlocks an export directory so that replication from it can resume. The function decrements 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 NetReplExportDirUnlock function.

NET_API_STATUS NetReplExportDirUnlock(
  LPCWSTR servername, 
  LPCWSTR dirname,    
  DWORD unlockforce  
);

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 directory to unlock.
unlockforce
[in] Specifies a force level to use when unlocking the export directory. This parameter can be one of the following values.
Value Meaning
REPL_UNLOCK_NOFORCE Decrements the lock reference count for the export directory. Note that the lock reference count may or may not return to 0, so the directory could remain locked.
REPL_UNLOCK_FORCE Unlocks the export directory by removing all outstanding locks on the directory. Sets the lock reference count to 0.

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

Replication resumes when all outstanding locks on the directory are released and the lock reference count is returned to 0.

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