IVssComponent::GetAlternateLocationMapping method (vswriter.h)
The GetAlternateLocationMapping is used to return a file set's alternate location for file restoration. This method can be called by either a writer or a requester.
Syntax
HRESULT GetAlternateLocationMapping(
[in] UINT iMapping,
[out] IVssWMFiledesc **ppFiledesc
);
Parameters
[in] iMapping
Index of a particular mapping. The value of this parameter is an integer from 0 to n–1 inclusive, where n is the total number of alternate location mappings associated with the current component. The value of n is returned by IVssComponent::GetAlternateLocationMappingCount.
[out] ppFiledesc
Doubly indirect pointer to a IVssWMFiledesc object containing the mapping information.
Return value
The following are the valid return codes for this method.
Value | Meaning |
---|---|
|
Successfully returned the attribute value. |
|
One of the parameter values is not valid. |
|
The caller is out of memory or other system resources. |
|
The XML document is not valid. Check the event log for details. For more information, see Event and Error Handling Under VSS. |
|
The specified item was not found. |
Remarks
Alternate location mappings returned by GetAlternateLocationMapping can come not only from files in the current component, but also from files in any of its nonselectable subcomponents.
The value returned by IVssComponent::GetAlternateLocationMapping should also not be confused with that returned by IVssExamineWriterMetadata::GetAlternateLocationMapping:
- IVssExamineWriterMetadata::GetAlternateLocationMapping is the alternate location mapping to which a file may be restored if necessary.
- IVssComponent::GetAlternateLocationMapping is the alternate location to which a file was in fact restored.
- The restore method (set at backup time) is VSS_RME_RESTORE_TO_ALTERNATE_LOCATION.
- Its restore target was set (at restore time) to VSS_RT_ALTERNATE.
A file can be restored to an alternate location mapping if either of the following is true:
- The restore method is VSS_RME_RESTORE_IF_NOT_THERE and a version of the file is already present on disk.
- The restore method is VSS_RME_RESTORE_IF_CAN_REPLACE and a version of the file is present on disk and cannot be replaced.
The mapping returned by GetAlternateLocationMapping refers to the alternate location mappings used in the course of restoring files.
Alternate location mappings are added to an IVssComponent object by IVssBackupComponents::AddAlternativeLocationMapping.
The caller must call IUnknown::Release to release the system resources held by the ppMapping parameter when it is done with the IVssWMFiledesc object that it points to.
For more information on backup and restore file locations under VSS, see Non-Default Backup And Restore Locations.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows XP [desktop apps only] |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Target Platform | Windows |
Header | vswriter.h (include Vss.h, VsWriter.h) |
Library | VssApi.lib |