CVssWriterEx2::SetWriterFailureEx method (vswriter.h)

Sets extended error information to indicate that the writer has encountered a problem with participating in a VSS operation.

Syntax

HRESULT SetWriterFailureEx(
  [in] HRESULT hrWriter,
  [in] HRESULT hrApplication,
  [in] LPCWSTR wszApplicationMessage
);

Parameters

[in] hrWriter

The error code to be returned to the requester.

The following are the error codes that this method can set.

Value Meaning
S_OK
The writer was successful.
VSS_E_WRITERERROR_INCONSISTENTSNAPSHOT
The shadow copy contains only a subset of the volumes needed by the writer to correctly back up the application component.
VSS_E_WRITERERROR_OUTOFRESOURCES
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.
VSS_E_WRITERERROR_TIMEOUT
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.
VSS_E_WRITERERROR_RETRYABLE
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.
VSS_E_WRITERERROR_NONRETRYABLE
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.
VSS_E_WRITERERROR_PARTIAL_FAILURE
The writer is reporting one or more component-level errors. To report the errors, the writer must use the IVssComponentEx2::SetFailure method.

[in] hrApplication

An additional error code to be returned to the requester. This parameter is optional.

[in] 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 NULL or an empty string.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

This method cannot be called from CVssWriter::OnIdentify or CVssWriterEx::OnIdentifyEx.

To report component-level errors, writers should use the IVssComponentEx2::SetFailure method.

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.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header vswriter.h (include Vss.h, VsWriter.h)
Library VssApi.lib

See also

CVssWriter::SetWriterFailure

CVssWriterEx2

IVssBackupComponentsEx3::GetWriterStatusEx