IVssBackupComponents::EnableWriterClasses method (vsbackup.h)
The EnableWriterClasses method enables the specified writers to receive all events.
Syntax
HRESULT EnableWriterClasses(
[in] const VSS_ID *rgWriterClassId,
[in] UINT cClassId
);
Parameters
[in] rgWriterClassId
An array containing one or more writer class identifiers.
[in] cClassId
The number of entries in the rgWriterClassId array.
Return value
The following are the valid return codes for this method.
Value | Meaning |
---|---|
|
Successfully enabled the writer class. |
|
The caller does not have sufficient backup privileges or is not an administrator. |
|
The caller is out of memory or other system resources. |
|
The 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. |
|
Unexpected error. The error code is logged in the error log file. For more information, see
Event and Error Handling Under VSS.
Windows Server 2008, Windows Vista, Windows Server 2003 and Windows XP: This value is not supported until Windows Server 2008 R2 and Windows 7. E_UNEXPECTED is used instead. |
Remarks
If the EnableWriterClasses method and the IVssBackupComponents::DisableWriterClasses method are never called, all writer classes are enabled.
After the first call to EnableWriterClasses returns, the writer classes that were specified in the rgWriterClassId array are enabled, and all other writer classes are disabled.
If you call EnableWriterClasses more than once, each call adds the writers in the rgWriterClassId array to the list of enabled writers.
If you call EnableWriterClasses one or more times and then call DisableWriterClasses, the call to DisableWriterClasses disables any writers in the rgWriterClassId array that were enabled in the calls to EnableWriterClasses.
If you call EnableWriterClasses, you must do so before calling the IVssBackupComponents::GatherWriterMetadata method. If you call GatherWriterMetadata first and then call EnableWriterClasses, the call to EnableWriterClasses has no effect. If you need to call GatherWriterMetadata first, to determine which writer classes to enable, you must call it from a different instance of the IVssBackupComponents interface.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows XP [desktop apps only] |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Target Platform | Windows |
Header | vsbackup.h (include VsBackup.h, Vss.h, VsWriter.h) |
Library | VssApi.lib |