IVssComponentEx2::SetFailure method (vswriter.h)

VSS writers call this method to report errors at the component level.

Syntax

HRESULT SetFailure(
  [in] HRESULT hr,
  [in] HRESULT hrApplication,
  [in] LPCWSTR wszApplicationMessage,
  [in] DWORD   dwReserved
);

Parameters

[in] hr

The error code to be returned to the requester that calls the IVssComponentEx2::GetFailure method.

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.

[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.

[in] dwReserved

This parameter is reserved for future use and should be set to zero.

Return value

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

Remarks

In addition to calling this method, use the CVssWriterEx2::SetWriterFailureEx method to report that a partial writer failure has occurred.

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

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

See also

IVssComponentEx2