CVssWriter::OnAbort method (vswriter.h)

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.


bool OnAbort();

Return value

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:

Writers should never throw an exception from this method or any other CVssWriter(Ex)::OnXxx callback method.

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]
Target Platform Windows
Header vswriter.h (include Vss.h, VsWriter.h)
Library VssApi.lib

See also