Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Sets the context for subsequent shadow copy-related operations.
Syntax
HRESULT SetContext(
[in] LONG lContext
);
Parameters
[in] lContext
The context to be set. The context must be one of the supported values of _VSS_SNAPSHOT_CONTEXT or a supported combination of _VSS_VOLUME_SNAPSHOT_ATTRIBUTES and _VSS_SNAPSHOT_CONTEXT values.
Return value
The following are the valid return codes for this method.
| Value | Meaning |
|---|---|
|
The context was set successfully. |
|
The caller does not have sufficient backup privileges or is not an administrator. |
|
One of the parameter values is not valid. |
|
The caller is out of memory or other system resources. |
|
The context is frozen and cannot be changed. |
Remarks
The default context for VSS shadow copies is VSS_CTX_BACKUP.
Windows XP: The only supported context is the default context, VSS_CTX_BACKUP. Therefore, calling SetContext under Windows XP returns E_NOTIMPL.
For more information about how the context that is set by SetContext affects how a shadow copy is created and managed, see Implementation Details for Creating Shadow Copies.
For a complete discussion of the permitted shadow copy contexts, see _VSS_SNAPSHOT_CONTEXT and _VSS_VOLUME_SNAPSHOT_ATTRIBUTES.
Requirements
| Requirement | Value |
|---|---|
| Minimum supported client | Windows Vista [desktop apps only] |
| Minimum supported server | Windows Server 2003 [desktop apps only] |
| Target Platform | Windows |
| Header | vsprov.h |
| Library | VssApi.lib |