3.1.4.22.3 RemoveShare (Opnum 5)

This method is called by a replication client application to remove a file share that was used during replication and is no longer needed.

 HRESULT RemoveShare(
   [in] LPCWSTR pwszShareName
 );

pwszShareName: The share name (as specified for a path in UNC syntax) of the file share to remove. This MUST be a SourceShareName, TargetNewShareName, or TargetCurrentShareName, according to the following Augmented Backus-Naur Form (ABNF) syntax, as specified in [RFC4234].

 SourceShareName = "ReplicaSource" CurlyBracedGuidString
 TargetNewShareName = "ReplicaTargetNew" CurlyBracedGuidString
 TargetCurrentShareName = "ReplicaTargetCurrent"

Where CurlyBracedGuidString is in Curly Braced GUID String Syntax ([MS-DTYP] section 2.3.4.3).

These formats have the following usage.

Format

Usage

SourceShareName

Used when the server is a replication source and the replication client application is finished copying files from the server.

TargetNewShareName

Used when the server is a replication target and the replication client application is finished copying files to the server.

TargetCurrentShareName

Used when the server is a replication target and the replication client application is finished importing conglomerations from the share.

Return Values: This method MUST return S_OK (0x00000000) on success, and a failure result, as specified in [MS-ERREF] section 2.1, on failure. All failure results MUST be treated identically.

Upon receiving a call to this method, the server MAY verify that pwszShareName is valid, and fail the call if not.

The server then MUST attempt to remove the file share with the provided name, and fail the call if it cannot.

If pwszShareName is the TargetCurrentShareName, the server MAY infer that a replication operation has concluded and perform implementation-specific local actions to manage replication history and/or backup state accordingly.

The server MUST then return success.