Click or drag to resize
IVssBackupComponentsExposeSnapshot Method
The ExposeSnapshot method exposes a shadow copy either by mounting it as a device on a drive letter or mount point, or as a file share.

Namespace: Alphaleonis.Win32.Vss
Assembly: AlphaVSS.Common (in AlphaVSS.Common.dll) Version: 1.3.0.0 (1.3.0.0)
Syntax
string ExposeSnapshot(
	Guid snapshotId,
	string pathFromRoot,
	VssVolumeSnapshotAttributes attributes,
	string expose
)

Parameters

snapshotId
Type: SystemGuid
Shadow copy identifier.
pathFromRoot
Type: SystemString

The path to the portion of the volume made available when exposing a shadow copy as a file share. The value of this parameter must be NULL when exposing a shadow copy locally; that is, by mounting to a drive letter or a mount point.

The path cannot contain environment variables (for example, %MyEnv%) or wildcard characters.

There is no requirement that the path end with a backslash ("\"). It is up to applications that retrieve this information to check.

attributes
Type: Alphaleonis.Win32.VssVssVolumeSnapshotAttributes
Attributes of the exposed shadow copy indicating whether it is exposed locally or remotely. The value must be either the ExposedLocally or the ExposedRemotely value of VssVolumeSnapshotAttributes.
expose
Type: SystemString
When a shadow copy is exposed as a file share, the value of this parameter is the share name. If a shadow copy is exposed by mounting it as a device, the parameter value is a drive letter followed by a colon, for example, "X:" or a mount point path (for example, "X:\a\b"). If the value of this parameter is , then VSS determines the share name or drive letter if the attributes parameter is ExposedRemotely.

Return Value

Type: String
The exposed name of the shadow copy. This is either a share name, a drive letter followed by a colon, or a mount point.
Exceptions
ExceptionCondition
ArgumentExceptionOne of the parameter values is not valid.
UnauthorizedAccessExceptionThe caller does not have sufficient backup privileges or is not an administrator.
OutOfMemoryExceptionOut of memory or other system resources.
SystemExceptionUnexpected VSS system error. The error code is logged in the event log.
VssBadStateExceptionThe backup components object is not initialized, this method has been called during a restore operation, or this method has not been called within the correct sequence.
VssObjectNotFoundExceptionThe specified shadow copy does not exist.
VssProviderVetoExceptionExpected provider error. The provider logged the error in the event log.
VssUnexpectedProviderErrorExceptionUnexpected provider error. The error code is logged in the error log.
Remarks

When exposing a persistent shadow copy, it remains exposed through subsequent boots.

When exposing a shadow copy of a volume, the shadow copy may be treated either as a mountable device or as a file system available for file sharing.

When it is exposed as a device, as with other mountable devices, the shadow copy of a volume is exposed at its mount point starting with its root.

When exposed as a file share, subsets (indicated by pathFromRoot) of the volume can be shared.

See Also