Platform SDK: Network Management

NetReplImportDirUnlock

The NetReplImportDirUnlock function unlocks an import directory so that replication to 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 Replicator group can successfully execute the NetReplImportDirUnlock function.

NET_API_STATUS NetReplImportDirUnlock(
  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 import directory name to unlock.
unlockforce
[in] Specifies a force level to use when unlocking the import directory. This parameter can be one of the following values.
Value Meaning
REPL_UNLOCK_NOFORCE Decrements the lock reference count for the import 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 import 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 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, NetReplImportDirLock