The OnAbort method is called by a writer following an Abort event issued by VSS indicating that a shadow copy operation has terminated prematurely. The writer uses this method to clean up from its attempt to participate in that operation.
OnAbort is a pure virtual method. It is not implemented by the CVssWriter base class, and must be implemented by derived classes.
Platform::Boolean OnAbort( );
This method has no parameters.
The implementation of this method should return true except in the case of a fatal error. If a fatal error occurs, the method must call the CVssWriter::SetWriterFailure method to provide a description of the failure before returning false. If a nonfatal error occurs, the method should still call SetWriterFailure but return true. If the error is caused by a transient problem, the method should specify VSS_E_WRITERERROR_RETRYABLE in the call to SetWriterFailure.
In all cases when a failure occurs, the method should write an event to the event log to report the exact reason for the failure.
In this method, the writer should free all temporary system resources it created when preparing to participate with a VSS operation.
The writer will not receive further event notifications related to the VSS operation it was participating in after CVssWriter::OnAbort has been executed.
This method will not be called if the writer has called CVssWriter::OnPostSnapshot (that is, received notification of the end of a shadow copy).
An Abort event is generated when:
- A writer's Freeze and Thaw event handlers (CVssWriter::OnFreeze and CVssWriter::OnThaw) return false, or cannot complete in the time window specified in CVssWriter::Initialize.
- A requester explicitly generates an Abort event by calling IVssBackupComponents::AbortBackup.
- There is any failure of the provider or VSS during the creation of a shadow copy following the PrepareForSnapshot event.
If this method calls the CVssWriterEx2::GetSessionId, CVssWriter::SetWriterFailure, or CVssWriterEx2::SetWriterFailureEx method, it must do so in the same thread that called this method. For more information, see Writer Event Handling.
|Minimum supported client||Windows XP [desktop apps only]|
|Minimum supported server||Windows Server 2003 [desktop apps only]|
|Header||vswriter.h (include Vss.h, VsWriter.h)|