/// <para>Returns a pointer to an IVssCreateWriterMetadataEx object.</para>
/// <para><c>OnIdentifyEx</c> is a virtual method. It is implemented by the CVssWriterEx base class, but can be overridden by derived classes.</para>
/// </summary>
/// <param name="pMetadata">A pointer to an IVssCreateWriterMetadataEx object.</param>
/// <returns>
/// <para>As implemented by the base class, <c>OnIdentifyEx</c> always returns <c>true</c>.</para>
/// <para>Any other implementation of this method must return <c>true</c> except in the case of a fatal error. If a fatal error occurs, the method should return <c>false</c>.</para>
/// <para>In all cases when a failure occurs, including nonfatal errors, the method should write a detailed entry to the event log to report the exact reason for the failure.</para>
/// </returns>
/// <remarks>
/// <para>The <c>OnIdentifyEx</c> method is identical to the OnIdentify method, except that it returns an IVssCreateWriterMetadataEx interface pointer instead of an IVssCreateWriterMetadata interface pointer in the <c>pMetadata</c> parameter. A writer can override <c>OnIdentify</c> or <c>OnIdentifyEx</c>, but not both.</para>
/// <para>Writers should never throw an exception from this method or any other <c>CVssWriter(Ex)::On<c>Xxx</c></c> callback method.</para>
/// <para>Writers should never call the CVssWriter::SetWriterFailure method from the OnIdentify or <c>OnIdentifyEx</c> method.</para>
/// <para>If this method calls the CVssWriterEx2::GetSessionId method, it must do so in the same thread that called this method. For more information, see Writer Event Handling.</para>
/// <para>In response to an Identify event that is generated by another application, a writer calls <c>OnIdentifyEx</c> to create a Writer Metadata Document that contains information about the components it manages using the IVssCreateWriterMetadataEx interface.</para>
/// <para>The application that generated the Identify event then retrieves the Writer Metadata Document and examines the writer's component information using the IVssExamineWriterMetadata interface.</para>
/// <para>An Identify event is required before the events that make up a backup or restore sequence. Therefore, <c>OnIdentifyEx</c> is typically called to handle an <c>Identify</c> event in response to a requester's call to IVssBackupComponents::GatherWriterMetadata as part of a backup or restore operation.</para>
/// <para>However, an Identify event by itself is not part of the sequence of events that make up a backup or restore sequence, and the VSS service does not prevent <c>Identify</c> events from being generated, even while a backup or restore sequence is in progress. For example, VSS management applications use the <c>Identify</c> event to determine and display the state of the writers on the system.</para>
/// <para>For this reason, writers should never use their implementation of <c>OnIdentifyEx</c> in any of the following ways:</para>
/// <list type="bullet">
/// <item>
/// <term>As the beginning of their handling of a backup or restore sequence</term>
/// </item>
/// <item>
/// <term>To set or maintain information about the writer's state</term>
/// </item>
/// </list>
/// <para>For more information about writer interactions with events, see Writer Event Handling.</para>
/// <para>During the PrepareForBackup, PrepareForSnapshot, and PostSnapshot events, a writer can use the GetIdentifyInformation method to get the metadata that the writer's <c>OnIdentifyEx</c> method previously reported.</para>
/// <para>The life cycle of the IVssCreateWriterMetadataEx object that the <c>pMetadata</c> parameter points to is managed by the VSS infrastructure.</para>
/// <para>The <c>OnPrepareBackup</c> method is called by a writer following a PrepareForBackup event. This method is used to configure a writer's state and its components in preparation for a backup operation.</para>
/// <para><c>OnPrepareBackup</c> is a virtual method. It is implemented by the CVssWriter base class, but can be overridden by derived classes.</para>
/// </summary>
/// <param name="pComponent">Pointer to an instantiation of an IVssWriterComponents object containing the contents of the Writer Metadata Document. The value of this parameter may be <c>NULL</c> if the requester does not support components (if CVssWriter::AreComponentsSelected returns <c>false</c>).</param>
/// <returns>
/// <para>As implemented by the base class, <c>OnPrepareBackup</c> always returns <c>true</c>.</para>
/// <para>Any other implementation of this method must return <c>true</c> 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 <c>false</c>. If a nonfatal error occurs, the method should still call <c>SetWriterFailure</c> but return <c>true</c>. If the error is caused by a transient problem, the method should specify VSS_E_WRITERERROR_RETRYABLE in the call to <c>SetWriterFailure</c>.</para>
/// <para>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.</para>
/// </returns>
/// <remarks>
/// <para>The default implementation of this method by the CVssWriter base class returns <c>true</c> without performing any other operation.</para>
/// <para><c>OnPrepareBackup</c> provides a writer an opportunity to more finely select what will be backed up.</para>
/// <para>Handling the PrepareForBackup event is the last opportunity for a writer to get access to metadata contained in the Backup Components Document prior to the shadow copy's creation.</para>
/// <para>Therefore, <c>OnPrepareBackup</c> provides an opportunity for the writer to make any final additions or updates to stored component information (using the IVssComponent interface). In particular, writer-specific metadata can be updated by IVssComponent::SetBackupMetadata or IVssComponent::SetRestoreMetadata.</para>
/// <para>In addition, while handling the PrepareForSnapshot event provides another opportunity in the life cycle of a VSS backup operation to perform time-consuming operations (such as synchronizing data across multiple sites), <c>OnPrepareBackup</c> provides a chance for the writer to start such an operation asynchronously. Tasks like these must be completed prior to the return of CVssWriter::OnPrepareSnapshot.</para>
/// <para>Writers should never throw an exception from this method or any other <c>CVssWriter(Ex)::On<c>Xxx</c></c> callback method.</para>
/// <para>A requester generates a PrepareForBackup event, triggering a call to <c>OnPrepareBackup</c>, by calling <c>IVssBackupComponents::PrepareForBackup</c>.</para>
/// <para>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.</para>
/// <para>The <c>OnPrepareSnapshot</c> method is called by a writer to handle a PrepareForSnapshot event. It is used to perform operations needed to prepare a writer to participate in the shadow copy or to veto a shadow copy.</para>
/// <para><c>OnPrepareSnapshot</c> is a pure virtual method. It is not implemented by the CVssWriter base class, and must be implemented by derived classes.</para>
/// </summary>
/// <returns>
/// <para>The implementation of this method must return <c>true</c> 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 <c>false</c>. If a nonfatal error occurs, the method should still call <c>SetWriterFailure</c> but return <c>true</c>. If the error is caused by a transient problem, the method should specify VSS_E_WRITERERROR_RETRYABLE in the call to <c>SetWriterFailure</c>.</para>
/// <para>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.</para>
/// </returns>
/// <remarks>
/// <para>The <c>OnPrepareSnapshot</c> method performs operations that are required prior to any shadow copy freeze.</para>
/// <para>The time-out window for handling a PrepareForSnapshot event is typically longer than that for handling a Freeze event. Therefore, developers can use <c>OnPrepareSnapshot</c> to handle more time-consuming operations. A typical use might be for the writer to explicitly checkpoint its data.</para>
/// <para>Writers should never throw an exception from this method or any other <c>CVssWriter(Ex)::On<c>Xxx</c></c> callback method.</para>
/// <para>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.</para>
/// <para>The <c>OnFreeze</c> method is called by a writer on receipt of a Freeze event at the start of a shadow copy freeze. A writer uses this method to perform operations needed to participate in the freeze or to veto the freeze.</para>
/// <para><c>OnFreeze</c> is a pure virtual method. It is not implemented by the CVssWriter base class, and must be implemented by derived classes.</para>
/// </summary>
/// <returns>
/// <para>The implementation of this method must return <c>true</c> 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 <c>false</c>. If a nonfatal error occurs, the method should still call <c>SetWriterFailure</c> but return <c>true</c>. If the error is caused by a transient problem, the method should specify VSS_E_WRITERERROR_RETRYABLE in the call to <c>SetWriterFailure</c>.</para>
/// <para>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.</para>
/// </returns>
/// <remarks>
/// <para>In this method, the writer application should put itself into a well-defined state that is compatible with the VSS operation.</para>
/// <para>In this method, the writer should complete final preparations to support the creation of a shadow copy. Once the shadow copy is created, the writer will receive the Thaw event and can continue normal operations.</para>
/// <para>By default, the time-out window between Freeze and Thaw events is 60 seconds. That is, if a Thaw event is not received with the time-out window, an Abort event will be generated. Writers can change the time-out window at initialization time by setting the <c>dwTimeoutFreeze</c> argument to CVssWriter::Initialize.</para>
/// <para>How a writer prepares for a shadow copy is highly dependent on the application that hosts it. Some applications can afford to hold all writes and keep the data in an absolute consistent state for this period. Other applications, like many databases, cannot stop work during this period but can take actions, such as checkpointing their state, which may reduce the recovery time for a shadow copy created during this window.</para>
/// <para>If the writer cannot put itself into a well-defined state for the Freeze, the following happens:</para>
/// <list type="number">
/// <item>
/// <term><c>OnFreeze</c> should return <c>false</c>, vetoing the shadow copy.</term>
/// </item>
/// <item>
/// <term>The writer calls CVssWriter::SetWriterFailure to provide a description of the failure.</term>
/// </item>
/// <item>
/// <term>An Abort event will be generated upon <c>OnFreeze</c> return of <c>false</c></term>
/// </item>
/// </list>
/// <para>Writers should never throw an exception from this method or any other <c>CVssWriter(Ex)::On<c>Xxx</c></c> callback method.</para>
/// <para>The time-out window for handling the Freeze event is typically relatively short as compared to that for handling the PrepareForSnapshot event. Therefore, developers should avoid lengthy operations in this method. A typical use might be to suspend logging by the writer.</para>
/// <para>It is recommended that all time-consuming operations be handled by CVssWriter::OnPrepareSnapshot.</para>
/// <para>Either CVssWriter::OnThaw or CVssWriter::OnAbort will be called after this method.</para>
/// <para>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.</para>
/// </remarks>
virtualBooleanOnFreeze()=0;
/// <summary>
/// <para>The <c>OnThaw</c> method is called by a writer following a Thaw event.</para>
/// <para><c>OnThaw</c> is a pure virtual method. It is not implemented by the CVssWriter base class, and must be implemented by derived classes.</para>
/// </summary>
/// <returns>
/// <para>The implementation of this method must return <c>true</c> 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 <c>false</c>. If a nonfatal error occurs, the method should still call <c>SetWriterFailure</c> but return <c>true</c>. If the error is caused by a transient problem, the method should specify VSS_E_WRITERERROR_RETRYABLE in the call to <c>SetWriterFailure</c>.</para>
/// <para>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.</para>
/// </returns>
/// <remarks>
/// <para>This method is called at the end of a shadow copy freeze when writers can begin to modify data on disk again.</para>
/// <para><c>OnThaw</c> is used to return the writer to normal operation, typically reversing actions taken during CVssWriter::OnPrepareSnapshot and CVssWriter::OnFreeze.</para>
/// <para>Final updates by the writer to the backup components metadata and cleanup (such as removing temporary files) are typically reserved for CVssWriter::OnPostSnapshot.</para>
/// <para>Writers should never throw an exception from this method or any other <c>CVssWriter(Ex)::On<c>Xxx</c></c> callback method.</para>
/// <para>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.</para>
/// </remarks>
virtualBooleanOnThaw()=0;
/// <summary>
/// <para>The <c>OnAbort</c> 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.</para>
/// <para><c>OnAbort</c> is a pure virtual method. It is not implemented by the CVssWriter base class, and must be implemented by derived classes.</para>
/// </summary>
/// <returns>
/// <para>The implementation of this method should return <c>true</c> 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 <c>false</c>. If a nonfatal error occurs, the method should still call <c>SetWriterFailure</c> but return <c>true</c>. If the error is caused by a transient problem, the method should specify VSS_E_WRITERERROR_RETRYABLE in the call to <c>SetWriterFailure</c>.</para>
/// <para>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.</para>
/// </returns>
/// <remarks>
/// <para>In this method, the writer should free all temporary system resources it created when preparing to participate with a VSS operation.</para>
/// <para>The writer will not receive further event notifications related to the VSS operation it was participating in after <c>CVssWriter::OnAbort</c> has been executed.</para>
/// <para>This method will not be called if the writer has called CVssWriter::OnPostSnapshot (that is, received notification of the end of a shadow copy).</para>
/// <para>An Abort event is generated when:</para>
/// <list type="bullet">
/// <item>
/// <term>A writer's Freeze and Thaw event handlers (CVssWriter::OnFreeze and CVssWriter::OnThaw) return <c>false</c>, or cannot complete in the time window specified in CVssWriter::Initialize.</term>
/// </item>
/// <item>
/// <term>A requester explicitly generates an Abort event by calling IVssBackupComponents::AbortBackup.</term>
/// </item>
/// <item>
/// <term>There is any failure of the provider or VSS during the creation of a shadow copy following the PrepareForSnapshot event.</term>
/// </item>
/// </list>
/// <para>Writers should never throw an exception from this method or any other <c>CVssWriter(Ex)::On<c>Xxx</c></c> callback method.</para>
/// <para>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.</para>
/// </remarks>
virtualBooleanOnAbort()=0;
/// <summary>
/// <para>The <c>OnBackupComplete</c> method is called by a writer following a BackupComplete event. It is used to perform operations considered necessary following a backup. These operations cannot, however, modify the Backup Components Document.</para>
/// <para><c>OnBackupComplete</c> is a virtual method. It is implemented by the CVssWriter base class, but can be overridden by derived classes.</para>
/// </summary>
/// <param name="pComponent">A pointer to an IVssWriterComponents object passed in by VSS to provide the method with access to the writer's component information. The value of this parameter may be <c>NULL</c> if the requester does not support components (if CVssWriter::AreComponentsSelected returns <c>false</c>).</param>
/// <returns>
/// <para>As implemented by the base class, <c>OnBackupComplete</c> always returns <c>true</c>.</para>
/// <para>Any other implementation of this method should return <c>true</c> 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 <c>false</c>. If a nonfatal error occurs, the method should still call <c>SetWriterFailure</c> but return <c>true</c>. If the error is caused by a transient problem, the method should specify VSS_E_WRITERERROR_RETRYABLE in the call to <c>SetWriterFailure</c>.</para>
/// <para>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.</para>
/// </returns>
/// <remarks>
/// <para>The default implementation of this method by CVssWriter base class returns <c>true</c> without performing any other operation.</para>
/// <para>If special operations are to be performed by the writer at the end of a backup, the default implementation can be overridden.</para>
/// <para>With the generation of a BackupComplete event, a requester's Backup Components Document becomes a read-only document. Therefore, attempts to modify the document through the interface (for instance, calling IVssComponent::SetBackupMetadata) will fail in user implementations of <c>OnBackupComplete</c>.</para>
/// <para>A successful backup application will generate a BackupComplete event when all data has been saved to backup media.</para>
/// <para>However, there is no guarantee of the writer receiving a BackupComplete event notification, because these require the backup application to either successfully complete the backup or fail gracefully.</para>
/// <para>A BackupComplete event could fail to be generated should the backup application be terminated by the system or manually prior to the completion of the backup (for instance, if the backup operation hung and had to be shut down).</para>
/// <para>A writer should maintain state information so that it can track whether a BackupComplete event was sent for a given shadow copy set.</para>
/// <para>This information can be used by a writer's BackupShutdown event handler (CVssWriter::OnBackupShutdown), which will be called when a backup application actually terminates and its IVssBackupComponents is released, to perform cleanup operations should there be no call to <c>OnBackupComplete</c>.</para>
/// <para>Writers should never throw an exception from this method or any other <c>CVssWriter(Ex)::On<c>Xxx</c></c> callback method.</para>
/// <para>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.</para>
/// <para>The <c>OnBackupShutdown</c> method is called by a writer following a BackupShutdown event. It is used to perform operations considered necessary when a backup application shuts down, particularly in the case of a crash of the backup application.</para>
/// <para><c>OnBackupShutdown</c> is a virtual method. It is implemented by the CVssWriter base class, but can be overridden by derived classes.</para>
/// </summary>
/// <param name="SnapshotSetId">Identifier for the shadow copy set involved in the backup operation.</param>
/// <returns>
/// <para>As implemented by the base class, <c>OnBackupShutdown</c> always returns <c>true</c></para>
/// <para>Any other implementation of this method should return <c>true</c> 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 <c>false</c>. If a nonfatal error occurs, the method should still call <c>SetWriterFailure</c> but return <c>true</c>. If the error is caused by a transient problem, the method should specify VSS_E_WRITERERROR_RETRYABLE in the call to <c>SetWriterFailure</c>.</para>
/// <para>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.</para>
/// </returns>
/// <remarks>
/// <para>The default implementation of this method by the CVssWriter base class returns <c>true</c> without performing any other operation.</para>
/// <para>If special operations are to be performed by the writer when a backup application shuts down, the default implementation can be overridden.</para>
/// <para>If no shadow copy has been successfully performed, the value of the shadow copy set identifier (<c>SnapshotSetId</c>) will be <c>NULL</c>.</para>
/// <para>A BackupShutdown event will be generated whenever a backup application actually terminates and its IVssBackupComponents is released.</para>
/// <para>The BackupComplete event requires the backup application to either successfully complete the backup or fail gracefully; this may not be the case if the backup application is terminated by the system or terminated manually prior to the completion of the backup (for instance, if the backup operation hung and had to be shut down).</para>
/// <para>Because of this, a BackupShutdown event is a more robust signal of the end of a backup application than the BackupComplete event.</para>
/// <para>A writer should maintain state information so that it can track whether a BackupComplete event was sent for a given shadow copy set.</para>
/// <para>Any writer-specific implementation of <c>OnBackupShutdown</c> should check whether a BackupComplete event was handled. It should ensure that all necessary writer cleanup operations following a backup (successful or otherwise) are preformed.</para>
/// <para>Writers should never throw an exception from this method or any other <c>CVssWriter(Ex)::On<c>Xxx</c></c> callback method.</para>
/// <para>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.</para>
/// <para>The <c>OnPreRestore</c> method is called by a writer following a PreRestore event. This method is used to put the writer in a state to support the restore—for instance, taking database services offline—and to make modifications in the Backup Components Document of the requester that is restoring files (such as setting the restore target to override the original restore method).</para>
/// <para><c>OnPreRestore</c> is a virtual method. It is implemented by the CVssWriter base class, but can be overridden by derived classes.</para>
/// </summary>
/// <param name="pComponent">Pointer to an instantiation of an IVssWriterComponents object containing those components associated with the current writer in the requester's Backup Components Document.</param>
/// <returns>
/// <para>As implemented by the base class, <c>OnPreRestore</c> always returns <c>true</c>.</para>
/// <para>Any other implementation of this method must return <c>true</c> 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 <c>false</c>. If a nonfatal error occurs, the method should still call <c>SetWriterFailure</c> but return <c>true</c>. If the error is caused by a transient problem, the method should specify VSS_E_WRITERERROR_RETRYABLE in the call to <c>SetWriterFailure</c>.</para>
/// <para>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.</para>
/// </returns>
/// <remarks>
/// <para>The PreRestore event occurs before backed-up data is actually being restored. This is an opportunity for the writer to determine what is being restored.</para>
/// <para>The default implementation of this method by the CVssWriter base class returns <c>true</c> without performing any other operation.</para>
/// <para>This method enables the writer to determine what is being restored, to retrieve stored private metadata in the stored Backup Components Document, and to update that data.</para>
/// <para>Writers should never throw an exception from this method or any other <c>CVssWriter(Ex)::On<c>Xxx</c></c> callback method.</para>
/// <para>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.</para>
/// <para>The <c>OnPostRestore</c> method is called by a writer following a PostRestore event. It is used to perform operations considered necessary after files are restored to disk by a requester. These operations cannot, however, modify the Backup Components Document.</para>
/// <para><c>OnPostRestore</c> is a virtual method. It is implemented by the CVssWriter base class, but can be overridden by derived classes.</para>
/// </summary>
/// <param name="pComponent">A pointer to an IVssWriterComponents object passed in by VSS to provide the method with access to the writer's component information. The value of this parameter may be <c>NULL</c> if the requester does not support components (if CVssWriter::AreComponentsSelected returns <c>false</c>).</param>
/// <returns>
/// <para>As implemented by the base class, <c>OnPostRestore</c> always returns <c>true</c>.</para>
/// <para>Any other implementation of this method must return <c>true</c> 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 <c>false</c>. If a nonfatal error occurs, the method should still call <c>SetWriterFailure</c> but return <c>true</c>. If the error is caused by a transient problem, the method should specify VSS_E_WRITERERROR_RETRYABLE in the call to <c>SetWriterFailure</c>.</para>
/// <para>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.</para>
/// </returns>
/// <remarks>
/// <para>The default implementation of this method by the CVssWriter base class returns <c>true</c> without performing any other operation.</para>
/// <para>If necessary, a writer should remove any temporary files and release any system resources that it needed for its participation in the restore.</para>
/// <para>Writers should never throw an exception from this method or any other <c>CVssWriter(Ex)::On<c>Xxx</c></c> callback method.</para>
/// <para>With the generation of a PostRestore event, a requester's Backup Components Document becomes a read-only document. Therefore, attempts to modify the document through the interface (for instance, calling IVssComponent::SetRestoreMetadata) will fail in user implementations of <c>OnPostRestore</c>.</para>
/// <para>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.</para>
/// <para>The <c>OnPostSnapshot</c> method is called by a writer following a PostSnapshot event.</para>
/// <para><c>OnPostSnapshot</c> is a virtual method. It is implemented by the CVssWriter base class but can be overridden by derived classes.</para>
/// </summary>
/// <param name="pComponent">A pointer to an IVssWriterComponents object passed in by VSS to provide the method with access to the writer's component information. The value of this parameter may be NULL if the requester does not support components (if CVssWriter::AreComponentsSelected returns <c>false</c>).</param>
/// <returns>
/// <para>As implemented by the base class, <c>OnPostSnapshot</c> always returns <c>true</c>.</para>
/// <para>Any other implementation of this method must return <c>true</c> 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 <c>false</c>. If a nonfatal error occurs, the method should still call <c>SetWriterFailure</c> but return <c>true</c>. If the error is caused by a transient problem, the method should specify VSS_E_WRITERERROR_RETRYABLE in the call to <c>SetWriterFailure</c>.</para>
/// <para>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.</para>
/// </returns>
/// <remarks>
/// <para>The default implementation of this method by the CVssWriter base class returns <c>true</c> without performing any other operation.</para>
/// <para><c>CVssWriter::OnPostSnapshot</c> is typically used to process any final updates by the writer to the backup components metadata and clean up (such as removing temporary files).</para>
/// <para>If an incremental or differential backup is being performed, the writer may call IVssComponent::GetPreviousBackupStamp and IVssComponent::SetBackupStamp. For more information, see Writer Role in Backing Up Complex Stores. Another method that can be called at this time is IVssComponent::AddDifferencedFilesByLastModifyTime.</para>
/// <para>Most of the work needed to return the writer to normal operation (reversing the actions of CVssWriter::OnPrepareSnapshot and CVssWriter::OnFreeze) is typically performed in CVssWriter::OnThaw, not in <c>OnPostSnapshot</c>.</para>
/// <para>Writers should never throw an exception from this method or any other <c>CVssWriter(Ex)::On<c>Xxx</c></c> callback method.</para>
/// <para>If the shadow copy has the <c>VSS_VOLSNAP_ATTR_AUTORECOVER</c> flag set in the context, the writer should perform any recovery required (for example, rolling back any incomplete transactions) so that the component will be usable on a read-only copy for data mining (without adding load to the live server) or restore purposes (for example, to restore selected items from a database).</para>
/// <para>To retrieve the volume name of the shadow copy of a volume, perform the following steps:</para>
/// <list type="number">
/// <item>
/// <term>Call the CVssWriter::GetCurrentVolumeCount method to query the number of volumes in the shadow copy set.</term>
/// </item>
/// <item>
/// <term>Call the CVssWriter::GetCurrentVolumeArray method to enumerate the original names of the volumes in the shadow copy set.</term>
/// </item>
/// <item>
/// <term>Call the CVssWriter::GetSnapshotDeviceName to retrieve the name of the shadow copy volume.</term>
/// </item>
/// </list>
/// <para>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.</para>
/// <term>The writer ran out of memory or other system resources. The recommended way to handle this error code is to wait ten minutes and then repeat the operation, up to three times.</term>
/// </item>
/// <item>
/// <term><c>VSS_E_WRITERERROR_TIMEOUT</c></term>
/// <term>The writer operation failed because of a time-out between the Freeze and Thaw events. The recommended way to handle this error code is to wait ten minutes and then repeat the operation, up to three times.</term>
/// <term>The writer failed due to an error that would likely not occur if the entire backup, restore, or shadow copy creation process was restarted. The recommended way to handle this error code is to wait ten minutes and then repeat the operation, up to three times.</term>
/// <term>The writer operation failed because of an error that might recur if another shadow copy is created. For more information, see Event and Error Handling Under VSS.</term>
/// <term>The writer is reporting one or more component-level errors. To report the errors, the writer must use the IVssComponentEx2::SetFailure method.</term>
/// </item>
/// </list>
/// </param>
/// <param name="hrApplication">An additional error code to be returned to the requester. This parameter is optional.</param>
/// <param name="wszApplicationMessage">A string containing an error message for the requester to display to the end user. The writer is responsible for localizing this string if necessary before using it in this method. This parameter is optional and can be <c>NULL</c> or an empty string.</param>
/// <remarks>
/// <para>This method cannot be called from CVssWriter::OnIdentify or CVssWriterEx::OnIdentifyEx.</para>
/// <para>To report component-level errors, writers should use the IVssComponentEx2::SetFailure method.</para>
/// <para>If a writer's event handler (such as CVssWriter::OnFreeze) calls this method, it must do so in the same thread that called the event handler. For more information, see Writer Event Handling.</para>